Commit 79b88985 authored by Niels Möller's avatar Niels Möller

* acinclude.m4: Renamed macros to start with the LSH_-prfix.

Deleted unused code. Updated configure.ac to match.
(LSH_TYPE_SOCKLEN_T): Moved AH_TEMPLATE into the macro body.

Rev: acinclude.m4:1.13
Rev: configure.ac:1.31
parent 4b2f5737
AH_TEMPLATE([socklen_t], [Length type used by getsockopt])
# Try to detect the type of the third arg to getsockname() et al
AC_DEFUN([AC_TYPE_SOCKLEN_T],
[AC_CACHE_CHECK([for socklen_t in sys/socket.h], ac_cv_type_socklen_t,
AC_DEFUN([LSH_TYPE_SOCKLEN_T],
[AH_TEMPLATE([socklen_t], [Length type used by getsockopt])
AC_CACHE_CHECK([for socklen_t in sys/socket.h], ac_cv_type_socklen_t,
[AC_EGREP_HEADER(socklen_t, sys/socket.h,
[ac_cv_type_socklen_t=yes], [ac_cv_type_socklen_t=no])])
if test $ac_cv_type_socklen_t = no; then
......@@ -21,70 +20,6 @@ AC_DEFINE(socklen_t, int)
fi
])
# checks for gmp version 2 or later.
# AC_CHECK_LIBGMP(library, [, if-found [, if-not-found]])
AC_DEFUN([AC_CHECK_LIBGMP],
[AC_CACHE_CHECK([for mpz_get_d in -l$1], ac_cv_lib_$1_mpz_get_d,
[ac_save_libs="$LIBS"
LIBS="-l$1 $LIBS"
AC_TRY_LINK(dnl
[#if HAVE_GMP_H
#include <gmp.h>
#elif HAVE_GMP2_GMP_H
#include <gmp2/gmp.h>
#endif
],
[mpz_get_d(0);],
ac_cv_lib_$1_mpz_get_d=yes,
ac_cv_lib_$1_mpz_get_d=no)
LIBS="$ac_save_LIBS"
])
if test x$ac_cv_lib_$1_mpz_get_d = xyes ; then
ifelse([$2], ,
[AC_DEFINE(HAVE_LIBGMP)
LIBS="-l$1 $LIBS"
], [$2])
ifelse([$3], , ,
[else
$3
])dnl
fi
])
# checks for gmp version 2 or later.
# AC_SEARCH_LIBGMP(libraries, [, if-found [, if-not-found]])
AC_DEFUN([AC_SEARCH_LIBGMP],
[AC_CACHE_CHECK([for library containing mpz_get_d], ac_cv_search_mpz_get_d,
[ac_search_save_LIBS="$LIBS"
ac_cv_search_mpz_get_d="no"
for i in $1; do
LIBS="-l$i $ac_search_save_LIBS"
AC_TRY_LINK(dnl
[#if HAVE_GMP_H
#include <gmp.h>
#elif HAVE_GMP2_GMP_H
#include <gmp2/gmp.h>
#endif
],
[mpz_get_d(0);],
[ac_cv_search_mpz_get_d=-l$i
break
])
done
LIBS="$ac_search_save_LIBS"
])
if test "x$ac_cv_search_mpz_get_d" != xno ; then
LIBS="$ac_cv_search_mpz_get_d $LIBS"
ifelse([$2], ,
[AC_DEFINE(HAVE_LIBGMP)
], [$2])
ifelse([$3], , ,
[else
$3
])dnl
fi
])
# LSH_PATH_ADD(path-id, directory)
AC_DEFUN([LSH_PATH_ADD],
[AC_MSG_CHECKING($2)
......@@ -202,10 +137,10 @@ fi
])
# Like AC_CHECK_LIB, but uses $KRB_LIBS rather than $LIBS.
# AC_CHECK_KRB_LIB(LIBRARY, FUNCTION, [, ACTION-IF-FOUND [,
# LSH_CHECK_KRB_LIB(LIBRARY, FUNCTION, [, ACTION-IF-FOUND [,
# ACTION-IF-NOT-FOUND [, OTHER-LIBRARIES]]])
AC_DEFUN([AC_CHECK_KRB_LIB],
AC_DEFUN([LSH_CHECK_KRB_LIB],
[AC_CHECK_LIB([$1], [$2],
ifelse([$3], ,
[[ac_tr_lib=HAVE_LIB`echo $1 | sed -e 's/[^a-zA-Z0-9_]/_/g' \
......@@ -218,8 +153,8 @@ AC_DEFUN([AC_CHECK_KRB_LIB],
, [$5 $KRB_LIBS])
])
# AC_LIB_ARGP(ACTION-IF-OK, ACTION-IF-BAD)
AC_DEFUN([AC_LIB_ARGP],
# LSH_LIB_ARGP(ACTION-IF-OK, ACTION-IF-BAD)
AC_DEFUN([LSH_LIB_ARGP],
[ ac_argp_save_LIBS="$LIBS"
ac_argp_save_LDFLAGS="$LDFLAGS"
ac_argp_ok=no
......
......@@ -354,7 +354,7 @@ fi
# AC_CHECK_TYPE doesn't work, probably because the type in
# question is not defined in sys/types.h.
AC_TYPE_SOCKLEN_T
LSH_TYPE_SOCKLEN_T
# Checks for libraries
......@@ -362,10 +362,6 @@ AC_CHECK_LIB(gmp, __gmpz_getlimbn,,
[AC_MSG_ERROR(
[GNU MP not found, or not 3.1 or up, see http://www.swox.com/gmp.])])
# AC_SEARCH_LIBGMP(gmp gmp2,
# [LSH_RPATH_FIX],
# [AC_MSG_ERROR([GMP is missing. Get gmp-2.0.2 or better from ftp://ftp.gnu.org/pub/gnu/gmp]) ])
LSH_RPATH_FIX
AC_CHECK_LIB([oop], [oop_sys_new],,
......@@ -463,11 +459,11 @@ fi
# ordinary $LIBS.
if test x$enable_kerberos = xyes; then
AC_CHECK_KRB_LIB(roken, strlcpy)
AC_CHECK_KRB_LIB(resolv, dn_expand)
AC_CHECK_KRB_LIB(des, des_cbc_encrypt)
AC_CHECK_KRB_LIB(asn1, der_get_octet_string)
AC_CHECK_KRB_LIB(krb5, krb5_cc_gen_new,, [enable_kerberos=no])
LSH_CHECK_KRB_LIB(roken, strlcpy)
LSH_CHECK_KRB_LIB(resolv, dn_expand)
LSH_CHECK_KRB_LIB(des, des_cbc_encrypt)
LSH_CHECK_KRB_LIB(asn1, der_get_octet_string)
LSH_CHECK_KRB_LIB(krb5, krb5_cc_gen_new,, [enable_kerberos=no])
fi
AH_TEMPLATE([WITH_KERBEROS], [For kerberos])
......@@ -553,7 +549,7 @@ AC_CHECK_FUNCS(poll,,[AC_LIBOBJ([jpoll])])
# Test if the libc includes a good enough argp.
if test x$with_system_argp = xyes ; then
AC_LIB_ARGP(,with_system_argp=no)
LSH_LIB_ARGP(,with_system_argp=no)
fi
# We don't use LIBOBJS for this, as the LIBOBJS are added to
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment