From 8988b127e18435054e48cbcca8ac712ddda3d6d2 Mon Sep 17 00:00:00 2001 From: Guus Sliepen Date: Tue, 11 Jun 2002 11:03:17 +0000 Subject: [PATCH] Autoconf cleanup. Works for both 2.13 and 2.53, although running autoconf 2.53 still gives some errors. --- acconfig.h | 80 --------------------------------------------------- configure.in | 23 ++++++++------- m4/malloc.m4 | 8 +++--- m4/openssl.m4 | 18 ++++++------ m4/realloc.m4 | 8 +++--- m4/tuntap.m4 | 4 +-- 6 files changed, 31 insertions(+), 110 deletions(-) delete mode 100644 acconfig.h diff --git a/acconfig.h b/acconfig.h deleted file mode 100644 index f8e234fd..00000000 --- a/acconfig.h +++ /dev/null @@ -1,80 +0,0 @@ -/* Define to the name name of this package */ -#undef PACKAGE - -/* Define to the version of the package */ -#undef VERSION - -/* Define to rpl_malloc if the replacement function should be used. */ -#undef malloc - -/* Define to rpl_realloc if the replacement function should be used. */ -#undef realloc - -/* This is always defined. It enables GNU extensions on systems that - have them. */ -#if !defined(_GNU_SOURCE) -# undef _GNU_SOURCE -#endif - -#if !defined(__USE_BSD) -# undef __USE_BSD -#endif - - -/* Define to 1 if NLS is requested. */ -#undef ENABLE_NLS - -/* Define as 1 if you have catgets and don't want to use GNU gettext. */ -#undef HAVE_CATGETS - -/* Define as 1 if you have gettext and don't want to use GNU gettext. */ -#undef HAVE_GETTEXT - -/* Define if your locale.h file contains LC_MESSAGES. */ -#undef HAVE_LC_MESSAGES - -/* Define to 1 if you have the stpcpy function. */ -#undef HAVE_STPCPY - -/* For getopt */ -#if HAVE_STDLIB_H -# define getopt system_getopt -# include -# undef getopt -#endif - -/* Linux */ -#undef HAVE_LINUX - -/* FreeBSD */ -#undef HAVE_FREEBSD - -/* OpenBSD */ -#undef HAVE_OPENBSD - -/* Solaris */ -#undef HAVE_SOLARIS - -/* NetBSD */ -#undef HAVE_NETBSD - -/* Define to the location of the kernel sources */ -#undef CONFIG_TINC_KERNELDIR - -/* Define to 1 if tun/tap support is enabled and found */ -#undef HAVE_TUNTAP - -/* Define to the location of if_tun.h */ -#undef LINUX_IF_TUN_H - -/* Define to 1 if support for jumbograms is enabled */ -#undef ENABLE_JUMBOGRAMS - -/* Define to 1 if checkpoint tracing is enabled */ -#undef ENABLE_TRACING - -/* Define to enable use of old SSLeay_add_all_algorithms() function */ -#undef HAVE_SSLEAY_ADD_ALL_ALGORITHMS - -/* Define if there a socklen_t */ -#undef HAVE_SOCKLEN_T diff --git a/configure.in b/configure.in index 715b4016..e8b9527c 100644 --- a/configure.in +++ b/configure.in @@ -1,6 +1,6 @@ dnl Process this file with autoconf to produce a configure script. -dnl $Id: configure.in,v 1.13.2.50 2002/06/10 14:35:18 guus Exp $ +dnl $Id: configure.in,v 1.13.2.51 2002/06/11 11:03:17 guus Exp $ AC_INIT(src/tincd.c) AM_INIT_AUTOMAKE(tinc, 1.0-cvs) @@ -12,7 +12,8 @@ AM_ACLOCAL_INCLUDE(m4) # Enable GNU extensions. # Define this here, not in acconfig's @TOP@ section, since definitions # in the latter don't make it into the configure-time tests. -AC_DEFINE([_GNU_SOURCE], [__USE_BSD]) +AC_DEFINE([_GNU_SOURCE], 1, [Enable GNU extenstions]) +AC_DEFINE([__USE_BSD], 1, [Enable BSD extensions]) ALL_LINGUAS="nl" @@ -35,27 +36,27 @@ AC_CANONICAL_HOST case $host_os in *linux*) - AC_DEFINE(HAVE_LINUX) + AC_DEFINE(HAVE_LINUX, 1, [Linux]) [ rm -f src/device.c; ln -sf linux/device.c src/device.c ] ;; *freebsd*) - AC_DEFINE(HAVE_FREEBSD) + AC_DEFINE(HAVE_FREEBSD, 1, [FreeBSD]) [ rm -f src/device.c; ln -sf freebsd/device.c src/device.c ] ;; *darwin*) - AC_DEFINE(HAVE_DARWIN) + AC_DEFINE(HAVE_DARWIN, 1, [Darwin (MacOS/X)]) [ rm -f src/device.c; ln -sf darwin/device.c src/device.c ] ;; *solaris*) - AC_DEFINE(HAVE_SOLARIS) + AC_DEFINE(HAVE_SOLARIS, 1, [Solaris/SunOS]) [ rm -f src/device.c; ln -sf solaris/device.c src/device.c ] ;; *openbsd*) - AC_DEFINE(HAVE_OPENBSD) + AC_DEFINE(HAVE_OPENBSD, 1, [OpenBSD]) [ rm -f src/device.c; ln -sf openbsd/device.c src/device.c ] ;; *netbsd*) - AC_DEFINE(HAVE_NETBSD) + AC_DEFINE(HAVE_NETBSD, 1, [NetBSD]) [ rm -f src/device.c; ln -sf netbsd/device.c src/device.c ] ;; *) @@ -97,7 +98,7 @@ AC_CACHE_CHECK([for socklen_t], ac_cv_type_socklen_t, ac_cv_type_socklen_t=no) ]) if test $ac_cv_type_socklen_t = yes; then - AC_DEFINE(HAVE_SOCKLEN_T) + AC_DEFINE(HAVE_SOCKLEN_T, 1, [socklen_t available]) fi dnl Checks for library functions. @@ -130,13 +131,13 @@ tinc_ZLIB dnl Check if support for jumbograms is requested AC_ARG_ENABLE(jumbograms, [ --enable-jumbograms enable support for jumbograms (packets up to 9000 bytes)], - [ AC_DEFINE(ENABLE_JUMBOGRAMS) ] + [ AC_DEFINE(ENABLE_JUMBOGRAMS, 1, [Support for jumbograms (packets up to 9000 bytes)]) ] ) dnl Check if checkpoint tracing has to be enabled AC_ARG_ENABLE(tracing, [ --enable-tracing enable checkpoint tracing (debugging only)], - [ AC_DEFINE(ENABLE_TRACING) ] + [ AC_DEFINE(ENABLE_TRACING, 1, [Checkpoint tracing]) ] ) AC_SUBST(INCLUDES) diff --git a/m4/malloc.m4 b/m4/malloc.m4 index bd3cad46..dacd9191 100644 --- a/m4/malloc.m4 +++ b/m4/malloc.m4 @@ -20,8 +20,7 @@ AC_DEFUN(jm_FUNC_MALLOC, fi dnl xmalloc.c requires that this symbol be defined so it doesn't dnl mistakenly use a broken malloc -- as it might if this test were omitted. - ac_kludge=HAVE_DONE_WORKING_MALLOC_CHECK - AC_DEFINE_UNQUOTED($ac_kludge) + AC_DEFINE(HAVE_DONE_WORKING_MALLOC_CHECK, 1, [Needed for xmalloc.c]) AC_CACHE_CHECK([for working malloc], jm_cv_func_working_malloc, [AC_TRY_RUN([ @@ -38,7 +37,8 @@ AC_DEFUN(jm_FUNC_MALLOC, jm_cv_func_working_malloc=no) ]) if test $jm_cv_func_working_malloc = no; then - LIBOBJS="$LIBOBJS malloc.o" - AC_DEFINE_UNQUOTED(malloc, rpl_malloc) +dnl This should be converted to: AC_LIBOBJ([malloc]) + LIBOBJS="$LIBOBJS malloc.$ac_objext" + AC_DEFINE(malloc, rpl_malloc, [Replacement malloc()]) fi ]) diff --git a/m4/openssl.m4 b/m4/openssl.m4 index e5c09395..40ad4fd0 100644 --- a/m4/openssl.m4 +++ b/m4/openssl.m4 @@ -19,31 +19,31 @@ AC_DEFUN(tinc_OPENSSL, AC_CHECK_HEADERS(openssl/evp.h openssl/rsa.h openssl/rand.h openssl/err.h openssl/sha.h openssl/pem.h, [], - [AC_MSG_ERROR("OpenSSL header files not found."); break] + [AC_MSG_ERROR([OpenSSL header files not found.]); break] ) CPPFLAGS="$tinc_ac_save_CPPFLAGS" AC_CHECK_LIB(crypto, SHA1_version, [LIBS="$LIBS -lcrypto"], - [AC_MSG_ERROR("OpenSSL libraries not found.")] + [AC_MSG_ERROR([OpenSSL libraries not found.])] ) AC_CHECK_FUNCS(RAND_pseudo_bytes) AC_CHECK_FUNC(OpenSSL_add_all_algorithms, [], - AC_CHECK_FUNC(SSLeay_add_all_algorithms, - [AC_DEFINE(HAVE_SSLEAY_ADD_ALL_ALGORITHMS)], - [AC_MSG_ERROR("Missing required OpenSSL functionality!")] - ) + [AC_CHECK_FUNC(SSLeay_add_all_algorithms, + [AC_DEFINE(HAVE_SSLEAY_ADD_ALL_ALGORITHMS, 1, [Defined if this function should be used instead of OpenSLL_add_all_algorithms])], + [AC_MSG_ERROR([Missing required OpenSSL functionality!])] + )] ) AC_CHECK_FUNC(dlopen, [], - AC_CHECK_LIB(dl, dlopen, + [AC_CHECK_LIB(dl, dlopen, [LIBS="$LIBS -ldl"], - [AC_MSG_ERROR("OpenSSL depends on libdl.")] - ) + [AC_MSG_ERROR([OpenSSL depends on libdl.])] + )] ) ]) diff --git a/m4/realloc.m4 b/m4/realloc.m4 index aba19840..2eaeb0c3 100644 --- a/m4/realloc.m4 +++ b/m4/realloc.m4 @@ -20,8 +20,7 @@ AC_DEFUN(jm_FUNC_REALLOC, fi dnl xmalloc.c requires that this symbol be defined so it doesn't dnl mistakenly use a broken realloc -- as it might if this test were omitted. - ac_kludge=HAVE_DONE_WORKING_REALLOC_CHECK - AC_DEFINE_UNQUOTED($ac_kludge) + AC_DEFINE(HAVE_DONE_WORKING_REALLOC_CHECK, 1, [Needed for xmalloc.c]) AC_CACHE_CHECK([for working realloc], jm_cv_func_working_realloc, [AC_TRY_RUN([ @@ -38,7 +37,8 @@ AC_DEFUN(jm_FUNC_REALLOC, jm_cv_func_working_realloc=no) ]) if test $jm_cv_func_working_realloc = no; then - LIBOBJS="$LIBOBJS realloc.o" - AC_DEFINE_UNQUOTED(realloc, rpl_realloc) +dnl This should be converted to: AC_LIBOBJ([realloc]) + LIBOBJS="$LIBOBJS realloc.$ac_objext" + AC_DEFINE(realloc, rpl_realloc, [Replacement realloc()]) fi ]) diff --git a/m4/tuntap.m4 b/m4/tuntap.m4 index 0bee1ce3..cd3a485a 100644 --- a/m4/tuntap.m4 +++ b/m4/tuntap.m4 @@ -29,9 +29,9 @@ AC_CACHE_CHECK([for linux/if_tun.h], tinc_cv_linux_if_tun_h, ]) if test $tinc_cv_linux_if_tun_h != none; then - AC_DEFINE(HAVE_TUNTAP) + AC_DEFINE(HAVE_TUNTAP, 1, [Universal tun/tap driver present]) if test $tinc_cv_linux_if_tun_h != default; then - AC_DEFINE_UNQUOTED(LINUX_IF_TUN_H, $tinc_cv_linux_if_tun_h) + AC_DEFINE_UNQUOTED(LINUX_IF_TUN_H, $tinc_cv_linux_if_tun_h, [Location of if_tun.h]) fi fi AC_SUBST(LINUX_IF_TUN_H) -- 2.20.1