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
This commit is contained in:
Eric Wong 2006-07-22 23:28:30 +00:00
parent 7f363eb9c1
commit fe76580ce4
1 changed files with 33 additions and 25 deletions

View File

@ -23,33 +23,41 @@ case "$CC" in
;; ;;
esac esac
local_lib= if test -z "$prefix" || test "x$prefix" = xNONE; then
local_include= local_lib=
local_include=
# aren't autotools supposed to be smart enough to figure this out? # aren't autotools supposed to be smart enough to figure this out? oh
# oh well, the git-core Makefile managed to do some of the work for us :) # well, the git-core Makefile managed to do some of the work for us :)
case "$host_os" in case "$host_os" in
darwin*) darwin*)
local_lib='/sw/lib /opt/local/lib' local_lib='/sw/lib /opt/local/lib'
local_include='/sw/include /opt/local/include' local_include='/sw/include /opt/local/include'
;; ;;
freebsd* | openbsd*) freebsd* | openbsd*)
local_lib=/usr/local/lib local_lib=/usr/local/lib
local_include=/usr/local/include local_include=/usr/local/include
;; ;;
netbsd*) netbsd*)
local_lib=/usr/pkg/lib local_lib=/usr/pkg/lib
local_include=/usr/pkg/include local_include=/usr/pkg/include
LDFLAGS="$LDFLAGS -Wl,-rpath,/usr/pkg/lib" LDFLAGS="$LDFLAGS -Wl,-rpath,/usr/pkg/lib"
;; ;;
esac esac
for d in $local_lib; do for d in $local_lib; do
test -d "$d" && LDFLAGS="$LDFLAGS -L$d" if test -d "$d"; then
done LDFLAGS="$LDFLAGS -L$d"
for d in $local_include; do break
test -d "$d" && CFLAGS="$CFLAGS -I$d" fi
done 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(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]) AC_ARG_ENABLE(shout,[ --disable-shout disable support for streaming through shout (default: enable)],[enable_shout=$enableval],[enable_shout=yes])