From 331321baaf06974e38fa8cef8cd2949c0ecd5fc0 Mon Sep 17 00:00:00 2001 From: Hans Ulrich Niedermann Date: Fri, 15 Apr 2005 06:25:11 +0200 Subject: [PATCH] improved lots of stuff, and update macros from gphoto2 --- autogen.sh | 43 +++++++++++++++++++++++++++++++++++++++++-- configure.ac | 2 +- m4m/gp-check-library.m4 | 27 ++++++++++++++++----------- 3 files changed, 58 insertions(+), 14 deletions(-) diff --git a/autogen.sh b/autogen.sh index 880a11c..1f7547a 100755 --- a/autogen.sh +++ b/autogen.sh @@ -109,6 +109,15 @@ init_vars() { # But the cleaning should also work recursively, but that is difficult # with the current structure of the script. AG_SUBDIRS="$(for k in $(sed -n 's/^[[:space:]]*AC_CONFIG_SUBDIRS(\[\{0,1\}\([^])]*\).*/\1/p' "$CONFIGURE_AC"); do echo "${dir}/${k}"; done)" + AG_LIBLTDL_DIR="$(sed -n 's/^[[:space:]]*AC_LIBLTDL_\(INSTALLABLE\|CONVENIENCE\)(\[\{0,1\}\([^])]*\).*/\2/p' < "$CONFIGURE_AC")" + if test "x$AG_LIBLTDL_DIR" = "x"; then + tmp="$(sed -n 's/^[[:space:]]*\(AC_LIBLTDL_\)\(INSTALLABLE\|CONVENIENCE\)(\[\{0,1\}\([^])]*\).*/\1/p' < "$CONFIGURE_AC")" + if test "x$tmp" = "xAC_LIBLTDL_"; then + AG_LIBLTDL_DIR="libltdl" + else + AG_LIBLTDL_DIR="" + fi + fi AG_AUX="$(sed -n 's/^AC_CONFIG_AUX_DIR(\[\{0,1\}\([^])]*\).*/\1/p' < "$CONFIGURE_AC")" if test "x$AG_AUX" = "x"; then AG_AUX="." @@ -133,6 +142,26 @@ init_vars() { done AG_GEN_ACAM="aclocal.m4 configure $AG_AUX/config.guess $AG_AUX/config.sub $AG_AUX/compile" AG_GEN_RECONF="$AG_AUX/install-sh $AG_AUX/missing $AG_AUX/depcomp" + AG_GEN_LIBTOOL="$AG_AUX/ltmain.sh libtool" + while read file; do + AG_GEN_LIBTOOL="${AG_GEN_LIBTOOL} ${AG_LIBLTDL_DIR}/${file}" + done <>" + ${LIBTOOLIZE-"libtoolize"} --ltdl + # And we have to clean up the generated files after libtoolize because + # - we still want symlinks for the files + # - but we want to (implicitly) AC_CONFIG_SUBDIR and that writes to + # these files. + (cd "${AG_LIBLTDL_DIR}" && rm -f aclocal.m4 config.guess config.sub configure install-sh ltmain.sh Makefile.in missing) + fi echo "Running <<" autoreconf --install --symlink ${AUTORECONF_OPTS} ">>" if autoreconf --install --symlink ${AUTORECONF_OPTS}; then :; else diff --git a/configure.ac b/configure.ac index 8907cdc..04009de 100644 --- a/configure.ac +++ b/configure.ac @@ -5,7 +5,7 @@ AC_CONFIG_HEADERS([config.h]) AM_INIT_AUTOMAKE([gnu 1.8 dist-bzip2]) GP_CHECK_SHELL_ENVIRONMENT - +GP_CONFIG_MSG([Build]) GP_CONFIG_MSG([Source code location],[${srcdir}]) dnl --------------------------------------------------------------------------- diff --git a/m4m/gp-check-library.m4 b/m4m/gp-check-library.m4 index 455a4e5..058956f 100644 --- a/m4m/gp-check-library.m4 +++ b/m4m/gp-check-library.m4 @@ -1,4 +1,7 @@ -dnl @synopsis GP_CHECK_LIBRARY([VARNAMEPART],[libname],[VERSION-REQUIREMENT],[headername],[functionname],[ACTION-IF-FOUND],[ACTION-IF-NOT-FOUND],[OPTIONAL-REQUIRED-ETC],[WHERE-TO-GET-IT]) +dnl @synopsis GP_CHECK_LIBRARY([VARNAMEPART],[libname],[VERSION-REQUIREMENT], +dnl [headername],[functionname], +dnl [ACTION-IF-FOUND],[ACTION-IF-NOT-FOUND], +dnl [OPTIONAL-REQUIRED-ETC],[WHERE-TO-GET-IT]) dnl dnl Checks for the presence of a certain library. dnl @@ -97,6 +100,7 @@ AC_ARG_VAR([$1][_CFLAGS], [CFLAGS for compiling with ][$2])dnl AC_ARG_VAR([$1][_LIBS], [LIBS to add for linking against ][$2])dnl dnl AC_MSG_CHECKING([for ][$2][ to use]) +userdef_[$1]=no have_[$1]=no if test "x${[$1][_LIBS]}" = "x" && test "x${[$1][_CFLAGS]}" = "x"; then m4_if([$8], [default-off], @@ -157,6 +161,7 @@ if test "x${[$1][_LIBS]}" = "x" && test "x${[$1][_CFLAGS]}" = "x"; then fi elif test "x${[$1][_LIBS]}" != "x" && test "x${[$1][_CFLAGS]}" != "x"; then AC_MSG_RESULT([user-defined]) + userdef_[$1]=yes have_[$1]=yes else AC_MSG_ERROR([ @@ -201,16 +206,16 @@ fi dnl dnl Run our own test link dnl Does not work for libraries which be built after configure time, -dnl so we deactivate it. -dnl -dnl m4_ifval([$5],[dnl -dnl if test "x${[have_][$1]}" = "xyes"; then -dnl LIBS_save="$LIBSS" -dnl LIBS="${[$1]_LIBS}" -dnl AC_TRY_LINK_FUNC([$5],[],[have_][$1][=no]) -dnl LIBS="$LIBS_save" -dnl fi -dnl ])dnl +dnl so we deactivate it for them (userdef_). +dnl +m4_ifval([$5],[dnl +if test "x${[userdef_][$1]}" = "xno" && test "x${[have_][$1]}" = "xyes"; then + LIBS_save="$LIBSS" + LIBS="${[$1]_LIBS}" + AC_TRY_LINK_FUNC([$5],[],[have_][$1][=no]) + LIBS="$LIBS_save" +fi +])dnl dnl dnl Abort configure script if mandatory, but not found dnl -- 2.7.4