Cleanup build to be more portable at searching for libs.

This commit is contained in:
brectanus
2008-02-06 20:02:01 +00:00
parent fd8f4e319f
commit 46cb2beeba
3 changed files with 39 additions and 24 deletions

View File

@@ -30,7 +30,7 @@ fi
AC_MSG_CHECKING([for libapr config script]) AC_MSG_CHECKING([for libapr config script])
for x in ${test_paths}; do for x in ${test_paths}; do
for APR_CONFIG in apr-config apr-1-config; do for APR_CONFIG in apr-1-config apr-config; do
if test -e "${x}/bin/${APR_CONFIG}"; then if test -e "${x}/bin/${APR_CONFIG}"; then
with_apr="${x}/bin" with_apr="${x}/bin"
break break

View File

@@ -6,7 +6,7 @@ dnl APU_LDFLAGS
dnl APU_LIBS dnl APU_LIBS
dnl APU_LINK_LD dnl APU_LINK_LD
APU_CONFIG="apu-1-config" APU_CONFIG=""
APU_CFLAGS="" APU_CFLAGS=""
APU_LDFLAGS="" APU_LDFLAGS=""
APU_LIBS="" APU_LIBS=""
@@ -30,6 +30,7 @@ fi
AC_MSG_CHECKING([for libapr-util config script]) AC_MSG_CHECKING([for libapr-util config script])
for x in ${test_paths}; do for x in ${test_paths}; do
for APU_CONFIG in apu-1-config apu-config; do
if test -e "${x}/bin/${APU_CONFIG}"; then if test -e "${x}/bin/${APU_CONFIG}"; then
with_apu="${x}/bin" with_apu="${x}/bin"
break break
@@ -40,6 +41,10 @@ for x in ${test_paths}; do
with_apu="" with_apu=""
fi fi
done done
if test -n "$with_apu"; then
break
fi
done
if test -n "${with_apu}"; then if test -n "${with_apu}"; then
APU_CONFIG="${with_apu}/${APU_CONFIG}" APU_CONFIG="${with_apu}/${APU_CONFIG}"
AC_MSG_RESULT([${APU_CONFIG}]) AC_MSG_RESULT([${APU_CONFIG}])

View File

@@ -5,7 +5,7 @@ dnl LUA_CFLAGS
dnl LUA_LIBS dnl LUA_LIBS
LUA_CONFIG="pkg-config" LUA_CONFIG="pkg-config"
LUA_PKGNAME="lua5.1" LUA_PKGNAMES="lua5.1 lua5 lua"
LUA_CFLAGS="" LUA_CFLAGS=""
LUA_LIBS="" LUA_LIBS=""
@@ -25,7 +25,7 @@ else
test_paths="${lua_path}" test_paths="${lua_path}"
fi fi
AC_MSG_CHECKING([for pkg-config script for liblua]) AC_MSG_CHECKING([for pkg-config script for lua library])
for x in ${test_paths}; do for x in ${test_paths}; do
if test -e "${x}/bin/${LUA_CONFIG}"; then if test -e "${x}/bin/${LUA_CONFIG}"; then
with_lua="${x}/bin" with_lua="${x}/bin"
@@ -36,11 +36,21 @@ for x in ${test_paths}; do
done done
if test -n "${with_lua}"; then if test -n "${with_lua}"; then
LUA_CONFIG="${with_lua}/${LUA_CONFIG}" LUA_CONFIG="${with_lua}/${LUA_CONFIG}"
for LUA_PKGNAME in ${LUA_PKGNAMES}; do
if ${LUA_CONFIG} --exists ${LUA_PKGNAME}; then
break
fi
LUA_PKGNAME=""
done
if test -n "$LUA_PKGNAME"; then
AC_MSG_RESULT([${LUA_CONFIG} ${LUA_PKGNAME}]) AC_MSG_RESULT([${LUA_CONFIG} ${LUA_PKGNAME}])
LUA_CFLAGS="`${LUA_CONFIG} ${LUA_PKGNAME} --cflags`" LUA_CFLAGS="`${LUA_CONFIG} ${LUA_PKGNAME} --cflags`"
LUA_LIBS="`${LUA_CONFIG} ${LUA_PKGNAME} --libs`" LUA_LIBS="`${LUA_CONFIG} ${LUA_PKGNAME} --libs`"
CFLAGS=$save_CFLAGS CFLAGS=$save_CFLAGS
LDFLAGS=$save_LDFLAGS LDFLAGS=$save_LDFLAGS
else
AC_MSG_RESULT([no])
fi
else else
AC_MSG_RESULT([no]) AC_MSG_RESULT([no])