aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEric Wong <normalperson@yhbt.net>2006-07-22 23:28:30 +0000
committerEric Wong <normalperson@yhbt.net>2006-07-22 23:28:30 +0000
commitfe76580ce4b809206bc09c862dcc642c64957b94 (patch)
tree0e64cd46266f0e5f05224ac04cdb8c815dbf3bdb
parent7f363eb9c18d2f35aab98db0c0cafbf059c67882 (diff)
downloadmpd-fe76580ce4b809206bc09c862dcc642c64957b94.tar.gz
mpd-fe76580ce4b809206bc09c862dcc642c64957b94.tar.xz
mpd-fe76580ce4b809206bc09c862dcc642c64957b94.zip
configure.ac: don't always try to add local lib/include paths
Only add them if --prefix= wasn't specified, and only allow one path of each to be added. This way Fink and Darwinports users won't have libs from *both* (which would conflict). Testing from OSX (Fink and/or Darwinports) users would be greatly appreciated, as would testers from other non-GNU/Linux systems. git-svn-id: https://svn.musicpd.org/mpd/trunk@4432 09075e82-0dd4-0310-85a5-a0d7c8717e4f
Diffstat (limited to '')
-rw-r--r--configure.ac62
1 files changed, 35 insertions, 27 deletions
diff --git a/configure.ac b/configure.ac
index 7cbd40922..7ea6039c3 100644
--- a/configure.ac
+++ b/configure.ac
@@ -23,33 +23,41 @@ case "$CC" in
;;
esac
-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
+if test -z "$prefix" || test "x$prefix" = xNONE; then
+ 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
+ if test -d "$d"; then
+ LDFLAGS="$LDFLAGS -L$d"
+ break
+ fi
+ done
+ for d in $local_include; do
+ if test -d "$d"; then
+ CFLAGS="$CFLAGS -I$d"
+ break
+ fi
+ done
+fi
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])