diff options
Diffstat (limited to '')
-rwxr-xr-x | autogen.sh | 22 | ||||
-rw-r--r-- | configure.ac | 30 | ||||
-rw-r--r-- | m4/shout.m4 | 11 |
3 files changed, 56 insertions, 7 deletions
diff --git a/autogen.sh b/autogen.sh index 6b0787ba8..48242f016 100755 --- a/autogen.sh +++ b/autogen.sh @@ -124,13 +124,23 @@ fi echo "Generating configuration files for $package, please wait...." ACLOCAL_FLAGS="$ACLOCAL_FLAGS -I $PWD/m4" -if [ -d /usr/local/share/aclocal ]; then - ACLOCAL_FLAGS="$ACLOCAL_FLAGS -I /usr/local/share/aclocal" -fi -# if [ -d "/usr/local/share/`basename $ACLOCAL`" ]; then - # ACLOCAL_FLAGS="$ACLOCAL_FLAGS -I /usr/local/share/`basename $ACLOCAL`" -# fi +# /usr/share/aclocal is most likely included by default, already... +ac_local_paths=' +/usr/local/share/aclocal +/sw/share/aclocal +/usr/pkg/share/aclocal +/opt/share/aclocal +/usr/gnu/share/aclocal +' + +for i in $ac_local_paths; do + if test -d "$i"; then + ACLOCAL_FLAGS="$ACLOCAL_FLAGS -I $i" + # we probably only want one of these... + break + fi +done echo " $ACLOCAL $ACLOCAL_FLAGS" $ACLOCAL $ACLOCAL_FLAGS diff --git a/configure.ac b/configure.ac index 61ee82059..31e775c34 100644 --- a/configure.ac +++ b/configure.ac @@ -25,13 +25,41 @@ AC_PROG_MAKE_SET AM_CONFIG_HEADER(config.h) +MPD_LIBS="" MPD_CFLAGS="" case "$CC" in *gcc*) MPD_CFLAGS="-Wall" ;; esac -MPD_LIBS="" + +local_lib= +local_include= + +# aren't autotools supposed to be smart enough to figure this out? +# oh well, the git-core Makefile managed to do some of the work for us :) +case "$host_os" in +darwin*) + local_lib='/sw/lib /opt/local/lib' + local_include='/sw/include /opt/local/include' + ;; +freebsd* | openbsd*) + local_lib=/usr/local/lib + local_include=/usr/local/include + ;; +netbsd*) + local_lib=/usr/pkg/lib + local_include=/usr/pkg/include + LDFLAGS="$LDFLAGS -Wl,-rpath,/usr/pkg/lib" + ;; +esac + +for d in $local_lib; do + test -d "$d" && LDFLAGS="$LDFLAGS -L$d" +done +for d in $local_include; do + test -d "$d" && CFLAGS="$CFLAGS -I$d" +done AC_ARG_ENABLE(ao,[ --enable-ao enable support for libao (default: disable)],[enable_ao=$enableval],[enable_ao=no]) AC_ARG_ENABLE(shout,[ --disable-shout disable support for streaming through shout (default: enable)],[enable_shout=$enableval],[enable_shout=yes]) diff --git a/m4/shout.m4 b/m4/shout.m4 index 9fad512e6..4eba5c09b 100644 --- a/m4/shout.m4 +++ b/m4/shout.m4 @@ -53,6 +53,17 @@ then ac_save_CPPFLAGS="$CPPFLAGS" ac_save_CFLAGS="$CFLAGS" ac_save_LIBS="$LIBS" + + # freebsd 6.1 + shout 2.2 port seems to leave pthread out + case "$host_os" in + freebsd*) + case "$SHOUT_CFLAGS$SHOUT_CPPFLAGS" in + *-D_THREAD_SAFE*) + SHOUT_LIBS="$SHOUT_LIBS -lpthread" + ;; + esac + ;; + esac CPPFLAGS="$CPPFLAGS $SHOUT_CPPFLAGS" CFLAGS="$CFLAGS $SHOUT_CFLAGS" LIBS="$SHOUT_LIBS $LIBS" |