summaryrefslogtreecommitdiffabout
authorSergey Poznyakoff <gray@gnu.org.ua>2010-03-07 08:53:17 (GMT)
committer Sergey Poznyakoff <gray@gnu.org.ua>2010-03-07 08:53:17 (GMT)
commit47e8375965170ebe93579f207ca9b5977e7b3f1c (patch) (side-by-side diff)
treec1dde07f71947024ff7d628588078a46600aa853
parent6707c35f1112aa22f13f97d4d3f233495f44e015 (diff)
downloadgamma-47e8375965170ebe93579f207ca9b5977e7b3f1c.tar.gz
gamma-47e8375965170ebe93579f207ca9b5977e7b3f1c.tar.bz2
Improve configure
* am/guile.m4: Minor fix. * am/lib.m4: Imported from Mailutils * configure.ac: Use MU_CHECK_LIB
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--am/guile.m42
-rw-r--r--am/lib.m443
-rw-r--r--configure.ac34
3 files changed, 44 insertions, 35 deletions
diff --git a/am/guile.m4 b/am/guile.m4
index 6c2faf5..8c7f5cf 100644
--- a/am/guile.m4
+++ b/am/guile.m4
@@ -44,7 +44,7 @@ AC_DEFUN([MU_CHECK_GUILE],
fi
if test $GUILE_CONFIG != no; then
- AC_MSG_CHECKING(for guile version 1.6 or higher)
+ AC_MSG_CHECKING(for guile version 1.8 or higher)
GUILE_VERSION=`($GUILE_CONFIG --version 2>&1; echo '')|sed -n 's/guile-config - Guile version \([[0-9]][[0-9]]*\)\.\([[0-9]][[0-9]]*\).*/\1\2/p'`
case "x$GUILE_VERSION" in
x[[0-9]]*)
diff --git a/am/lib.m4 b/am/lib.m4
index 73f3564..c44e13f 100644
--- a/am/lib.m4
+++ b/am/lib.m4
@@ -5,22 +5,31 @@ dnl $3 -- Any additional libraries that might be needed
dnl $4 -- Action to be taken when test succeeds
dnl $5 -- Action to be taken when test fails
dnl $6 -- Directories where the library may reside
-AC_DEFUN([RA_CHECK_LIB],
-[
- save_LIBS=$LIBS
- AC_CACHE_CHECK([for -l$1], ra_cv_lib_$1,
- [
- for path in $6
- do
- LIBS="$save_LIBS -L$path"
- AC_CHECK_LIB($1, $2,
- [ra_cv_lib_$1="$3 -L$path -l$1"
- break],
- [ra_cv_lib_$1=no],$3)
- done
- ])
- RA_RESULT_ACTIONS([ra_cv_lib_$1],[LIB$1],[$4],[$5])
- LIBS=$save_LIBS
-])
+AC_DEFUN([MU_CHECK_LIB],
+[m4_ifval([$4], , [AH_CHECK_LIB([$1])])dnl
+AS_VAR_PUSHDEF([mu_Lib], [mu_cv_lib_$1])dnl
+AC_CACHE_CHECK([for $2 in -l$1], [mu_Lib],
+[AS_VAR_SET([mu_Lib], [no])
+ mu_check_lib_save_LIBS=$LIBS
+ for path in "" $6
+ do
+ if test -n "$path"; then
+ mu_ldflags="-L$path -l$1 $3"
+ else
+ mu_ldflags="-l$1 $3"
+ fi
+ LIBS="$mu_ldflags $mu_check_lib_save_LIBS"
+ AC_LINK_IFELSE([AC_LANG_CALL([], [$2])],
+ [AS_VAR_SET([mu_Lib], ["$mu_ldflags"])
+ break])
+ done
+ LIBS=$mu_check_lib_save_LIBS])
+AS_IF([test "AS_VAR_GET([mu_Lib])" != no],
+ [m4_default([$4], [AC_DEFINE_UNQUOTED(AS_TR_CPP(HAVE_LIB$1))
+ LIBS="-l$1 $LIBS"
+])],
+ [$5])dnl
+AS_VAR_POPDEF([mu_Lib])dnl
+])# MU_CHECK_LIB
diff --git a/configure.ac b/configure.ac
index 1d59c37..31793a7 100644
--- a/configure.ac
+++ b/configure.ac
@@ -77,23 +77,23 @@ if test $mu_cv_lib_guile = yes; then
SQLLIBS=""
# Check individual libraries
- RA_CHECK_LIB(mysqlclient, mysql_real_connect, "-lm",
- [ AC_DEFINE(USE_SQL_MYSQL,1,
- [Define this if you are going to use MySQL])
- AC_DEFINE(HAVE_LIBMYSQL,1,
- [Define this if you have mysqlclient library])
- SQLLIBS="$SQLLIBS $ra_cv_lib_mysqlclient" ],
- [ MYSQL=no ],
- [/usr/local/lib/mysql /usr/lib/mysql])
-
- RA_CHECK_LIB(pq, PQconnectStart, [],
- [ AC_DEFINE(USE_SQL_PGSQL,1,
- [Define this if you are going to use PostgreSQL])
- AC_DEFINE(HAVE_LIBPQ,1,
- [Define this if you have libp])
- SQLLIBS="$SQLLIBS $ra_cv_lib_pq" ],
- [ PGSQL=no ],
- [/usr/local/pgsql/lib /usr/pgsql/lib])
+ MU_CHECK_LIB([mysqlclient], [mysql_real_connect], [-lm],
+ [ AC_DEFINE([USE_SQL_MYSQL],1,
+ [Define this if you are going to use MySQL])
+ AC_DEFINE([HAVE_LIBMYSQL],1,
+ [Define this if you have mysqlclient library])
+ SQLLIBS="$SQLLIBS $mu_cv_lib_mysqlclient" ],
+ [ MYSQL=no ],
+ [/usr/local/lib/mysql /usr/lib/mysql])
+
+ MU_CHECK_LIB([pq], [PQconnectStart], [],
+ [ AC_DEFINE([USE_SQL_PGSQL],1,
+ [Define this if you are going to use PostgreSQL])
+ AC_DEFINE([HAVE_LIBPQ],1,
+ [Define this if you have libp])
+ SQLLIBS="$SQLLIBS $mu_cv_lib_pq" ],
+ [ PGSQL=no ],
+ [/usr/local/pgsql/lib /usr/pgsql/lib])
if test "x$SQLLIBS" != "x"; then
LIBS="$LIBS $SQLLIBS"

Return to:

Send suggestions and report system problems to the System administrator.