chiark / gitweb /
Build fixes for FreeBSD:
authorrjk@greenend.org.uk <>
Fri, 4 Jan 2008 23:14:56 +0000 (23:14 +0000)
committerrjk@greenend.org.uk <>
Fri, 4 Jan 2008 23:14:56 +0000 (23:14 +0000)
  - disorder-playrtp needs an explicit -lpthread.
  - libdb is installed off even the non-default path
  - find GNU sed as the native sed is not adequate
  - adding some missing includes

The result builds but I've not run all the test yet.

clients/Makefile.am
configure.ac
disobedience/Makefile.am
doc/Makefile.am
lib/sendmail.c
scripts/htmlman
scripts/sedfiles.make
server/speaker-network.c

index 7baa667..b9b3640 100644 (file)
@@ -38,7 +38,8 @@ disorderfm_DEPENDENCIES=$(LIBOBJS) ../lib/libdisorder.a
 disorder_playrtp_SOURCES=playrtp.c playrtp.h playrtp-mem.c \
                         playrtp-alsa.c playrtp-coreaudio.c playrtp-oss.c
 disorder_playrtp_LDADD=$(LIBOBJS) ../lib/libdisorder.a \
-       $(LIBASOUND) $(LIBPCRE) $(LIBICONV) $(LIBGCRYPT) $(COREAUDIO) $(LIBDB)
+       $(LIBASOUND) $(LIBPCRE) $(LIBICONV) $(LIBGCRYPT) $(COREAUDIO) \
+       $(LIBDB) $(LIBPTHREAD)
 disorder_playrtp_DEPENDENCIES=$(LIBOBJS) ../lib/libdisorder.a
 
 filename_bytes_SOURCES=filename-bytes.c
index c167d8d..4bae211 100644 (file)
@@ -85,8 +85,13 @@ case "$host" in
 *-freebsd* )
   AC_MSG_RESULT([FreeBSD])
   want_server=yes
+  # Ports install to /usr/local but the compiler stupidly doesn't look
+  # there by default
   LDFLAGS="${LDFLAGS} -L/usr/local/lib"
   CPPFLAGS="${CPPFLAGS} -I/usr/local/include"
+  # libdb installs elsewhere again
+  LDFLAGS="${LDFLAGS} -L/usr/local/lib/db44"
+  CPPFLAGS="${CPPFLAGS} -I/usr/local/include/db44"
   ;;
 * )
   AC_MSG_RESULT([unknown, winging it])
@@ -150,6 +155,20 @@ AC_DISABLE_STATIC
 
 AC_PROG_LIBTOOL
 
+AC_CACHE_CHECK([for GNU sed],[rjk_cv_gnused],[
+  rjk_cv_gnused="not found"
+  for candidate in sed gsed; do
+    if $candidate --version >/dev/null 2>&1; then
+      rjk_cv_gnused=$candidate 
+    fi
+  done
+])
+GNUSED="${GNUSED:-$rjk_cv_gnused}"
+if test "$GNUSED" = "not found"; then
+  AC_MSG_ERROR([GNU sed is required to build this program])
+fi
+AC_SUBST([GNUSED])
+
 missing_libraries=""
 missing_headers=""
 missing_functions=""
@@ -211,6 +230,9 @@ if test $want_server = yes; then
               [AC_SUBST(LIBFLAC,[-lFLAC])],
               [missing_libraries="$missing_libraries libFLAC"])
 fi
+AC_CHECK_LIB([pthread], [pthread_create],
+             [AC_SUBST(LIBPTHREAD,[-lpthread])],
+            [missing_libraries="$missing_libraries libpthread"])
 
 if test $want_gtk = yes; then
   AM_PATH_GLIB_2_0([],[],[missing_libraries="$missing_libraries libglib"])
index 93a280a..ae3bc6c 100644 (file)
@@ -49,12 +49,12 @@ misc.o: images.h
 images.h: $(PNGS)
        exec > @$.new;                                                  \
        for png in $(PNGS); do                                          \
-         name=`echo $$png | sed 's,.*/,,;s,\.png,,;'`;                 \
+         name=`echo $$png | $(GNUSED) 's,.*/,,;s,\.png,,;'`;                   \
          gdk-pixbuf-csource --raw --name=image_$$name $$png;           \
        done;                                                           \
        echo "static const struct image images[] = {";                  \
        for png in $(PNGS); do                                          \
-         name=`echo $$png | sed 's,.*/,,;s,\.png,,;'`;                 \
+         name=`echo $$png | $(GNUSED) 's,.*/,,;s,\.png,,;'`;                   \
          echo "  { \"$$name.png\", image_$$name },";                   \
        done;                                                           \
        echo "};"
@@ -63,3 +63,5 @@ images.h: $(PNGS)
 # check everything has working --help
 check-help: all
        ./disobedience --version > /dev/null
+
+export GNUSED
index 3e8078c..9316298 100644 (file)
@@ -51,3 +51,5 @@ EXTRA_DIST=disorderd.8.in disorder.1.in disorder_config.5.in \
           disorder-stats.8.in disorder-dbupgrade.8.in
 
 CLEANFILES=$(SEDFILES) $(HTMLMAN)
+
+export GNUSED
index 63daee1..8ca1e88 100644 (file)
@@ -29,6 +29,7 @@
 #include <unistd.h>
 #include <gcrypt.h>
 #include <time.h>
+#include <netinet/in.h>
 
 #include "syscalls.h"
 #include "log.h"
index f703067..04851fa 100755 (executable)
@@ -53,7 +53,7 @@ if $stdhead; then
 fi
 printf "   <pre class=manpage>"
 # this is kind of painful using only BREs
-nroff -man "$1" | sed \
+nroff -man "$1" | ${GNUSED} \
                       '1d;$d;
                        1,/./{/^$/d};
                        s/&/\&amp;/g;
index 4bd1430..8557a86 100644 (file)
@@ -20,7 +20,7 @@
 
 $(SEDFILES) : % : %.in Makefile
        rm -f $@.new
-       sed -e 's!sbindir!${sbindir}!g;' \
+       $(GNUSED) -e 's!sbindir!${sbindir}!g;' \
            -e 's!bindir!${bindir}!g;' \
            -e 's!pkgconfdir!${sysconfdir}/disorder!g;' \
            -e 's!pkgstatedir!${localstatedir}/disorder!g;' \
index 810aff7..67fca83 100644 (file)
@@ -33,6 +33,7 @@
 #include <net/if.h>
 #include <ifaddrs.h>
 #include <errno.h>
+#include <netinet/in.h>
 
 #include "configuration.h"
 #include "syscalls.h"