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 7baa667ae599975b2c782aa63fb5e1f938ca2e44..b9b364042c1e2c7426aea9d838f0af444b6d2d21 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 c167d8deb0cc3463f7175dbc8d5ac77f67e6b77d..4bae211aec895a11bbf246ae62e5f23314943f7d 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 93a280a36d1882d1a1006739c0a33f2831f092c5..ae3bc6cb768ccbe65919a48dcbdcccb7efc15d62 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 3e8078cd2fb9ce3b33e62ae76ba9fed4f3a4a1fe..9316298c15b20436b1f60d3d2a755921049b6bf8 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 63daee1c11d4850cea04678787627e53223c77e5..8ca1e880309fa86409740936e1579b3df8e29618 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 f7030674d4a6c29d9e6865f5349d708a32dfc1ba..04851fa5bcf95643280d865898f3e26ae3953e7f 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 4bd143067d0458ed4fb0a49af1bdb30714f38bac..8557a865e8ca2b52959985695b29e0be0007a686 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 810aff766ba73c2041bd5b7b8efdae469beabc7d..67fca8388b089ddc80dae8f41d6f5f03a27b9cb6 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"