Synchronise HEAD with CABAL branch.

This commit is contained in:
Guus Sliepen 2003-08-24 20:38:31 +00:00
parent efa5148bc7
commit 013a2e159e
173 changed files with 12252 additions and 28046 deletions

25
m4/attribute.m4 Normal file
View file

@ -0,0 +1,25 @@
dnl Check to find out whether function attributes are supported.
dnl If they are not, #define them to be nothing.
AC_DEFUN(tinc_ATTRIBUTE,
[
AC_CACHE_CHECK([for working $1 attribute], tinc_cv_attribute_$1,
[
tempcflags="$CFLAGS"
CFLAGS="$CFLAGS -Wall -Werror"
AC_COMPILE_IFELSE(
[AC_LANG_SOURCE(
[void test(void) __attribute__ (($1));
void test(void) { return; }
],
)],
[tinc_cv_attribute_$1=yes],
[tinc_cv_attribute_$1=no]
)
CFLAGS="$tempcflags"
])
if test ${tinc_cv_attribute_$1} = no; then
AC_DEFINE([$1], [], [Defined if the $1 attribute is not supported.])
fi
])

39
m4/lzo.m4 Normal file
View file

@ -0,0 +1,39 @@
dnl Check to find the lzo headers/libraries
AC_DEFUN(tinc_LZO,
[
tinc_ac_save_CPPFLAGS="$CPPFLAGS"
AC_ARG_WITH(lzo,
AC_HELP_STRING([--with-lzo=DIR], [lzo base directory, or:]),
[lzo="$withval"
CFLAGS="$CFLAGS -I$withval/include"
CPPFLAGS="$CPPFLAGS -I$withval/include"
LIBS="$LIBS -L$withval/lib"]
)
AC_ARG_WITH(lzo-include,
AC_HELP_STRING([--with-lzo-include=DIR], [lzo headers directory]),
[lzo_include="$withval"
CFLAGS="$CFLAGS -I$withval"
CPPFLAGS="$CPPFLAGS -I$withval"]
)
AC_ARG_WITH(lzo-lib,
AC_HELP_STRING([--with-lzo-lib=DIR], [lzo library directory]),
[lzo_lib="$withval"
LIBS="$LIBS -L$withval"]
)
AC_CHECK_HEADERS(lzo1x.h,
[],
[AC_MSG_ERROR("lzo header files not found."); break]
)
CPPFLAGS="$tinc_ac_save_CPPFLAGS"
AC_CHECK_LIB(lzo, lzo1x_1_compress,
[LIBS="$LIBS -llzo"],
[AC_MSG_ERROR("lzo libraries not found.")]
)
])

View file

@ -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 was: LIBOBJS="$LIBOBJS malloc.$ac_objext"
AC_LIBOBJ([malloc])
AC_DEFINE(malloc, rpl_malloc, [Replacement malloc()])
fi
])

View file

@ -4,48 +4,63 @@ AC_DEFUN(tinc_OPENSSL,
[
tinc_ac_save_CPPFLAGS="$CPPFLAGS"
AC_ARG_WITH(openssl,
AC_HELP_STRING([--with-openssl=DIR], [OpenSSL base directory, or:]),
[openssl="$withval"
CFLAGS="$CFLAGS -I$withval/include"
CPPFLAGS="$CPPFLAGS -I$withval/include"
LIBS="$LIBS -L$withval/lib"]
)
AC_ARG_WITH(openssl-include,
[ --with-openssl-include=DIR OpenSSL headers directory (without trailing /openssl)],
AC_HELP_STRING([--with-openssl-include=DIR], [OpenSSL headers directory (without trailing /openssl)]),
[openssl_include="$withval"
CFLAGS="$CFLAGS -I$withval"
CPPFLAGS="$CPPFLAGS -I$withval"]
)
AC_ARG_WITH(openssl-lib,
[ --with-openssl-lib=DIR OpenSSL library directory],
AC_HELP_STRING([--with-openssl-lib=DIR], [OpenSSL library directory]),
[openssl_lib="$withval"
LIBS="$LIBS -L$withval"]
)
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_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!")]
case $host_os in
*mingw*)
AC_CHECK_LIB(crypto, SHA1_version,
[LIBS="$LIBS -lcrypto -lgdi32"],
[AC_MSG_ERROR([OpenSSL libraries not found.])]
)
)
AC_CHECK_FUNC(dlopen,
[],
AC_CHECK_LIB(dl, dlopen,
[LIBS="$LIBS -ldl"],
[AC_MSG_ERROR("OpenSSL depends on libdl.")]
;;
*)
AC_CHECK_LIB(crypto, SHA1_version,
[LIBS="$LIBS -lcrypto"],
[AC_MSG_ERROR([OpenSSL libraries not found.])]
)
AC_CHECK_FUNC(dlopen,
[],
[AC_CHECK_LIB(dl, dlopen,
[LIBS="$LIBS -ldl"],
[AC_MSG_ERROR([OpenSSL depends on libdl.]); break]
)]
)
;;
esac
AC_CHECK_FUNCS([RAND_pseudo_bytes EVP_EncryptInit_ex], ,
[AC_MSG_ERROR([Missing OpenSSL functionality, make sure you have installed the latest version.]); break],
)
found_openssl=1
AC_CHECK_DECL([OpenSSL_add_all_algorithms], ,
[AC_MSG_ERROR([Missing OpenSSL functionality, make sure you have installed the latest version.]); break],
[#include <openssl/evp.h>]
)
])

View file

@ -1,39 +0,0 @@
#serial 1
dnl From Jim Meyering.
dnl Find a new-enough version of Perl.
dnl
AC_DEFUN(jm_PERL,
[
dnl FIXME: don't hard-code 5.003
dnl FIXME: should we cache the result?
AC_MSG_CHECKING([for perl5.003 or newer])
if test "${PERL+set}" = set; then
# `PERL' is set in the user's environment.
candidate_perl_names="$PERL"
perl_specified=yes
else
candidate_perl_names='perl perl5'
perl_specified=no
fi
found=no
AC_SUBST(PERL)
PERL="$missing_dir/missing perl"
for perl in $candidate_perl_names; do
# Run test in a subshell; some versions of sh will print an error if
# an executable is not found, even if stderr is redirected.
if ( $perl -e 'require 5.003' ) > /dev/null 2>&1; then
PERL=$perl
found=yes
break
fi
done
AC_MSG_RESULT($found)
test $found = no && AC_MSG_WARN([
*** You don't seem to have perl5.003 or newer installed.
*** Because of that, you may be unable to regenerate certain files
*** if you modify the sources from which they are derived.] )
])

View file

@ -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 was: LIBOBJS="$LIBOBJS realloc.$ac_objext"
AC_LIBOBJ([realloc])
AC_DEFINE(realloc, rpl_realloc, [Replacement realloc()])
fi
])

View file

@ -2,38 +2,37 @@ dnl Check to find out whether the running kernel has support for TUN/TAP
AC_DEFUN(tinc_TUNTAP,
[
AC_ARG_WITH(kernel,
[ --with-kernel=dir give the directory with kernel sources]
[ (default: /usr/src/linux)],
kerneldir="$withval",
kerneldir="/usr/src/linux"
)
AC_CACHE_CHECK([for linux/if_tun.h], tinc_cv_linux_if_tun_h,
[
AC_TRY_COMPILE([#include "$kerneldir/include/linux/if_tun.h"],
[int a = IFF_TAP;],
if_tun_h="\"$kerneldir/include/linux/if_tun.h\"",
[AC_TRY_COMPILE([#include <linux/if_tun.h>],
[int a = IFF_TAP;],
if_tun_h="default",
if_tun_h="no"
)]
AC_ARG_WITH(kernel,
AC_HELP_STRING([--with-kernel=DIR], [give the directory with kernel sources (default: /usr/src/linux)]),
kerneldir="$withval",
kerneldir="/usr/src/linux"
)
if test $if_tun_h = no; then
tinc_cv_linux_if_tun_h=none
else
tinc_cv_linux_if_tun_h="$if_tun_h"
AC_CACHE_CHECK([for linux/if_tun.h], tinc_cv_linux_if_tun_h,
[
AC_TRY_COMPILE([#include "$kerneldir/include/linux/if_tun.h"],
[int a = IFF_TAP;],
if_tun_h="\"$kerneldir/include/linux/if_tun.h\"",
[AC_TRY_COMPILE([#include <linux/if_tun.h>],
[int a = IFF_TAP;],
if_tun_h="default",
if_tun_h="no"
)]
)
if test $if_tun_h = no; then
tinc_cv_linux_if_tun_h=none
else
tinc_cv_linux_if_tun_h="$if_tun_h"
fi
])
if test $tinc_cv_linux_if_tun_h != none; then
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, [Location of if_tun.h])
fi
fi
])
if test $tinc_cv_linux_if_tun_h != none; then
AC_DEFINE(HAVE_TUNTAP)
if test $tinc_cv_linux_if_tun_h != default; then
AC_DEFINE_UNQUOTED(LINUX_IF_TUN_H, $tinc_cv_linux_if_tun_h)
fi
fi
AC_SUBST(LINUX_IF_TUN_H)
AC_SUBST(HAVE_TUNTAP)
AC_SUBST(LINUX_IF_TUN_H)
AC_SUBST(HAVE_TUNTAP)
])

View file

@ -4,15 +4,23 @@ AC_DEFUN(tinc_ZLIB,
[
tinc_ac_save_CPPFLAGS="$CPPFLAGS"
AC_ARG_WITH(zlib,
AC_HELP_STRING([--with-zlib=DIR], [zlib base directory, or:]),
[zlib="$withval"
CFLAGS="$CFLAGS -I$withval/include"
CPPFLAGS="$CPPFLAGS -I$withval/include"
LIBS="$LIBS -L$withval/lib"]
)
AC_ARG_WITH(zlib-include,
[ --with-zlib-include=DIR zlib headers directory],
AC_HELP_STRING([--with-zlib-include=DIR], [zlib headers directory]),
[zlib_include="$withval"
CFLAGS="$CFLAGS -I$withval"
CPPFLAGS="$CPPFLAGS -I$withval"]
)
AC_ARG_WITH(zlib-lib,
[ --with-zlib-lib=DIR zlib library directory],
AC_HELP_STRING([--with-zlib-lib=DIR], [zlib library directory]),
[zlib_lib="$withval"
LIBS="$LIBS -L$withval"]
)