summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2013-05-22 12:23:20 +1000
committerAndrew Bartlett <abartlet@samba.org>2013-05-28 12:17:10 +1000
commitcd4b413cb0574c459c1c24cf07f8d6b44f5fc077 (patch)
tree692104ce22e21cb0e8320b5c7aa9c4c2102eafc0 /lib
parent97cceb5f8b9fc68cb8942092e92fde2b965883e4 (diff)
downloadsamba-cd4b413cb0574c459c1c24cf07f8d6b44f5fc077.tar.gz
samba-cd4b413cb0574c459c1c24cf07f8d6b44f5fc077.tar.bz2
samba-cd4b413cb0574c459c1c24cf07f8d6b44f5fc077.zip
build: Remove autoconf build system
We are now confident that that waf build system meets enough of our needs that we will work to improve it, rather than maintain two build systems. Andrew Bartlett Reviewed-by: Jelmer Vernooij <jelmer@samba.org> Reviewed-by: David Disseldorp <ddiss@samba.org>
Diffstat (limited to 'lib')
-rw-r--r--lib/ccan/libccan.m4363
-rw-r--r--lib/iniparser_build/config.m445
-rw-r--r--lib/nss_wrapper/config.m419
-rw-r--r--lib/ntdb/libntdb.m441
-rw-r--r--lib/popt/libpopt.m443
-rw-r--r--lib/popt/samba.m48
-rw-r--r--lib/replace/crypt.m46
-rw-r--r--lib/replace/dlfcn.m431
-rw-r--r--lib/replace/libreplace.m4490
-rw-r--r--lib/replace/libreplace_cc.m4197
-rw-r--r--lib/replace/libreplace_ld.m4337
-rw-r--r--lib/replace/libreplace_macros.m4347
-rw-r--r--lib/replace/libreplace_network.m4503
-rw-r--r--lib/replace/repdir.m481
-rw-r--r--lib/replace/strptime.m416
-rw-r--r--lib/replace/system/config.m4145
-rw-r--r--lib/replace/timegm.m41
-rw-r--r--lib/replace/win32.m420
-rw-r--r--lib/socket_wrapper/config.m422
-rw-r--r--lib/talloc/compat/talloc_compat1.m414
-rw-r--r--lib/talloc/libtalloc.m438
-rw-r--r--lib/tdb/libtdb.m441
-rw-r--r--lib/tevent/libtevent.m475
-rw-r--r--lib/uid_wrapper/config.m419
-rw-r--r--lib/zlib/zlib.m429
25 files changed, 0 insertions, 2931 deletions
diff --git a/lib/ccan/libccan.m4 b/lib/ccan/libccan.m4
deleted file mode 100644
index c573215070..0000000000
--- a/lib/ccan/libccan.m4
+++ /dev/null
@@ -1,363 +0,0 @@
-dnl find the ccan sources.
-ccandir="../lib/ccan"
-for d in $ccanpaths; do
- if test -f "$srcdir/$d/str/str.c"; then
- ccandir="$d"
- AC_SUBST(ccandir)
- break
- fi
-done
-if test -f "$ccandir/str/str.c"; then :; else
- AC_MSG_ERROR([cannot find ccan source in $ccandir])
-fi
-CCAN_OBJ="$ccandir/hash/hash.o $ccandir/htable/htable.o $ccandir/ilog/ilog.o $ccandir/likely/likely.o $ccandir/str/debug.o $ccandir/str/str.o $ccandir/tally/tally.o"
-
-AC_SUBST(CCAN_OBJ)
-
-# Preferred method for including ccan modules is #include <ccan/module/...>.
-CCAN_CFLAGS="-I$ccandir/.. -DHAVE_CCAN"
-AC_SUBST(CCAN_CFLAGS)
-
-# All the configuration checks. Regrettably, the __attribute__ checks will
-# give false positives on old GCCs, since they just cause warnings. But that's
-# fairly harmless.
-AC_CHECK_HEADERS(err.h)
-
-AC_CHECK_HEADERS(byteswap.h)
-
-AC_CACHE_CHECK([whether we can compile with __attribute__((cold))],
- samba_cv_attribute_cold,
- [
- AC_COMPILE_IFELSE([AC_LANG_SOURCE(
- [
- static void __attribute__((cold))
- cleanup(void) { }
- ])],
- samba_cv_attribute_cold=yes)
- ])
-
-if test x"$samba_cv_attribute_cold" = xyes ; then
- AC_DEFINE(HAVE_ATTRIBUTE_COLD, 1,
- [whether we can compile with __attribute__((cold))])
-fi
-
-AC_CACHE_CHECK([whether we can compile with __attribute__((const))],
- samba_cv_attribute_const,
- [
- AC_COMPILE_IFELSE([AC_LANG_SOURCE(
- [
- static void __attribute__((const))
- cleanup(void) { }
- ])],
- samba_cv_attribute_const=yes)
- ])
-
-if test x"$samba_cv_attribute_const" = xyes ; then
- AC_DEFINE(HAVE_ATTRIBUTE_CONST, 1,
- [whether we can compile with __attribute__((const))])
-fi
-
-AC_CACHE_CHECK([whether we can compile with __attribute__((noreturn))],
- samba_cv_attribute_noreturn,
- [
- AC_COMPILE_IFELSE([AC_LANG_SOURCE(
- [
- static void __attribute__((noreturn))
- cleanup(void) { exit(1); }
- ])],
- samba_cv_attribute_noreturn=yes)
- ])
-
-if test x"$samba_cv_attribute_noreturn" = xyes ; then
- AC_DEFINE(HAVE_ATTRIBUTE_NORETURN, 1,
- [whether we can compile with __attribute__((noreturn))])
-fi
-
-AC_CACHE_CHECK([whether we can compile with __attribute__((printf))],
- samba_cv_attribute_printf,
- [
- AC_COMPILE_IFELSE([AC_LANG_SOURCE(
- [
- static void __attribute__((format(__printf__, 1, 2)))
- cleanup(const char *fmt, ...) { }
- ])],
- samba_cv_attribute_printf=yes)
- ])
-
-if test x"$samba_cv_attribute_printf" = xyes ; then
- AC_DEFINE(HAVE_ATTRIBUTE_PRINTF, 1,
- [whether we can compile with __attribute__((format(printf)))])
-fi
-
-AC_CACHE_CHECK([whether we can compile with __attribute__((unused))],
- samba_cv_attribute_unused,
- [
- AC_COMPILE_IFELSE([AC_LANG_SOURCE(
- [
- static void __attribute__((unused))
- cleanup(void) { }
- ])],
- samba_cv_attribute_unused=yes)
- ])
-
-if test x"$samba_cv_attribute_unused" = xyes ; then
- AC_DEFINE(HAVE_ATTRIBUTE_UNUSED, 1,
- [whether we can compile with __attribute__((unused))])
-fi
-
-AC_CACHE_CHECK([whether we can compile with __attribute__((used))],
- samba_cv_attribute_used,
- [
- AC_COMPILE_IFELSE([AC_LANG_SOURCE(
- [
- static void __attribute__((used))
- cleanup(void) { }
- ])],
- samba_cv_attribute_used=yes)
- ])
-
-if test x"$samba_cv_attribute_used" = xyes ; then
- AC_DEFINE(HAVE_ATTRIBUTE_USED, 1,
- [whether we can compile with __attribute__((used))])
-fi
-
-# FIXME: We could use endian.h or sys/endian.h here, and __BYTE_ORDER for
-# cross-compiling.
-AC_CACHE_CHECK([whether we are big endian],samba_cv_big_endian,[
-AC_TRY_RUN([int main(void) {
-union { int i; char c[sizeof(int)]; } u;
- u.i = 0x01020304;
- return u.c[0] == 0x01 && u.c[1] == 0x02 && u.c[2] == 0x03 && u.c[3] == 0x04 ? 0 : 1;
-}],
-samba_cv_big_endian=yes,
-samba_cv_big_endian=no)])
-if test x"$samba_cv_big_endian" = xyes ; then
- AC_DEFINE(HAVE_BIG_ENDIAN, 1,
- [whether we are big endian])
-fi
-
-AC_CACHE_CHECK([whether we have __builtin_clz],
- samba_cv_builtin_clz,
- [
- AC_LINK_IFELSE([AC_LANG_SOURCE(
- [int main(void) {
- return __builtin_clz(1) == (sizeof(int)*8 - 1) ? 0 : 1;
- }])],
- samba_cv_builtin_clz=yes)
- ])
-
-if test x"$samba_cv_builtin_clz" = xyes ; then
- AC_DEFINE(HAVE_BUILTIN_CLZ, 1,
- [whether we have __builtin_clz])
-fi
-
-AC_CACHE_CHECK([whether we have __builtin_clzl],
- samba_cv_builtin_clzl,
- [
- AC_LINK_IFELSE([AC_LANG_SOURCE(
- [int main(void) {
- return __builtin_clzl(1) == (sizeof(int)*8 - 1) ? 0 : 1;
- }])],
- samba_cv_builtin_clzl=yes)
- ])
-
-if test x"$samba_cv_builtin_clzl" = xyes ; then
- AC_DEFINE(HAVE_BUILTIN_CLZL, 1,
- [whether we have __builtin_clzl])
-fi
-AC_CACHE_CHECK([whether we have __builtin_clzll],
- samba_cv_builtin_clzll,
- [
- AC_LINK_IFELSE([AC_LANG_SOURCE(
- [int main(void) {
- return __builtin_clzll(1) == (sizeof(int)*8 - 1) ? 0 : 1;
- }])],
- samba_cv_builtin_clzll=yes)
- ])
-
-if test x"$samba_cv_builtin_clzll" = xyes ; then
- AC_DEFINE(HAVE_BUILTIN_CLZLL, 1,
- [whether we have __builtin_clzll])
-fi
-
-AC_CACHE_CHECK([whether we have __builtin_constant_p],
- samba_cv_builtin_constant_p,
- [
- AC_LINK_IFELSE([AC_LANG_SOURCE(
- [int main(void) {
- return __builtin_constant_p(1) ? 0 : 1;
- }])],
- samba_cv_builtin_constant_p=yes)
- ])
-
-if test x"$samba_cv_builtin_constant_p" = xyes ; then
- AC_DEFINE(HAVE_BUILTIN_CONSTANT_P, 1,
- [whether we have __builtin_constant_p])
-fi
-
-AC_CACHE_CHECK([whether we have __builtin_expect],
- samba_cv_builtin_expect,
- [
- AC_LINK_IFELSE([AC_LANG_SOURCE(
- [int main(void) {
- return __builtin_expect(main != 0, 1) ? 0 : 1;
- }])],
- samba_cv_builtin_expect=yes)
- ])
-
-if test x"$samba_cv_builtin_expect" = xyes ; then
- AC_DEFINE(HAVE_BUILTIN_EXPECT, 1,
- [whether we have __builtin_expect])
-fi
-
-AC_CACHE_CHECK([whether we have __builtin_popcountl],
- samba_cv_builtin_popcountl,
- [
- AC_LINK_IFELSE([AC_LANG_SOURCE(
- [int main(void) {
- return __builtin_popcountl(255L) == 8 ? 0 : 1;
- }])],
- samba_cv_builtin_popcountl=yes)
- ])
-
-if test x"$samba_cv_builtin_popcountl" = xyes ; then
- AC_DEFINE(HAVE_BUILTIN_POPCOUNTL, 1,
- [whether we have __builtin_popcountl])
-fi
-
-AC_CACHE_CHECK([whether we have __builtin_types_compatible_p],
- samba_cv_builtin_types_compatible_p,
- [
- AC_LINK_IFELSE([AC_LANG_SOURCE(
- [int main(void) {
- return __builtin_types_compatible_p(char *, int) ? 1 : 0;
- }])],
- samba_cv_builtin_types_compatible_p=yes)
- ])
-
-if test x"$samba_cv_builtin_types_compatible_p" = xyes ; then
- AC_DEFINE(HAVE_BUILTIN_TYPES_COMPATIBLE_P, 1,
- [whether we have __builtin_types_compatible_p])
-fi
-
-AC_CACHE_CHECK([whether we have __builtin_choose_expr],
- samba_cv_builtin_choose_expr,
- [
- AC_LINK_IFELSE([AC_LANG_SOURCE(
- [int main(void) {
- return __builtin_choose_expr(1, 0, "garbage");
- }])],
- samba_cv_builtin_choose_expr=yes)
- ])
-
-if test x"$samba_cv_builtin_choose_expr" = xyes ; then
- AC_DEFINE(HAVE_BUILTIN_CHOOSE_EXPR, 1,
- [whether we have __builtin_choose_expr])
-fi
-
-# We use @<:@ and @:>@ here for embedded [ and ].
-AC_CACHE_CHECK([whether we have compound literals],
- samba_cv_compound_literals,
- [
- AC_COMPILE_IFELSE([AC_LANG_SOURCE(
- [int main(void) {
- int *foo = (int@<:@@:>@) { 1, 2, 3, 4 };
- return foo@<:@0@:>@ == 1 ? 0 : 1;
- }])],
- samba_cv_compound_literals=yes)
- ])
-
-if test x"$samba_cv_compound_literals" = xyes ; then
- AC_DEFINE(HAVE_COMPOUND_LITERALS, 1,
- [whether we have compound literals])
-fi
-
-AC_CACHE_CHECK([whether we have flexible array members],
- samba_cv_have_flex_arr_member,
- [
- AC_COMPILE_IFELSE([AC_LANG_SOURCE(
- [struct foo { unsigned int x; int arr@<:@@:>@; }; ])],
- samba_cv_have_flex_arr_member=yes)
- ])
-
-if test x"$samba_cv_have_flex_arr_member" = xyes ; then
- AC_DEFINE(HAVE_FLEXIBLE_ARRAY_MEMBER, 1,
- [whether we have flexible array member support])
-fi
-
-AC_CACHE_CHECK([whether we have isblank],
- samba_cv_have_isblank,
- [
- AC_LINK_IFELSE([AC_LANG_SOURCE(
- [#include <ctype.h>
- int main(void) { return isblank(' ') ? 0 : 1; }
- ])],
- samba_cv_have_isblank=yes)
- ])
-
-if test x"$samba_cv_have_isblank" = xyes ; then
- AC_DEFINE(HAVE_ISBLANK, 1,
- [whether we have isblank])
-fi
-
-# FIXME: We could use endian.h or sys/endian.h here, and __BYTE_ORDER for
-# cross-compiling.
-AC_CACHE_CHECK([whether we are little endian],samba_cv_little_endian,[
-AC_TRY_RUN([int main(void) {
-union { int i; char c[sizeof(int)]; } u;
- u.i = 0x01020304;
- return u.c[0] == 0x04 && u.c[1] == 0x03 && u.c[2] == 0x02 && u.c[3] == 0x01 ? 0 : 1;
-}],
-samba_cv_little_endian=yes,
-samba_cv_little_endian=no)])
-if test x"$samba_cv_little_endian" = xyes ; then
- AC_DEFINE(HAVE_LITTLE_ENDIAN, 1,
- [whether we are little endian])
-fi
-
-AC_CACHE_CHECK([whether we have __typeof__],
- samba_cv_typeof,
- [
- AC_COMPILE_IFELSE([AC_LANG_SOURCE(
- [int main(void) {
- int x = 1;
- __typeof__(x) i;
- i = x;
- return i == x ? 0 : 1;
- }])],
- samba_cv_typeof=yes)
- ])
-
-if test x"$samba_cv_typeof" = xyes ; then
- AC_DEFINE(HAVE_TYPEOF, 1,
- [whether we have __typeof__])
-fi
-
-AC_CACHE_CHECK([whether we have __attribute__((warn_unused_result))],
- samba_cv_warn_unused_result,
- [
- AC_COMPILE_IFELSE([AC_LANG_SOURCE(
- [int __attribute__((warn_unused_result)) func(int x)
- { return x; }])],
- samba_cv_warn_unused_result=yes)
- ])
-
-if test x"$samba_cv_warn_unused_result" = xyes ; then
- AC_DEFINE(HAVE_WARN_UNUSED_RESULT, 1,
- [whether we have __attribute__((warn_unused_result))])
-fi
-
-AC_CACHE_CHECK([whether we have bswap_64],
- samba_cv_have_bswap_64,
- [
- AC_LINK_IFELSE([AC_LANG_SOURCE(
- [#include <byteswap.h>
- int main(void) { return bswap_64(1) ? 0 : 1; }
- ])],
- samba_cv_have_bswap_64=yes)
- ])
-
-if test x"$samba_cv_have_bswap_64" = xyes ; then
- AC_DEFINE(HAVE_BSWAP_64, 1,
- [whether we have bswap_64])
-fi
diff --git a/lib/iniparser_build/config.m4 b/lib/iniparser_build/config.m4
deleted file mode 100644
index 282c977c18..0000000000
--- a/lib/iniparser_build/config.m4
+++ /dev/null
@@ -1,45 +0,0 @@
-AC_ARG_WITH(included-iniparser,
-[AS_HELP_STRING([--with-included-iniparser], [use bundled iniparser library, not from system])],
-[
- case "$withval" in
- yes)
- INCLUDED_INIPARSER=yes
- ;;
- no)
- INCLUDED_INIPARSER=no
- ;;
- esac ],
-)
-if test x"$INCLUDED_INIPARSER" != x"yes"; then
- AC_CHECK_LIB_EXT(iniparser, LIBINIPARSER_LIBS, iniparser_load)
-
-fi
-
-AC_MSG_CHECKING(whether to use included iniparser)
-if test x"$ac_cv_lib_ext_iniparser" != x"yes"; then
-
- iniparserpaths="../iniparser ../lib/iniparser"
- for d in $iniparserpaths; do
- if test -f "$srcdir/$d/src/iniparser.c"; then
- iniparserdir="$d"
- break;
- fi
- done
- if test x"$iniparserdir" = "x"; then
- AC_MSG_ERROR([cannot find iniparser source in $iniparserpaths])
- fi
- INIPARSER_CFLAGS="-I$srcdir/$iniparserdir/src"
- AC_MSG_RESULT(yes)
-
- INIPARSER_OBJS=""
- INIPARSER_OBJS="$INIPARSER_OBJS $srcdir/$iniparserdir/../iniparser_build/iniparser.o"
- INIPARSER_OBJS="$INIPARSER_OBJS $srcdir/$iniparserdir/../iniparser_build/dictionary.o"
- INIPARSER_OBJS="$INIPARSER_OBJS $srcdir/$iniparserdir/../iniparser_build/strlib.o"
-
- SMB_SUBSYSTEM(LIBINIPARSER,[$INIPARSER_OBJS],[],[$INIPARSER_CFLAGS])
-else
- AC_MSG_RESULT(no)
- SMB_EXT_LIB(LIBINIPARSER,,,,${LIBINIPARSER_LIBS})
- SMB_ENABLE(LIBINIPARSER,YES)
-fi
-
diff --git a/lib/nss_wrapper/config.m4 b/lib/nss_wrapper/config.m4
deleted file mode 100644
index 1e864bfc3a..0000000000
--- a/lib/nss_wrapper/config.m4
+++ /dev/null
@@ -1,19 +0,0 @@
-AC_ARG_ENABLE(nss-wrapper,
-AS_HELP_STRING([--enable-nss-wrapper], [Turn on nss wrapper library (default=no)]))
-
-HAVE_NSS_WRAPPER=no
-
-if eval "test x$developer = xyes -o x$selftest = xyes"; then
- enable_nss_wrapper=yes
-fi
-
-if eval "test x$enable_nss_wrapper = xyes"; then
- AC_DEFINE(NSS_WRAPPER,1,[Use nss wrapper library])
- HAVE_NSS_WRAPPER=yes
-
- # this is only used for samba3
- NSS_WRAPPER_OBJS="../lib/nss_wrapper/nss_wrapper.o"
-fi
-
-AC_SUBST(HAVE_NSS_WRAPPER)
-AC_SUBST(NSS_WRAPPER_OBJS)
diff --git a/lib/ntdb/libntdb.m4 b/lib/ntdb/libntdb.m4
deleted file mode 100644
index 847dc6421a..0000000000
--- a/lib/ntdb/libntdb.m4
+++ /dev/null
@@ -1,41 +0,0 @@
-dnl find the ntdb sources. This is meant to work both for
-dnl ntdb standalone builds, and builds of packages using ntdb
-ntdbdir=""
-ntdbpaths=". lib/ntdb ntdb ../ntdb ../lib/ntdb"
-for d in $ntdbpaths; do
- if test -f "$srcdir/$d/ntdb.c"; then
- ntdbdir="$d"
- AC_SUBST(ntdbdir)
- break;
- fi
-done
-if test x"$ntdbdir" = "x"; then
- AC_MSG_ERROR([cannot find ntdb source in $ntdbpaths])
-fi
-NTDB_OBJ="check.o free.o hash.o io.o lock.o ntdb.o open.o summary.o transaction.o traverse.o"
-AC_SUBST(NTDB_OBJ)
-AC_SUBST(LIBREPLACEOBJ)
-AC_SUBST(CCAN_OBJ)
-
-NTDB_LIBS=""
-AC_SUBST(NTDB_LIBS)
-
-NTDB_DEPS=""
-if test x$libreplace_cv_HAVE_FDATASYNC_IN_LIBRT = xyes ; then
- NTDB_DEPS="$NTDB_DEPS -lrt"
-fi
-AC_SUBST(NTDB_DEPS)
-
-NTDB_CFLAGS="-I$ntdbdir"
-AC_SUBST(NTDB_CFLAGS)
-
-AC_CHECK_FUNCS(mmap pread pwrite getpagesize utime)
-AC_CHECK_HEADERS(getopt.h sys/select.h sys/time.h)
-
-AC_HAVE_DECL(pread, [#include <unistd.h>])
-AC_HAVE_DECL(pwrite, [#include <unistd.h>])
-
-if test x"$VERSIONSCRIPT" != "x"; then
- EXPORTSFILE=ntdb.exports
- AC_SUBST(EXPORTSFILE)
-fi
diff --git a/lib/popt/libpopt.m4 b/lib/popt/libpopt.m4
deleted file mode 100644
index cfa2eaad23..0000000000
--- a/lib/popt/libpopt.m4
+++ /dev/null
@@ -1,43 +0,0 @@
-dnl Check to see if we should use the included popt
-
-INCLUDED_POPT=auto
-AC_ARG_WITH(included-popt,
-[ --with-included-popt use bundled popt library, not from system],
-[ INCLUDED_POPT=$withval ])
-
-AC_SUBST(POPT_LIBS)
-AC_SUBST(POPT_CFLAGS)
-
-if test x"$INCLUDED_POPT" != x"yes"; then
- AC_CHECK_HEADERS(popt.h)
- AC_CHECK_LIB(popt, poptGetContext, [ POPT_LIBS="-lpopt" ])
- if test x"$ac_cv_header_popt_h" = x"no" -o x"$ac_cv_lib_popt_poptGetContext" = x"no"; then
- INCLUDED_POPT=yes
- POPT_CFLAGS=""
- else
- INCLUDED_POPT=no
- fi
-fi
-
-AC_MSG_CHECKING(whether to use included popt)
-AC_MSG_RESULT($INCLUDED_POPT)
-if test x"$INCLUDED_POPT" != x"no"; then
- dnl find the popt sources. This is meant to work both for
- dnl popt standalone builds, and builds of packages using popt
- poptdir=""
- poptpaths="$srcdir $srcdir/lib/popt $srcdir/popt $srcdir/../popt $srcdir/../lib/popt"
- for d in $poptpaths; do
- if test -f "$d/popt.c"; then
- poptdir="$d"
- POPT_CFLAGS="-I$d"
- AC_SUBST(poptdir)
- break
- fi
- done
- if test x"$poptdir" = "x"; then
- AC_MSG_ERROR([cannot find popt source in $poptpaths])
- fi
- POPT_OBJ="popt.o findme.o poptconfig.o popthelp.o poptparse.o"
- AC_SUBST(POPT_OBJ)
- AC_CHECK_HEADERS([float.h alloca.h])
-fi
diff --git a/lib/popt/samba.m4 b/lib/popt/samba.m4
deleted file mode 100644
index 627dd854b2..0000000000
--- a/lib/popt/samba.m4
+++ /dev/null
@@ -1,8 +0,0 @@
-m4_include(../lib/popt/libpopt.m4)
-
-if test x"$POPT_OBJ" = "x"; then
- SMB_EXT_LIB(LIBPOPT, [${POPT_LIBS}])
-else
- SMB_INCLUDE_MK(../lib/popt/config.mk)
-fi
-
diff --git a/lib/replace/crypt.m4 b/lib/replace/crypt.m4
deleted file mode 100644
index fae2a58685..0000000000
--- a/lib/replace/crypt.m4
+++ /dev/null
@@ -1,6 +0,0 @@
-###############################################
-# test for where we get crypt() from
-AC_CHECK_HEADERS(crypt.h)
-AC_SEARCH_LIBS_EXT(crypt, [crypt], CRYPT_LIBS,
- [ AC_DEFINE(HAVE_CRYPT,1,[Whether the system has the crypt() function]) ],
- [ LIBREPLACEOBJ="${LIBREPLACEOBJ} $libreplacedir/crypt.o" ])
diff --git a/lib/replace/dlfcn.m4 b/lib/replace/dlfcn.m4
deleted file mode 100644
index 722e0246b7..0000000000
--- a/lib/replace/dlfcn.m4
+++ /dev/null
@@ -1,31 +0,0 @@
-dnl dummies provided by dlfcn.c if not available
-save_LIBS="$LIBS"
-LIBS=""
-
-libreplace_cv_dlfcn=no
-AC_SEARCH_LIBS(dlopen, dl)
-
-AC_CHECK_HEADERS(dlfcn.h)
-AC_CHECK_FUNCS([dlopen dlsym dlerror dlclose],[],[libreplace_cv_dlfcn=yes])
-
-libreplace_cv_shl=no
-AC_SEARCH_LIBS(shl_load, sl)
-AC_CHECK_HEADERS(dl.h)
-AC_CHECK_FUNCS([shl_load shl_unload shl_findsym],[],[libreplace_cv_shl=yes])
-
-AC_VERIFY_C_PROTOTYPE([void *dlopen(const char* filename, unsigned int flags)],
- [
- return 0;
- ],[
- AC_DEFINE(DLOPEN_TAKES_UNSIGNED_FLAGS, 1, [Whether dlopen takes unsigned int flags])
- ],[],[
- #include <dlfcn.h>
- ])
-
-if test x"${libreplace_cv_dlfcn}" = x"yes";then
- LIBREPLACEOBJ="${LIBREPLACEOBJ} $libreplacedir/dlfcn.o"
-fi
-
-LIBDL="$LIBS"
-AC_SUBST(LIBDL)
-LIBS="$save_LIBS"
diff --git a/lib/replace/libreplace.m4 b/lib/replace/libreplace.m4
deleted file mode 100644
index f4ae715340..0000000000
--- a/lib/replace/libreplace.m4
+++ /dev/null
@@ -1,490 +0,0 @@
-AC_DEFUN_ONCE(AC_LIBREPLACE_LOCATION_CHECKS,
-[
-echo "LIBREPLACE_LOCATION_CHECKS: START"
-
-dnl find the libreplace sources. This is meant to work both for
-dnl libreplace standalone builds, and builds of packages using libreplace
-libreplacedir=""
-libreplacepaths="$srcdir $srcdir/lib/replace $srcdir/libreplace $srcdir/../libreplace $srcdir/../replace $srcdir/../lib/replace $srcdir/../../../lib/replace"
-for d in $libreplacepaths; do
- if test -f "$d/replace.c"; then
- libreplacedir="$d"
- AC_SUBST(libreplacedir)
- break;
- fi
-done
-if test x"$libreplacedir" = "x"; then
- AC_MSG_ERROR([cannot find libreplace in $libreplacepaths])
-fi
-LIBREPLACEOBJ="$libreplacedir/replace.o"
-AC_SUBST(LIBREPLACEOBJ)
-
-AC_CANONICAL_BUILD
-AC_CANONICAL_HOST
-AC_CANONICAL_TARGET
-
-echo "LIBREPLACE_LOCATION_CHECKS: END"
-]) dnl end AC_LIBREPLACE_LOCATION_CHECKS
-
-
-AC_DEFUN_ONCE(AC_LIBREPLACE_BROKEN_CHECKS,
-[
-echo "LIBREPLACE_BROKEN_CHECKS: START"
-
-dnl find the libreplace sources. This is meant to work both for
-dnl libreplace standalone builds, and builds of packages using libreplace
-libreplacedir=""
-libreplacepaths="$srcdir $srcdir/lib/replace $srcdir/libreplace $srcdir/../libreplace $srcdir/../replace $srcdir/../lib/replace $srcdir/../../../lib/replace"
-for d in $libreplacepaths; do
- if test -f "$d/replace.c"; then
- libreplacedir="$d"
- AC_SUBST(libreplacedir)
- break;
- fi
-done
-if test x"$libreplacedir" = "x"; then
- AC_MSG_ERROR([cannot find libreplace in $libreplacepaths])
-fi
-
-LIBREPLACEOBJ="$libreplacedir/replace.o"
-AC_SUBST(LIBREPLACEOBJ)
-
-LIBREPLACEOBJ="${LIBREPLACEOBJ} $libreplacedir/snprintf.o $libreplacedir/xattr.o"
-
-AC_TYPE_UID_T
-AC_TYPE_MODE_T
-AC_TYPE_OFF_T
-AC_TYPE_SIZE_T
-AC_TYPE_PID_T
-AC_STRUCT_ST_RDEV
-AC_CHECK_TYPE(ino_t,unsigned)
-AC_CHECK_TYPE(loff_t,off_t)
-AC_CHECK_TYPE(offset_t,loff_t)
-AC_CHECK_TYPE(blksize_t,long)
-AC_CHECK_TYPE(blkcnt_t,long)
-
-AC_FUNC_MEMCMP
-
-AC_CHECK_FUNCS([pipe strftime srandom random srand rand usleep setbuffer lstat getpgrp utime utimes])
-
-AC_CHECK_HEADERS(stdbool.h stdint.h sys/select.h)
-AC_CHECK_HEADERS(setjmp.h utime.h sys/wait.h)
-
-LIBREPLACE_PROVIDE_HEADER([stdint.h])
-LIBREPLACE_PROVIDE_HEADER([stdbool.h])
-
-AC_DEFINE(HAVE_LIBREPLACE, 1, [We have libreplace])
-
-AC_CHECK_TYPE(bool,
-[AC_DEFINE(HAVE_BOOL, 1, [Whether the bool type is available])],,
-[
-AC_INCLUDES_DEFAULT
-#ifdef HAVE_STDBOOL_H
-#include <stdbool.h>
-#endif]
-)
-
-AC_CHECK_TYPE(_Bool,
-[AC_DEFINE(HAVE__Bool, 1, [Whether the _Bool type is available])],,
-[
-AC_INCLUDES_DEFAULT
-#ifdef HAVE_STDBOOL_H
-#include <stdbool.h>
-#endif]
-)
-
-AC_CHECK_HEADERS(linux/types.h)
-
-AC_CACHE_CHECK([for working mmap],libreplace_cv_HAVE_MMAP,[
-AC_TRY_RUN([#include "$libreplacedir/test/shared_mmap.c"],
- libreplace_cv_HAVE_MMAP=yes,libreplace_cv_HAVE_MMAP=no,libreplace_cv_HAVE_MMAP=cross)])
-if test x"$libreplace_cv_HAVE_MMAP" = x"yes"; then
- AC_DEFINE(HAVE_MMAP,1,[Whether mmap works])
-fi
-
-AC_CACHE_CHECK([for working mremap],libreplace_cv_HAVE_MREMAP,[
-AC_TRY_RUN([#include "$libreplacedir/test/shared_mremap.c"],
- libreplace_cv_HAVE_MREMAP=yes,libreplace_cv_HAVE_MREMAP=no,libreplace_cv_HAVE_MREMAP=cross)])
-if test x"$libreplace_cv_HAVE_MREMAP" = x"yes"; then
- AC_DEFINE(HAVE_MREMAP,1,[Whether mremap works])
-fi
-
-AC_CACHE_CHECK([for incoherent mmap],libreplace_cv_HAVE_INCOHERENT_MMAP,[
-AC_TRY_RUN([#include "$libreplacedir/test/incoherent_mmap.c"],
- libreplace_cv_HAVE_INCOHERENT_MMAP=yes,libreplace_cv_HAVE_INCOHERENT_MMAP=no,libreplace_cv_HAVE_INCOHERENT_MMAP=cross)])
-if test x"$libreplace_cv_HAVE_INCOHERENT_MMAP" = x"yes"; then
- AC_DEFINE(HAVE_INCOHERENT_MMAP,1,[Whether mmap is incoherent against write])
-fi
-
-
-AC_CHECK_HEADERS(sys/syslog.h syslog.h)
-AC_CHECK_HEADERS(sys/time.h time.h)
-AC_CHECK_HEADERS(stdarg.h vararg.h)
-AC_CHECK_HEADERS(sys/mount.h mntent.h)
-AC_CHECK_HEADERS(stropts.h)
-AC_CHECK_HEADERS(unix.h)
-AC_CHECK_HEADERS(malloc.h)
-AC_CHECK_HEADERS(syscall.h)
-AC_CHECK_HEADERS(sys/syscall.h)
-AC_CHECK_HEADERS(sys/ucontext.h)
-
-AC_CHECK_FUNCS(syscall setuid seteuid setreuid setresuid setgid setegid setregid setresgid setgroups)
-AC_CHECK_FUNCS(chroot bzero strerror strerror_r memalign posix_memalign getpagesize)
-AC_CHECK_FUNCS(vsyslog setlinebuf mktime ftruncate chsize rename)
-AC_CHECK_FUNCS(waitpid wait4 strlcpy strlcat initgroups memmove strdup)
-AC_CHECK_FUNCS(pread pwrite strndup strcasestr strtok_r mkdtemp dup2 dprintf vdprintf)
-AC_CHECK_FUNCS(isatty chown lchown link readlink symlink realpath)
-AC_CHECK_FUNCS(fdatasync,,[
- # if we didn't find it, look in librt (Solaris hides it there...)
- AC_CHECK_LIB(rt, fdatasync,
- [libreplace_cv_HAVE_FDATASYNC_IN_LIBRT=yes
- AC_DEFINE(HAVE_FDATASYNC, 1, Define to 1 if there is support for fdatasync)])
-])
-AC_HAVE_DECL(fdatasync, [#include <unistd.h>])
-AC_CHECK_FUNCS(clock_gettime,libreplace_cv_have_clock_gettime=yes,[
- AC_CHECK_LIB(rt, clock_gettime,
- [libreplace_cv_HAVE_CLOCK_GETTIME_IN_LIBRT=yes
- libreplace_cv_have_clock_gettime=yes
- AC_DEFINE(HAVE_CLOCK_GETTIME, 1, Define to 1 if there is support for clock_gettime)])
-])
-
-AC_CHECK_HEADERS(sys/attributes.h attr/xattr.h sys/xattr.h sys/extattr.h sys/uio.h)
-AC_CHECK_HEADERS(sys/ea.h sys/proplist.h)
-
-LIBREPLACE_FILESYS_LIBS=""
-
-############################################
-# Check for EA implementations
-case "$host_os" in
- *freebsd4* | *dragonfly* )
- AC_DEFINE(BROKEN_EXTATTR, 1, [Does extattr API work])
- ;;
- *)
- AC_SEARCH_LIBS(getxattr, [attr])
- AC_CHECK_FUNCS(attr_get attr_getf attr_list attr_listf attropen attr_remove)
- AC_CHECK_FUNCS(attr_removef attr_set attr_setf extattr_delete_fd extattr_delete_file)
- AC_CHECK_FUNCS(extattr_get_fd extattr_get_file extattr_list_fd extattr_list_file)
- AC_CHECK_FUNCS(extattr_set_fd extattr_set_file fgetea fgetxattr flistea flistxattr)
- AC_CHECK_FUNCS(fremoveea fremovexattr fsetea fsetxattr getea getxattr listea)
- AC_CHECK_FUNCS(listxattr removeea removexattr setea setxattr)
-
- AC_CHECK_LIB_EXT(attr, LIBREPLACE_FILESYS_LIBS, flistea)
- AC_CHECK_LIB_EXT(attr, LIBREPLACE_FILESYS_LIBS, flistxattr)
- AC_CHECK_LIB_EXT(attr, LIBREPLACE_FILESYS_LIBS, attr_listf)
- AC_CHECK_LIB_EXT(attr, LIBREPLACE_FILESYS_LIBS, extattr_list_fd)
-
- ;;
-esac
-
-
-########################################################
-# Do xattr functions take additional options like on Darwin?
-if test x"$ac_cv_func_getxattr" = x"yes" ; then
- AC_CACHE_CHECK([whether xattr interface takes additional options], smb_attr_cv_xattr_add_opt, [
- old_LIBS=$LIBS
- LIBS="$LIBS $LIBREPLACE_FILESYS_LIBS"
- AC_TRY_COMPILE([
- #include <sys/types.h>
- #if HAVE_ATTR_XATTR_H
- #include <attr/xattr.h>
- #elif HAVE_SYS_XATTR_H
- #include <sys/xattr.h>
- #endif
- ],[
- getxattr(0, 0, 0, 0, 0, 0);
- ],
- [smb_attr_cv_xattr_add_opt=yes],
- [smb_attr_cv_xattr_add_opt=no;LIBS=$old_LIBS])
- ])
- if test x"$smb_attr_cv_xattr_add_opt" = x"yes"; then
- AC_DEFINE(XATTR_ADDITIONAL_OPTIONS, 1, [xattr functions have additional options])
- fi
-fi
-
-AC_CHECK_FUNCS(get_current_dir_name)
-AC_HAVE_DECL(setresuid, [#include <unistd.h>])
-AC_HAVE_DECL(setresgid, [#include <unistd.h>])
-AC_HAVE_DECL(errno, [#include <errno.h>])
-
-AC_CACHE_CHECK([for secure mkstemp],libreplace_cv_HAVE_SECURE_MKSTEMP,[
-AC_TRY_RUN([#include <stdlib.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <unistd.h>
-main() {
- struct stat st;
- char tpl[20]="/tmp/test.XXXXXX";
- char tpl2[20]="/tmp/test.XXXXXX";
- int fd = mkstemp(tpl);
- int fd2 = mkstemp(tpl2);
- if (fd == -1) {
- if (fd2 != -1) {
- unlink(tpl2);
- }
- exit(1);
- }
- if (fd2 == -1) exit(1);
- unlink(tpl);
- unlink(tpl2);
- if (fstat(fd, &st) != 0) exit(1);
- if ((st.st_mode & 0777) != 0600) exit(1);
- if (strcmp(tpl, "/tmp/test.XXXXXX") == 0) {
- exit(1);
- }
- if (strcmp(tpl, tpl2) == 0) {
- exit(1);
- }
- exit(0);
-}],
-libreplace_cv_HAVE_SECURE_MKSTEMP=yes,
-libreplace_cv_HAVE_SECURE_MKSTEMP=no,
-libreplace_cv_HAVE_SECURE_MKSTEMP=cross)])
-if test x"$libreplace_cv_HAVE_SECURE_MKSTEMP" = x"yes"; then
- AC_DEFINE(HAVE_SECURE_MKSTEMP,1,[Whether mkstemp is secure])
-fi
-
-dnl Provided by snprintf.c:
-AC_CHECK_HEADERS(stdio.h strings.h)
-AC_CHECK_DECLS([snprintf, vsnprintf, asprintf, vasprintf])
-AC_CHECK_FUNCS(snprintf vsnprintf asprintf vasprintf)
-
-AC_CACHE_CHECK([for C99 vsnprintf],libreplace_cv_HAVE_C99_VSNPRINTF,[
-AC_TRY_RUN([
-#include <sys/types.h>
-#include <stdio.h>
-#include <stdarg.h>
-#include <stdlib.h>
-void foo(const char *format, ...) {
- va_list ap;
- int len;
- char buf[20];
- long long l = 1234567890;
- l *= 100;
-
- va_start(ap, format);
- len = vsnprintf(buf, 0, format, ap);
- va_end(ap);
- if (len != 5) exit(1);
-
- va_start(ap, format);
- len = vsnprintf(0, 0, format, ap);
- va_end(ap);
- if (len != 5) exit(2);
-
- if (snprintf(buf, 3, "hello") != 5 || strcmp(buf, "he") != 0) exit(3);
-
- if (snprintf(buf, 20, "%lld", l) != 12 || strcmp(buf, "123456789000") != 0) exit(4);
- if (snprintf(buf, 20, "%zu", 123456789) != 9 || strcmp(buf, "123456789") != 0) exit(5);
- if (snprintf(buf, 20, "%2\$d %1\$d", 3, 4) != 3 || strcmp(buf, "4 3") != 0) exit(6);
- if (snprintf(buf, 20, "%s", 0) < 3) exit(7);
-
- exit(0);
-}
-main() { foo("hello"); }
-],
-libreplace_cv_HAVE_C99_VSNPRINTF=yes,libreplace_cv_HAVE_C99_VSNPRINTF=no,libreplace_cv_HAVE_C99_VSNPRINTF=cross)])
-if test x"$libreplace_cv_HAVE_C99_VSNPRINTF" = x"yes"; then
- AC_DEFINE(HAVE_C99_VSNPRINTF,1,[Whether there is a C99 compliant vsnprintf])
-fi
-
-
-dnl VA_COPY
-AC_CACHE_CHECK([for va_copy],libreplace_cv_HAVE_VA_COPY,[
-AC_TRY_LINK([#include <stdarg.h>
-va_list ap1,ap2;], [va_copy(ap1,ap2);],
-libreplace_cv_HAVE_VA_COPY=yes,libreplace_cv_HAVE_VA_COPY=no)])
-if test x"$libreplace_cv_HAVE_VA_COPY" = x"yes"; then
- AC_DEFINE(HAVE_VA_COPY,1,[Whether va_copy() is available])
-fi
-
-if test x"$libreplace_cv_HAVE_VA_COPY" != x"yes"; then
-AC_CACHE_CHECK([for __va_copy],libreplace_cv_HAVE___VA_COPY,[
-AC_TRY_LINK([#include <stdarg.h>
-va_list ap1,ap2;], [__va_copy(ap1,ap2);],
-libreplace_cv_HAVE___VA_COPY=yes,libreplace_cv_HAVE___VA_COPY=no)])
-if test x"$libreplace_cv_HAVE___VA_COPY" = x"yes"; then
- AC_DEFINE(HAVE___VA_COPY,1,[Whether __va_copy() is available])
-fi
-fi
-
-dnl __FUNCTION__ macro
-AC_CACHE_CHECK([for __FUNCTION__ macro],libreplace_cv_HAVE_FUNCTION_MACRO,[
-AC_TRY_COMPILE([#include <stdio.h>], [printf("%s\n", __FUNCTION__);],
-libreplace_cv_HAVE_FUNCTION_MACRO=yes,libreplace_cv_HAVE_FUNCTION_MACRO=no)])
-if test x"$libreplace_cv_HAVE_FUNCTION_MACRO" = x"yes"; then
- AC_DEFINE(HAVE_FUNCTION_MACRO,1,[Whether there is a __FUNCTION__ macro])
-else
- dnl __func__ macro
- AC_CACHE_CHECK([for __func__ macro],libreplace_cv_HAVE_func_MACRO,[
- AC_TRY_COMPILE([#include <stdio.h>], [printf("%s\n", __func__);],
- libreplace_cv_HAVE_func_MACRO=yes,libreplace_cv_HAVE_func_MACRO=no)])
- if test x"$libreplace_cv_HAVE_func_MACRO" = x"yes"; then
- AC_DEFINE(HAVE_func_MACRO,1,[Whether there is a __func__ macro])
- fi
-fi
-
-AC_CHECK_HEADERS([sys/param.h limits.h])
-
-AC_CHECK_TYPE(comparison_fn_t,
-[AC_DEFINE(HAVE_COMPARISON_FN_T, 1,[Whether or not we have comparison_fn_t])])
-
-AC_HAVE_DECL(setenv, [#include <stdlib.h>])
-AC_CHECK_FUNCS(setenv unsetenv)
-AC_HAVE_DECL(environ, [#include <unistd.h>])
-
-AC_CHECK_FUNCS(strnlen)
-AC_CHECK_FUNCS(strtoull __strtoull strtouq strtoll __strtoll strtoq)
-
-AC_CHECK_FUNCS(memmem)
-
-# this test disabled as we don't actually need __VA_ARGS__ yet
-AC_TRY_CPP([
-#define eprintf(...) fprintf(stderr, __VA_ARGS__)
-eprintf("bla", "bar");
-], AC_DEFINE(HAVE__VA_ARGS__MACRO, 1, [Whether the __VA_ARGS__ macro is available]))
-
-
-AC_CACHE_CHECK([for sig_atomic_t type],libreplace_cv_sig_atomic_t, [
- AC_TRY_COMPILE([
-#include <sys/types.h>
-#if STDC_HEADERS
-#include <stdlib.h>
-#include <stddef.h>
-#endif
-#include <signal.h>],[sig_atomic_t i = 0],
- libreplace_cv_sig_atomic_t=yes,libreplace_cv_sig_atomic_t=no)])
-if test x"$libreplace_cv_sig_atomic_t" = x"yes"; then
- AC_DEFINE(HAVE_SIG_ATOMIC_T_TYPE,1,[Whether we have the atomic_t variable type])
-fi
-
-
-dnl Check if the C compiler understands volatile (it should, being ANSI).
-AC_CACHE_CHECK([that the C compiler understands volatile],libreplace_cv_volatile, [
- AC_TRY_COMPILE([#include <sys/types.h>],[volatile int i = 0],
- libreplace_cv_volatile=yes,libreplace_cv_volatile=no)])
-if test x"$libreplace_cv_volatile" = x"yes"; then
- AC_DEFINE(HAVE_VOLATILE, 1, [Whether the C compiler understands volatile])
-fi
-
-m4_include(system/config.m4)
-
-AC_CACHE_CHECK([for O_DIRECT flag to open(2)],libreplace_cv_HAVE_OPEN_O_DIRECT,[
-AC_TRY_COMPILE([
-#include <unistd.h>
-#ifdef HAVE_FCNTL_H
-#include <fcntl.h>
-#endif],
-[int fd = open("/dev/null", O_DIRECT);],
-libreplace_cv_HAVE_OPEN_O_DIRECT=yes,libreplace_cv_HAVE_OPEN_O_DIRECT=no)])
-if test x"$libreplace_cv_HAVE_OPEN_O_DIRECT" = x"yes"; then
- AC_DEFINE(HAVE_OPEN_O_DIRECT,1,[Whether the open(2) accepts O_DIRECT])
-fi
-
-m4_include(dlfcn.m4)
-m4_include(strptime.m4)
-m4_include(win32.m4)
-m4_include(timegm.m4)
-m4_include(repdir.m4)
-m4_include(crypt.m4)
-
-if test x$libreplace_cv_have_clock_gettime = xyes ; then
- SMB_CHECK_CLOCK_ID(CLOCK_MONOTONIC)
- SMB_CHECK_CLOCK_ID(CLOCK_PROCESS_CPUTIME_ID)
- SMB_CHECK_CLOCK_ID(CLOCK_REALTIME)
-fi
-
-AC_CACHE_CHECK([for struct timespec type],libreplace_cv_struct_timespec, [
- AC_TRY_COMPILE([
-#include <sys/types.h>
-#if STDC_HEADERS
-#include <stdlib.h>
-#include <stddef.h>
-#endif
-#if TIME_WITH_SYS_TIME
-# include <sys/time.h>
-# include <time.h>
-#else
-# if HAVE_SYS_TIME_H
-# include <sys/time.h>
-# else
-# include <time.h>
-# endif
-#endif
-],[struct timespec ts;],
- libreplace_cv_struct_timespec=yes,libreplace_cv_struct_timespec=no)])
-if test x"$libreplace_cv_struct_timespec" = x"yes"; then
- AC_DEFINE(HAVE_STRUCT_TIMESPEC,1,[Whether we have struct timespec])
-fi
-
-AC_CACHE_CHECK([for ucontext_t type],libreplace_cv_ucontext_t, [
- AC_TRY_COMPILE([
-#include <signal.h>
-#if HAVE_SYS_UCONTEXT_H
-#include <sys/ucontext.h>
-# endif
-],[ucontext_t uc; sigaddset(&uc.uc_sigmask, SIGUSR1);],
- libreplace_cv_ucontext_t=yes,libreplace_cv_ucontext_t=no)])
-if test x"$libreplace_cv_ucontext_t" = x"yes"; then
- AC_DEFINE(HAVE_UCONTEXT_T,1,[Whether we have ucontext_t])
-fi
-
-AC_CHECK_FUNCS([printf memset memcpy],,[AC_MSG_ERROR([Required function not found])])
-
-echo "LIBREPLACE_BROKEN_CHECKS: END"
-]) dnl end AC_LIBREPLACE_BROKEN_CHECKS
-
-AC_DEFUN_ONCE(AC__LIBREPLACE_ALL_CHECKS_START,
-[
-#LIBREPLACE_ALL_CHECKS: START"
-])
-AC_DEFUN_ONCE(AC__LIBREPLACE_ALL_CHECKS_END,
-[
-#LIBREPLACE_ALL_CHECKS: END"
-])
-m4_define(AC_LIBREPLACE_ALL_CHECKS,
-[
-AC__LIBREPLACE_ALL_CHECKS_START
-AC_LIBREPLACE_LOCATION_CHECKS
-AC_LIBREPLACE_CC_CHECKS
-AC_LIBREPLACE_BROKEN_CHECKS
-AC__LIBREPLACE_ALL_CHECKS_END
-CFLAGS="$CFLAGS -I$libreplacedir"
-])
-
-m4_include(libreplace_cc.m4)
-m4_include(libreplace_ld.m4)
-m4_include(libreplace_network.m4)
-m4_include(libreplace_macros.m4)
-
-
-dnl SMB_CHECK_CLOCK_ID(clockid)
-dnl Test whether the specified clock_gettime clock ID is available. If it
-dnl is, we define HAVE_clockid
-AC_DEFUN([SMB_CHECK_CLOCK_ID],
-[
- AC_MSG_CHECKING(for $1)
- AC_TRY_LINK([
-#if TIME_WITH_SYS_TIME
-# include <sys/time.h>
-# include <time.h>
-#else
-# if HAVE_SYS_TIME_H
-# include <sys/time.h>
-# else
-# include <time.h>
-# endif
-#endif
- ],
- [
-clockid_t clk = $1;
- ],
- [
- AC_MSG_RESULT(yes)
- AC_DEFINE(HAVE_$1, 1,
- [Whether the clock_gettime clock ID $1 is available])
- ],
- [
- AC_MSG_RESULT(no)
- ])
-])
-m4_ifndef([AC_USE_SYSTEM_EXTENSIONS],[m4_include(autoconf-2.60.m4)])
diff --git a/lib/replace/libreplace_cc.m4 b/lib/replace/libreplace_cc.m4
deleted file mode 100644
index 50cb73583b..0000000000
--- a/lib/replace/libreplace_cc.m4
+++ /dev/null
@@ -1,197 +0,0 @@
-
-AC_DEFUN_ONCE(AC__LIBREPLACE_ONLY_CC_CHECKS_START,
-[
-echo "LIBREPLACE_CC_CHECKS: START"
-])
-
-AC_DEFUN_ONCE(AC__LIBREPLACE_ONLY_CC_CHECKS_END,
-[
-echo "LIBREPLACE_CC_CHECKS: END"
-])
-
-dnl
-dnl
-dnl AC_LIBREPLACE_CC_CHECKS
-dnl
-dnl Note: we need to use m4_define instead of AC_DEFUN because
-dnl of the ordering of tests
-dnl
-dnl
-m4_define(AC_LIBREPLACE_CC_CHECKS,
-[
-AC__LIBREPLACE_ONLY_CC_CHECKS_START
-
-dnl stop the C89 attempt by autoconf - if autoconf detects -Ae it will enable it
-dnl which conflicts with C99 on HPUX
-ac_cv_prog_cc_Ae=no
-
-savedCFLAGS=$CFLAGS
-AC_PROG_CC
-CFLAGS=$savedCFLAGS
-
-dnl don't try for C99 if we are using gcc, as otherwise we
-dnl lose immediate structure constants
-if test x"$GCC" != x"yes" ; then
-AC_PROG_CC_C99
-fi
-
-if test x"$GCC" = x"yes" ; then
- AC_MSG_CHECKING([for version of gcc])
- GCC_VERSION=`$CC -dumpversion`
- AC_MSG_RESULT(${GCC_VERSION})
-fi
-AC_USE_SYSTEM_EXTENSIONS
-AC_C_BIGENDIAN
-AC_C_INLINE
-LIBREPLACE_C99_STRUCT_INIT([],[AC_MSG_WARN([c99 structure initializer are not supported])])
-
-AC_PROG_INSTALL
-
-AC_ISC_POSIX
-AC_N_DEFINE(_XOPEN_SOURCE_EXTENDED)
-
-AC_MSG_CHECKING(checking getconf LFS_CFLAGS for large file support flags)
-LFS_CFLAGS=`(getconf LFS_CFLAGS) 2>/dev/null` || LFS_CFLAGS=""
-
-AC_MSG_RESULT(${LFS_CFLAGS})
-if test "x$LFS_CFLAGS" != 'x-1' || test "x$LFS_CFLAGS" != "xundefined"; then
- CFLAGS="$CFLAGS $LFS_CFLAGS"
-fi
-
-AC_SYS_LARGEFILE
-
-dnl Add #include for broken IRIX header files
-case "$host_os" in
- *irix6*) AC_ADD_INCLUDE(<standards.h>)
- AC_N_DEFINE(_XOPEN_SOURCE,600)
- AC_N_DEFINE(_BSD_TYPES)
- ;;
- *hpux*)
- # mmap on HPUX is completely broken...
- AC_DEFINE(MMAP_BLACKLIST, 1, [Whether MMAP is broken])
- if test "`uname -r`" = "B.11.00" -o "`uname -r`" = "B.11.11"; then
- AC_MSG_WARN([Enabling HPUX 11.00/11.11 header bug workaround])
- CFLAGS="$CFLAGS -Dpread=pread64 -Dpwrite=pwrite64"
- fi
- if test "`uname -r`" = "B.11.23"; then
- AC_MSG_WARN([Enabling HPUX 11.23 machine/sys/getppdp.h bug workaround])
- CFLAGS="$CFLAGS -D_MACHINE_SYS_GETPPDP_INCLUDED"
- fi
- ;;
- *aix*)
- AC_DEFINE(BROKEN_STRNDUP, 1, [Whether strndup is broken])
- AC_DEFINE(BROKEN_STRNLEN, 1, [Whether strnlen is broken])
- if test "${GCC}" != "yes"; then
- ## for funky AIX compiler using strncpy()
- CFLAGS="$CFLAGS -D_LINUX_SOURCE_COMPAT -qmaxmem=32000"
- fi
- ;;
- *osf*)
- # this brings in socklen_t
- AC_N_DEFINE(_XOPEN_SOURCE,600)
- AC_N_DEFINE(_OSF_SOURCE)
- ;;
- #
- # VOS may need to have POSIX support and System V compatibility enabled.
- #
- *vos*)
- case "$CFLAGS" in
- *-D_POSIX_C_SOURCE*);;
- *)
- CFLAGS="$CFLAGS -D_POSIX_C_SOURCE=200112L"
- AC_DEFINE(_POSIX_C_SOURCE, 200112L, [Whether to enable POSIX support])
- ;;
- esac
- case "$CFLAGS" in
- *-D_SYSV*|*-D_SVID_SOURCE*);;
- *)
- CFLAGS="$CFLAGS -D_SYSV"
- AC_DEFINE(_SYSV, 1, [Whether to enable System V compatibility])
- ;;
- esac
- ;;
-esac
-
-# Do not check for standards.h on darwin, we get nasty warnings on
-# OS/X Lion. Probably a positive-list of OS'es like IRIX and AIX
-# would be the better choice, but this seems to work fine
-
-case "$host_os" in
- *darwin*)
- ;;
- *)
- AC_CHECK_HEADERS([standards.h])
- ;;
-esac
-
-# Solaris needs HAVE_LONG_LONG defined
-AC_CHECK_TYPES(long long)
-
-AC_CHECK_SIZEOF(int)
-AC_CHECK_SIZEOF(char)
-AC_CHECK_SIZEOF(short)
-AC_CHECK_SIZEOF(long)
-AC_CHECK_SIZEOF(long long)
-
-AC_CHECK_TYPE(int8_t, char)
-AC_CHECK_TYPE(uint8_t, unsigned char)
-AC_CHECK_TYPE(int16_t, short)
-AC_CHECK_TYPE(uint16_t, unsigned short)
-
-if test $ac_cv_sizeof_int -eq 4 ; then
-AC_CHECK_TYPE(int32_t, int)
-AC_CHECK_TYPE(uint32_t, unsigned int)
-elif test $ac_cv_size_long -eq 4 ; then
-AC_CHECK_TYPE(int32_t, long)
-AC_CHECK_TYPE(uint32_t, unsigned long)
-else
-AC_MSG_ERROR([LIBREPLACE no 32-bit type found])
-fi
-
-AC_CHECK_TYPE(int64_t, long long)
-AC_CHECK_TYPE(uint64_t, unsigned long long)
-
-AC_CHECK_TYPE(size_t, unsigned int)
-AC_CHECK_TYPE(ssize_t, int)
-
-AC_CHECK_SIZEOF(off_t)
-AC_CHECK_SIZEOF(size_t)
-AC_CHECK_SIZEOF(ssize_t)
-
-AC_CHECK_TYPES([intptr_t, uintptr_t, ptrdiff_t])
-
-if test x"$ac_cv_type_long_long" != x"yes";then
- AC_MSG_ERROR([LIBREPLACE needs type 'long long'])
-fi
-if test $ac_cv_sizeof_long_long -lt 8;then
- AC_MSG_ERROR([LIBREPLACE needs sizeof(long long) >= 8])
-fi
-
-############################################
-# check if the compiler can do immediate structures
-AC_SUBST(libreplace_cv_immediate_structures)
-AC_CACHE_CHECK([for immediate structures],libreplace_cv_immediate_structures,[
- AC_TRY_COMPILE([
- #include <stdio.h>
- ],[
- typedef struct {unsigned x;} FOOBAR;
- #define X_FOOBAR(x) ((FOOBAR) { x })
- #define FOO_ONE X_FOOBAR(1)
- FOOBAR f = FOO_ONE;
- static const struct {
- FOOBAR y;
- } f2[] = {
- {FOO_ONE}
- };
- static const FOOBAR f3[] = {FOO_ONE};
- ],
- libreplace_cv_immediate_structures=yes,
- libreplace_cv_immediate_structures=no,
- libreplace_cv_immediate_structures=cross)
-])
-if test x"$libreplace_cv_immediate_structures" = x"yes"; then
- AC_DEFINE(HAVE_IMMEDIATE_STRUCTURES,1,[Whether the compiler supports immediate structures])
-fi
-
-AC__LIBREPLACE_ONLY_CC_CHECKS_END
-]) dnl end AC_LIBREPLACE_CC_CHECKS
diff --git a/lib/replace/libreplace_ld.m4 b/lib/replace/libreplace_ld.m4
deleted file mode 100644
index bf0df6186d..0000000000
--- a/lib/replace/libreplace_ld.m4
+++ /dev/null
@@ -1,337 +0,0 @@
-#
-# This offers a nice overview how to build shared libraries on all platforms
-# http://www.fortran-2000.com/ArnaudRecipes/sharedlib.html
-#
-
-AC_DEFUN([AC_LIBREPLACE_STLD],
-[
- AC_PATH_PROG(PROG_AR, ar)
-
- STLD=${PROG_AR}
-
- AC_SUBST(STLD)
-])
-
-AC_DEFUN([AC_LIBREPLACE_STLD_FLAGS],
-[
- STLD_FLAGS="-rcs"
- AC_SUBST(STLD_FLAGS)
-])
-
-AC_DEFUN([AC_LD_EXPORT_DYNAMIC],
-[
-saved_LDFLAGS="$LDFLAGS"
-if AC_TRY_COMMAND([${CC-cc} $CFLAGS -Wl,--version 2>&1 | grep "GNU ld" >/dev/null]); then
- LD_EXPORT_DYNAMIC="-Wl,-export-dynamic"
-else
- case "$host_os" in
- hpux* )
- LD_EXPORT_DYNAMIC="-Wl,-E"
- ;;
- *)
- LD_EXPORT_DYNAMIC=""
- ;;
- esac
-fi
-AC_SUBST(LD_EXPORT_DYNAMIC)
-LDFLAGS="$saved_LDFLAGS"
-])
-
-AC_DEFUN([AC_LD_PICFLAG],
-[
-case "$host_os" in
- *linux*|*gnu*)
- PICFLAG="-fPIC"
- ;;
- *solaris*)
- if test "${GCC}" = "yes"; then
- PICFLAG="-fPIC"
- else
- PICFLAG="-KPIC"
- fi
- ;;
- *sunos*)
- PICFLAG="-KPIC" # Is this correct for SunOS
- ;;
- *netbsd* | *freebsd* | *dragonfly* )
- PICFLAG="-fPIC -DPIC"
- ;;
- *openbsd*)
- PICFLAG="-fPIC"
- ;;
- *irix*)
- if test "${GCC}" = "yes"; then
- PICFLAG="-fPIC"
- else
- PICFLAG="-KPIC"
- fi
- ;;
- *aix*)
- # as AIX code is always position independent...
- PICFLAG="-O2"
- ;;
- *hpux*)
- if test "${GCC}" = "yes"; then
- PICFLAG="-fPIC"
- elif test "$host_cpu" = "ia64"; then
- PICFLAG="+z"
- elif test $ac_cv_prog_cc_Ae = yes; then
- PICFLAG="+z +ESnolit"
- fi
- ;;
- *osf*)
- PICFLAG="-fPIC"
- ;;
- *unixware*)
- PICFLAG="-KPIC"
- ;;
- *darwin*)
- PICFLAG="-fno-common"
- ;;
-esac
-AC_SUBST(PICFLAG)
-])
-
-AC_DEFUN([AC_LIBREPLACE_LD_SHLIB_LINKER],
-[
- LD_SHLIB_LINKER="${CC}"
-
- case "$host_os" in
- *irix*)
- LD_SHLIB_LINKER="${PROG_LD}"
- ;;
- esac
-
- AC_SUBST(LD_SHLIB_LINKER)
-])
-
-AC_DEFUN([AC_LIBREPLACE_LD_SHLIB_FLAGS],
-[
- LD_SHLIB_FLAGS="-shared"
-
- case "$host_os" in
- *linux*|*gnu*)
- LD_SHLIB_FLAGS="-shared -Wl,-Bsymbolic"
- ;;
- *solaris*)
- LD_SHLIB_FLAGS="-G"
- if test "${GCC}" = "no"; then
- ## ${CFLAGS} added for building 64-bit shared
- ## libs using Sun's Compiler
- LD_SHLIB_FLAGS="-G \${CFLAGS}"
- fi
- ;;
- *sunos*)
- LD_SHLIB_FLAGS="-G"
- ;;
- *irix*)
- LD_SHLIB_FLAGS="-shared"
- ;;
- *aix*)
- LD_SHLIB_FLAGS="-Wl,-G,-bexpall,-bbigtoc"
- ;;
- *hpux*)
- if test "${GCC}" = "yes"; then
- LD_SHLIB_FLAGS="-shared"
- else
- LD_SHLIB_FLAGS="-b"
- fi
- ;;
- *osf*)
- LD_SHLIB_FLAGS="-shared"
- ;;
- *darwin*)
- LD_SHLIB_FLAGS="-dynamiclib -Wl,-search_paths_first"
- ;;
- esac
-
- AC_SUBST(LD_SHLIB_FLAGS)
-])
-
-AC_DEFUN([AC_LIBREPLACE_LD_SHLIB_DISALLOW_UNDEF_FLAG],
-[
- LD_SHLIB_DISALLOW_UNDEF_FLAG=""
-
- #
- # TODO: enforce error not only warnings
- #
- # NOTE: -Wl,--no-allow-shlib-undefined isn't what we want...
- # as it bails out on broken system libraries
- #
- case "$host_os" in
- *osf*)
- LD_SHLIB_DISALLOW_UNDEF_FLAG="-warning_unresolved"
- ;;
- *darwin*)
- LD_SHLIB_DISALLOW_UNDEF_FLAG="-undefined error"
- ;;
- esac
-
- AC_SUBST(LD_SHLIB_DISALLOW_UNDEF_FLAG)
-])
-
-AC_DEFUN([AC_LIBREPLACE_SHLD],
-[
- AC_REQUIRE([AC_LIBREPLACE_LD_SHLIB_LINKER])
- SHLD="$LD_SHLIB_LINKER"
- AC_SUBST(SHLD)
-])
-
-AC_DEFUN([AC_LIBREPLACE_SHLD_FLAGS],
-[
- AC_REQUIRE([AC_LIBREPLACE_LD_SHLIB_FLAGS])
- AC_REQUIRE([AC_LIBREPLACE_LD_SHLIB_DISALLOW_UNDEF_FLAG])
- SHLD_FLAGS="$LD_SHLIB_FLAGS $LD_SHLIB_DISALLOW_UNDEF_FLAG"
- AC_SUBST(SHLD_FLAGS)
-])
-
-AC_DEFUN([AC_LD_SHLIBEXT],
-[
- SHLIBEXT="so"
- case "$host_os" in
- *hpux*)
- if test "$host_cpu" = "ia64"; then
- SHLIBEXT="so"
- else
- SHLIBEXT="sl"
- fi
- ;;
- *darwin*)
- SHLIBEXT="dylib"
- ;;
- esac
- AC_SUBST(SHLIBEXT)
-])
-
-AC_DEFUN([AC_LD_SONAMEFLAG],
-[
- AC_SUBST(SONAMEFLAG)
- SONAMEFLAG=""
- case "$host_os" in
- *linux*|*gnu*|*qnx*)
- SONAMEFLAG="-Wl,-soname="
- ;;
- *solaris*)
- SONAMEFLAG="-h "
- if test "${GCC}" = "yes"; then
- SONAMEFLAG="-Wl,-soname="
- fi
- ;;
- *sunos*)
- SONAMEFLAG="-Wl,-h,"
- ;;
- *netbsd* | *freebsd* | *dragonfly* )
- SONAMEFLAG="-Wl,-soname,"
- ;;
- *openbsd*)
- SONAMEFLAG="-Wl,-soname,"
- ;;
- *irix*)
- SONAMEFLAG="-Wl,-soname,"
- ;;
- *hpux*)
- SONAMEFLAG="-Wl,+h,"
- ;;
- *osf*)
- SONAMEFLAG="-Wl,-soname,"
- ;;
- *unixware*)
- SONAMEFLAG="-Wl,-soname,"
- ;;
- *darwin*)
- SONAMEFLAG="#"
- ;;
- *aix*)
- # Not supported
- SONAMEFLAG="#"
- ;;
- esac
-])
-
-AC_DEFUN([AC_LD_VERSIONSCRIPT],
-[
- AC_SUBST(VERSIONSCRIPT)
- VERSIONSCRIPT=""
- case "$host_os" in
- *linux*|*gnu*)
- VERSIONSCRIPT="-Wl,--version-script"
- ;;
- *solaris*)
- if test "${GCC}" = "yes"; then
- VERSIONSCRIPT="-Wl,--version-script"
- fi
- ;;
- esac
-])
-
-AC_DEFUN([AC_LIBREPLACE_MDLD],
-[
- AC_REQUIRE([AC_LIBREPLACE_LD_SHLIB_LINKER])
- MDLD="$LD_SHLIB_LINKER"
- AC_SUBST(MDLD)
-])
-
-AC_DEFUN([AC_LIBREPLACE_LD_SHLIB_ALLOW_UNDEF_FLAG],
-[
- LD_ALLOW_SHLIB_UNDEF_FLAG=""
-
- case "$host_os" in
- *linux*|*gnu*)
- LD_SHLIB_ALLOW_UNDEF_FLAG="-Wl,--allow-shlib-undefined"
- ;;
- *osf*)
- LD_SHLIB_ALLOW_UNDEF_FLAG="-Wl,-expect_unresolved,\"*\""
- ;;
- *darwin*)
- LD_SHLIB_ALLOW_UNDEF_FLAG="-undefined dynamic_lookup"
- ;;
- *aix*)
- LD_SHLIB_ALLOW_UNDEF_FLAG="-Wl,-bnoentry"
- ;;
- esac
-
- AC_SUBST(LD_SHLIB_ALLOW_UNDEF_FLAG)
-])
-
-AC_DEFUN([AC_LIBREPLACE_MDLD_FLAGS],
-[
- AC_REQUIRE([AC_LIBREPLACE_LD_SHLIB_FLAGS])
- AC_REQUIRE([AC_LIBREPLACE_LD_SHLIB_ALLOW_UNDEF_FLAG])
- MDLD_FLAGS="$LD_SHLIB_FLAGS $LD_SHLIB_ALLOW_UNDEF_FLAG"
- AC_SUBST(MDLD_FLAGS)
-])
-
-AC_DEFUN([AC_LIBREPLACE_RUNTIME_LIB_PATH_VAR],
-[
- case "$host_os" in
- *linux*|*gnu*)
- LIB_PATH_VAR=LD_LIBRARY_PATH
- ;;
- *bsd*)
- LIB_PATH_VAR=LD_LIBRARY_PATH
- ;;
- *solaris*)
- LIB_PATH_VAR=LD_LIBRARY_PATH
- ;;
- *hpux*)
- LIB_PATH_VAR=SHLIB_PATH
- ;;
- *osf*)
- LIB_PATH_VAR=LD_LIBRARY_PATH
- ;;
- *aix*)
- LIB_PATH_VAR=LIBPATH
- ;;
- *irix*)
- LIB_PATH_VAR=LD_LIBRARY_PATH
- ;;
- *darwin*)
- LIB_PATH_VAR=DYLD_LIBRARY_PATH
- ;;
- *)
- LIB_PATH_VAR=LD_LIBRARY_PATH
- ;;
- esac
-
- AC_SUBST(LIB_PATH_VAR)
-])
diff --git a/lib/replace/libreplace_macros.m4 b/lib/replace/libreplace_macros.m4
deleted file mode 100644
index f3753c47c2..0000000000
--- a/lib/replace/libreplace_macros.m4
+++ /dev/null
@@ -1,347 +0,0 @@
-#
-# This is a collection of useful autoconf macros
-#
-
-############################################
-# Check if the compiler handles c99 struct initialization, and if not try -AC99 and -c99 flags
-# Usage: LIBREPLACE_C99_STRUCT_INIT(success-action,failure-action)
-# changes CFLAGS to add -AC99 or -c99 if needed
-AC_DEFUN([LIBREPLACE_C99_STRUCT_INIT],
-[
-saved_CFLAGS="$CFLAGS";
-c99_init=no
-if test x"$c99_init" = x"no"; then
- AC_MSG_CHECKING(for C99 designated initializers)
- CFLAGS="$saved_CFLAGS";
- AC_TRY_COMPILE([#include <stdio.h>],
- [ struct foo {int x;char y;};
- struct foo bar = { .y = 'X', .x = 1 };
- ],
- [AC_MSG_RESULT(yes); c99_init=yes],[AC_MSG_RESULT(no)])
-fi
-if test x"$c99_init" = x"no"; then
- AC_MSG_CHECKING(for C99 designated initializers with -AC99)
- CFLAGS="$saved_CFLAGS -AC99";
- AC_TRY_COMPILE([#include <stdio.h>],
- [ struct foo {int x;char y;};
- struct foo bar = { .y = 'X', .x = 1 };
- ],
- [AC_MSG_RESULT(yes); c99_init=yes],[AC_MSG_RESULT(no)])
-fi
-if test x"$c99_init" = x"no"; then
- AC_MSG_CHECKING(for C99 designated initializers with -qlanglvl=extc99)
- CFLAGS="$saved_CFLAGS -qlanglvl=extc99";
- AC_TRY_COMPILE([#include <stdio.h>],
- [ struct foo {int x;char y;};
- struct foo bar = { .y = 'X', .x = 1 };
- ],
- [AC_MSG_RESULT(yes); c99_init=yes],[AC_MSG_RESULT(no)])
-fi
-if test x"$c99_init" = x"no"; then
- AC_MSG_CHECKING(for C99 designated initializers with -qlanglvl=stdc99)
- CFLAGS="$saved_CFLAGS -qlanglvl=stdc99";
- AC_TRY_COMPILE([#include <stdio.h>],
- [ struct foo {int x;char y;};
- struct foo bar = { .y = 'X', .x = 1 };
- ],
- [AC_MSG_RESULT(yes); c99_init=yes],[AC_MSG_RESULT(no)])
-fi
-if test x"$c99_init" = x"no"; then
- AC_MSG_CHECKING(for C99 designated initializers with -c99)
- CFLAGS="$saved_CFLAGS -c99"
- AC_TRY_COMPILE([#include <stdio.h>],
- [ struct foo {int x;char y;};
- struct foo bar = { .y = 'X', .x = 1 };
- ],
- [AC_MSG_RESULT(yes); c99_init=yes],[AC_MSG_RESULT(no)])
-fi
-
-if test "`uname`" = "HP-UX"; then
- if test "$ac_cv_c_compiler_gnu" = no; then
- # special override for broken HP-UX compiler - I can't find a way to test
- # this properly (its a compiler bug)
- CFLAGS="$CFLAGS -AC99";
- c99_init=yes;
- fi
-fi
-
-if test x"$c99_init" = x"yes"; then
- saved_CFLAGS=""
- $1
-else
- CFLAGS="$saved_CFLAGS"
- saved_CFLAGS=""
- $2
-fi
-])
-
-dnl AC_PROG_CC_FLAG(flag)
-AC_DEFUN(AC_PROG_CC_FLAG,
-[AC_CACHE_CHECK(whether ${CC-cc} accepts -$1, ac_cv_prog_cc_$1,
-[echo 'void f(){}' > conftest.c
-if test -z "`${CC-cc} -$1 -c conftest.c 2>&1`"; then
- ac_cv_prog_cc_$1=yes
-else
- ac_cv_prog_cc_$1=no
-fi
-rm -f conftest*
-])])
-
-dnl see if a declaration exists for a function or variable
-dnl defines HAVE_function_DECL if it exists
-dnl AC_HAVE_DECL(var, includes)
-AC_DEFUN(AC_HAVE_DECL,
-[
- AC_CACHE_CHECK([for $1 declaration],ac_cv_have_$1_decl,[
- AC_TRY_COMPILE([$2],[int i = (int)$1],
- ac_cv_have_$1_decl=yes,ac_cv_have_$1_decl=no)])
- if test x"$ac_cv_have_$1_decl" = x"yes"; then
- AC_DEFINE([HAVE_]translit([$1], [a-z], [A-Z])[_DECL],1,[Whether $1() is available])
- fi
-])
-
-
-# AC_CHECK_LIB_EXT(LIBRARY, [EXT_LIBS], [FUNCTION],
-# [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND],
-# [ADD-ACTION-IF-FOUND],[OTHER-LIBRARIES])
-# ------------------------------------------------------
-#
-# Use a cache variable name containing both the library and function name,
-# because the test really is for library $1 defining function $3, not
-# just for library $1. Separate tests with the same $1 and different $3s
-# may have different results.
-#
-# Note that using directly AS_VAR_PUSHDEF([ac_Lib], [ac_cv_lib_$1_$3])
-# is asking for trouble, since AC_CHECK_LIB($lib, fun) would give
-# ac_cv_lib_$lib_fun, which is definitely not what was meant. Hence
-# the AS_LITERAL_IF indirection.
-#
-# FIXME: This macro is extremely suspicious. It DEFINEs unconditionally,
-# whatever the FUNCTION, in addition to not being a *S macro. Note
-# that the cache does depend upon the function we are looking for.
-#
-# It is on purpose we used `ac_check_lib_ext_save_LIBS' and not just
-# `ac_save_LIBS': there are many macros which don't want to see `LIBS'
-# changed but still want to use AC_CHECK_LIB_EXT, so they save `LIBS'.
-# And ``ac_save_LIBS' is too tempting a name, so let's leave them some
-# freedom.
-AC_DEFUN([AC_CHECK_LIB_EXT],
-[
-AH_CHECK_LIB_EXT([$1])
-ac_check_lib_ext_save_LIBS=$LIBS
-LIBS="-l$1 $$2 $7 $LIBS"
-AS_LITERAL_IF([$1],
- [AS_VAR_PUSHDEF([ac_Lib_ext], [ac_cv_lib_ext_$1])],
- [AS_VAR_PUSHDEF([ac_Lib_ext], [ac_cv_lib_ext_$1''])])dnl
-
-m4_ifval([$3],
- [
- AH_CHECK_FUNC_EXT([$3])
- AS_LITERAL_IF([$1],
- [AS_VAR_PUSHDEF([ac_Lib_func], [ac_cv_lib_ext_$1_$3])],
- [AS_VAR_PUSHDEF([ac_Lib_func], [ac_cv_lib_ext_$1''_$3])])dnl
- AC_CACHE_CHECK([for $3 in -l$1], ac_Lib_func,
- [AC_TRY_LINK_FUNC($3,
- [AS_VAR_SET(ac_Lib_func, yes);
- AS_VAR_SET(ac_Lib_ext, yes)],
- [AS_VAR_SET(ac_Lib_func, no);
- AS_VAR_SET(ac_Lib_ext, no)])
- ])
- AS_IF([test AS_VAR_GET(ac_Lib_func) = yes],
- [AC_DEFINE_UNQUOTED(AS_TR_CPP(HAVE_$3))])dnl
- AS_VAR_POPDEF([ac_Lib_func])dnl
- ],[
- AC_CACHE_CHECK([for -l$1], ac_Lib_ext,
- [AC_TRY_LINK_FUNC([main],
- [AS_VAR_SET(ac_Lib_ext, yes)],
- [AS_VAR_SET(ac_Lib_ext, no)])
- ])
- ])
-LIBS=$ac_check_lib_ext_save_LIBS
-
-AS_IF([test AS_VAR_GET(ac_Lib_ext) = yes],
- [m4_default([$4],
- [AC_DEFINE_UNQUOTED(AS_TR_CPP(HAVE_LIB$1))
- case "$$2" in
- *-l$1*)
- ;;
- *)
- $2="-l$1 $$2"
- ;;
- esac])
- [$6]
- ],
- [$5])dnl
-AS_VAR_POPDEF([ac_Lib_ext])dnl
-])# AC_CHECK_LIB_EXT
-
-# AH_CHECK_LIB_EXT(LIBNAME)
-# ---------------------
-m4_define([AH_CHECK_LIB_EXT],
-[AH_TEMPLATE(AS_TR_CPP(HAVE_LIB$1),
- [Define to 1 if you have the `]$1[' library (-l]$1[).])])
-
-dnl AC_SEARCH_LIBS_EXT(FUNCTION, SEARCH-LIBS, EXT_LIBS,
-dnl [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND],
-dnl [OTHER-LIBRARIES])
-dnl --------------------------------------------------------
-dnl Search for a library defining FUNC, if it's not already available.
-AC_DEFUN([AC_SEARCH_LIBS_EXT],
-[AC_CACHE_CHECK([for library containing $1], [ac_cv_search_ext_$1],
-[
-ac_func_search_ext_save_LIBS=$LIBS
-ac_cv_search_ext_$1=no
-AC_LINK_IFELSE([AC_LANG_CALL([], [$1])],
- [ac_cv_search_ext_$1="none required"])
-if test "$ac_cv_search_ext_$1" = no; then
- for ac_lib in $2; do
- LIBS="-l$ac_lib $$3 $6 $ac_func_search_save_ext_LIBS"
- AC_LINK_IFELSE([AC_LANG_CALL([], [$1])],
- [ac_cv_search_ext_$1="-l$ac_lib"
-break])
- done
-fi
-LIBS=$ac_func_search_ext_save_LIBS])
-AS_IF([test "$ac_cv_search_ext_$1" != no],
- [test "$ac_cv_search_ext_$1" = "none required" || $3="$ac_cv_search_ext_$1 $$3"
- $4],
- [$5])dnl
-])
-
-dnl check for a function in a $LIBS and $OTHER_LIBS libraries variable.
-dnl AC_CHECK_FUNC_EXT(func,OTHER_LIBS,IF-TRUE,IF-FALSE)
-AC_DEFUN([AC_CHECK_FUNC_EXT],
-[
- AH_CHECK_FUNC_EXT($1)
- ac_check_func_ext_save_LIBS=$LIBS
- LIBS="$2 $LIBS"
- AS_VAR_PUSHDEF([ac_var], [ac_cv_func_ext_$1])dnl
- AC_CACHE_CHECK([for $1], ac_var,
- [AC_LINK_IFELSE([AC_LANG_FUNC_LINK_TRY([$1])],
- [AS_VAR_SET(ac_var, yes)],
- [AS_VAR_SET(ac_var, no)])])
- LIBS=$ac_check_func_ext_save_LIBS
- AS_IF([test AS_VAR_GET(ac_var) = yes],
- [AC_DEFINE_UNQUOTED(AS_TR_CPP([HAVE_$1])) $3],
- [$4])dnl
-AS_VAR_POPDEF([ac_var])dnl
-])# AC_CHECK_FUNC
-
-# AH_CHECK_FUNC_EXT(FUNCNAME)
-# ---------------------
-m4_define([AH_CHECK_FUNC_EXT],
-[AH_TEMPLATE(AS_TR_CPP(HAVE_$1),
- [Define to 1 if you have the `]$1[' function.])])
-
-dnl Define an AC_DEFINE with ifndef guard.
-dnl AC_N_DEFINE(VARIABLE [, VALUE])
-AC_DEFUN([AC_N_DEFINE],
-[
-AH_VERBATIM([$1], [
-#ifndef $1
-# undef $1
-#endif
-])
-
- cat >>confdefs.h <<\EOF
-#ifndef $1
-[#define] $1 m4_if($#, 1, 1, [$2])
-#endif
-EOF
-])
-
-dnl Add an #include
-dnl AC_ADD_INCLUDE(VARIABLE)
-define(AC_ADD_INCLUDE,
-[cat >> confdefs.h <<\EOF
-[#include] $1
-EOF
-])
-
-dnl remove an #include
-dnl AC_REMOVE_INCLUDE(VARIABLE)
-define(AC_REMOVE_INCLUDE,
-[
-grep -v '[#include] $1' confdefs.h >confdefs.h.tmp
-cat confdefs.h.tmp > confdefs.h
-rm confdefs.h.tmp
-])
-
-dnl remove an #define
-dnl AC_REMOVE_DEFINE(VARIABLE)
-define(AC_REMOVE_DEFINE,
-[
-grep -v '[#define] $1 ' confdefs.h |grep -v '[#define] $1[$]'>confdefs.h.tmp
-cat confdefs.h.tmp > confdefs.h
-rm confdefs.h.tmp
-])
-
-dnl AS_HELP_STRING is not available in autoconf 2.57, and AC_HELP_STRING is deprecated
-dnl in autoconf 2.59, so define AS_HELP_STRING to be AC_HELP_STRING unless it is already
-dnl defined.
-m4_ifdef([AS_HELP_STRING], , [m4_define([AS_HELP_STRING], m4_defn([AC_HELP_STRING]))])
-
-dnl check if the prototype in the header matches the given one
-dnl AC_VERIFY_C_PROTOTYPE(prototype,functionbody,[IF-TRUE].[IF-FALSE],[extraheaders])
-AC_DEFUN(AC_VERIFY_C_PROTOTYPE,
-[AC_CACHE_CHECK([for prototype $1], AS_TR_SH([ac_cv_c_prototype_$1]),
- AC_COMPILE_IFELSE([AC_LANG_SOURCE([
- AC_INCLUDES_DEFAULT
- $5
- $1
- {
- $2
- }
- ])],[
- eval AS_TR_SH([ac_cv_c_prototype_$1])=yes
- ],[
- eval AS_TR_SH([ac_cv_c_prototype_$1])=no
- ])
-)
-AS_IF([eval test $AS_TR_SH([ac_cv_c_prototype_$1]) = yes],[$3],[$4])
-])
-
-AC_DEFUN(LIBREPLACE_PROVIDE_HEADER,
-[AC_CHECK_HEADER([$1],
- [ AC_CONFIG_COMMANDS(rm-$1, [rm -f $libreplacedir/$1], [libreplacedir=$libreplacedir]) ],
- [ AC_CONFIG_COMMANDS(mk-$1, [echo "#include \"replace.h\"" > $libreplacedir/$1], [libreplacedir=$libreplacedir]) ]
- )
-])
-
-dnl AC_HAVE_TYPE(TYPE,INCLUDES)
-AC_DEFUN([AC_HAVE_TYPE], [
-AC_REQUIRE([AC_HEADER_STDC])
-cv=`echo "$1" | sed 'y%./+- %__p__%'`
-AC_MSG_CHECKING(for $1)
-AC_CACHE_VAL([ac_cv_type_$cv],
-AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
-AC_INCLUDES_DEFAULT
-$2]],
-[[$1 foo;]])],
-[eval "ac_cv_type_$cv=yes"],
-[eval "ac_cv_type_$cv=no"]))dnl
-ac_foo=`eval echo \\$ac_cv_type_$cv`
-AC_MSG_RESULT($ac_foo)
-if test "$ac_foo" = yes; then
- ac_tr_hdr=HAVE_`echo $1 | sed 'y%abcdefghijklmnopqrstuvwxyz./- %ABCDEFGHIJKLMNOPQRSTUVWXYZ____%'`
-if false; then
- AC_CHECK_TYPES($1)
-fi
- AC_DEFINE_UNQUOTED($ac_tr_hdr, 1, [Define if you have type `$1'])
-fi
-])
-
-# AC_CHECK_VALUEOF(TYPE, [INCLUDES = DEFAULT-INCLUDES])
-# ---------------------------------------------------------------
-AC_DEFUN([AC_CHECK_VALUEOF],
-[AS_LITERAL_IF(m4_translit([[$1]], [*], [p]), [],
- [m4_fatal([$0: requires literal arguments])])]dnl
-[
-_AC_CACHE_CHECK_INT([value of $1], [AS_TR_SH([ac_cv_valueof_$1])],
- [(long int) ($1)],
- [AC_INCLUDES_DEFAULT([$2])],
- [])
-
-AC_DEFINE_UNQUOTED(AS_TR_CPP(valueof_$1), $AS_TR_SH([ac_cv_valueof_$1]),
- [The value of `$1'.])
-])# AC_CHECK_VALUEOF
diff --git a/lib/replace/libreplace_network.m4 b/lib/replace/libreplace_network.m4
deleted file mode 100644
index bb2a84324e..0000000000
--- a/lib/replace/libreplace_network.m4
+++ /dev/null
@@ -1,503 +0,0 @@
-AC_DEFUN_ONCE(AC_LIBREPLACE_NETWORK_CHECKS,
-[
-echo "LIBREPLACE_NETWORK_CHECKS: START"
-
-AC_DEFINE(LIBREPLACE_NETWORK_CHECKS, 1, [LIBREPLACE_NETWORK_CHECKS were used])
-LIBREPLACE_NETWORK_OBJS=""
-LIBREPLACE_NETWORK_LIBS=""
-
-AC_CHECK_HEADERS(sys/socket.h netinet/in.h netdb.h arpa/inet.h)
-AC_CHECK_HEADERS(netinet/in_systm.h)
-AC_CHECK_HEADERS([netinet/ip.h], [], [],[
- #include <sys/types.h>
- #ifdef HAVE_NETINET_IN_H
- #include <netinet/in.h>
- #endif
- #ifdef HAVE_NETINET_IN_SYSTM_H
- #include <netinet/in_systm.h>
- #endif
-])
-AC_CHECK_HEADERS(netinet/tcp.h netinet/in_ip.h)
-AC_CHECK_HEADERS(sys/sockio.h sys/un.h)
-AC_CHECK_HEADERS(sys/uio.h)
-
-dnl we need to check that net/if.h really can be used, to cope with hpux
-dnl where including it always fails
-AC_CACHE_CHECK([for usable net/if.h],libreplace_cv_USABLE_NET_IF_H,[
- AC_COMPILE_IFELSE([AC_LANG_SOURCE([
- AC_INCLUDES_DEFAULT
- #if HAVE_SYS_SOCKET_H
- # include <sys/socket.h>
- #endif
- #include <net/if.h>
- int main(void) {return 0;}])],
- [libreplace_cv_USABLE_NET_IF_H=yes],
- [libreplace_cv_USABLE_NET_IF_H=no]
- )
-])
-if test x"$libreplace_cv_USABLE_NET_IF_H" = x"yes";then
- AC_DEFINE(HAVE_NET_IF_H, 1, usability of net/if.h)
-fi
-
-AC_HAVE_TYPE([socklen_t],[#include <sys/socket.h>])
-AC_HAVE_TYPE([sa_family_t],[#include <sys/socket.h>])
-AC_HAVE_TYPE([struct addrinfo], [#include <netdb.h>])
-AC_HAVE_TYPE([struct sockaddr], [#include <sys/socket.h>])
-AC_HAVE_TYPE([struct sockaddr_storage], [
-#include <sys/socket.h>
-#include <sys/types.h>
-#include <netinet/in.h>
-])
-AC_HAVE_TYPE([struct sockaddr_in6], [
-#include <sys/socket.h>
-#include <sys/types.h>
-#include <netinet/in.h>
-])
-
-if test x"$ac_cv_type_struct_sockaddr_storage" = x"yes"; then
-AC_CHECK_MEMBER(struct sockaddr_storage.ss_family,
- AC_DEFINE(HAVE_SS_FAMILY, 1, [Defined if struct sockaddr_storage has ss_family field]),,
- [
-#include <sys/socket.h>
-#include <sys/types.h>
-#include <netinet/in.h>
- ])
-
-if test x"$ac_cv_member_struct_sockaddr_storage_ss_family" != x"yes"; then
-AC_CHECK_MEMBER(struct sockaddr_storage.__ss_family,
- AC_DEFINE(HAVE___SS_FAMILY, 1, [Defined if struct sockaddr_storage has __ss_family field]),,
- [
-#include <sys/socket.h>
-#include <sys/types.h>
-#include <netinet/in.h>
- ])
-fi
-fi
-
-AC_CACHE_CHECK([for sin_len in sock],libreplace_cv_HAVE_SOCK_SIN_LEN,[
- AC_TRY_COMPILE(
- [
-#include <sys/types.h>
-#include <sys/socket.h>
-#include <netinet/in.h>
- ],[
-struct sockaddr_in sock; sock.sin_len = sizeof(sock);
- ],[
- libreplace_cv_HAVE_SOCK_SIN_LEN=yes
- ],[
- libreplace_cv_HAVE_SOCK_SIN_LEN=no
- ])
-])
-if test x"$libreplace_cv_HAVE_SOCK_SIN_LEN" = x"yes"; then
- AC_DEFINE(HAVE_SOCK_SIN_LEN,1,[Whether the sockaddr_in struct has a sin_len property])
-fi
-
-############################################
-# check for unix domain sockets
-AC_CACHE_CHECK([for unix domain sockets],libreplace_cv_HAVE_UNIXSOCKET,[
- AC_TRY_COMPILE([
-#include <sys/types.h>
-#include <stdlib.h>
-#include <stddef.h>
-#include <sys/socket.h>
-#include <sys/un.h>
- ],[
-struct sockaddr_un sunaddr;
-sunaddr.sun_family = AF_UNIX;
- ],[
- libreplace_cv_HAVE_UNIXSOCKET=yes
- ],[
- libreplace_cv_HAVE_UNIXSOCKET=no
- ])
-])
-if test x"$libreplace_cv_HAVE_UNIXSOCKET" = x"yes"; then
- AC_DEFINE(HAVE_UNIXSOCKET,1,[If we need to build with unixscoket support])
-fi
-
-dnl The following test is roughly taken from the cvs sources.
-dnl
-dnl If we can't find connect, try looking in -lsocket, -lnsl, and -linet.
-dnl The Irix 5 libc.so has connect and gethostbyname, but Irix 5 also has
-dnl libsocket.so which has a bad implementation of gethostbyname (it
-dnl only looks in /etc/hosts), so we only look for -lsocket if we need
-dnl it.
-AC_CHECK_FUNCS(connect)
-if test x"$ac_cv_func_connect" = x"no"; then
- AC_CHECK_LIB_EXT(nsl_s, LIBREPLACE_NETWORK_LIBS, connect)
- AC_CHECK_LIB_EXT(nsl, LIBREPLACE_NETWORK_LIBS, connect)
- AC_CHECK_LIB_EXT(socket, LIBREPLACE_NETWORK_LIBS, connect)
- AC_CHECK_LIB_EXT(inet, LIBREPLACE_NETWORK_LIBS, connect)
- dnl We can't just call AC_CHECK_FUNCS(connect) here,
- dnl because the value has been cached.
- if test x"$ac_cv_lib_ext_nsl_s_connect" = x"yes" ||
- test x"$ac_cv_lib_ext_nsl_connect" = x"yes" ||
- test x"$ac_cv_lib_ext_socket_connect" = x"yes" ||
- test x"$ac_cv_lib_ext_inet_connect" = x"yes"
- then
- AC_DEFINE(HAVE_CONNECT,1,[Whether the system has connect()])
- fi
-fi
-
-AC_CHECK_FUNCS(gethostbyname)
-if test x"$ac_cv_func_gethostbyname" = x"no"; then
- AC_CHECK_LIB_EXT(nsl_s, LIBREPLACE_NETWORK_LIBS, gethostbyname)
- AC_CHECK_LIB_EXT(nsl, LIBREPLACE_NETWORK_LIBS, gethostbyname)
- AC_CHECK_LIB_EXT(socket, LIBREPLACE_NETWORK_LIBS, gethostbyname)
- dnl We can't just call AC_CHECK_FUNCS(gethostbyname) here,
- dnl because the value has been cached.
- if test x"$ac_cv_lib_ext_nsl_s_gethostbyname" = x"yes" ||
- test x"$ac_cv_lib_ext_nsl_gethostbyname" = x"yes" ||
- test x"$ac_cv_lib_ext_socket_gethostbyname" = x"yes"
- then
- AC_DEFINE(HAVE_GETHOSTBYNAME,1,
- [Whether the system has gethostbyname()])
- fi
-fi
-
-dnl HP-UX has if_nametoindex in -lipv6
-AC_CHECK_FUNCS(if_nametoindex)
-if test x"$ac_cv_func_if_nametoindex" = x"no"; then
- AC_CHECK_LIB_EXT(ipv6, LIBREPLACE_NETWORK_LIBS, if_nametoindex)
- dnl We can't just call AC_CHECK_FUNCS(if_nametoindex) here,
- dnl because the value has been cached.
- if test x"$ac_cv_lib_ext_ipv6_if_nametoindex" = x"yes"
- then
- AC_DEFINE(HAVE_IF_NAMETOINDEX, 1,
- [Whether the system has if_nametoindex()])
- fi
-fi
-
-# The following tests need LIBS="${LIBREPLACE_NETWORK_LIBS}"
-old_LIBS=$LIBS
-LIBS="${LIBREPLACE_NETWORK_LIBS}"
-libreplace_SAVE_CPPFLAGS="$CPPFLAGS"
-CPPFLAGS="$CPPFLAGS -I$libreplacedir"
-
-AC_CHECK_FUNCS(socketpair,[],[LIBREPLACE_NETWORK_OBJS="${LIBREPLACE_NETWORK_OBJS} $libreplacedir/socketpair.o"])
-
-AC_CACHE_CHECK([for broken inet_ntoa],libreplace_cv_REPLACE_INET_NTOA,[
-AC_TRY_RUN([
-#include <stdio.h>
-#include <unistd.h>
-#include <sys/types.h>
-#include <netinet/in.h>
-#ifdef HAVE_ARPA_INET_H
-#include <arpa/inet.h>
-#endif
-main() { struct in_addr ip; ip.s_addr = 0x12345678;
-if (strcmp(inet_ntoa(ip),"18.52.86.120") &&
- strcmp(inet_ntoa(ip),"120.86.52.18")) { exit(0); }
-exit(1);}],
- libreplace_cv_REPLACE_INET_NTOA=yes,libreplace_cv_REPLACE_INET_NTOA=no,libreplace_cv_REPLACE_INET_NTOA=cross)])
-
-AC_CHECK_FUNCS(inet_ntoa,[],[libreplace_cv_REPLACE_INET_NTOA=yes])
-if test x"$libreplace_cv_REPLACE_INET_NTOA" = x"yes"; then
- AC_DEFINE(REPLACE_INET_NTOA,1,[Whether inet_ntoa should be replaced])
- LIBREPLACE_NETWORK_OBJS="${LIBREPLACE_NETWORK_OBJS} $libreplacedir/inet_ntoa.o"
-fi
-
-AC_CHECK_FUNCS(inet_aton,[],[LIBREPLACE_NETWORK_OBJS="${LIBREPLACE_NETWORK_OBJS} $libreplacedir/inet_aton.o"])
-
-AC_CHECK_FUNCS(inet_ntop,[],[LIBREPLACE_NETWORK_OBJS="${LIBREPLACE_NETWORK_OBJS} $libreplacedir/inet_ntop.o"])
-
-AC_CHECK_FUNCS(inet_pton,[],[LIBREPLACE_NETWORK_OBJS="${LIBREPLACE_NETWORK_OBJS} $libreplacedir/inet_pton.o"])
-
-dnl test for getaddrinfo/getnameinfo
-AC_CACHE_CHECK([for getaddrinfo],libreplace_cv_HAVE_GETADDRINFO,[
-AC_TRY_LINK([
-#include <sys/types.h>
-#if STDC_HEADERS
-#include <stdlib.h>
-#include <stddef.h>
-#endif
-#include <sys/socket.h>
-#include <netdb.h>],
-[
-struct sockaddr sa;
-struct addrinfo *ai = NULL;
-int ret = getaddrinfo(NULL, NULL, NULL, &ai);
-if (ret != 0) {
- const char *es = gai_strerror(ret);
-}
-freeaddrinfo(ai);
-ret = getnameinfo(&sa, sizeof(sa),
- NULL, 0,
- NULL, 0, 0);
-
-],
-libreplace_cv_HAVE_GETADDRINFO=yes,libreplace_cv_HAVE_GETADDRINFO=no)])
-
-if test x"$libreplace_cv_HAVE_GETADDRINFO" = x"yes"; then
- # getaddrinfo is broken on some AIX systems
- # see bug 5910, use our replacements if we detect
- # a broken system.
- AC_TRY_RUN([
- #include <stddef.h>
- #include <sys/types.h>
- #include <sys/socket.h>
- #include <netdb.h>
- int main(int argc, const char *argv[])
- {
- struct addrinfo hints = {0,};
- struct addrinfo *ppres;
- const char hostname1[] = "0.0.0.0";
- const char hostname2[] = "127.0.0.1";
- const char hostname3[] = "::";
- hints.ai_socktype = SOCK_STREAM;
- hints.ai_family = AF_UNSPEC;
- hints.ai_flags =
- AI_NUMERICHOST|AI_PASSIVE|AI_ADDRCONFIG;
- /* Test for broken flag combination on AIX. */
- if (getaddrinfo(hostname1, NULL, &hints, &ppres) == EAI_BADFLAGS) {
- /* This fails on an IPv6-only box, but not with
- the EAI_BADFLAGS error. */
- return 1;
- }
- if (getaddrinfo(hostname2, NULL, &hints, &ppres) == 0) {
- /* IPv4 lookup works - good enough. */
- return 0;
- }
- /* Uh-oh, no IPv4. Are we IPv6-only ? */
- return getaddrinfo(hostname3, NULL, &hints, &ppres) != 0 ? 1 : 0;
- }],
- libreplace_cv_HAVE_GETADDRINFO=yes,
- libreplace_cv_HAVE_GETADDRINFO=no)
-fi
-
-if test x"$libreplace_cv_HAVE_GETADDRINFO" = x"yes"; then
- AC_DEFINE(HAVE_GETADDRINFO,1,[Whether the system has getaddrinfo])
- AC_DEFINE(HAVE_GETNAMEINFO,1,[Whether the system has getnameinfo])
- AC_DEFINE(HAVE_FREEADDRINFO,1,[Whether the system has freeaddrinfo])
- AC_DEFINE(HAVE_GAI_STRERROR,1,[Whether the system has gai_strerror])
-else
- LIBREPLACE_NETWORK_OBJS="${LIBREPLACE_NETWORK_OBJS} $libreplacedir/getaddrinfo.o"
-fi
-
-AC_CHECK_HEADERS([ifaddrs.h])
-
-dnl Used when getifaddrs is not available
-AC_CHECK_MEMBERS([struct sockaddr.sa_len],
- [AC_DEFINE(HAVE_SOCKADDR_SA_LEN, 1, [Whether struct sockaddr has a sa_len member])],
- [],
- [#include <sys/socket.h>])
-
-dnl test for getifaddrs and freeifaddrs
-AC_CACHE_CHECK([for getifaddrs and freeifaddrs],libreplace_cv_HAVE_GETIFADDRS,[
-AC_TRY_LINK([
-#include <sys/types.h>
-#if STDC_HEADERS
-#include <stdlib.h>
-#include <stddef.h>
-#endif
-#include <sys/socket.h>
-#include <netinet/in.h>
-#include <arpa/inet.h>
-#include <ifaddrs.h>
-#include <netdb.h>],
-[
-struct ifaddrs *ifp = NULL;
-int ret = getifaddrs (&ifp);
-freeifaddrs(ifp);
-],
-libreplace_cv_HAVE_GETIFADDRS=yes,libreplace_cv_HAVE_GETIFADDRS=no)])
-if test x"$libreplace_cv_HAVE_GETIFADDRS" = x"yes"; then
- AC_DEFINE(HAVE_GETIFADDRS,1,[Whether the system has getifaddrs])
- AC_DEFINE(HAVE_FREEIFADDRS,1,[Whether the system has freeifaddrs])
- AC_DEFINE(HAVE_STRUCT_IFADDRS,1,[Whether struct ifaddrs is available])
-fi
-
-##################
-# look for a method of finding the list of network interfaces
-iface=no;
-AC_CACHE_CHECK([for iface getifaddrs],libreplace_cv_HAVE_IFACE_GETIFADDRS,[
-AC_TRY_RUN([
-#define HAVE_IFACE_GETIFADDRS 1
-#define NO_CONFIG_H 1
-#define AUTOCONF_TEST 1
-#define SOCKET_WRAPPER_NOT_REPLACE
-#include "$libreplacedir/replace.c"
-#include "$libreplacedir/inet_ntop.c"
-#include "$libreplacedir/snprintf.c"
-#include "$libreplacedir/getifaddrs.c"
-#define getifaddrs_test main
-#include "$libreplacedir/test/getifaddrs.c"],
- libreplace_cv_HAVE_IFACE_GETIFADDRS=yes,libreplace_cv_HAVE_IFACE_GETIFADDRS=no,libreplace_cv_HAVE_IFACE_GETIFADDRS=cross)])
-if test x"$libreplace_cv_HAVE_IFACE_GETIFADDRS" = x"yes"; then
- iface=yes;AC_DEFINE(HAVE_IFACE_GETIFADDRS,1,[Whether iface getifaddrs is available])
-else
- LIBREPLACE_NETWORK_OBJS="${LIBREPLACE_NETWORK_OBJS} $libreplacedir/getifaddrs.o"
-fi
-
-
-if test $iface = no; then
-AC_CACHE_CHECK([for iface AIX],libreplace_cv_HAVE_IFACE_AIX,[
-AC_TRY_RUN([
-#define HAVE_IFACE_AIX 1
-#define NO_CONFIG_H 1
-#define AUTOCONF_TEST 1
-#undef _XOPEN_SOURCE_EXTENDED
-#define SOCKET_WRAPPER_NOT_REPLACE
-#include "$libreplacedir/replace.c"
-#include "$libreplacedir/inet_ntop.c"
-#include "$libreplacedir/snprintf.c"
-#include "$libreplacedir/getifaddrs.c"
-#define getifaddrs_test main
-#include "$libreplacedir/test/getifaddrs.c"],
- libreplace_cv_HAVE_IFACE_AIX=yes,libreplace_cv_HAVE_IFACE_AIX=no,libreplace_cv_HAVE_IFACE_AIX=cross)])
-if test x"$libreplace_cv_HAVE_IFACE_AIX" = x"yes"; then
- iface=yes;AC_DEFINE(HAVE_IFACE_AIX,1,[Whether iface AIX is available])
-fi
-fi
-
-
-if test $iface = no; then
-AC_CACHE_CHECK([for iface ifconf],libreplace_cv_HAVE_IFACE_IFCONF,[
-AC_TRY_RUN([
-#define HAVE_IFACE_IFCONF 1
-#define NO_CONFIG_H 1
-#define AUTOCONF_TEST 1
-#define SOCKET_WRAPPER_NOT_REPLACE
-#include "$libreplacedir/replace.c"
-#include "$libreplacedir/inet_ntop.c"
-#include "$libreplacedir/snprintf.c"
-#include "$libreplacedir/getifaddrs.c"
-#define getifaddrs_test main
-#include "$libreplacedir/test/getifaddrs.c"],
- libreplace_cv_HAVE_IFACE_IFCONF=yes,libreplace_cv_HAVE_IFACE_IFCONF=no,libreplace_cv_HAVE_IFACE_IFCONF=cross)])
-if test x"$libreplace_cv_HAVE_IFACE_IFCONF" = x"yes"; then
- iface=yes;AC_DEFINE(HAVE_IFACE_IFCONF,1,[Whether iface ifconf is available])
-fi
-fi
-
-if test $iface = no; then
-AC_CACHE_CHECK([for iface ifreq],libreplace_cv_HAVE_IFACE_IFREQ,[
-AC_TRY_RUN([
-#define HAVE_IFACE_IFREQ 1
-#define NO_CONFIG_H 1
-#define AUTOCONF_TEST 1
-#define SOCKET_WRAPPER_NOT_REPLACE
-#include "$libreplacedir/replace.c"
-#include "$libreplacedir/inet_ntop.c"
-#include "$libreplacedir/snprintf.c"
-#include "$libreplacedir/getifaddrs.c"
-#define getifaddrs_test main
-#include "$libreplacedir/test/getifaddrs.c"],
- libreplace_cv_HAVE_IFACE_IFREQ=yes,libreplace_cv_HAVE_IFACE_IFREQ=no,libreplace_cv_HAVE_IFACE_IFREQ=cross)])
-if test x"$libreplace_cv_HAVE_IFACE_IFREQ" = x"yes"; then
- iface=yes;AC_DEFINE(HAVE_IFACE_IFREQ,1,[Whether iface ifreq is available])
-fi
-fi
-
-dnl Some old Linux systems have broken header files and
-dnl miss the IPV6_V6ONLY define in netinet/in.h,
-dnl but have it in linux/in6.h.
-dnl We can't include both files so we just check if the value
-dnl if defined and do the replacement in system/network.h
-AC_CACHE_CHECK([for IPV6_V6ONLY support],libreplace_cv_HAVE_IPV6_V6ONLY,[
- AC_TRY_COMPILE([
-#include <stdlib.h> /* for NULL */
-#include <sys/socket.h>
-#include <sys/types.h>
-#include <netdb.h>
-#include <netinet/in.h>
- ],
- [
-#ifndef IPV6_V6ONLY
-#error no IPV6_V6ONLY
-#endif
- ],[
- libreplace_cv_HAVE_IPV6_V6ONLY=yes
- ],[
- libreplace_cv_HAVE_IPV6_V6ONLY=no
- ])
-])
-if test x"$libreplace_cv_HAVE_IPV6_V6ONLY" != x"yes"; then
- dnl test for IPV6_V6ONLY
- AC_CACHE_CHECK([for IPV6_V6ONLY in linux/in6.h],libreplace_cv_HAVE_LINUX_IPV6_V6ONLY_26,[
- AC_TRY_COMPILE([
- #include <linux/in6.h>
- ],
- [
- #if (IPV6_V6ONLY != 26)
- #error no linux IPV6_V6ONLY
- #endif
- ],[
- libreplace_cv_HAVE_LINUX_IPV6_V6ONLY_26=yes
- ],[
- libreplace_cv_HAVE_LINUX_IPV6_V6ONLY_26=no
- ])
- ])
- if test x"$libreplace_cv_HAVE_LINUX_IPV6_V6ONLY_26" = x"yes"; then
- AC_DEFINE(HAVE_LINUX_IPV6_V6ONLY_26,1,[Whether the system has IPV6_V6ONLY in linux/in6.h])
- fi
-fi
-
-dnl test for ipv6
-AC_CACHE_CHECK([for ipv6 support],libreplace_cv_HAVE_IPV6,[
- AC_TRY_LINK([
-#include <stdlib.h> /* for NULL */
-#include <sys/socket.h>
-#include <sys/types.h>
-#include <netdb.h>
-#include <netinet/in.h>
- ],
- [
-struct sockaddr_storage sa_store;
-struct addrinfo *ai = NULL;
-struct in6_addr in6addr;
-int idx = if_nametoindex("iface1");
-int s = socket(AF_INET6, SOCK_STREAM, 0);
-int ret = getaddrinfo(NULL, NULL, NULL, &ai);
-if (ret != 0) {
- const char *es = gai_strerror(ret);
-}
-freeaddrinfo(ai);
-{
- int val = 1;
- #ifdef HAVE_LINUX_IPV6_V6ONLY_26
- #define IPV6_V6ONLY 26
- #endif
- ret = setsockopt(s, IPPROTO_IPV6, IPV6_V6ONLY,
- (const void *)&val, sizeof(val));
-}
- ],[
- libreplace_cv_HAVE_IPV6=yes
- ],[
- libreplace_cv_HAVE_IPV6=no
- ])
-])
-if test x"$libreplace_cv_HAVE_IPV6" = x"yes"; then
- AC_DEFINE(HAVE_IPV6,1,[Whether the system has IPv6 support])
-fi
-
-LIBS=$old_LIBS
-CPPFLAGS="$libreplace_SAVE_CPPFLAGS"
-
-AC_CACHE_CHECK([for SO_PEERCRED],libreplace_cv_HAVE_PEERCRED,[
-AC_TRY_COMPILE([#include <sys/types.h>
-#include <sys/socket.h>],
-[struct ucred cred;
- socklen_t cred_len;
- int ret = getsockopt(0, SOL_SOCKET, SO_PEERCRED, &cred, &cred_len);
-],
-libreplace_cv_HAVE_PEERCRED=yes,libreplace_cv_HAVE_PEERCRED=no,libreplace_cv_HAVE_PEERCRED=cross)])
-if test x"$libreplace_cv_HAVE_PEERCRED" = x"yes"; then
- AC_DEFINE(HAVE_PEERCRED,1,[Whether we can use SO_PEERCRED to get socket credentials])
-fi
-
-AC_CACHE_CHECK([for getpeereid],libreplace_cv_HAVE_GETPEEREID,[
-AC_TRY_LINK([#include <sys/types.h>
-#include <unistd.h>],
-[uid_t uid; gid_t gid; int ret;
- ret = getpeereid(0, &uid, &gid);
-],
-libreplace_cv_HAVE_GETPEEREID=yes,libreplace_cv_HAVE_GETPEEREID=no)])
-if test x"$libreplace_cv_HAVE_GETPEEREID" = xyes; then
- AC_DEFINE(HAVE_GETPEEREID,1,
- [Whether we have getpeereid to get socket credentials])
-fi
-
-LIBREPLACEOBJ="${LIBREPLACEOBJ} ${LIBREPLACE_NETWORK_OBJS}"
-
-echo "LIBREPLACE_NETWORK_CHECKS: END"
-]) dnl end AC_LIBREPLACE_NETWORK_CHECKS
diff --git a/lib/replace/repdir.m4 b/lib/replace/repdir.m4
deleted file mode 100644
index 682ab44c56..0000000000
--- a/lib/replace/repdir.m4
+++ /dev/null
@@ -1,81 +0,0 @@
-AC_CACHE_CHECK([for broken readdir],libreplace_cv_READDIR_NEEDED,[
- AC_TRY_RUN([
-#define test_readdir_os2_delete main
-#include "$libreplacedir/test/os2_delete.c"],
- [libreplace_cv_READDIR_NEEDED=no],
- [libreplace_cv_READDIR_NEEDED=yes],
- [libreplace_cv_READDIR_NEEDED="assuming not"])
-])
-
-AC_CHECK_FUNCS(dirfd)
-AC_HAVE_DECL(dirfd, [#include <dirent.h>])
-
-#
-# try to replace with getdirentries() if needed
-#
-if test x"$libreplace_cv_READDIR_NEEDED" = x"yes"; then
-AC_CHECK_FUNCS(getdirentries)
-AC_VERIFY_C_PROTOTYPE([long telldir(const DIR *dir)],
- [
- return 0;
- ],[
- AC_DEFINE(TELLDIR_TAKES_CONST_DIR, 1, [Whether telldir takes a const pointer])
- ],[],[
- #include <dirent.h>
- ])
-
-AC_VERIFY_C_PROTOTYPE([int seekdir(DIR *dir, long ofs)],
- [
- return 0;
- ],[
- AC_DEFINE(SEEKDIR_RETURNS_INT, 1, [Whether seekdir returns an int])
- ],[],[
- #include <dirent.h>
- ])
-AC_CACHE_CHECK([for replacing readdir using getdirentries()],libreplace_cv_READDIR_GETDIRENTRIES,[
- AC_TRY_RUN([
-#define _LIBREPLACE_REPLACE_H
-#include "$libreplacedir/repdir_getdirentries.c"
-#define test_readdir_os2_delete main
-#include "$libreplacedir/test/os2_delete.c"],
- [libreplace_cv_READDIR_GETDIRENTRIES=yes],
- [libreplace_cv_READDIR_GETDIRENTRIES=no])
-])
-fi
-if test x"$libreplace_cv_READDIR_GETDIRENTRIES" = x"yes"; then
- AC_DEFINE(REPLACE_READDIR,1,[replace readdir])
- AC_DEFINE(REPLACE_READDIR_GETDIRENTRIES,1,[replace readdir using getdirentries()])
- LIBREPLACEOBJ="${LIBREPLACEOBJ} $libreplacedir/repdir_getdirentries.o"
- libreplace_cv_READDIR_NEEDED=no
-fi
-
-#
-# try to replace with getdents() if needed
-#
-if test x"$libreplace_cv_READDIR_NEEDED" = x"yes"; then
-AC_CHECK_FUNCS(getdents)
-AC_CACHE_CHECK([for replacing readdir using getdents()],libreplace_cv_READDIR_GETDENTS,[
- AC_TRY_RUN([
-#define _LIBREPLACE_REPLACE_H
-#error _donot_use_getdents_replacement_anymore
-#include "$libreplacedir/repdir_getdents.c"
-#define test_readdir_os2_delete main
-#include "$libreplacedir/test/os2_delete.c"],
- [libreplace_cv_READDIR_GETDENTS=yes],
- [libreplace_cv_READDIR_GETDENTS=no])
-])
-fi
-if test x"$libreplace_cv_READDIR_GETDENTS" = x"yes"; then
- AC_DEFINE(REPLACE_READDIR,1,[replace readdir])
- AC_DEFINE(REPLACE_READDIR_GETDENTS,1,[replace readdir using getdents()])
- LIBREPLACEOBJ="${LIBREPLACEOBJ} $libreplacedir/repdir_getdents.o"
- libreplace_cv_READDIR_NEEDED=no
-fi
-
-AC_MSG_CHECKING([a usable readdir()])
-if test x"$libreplace_cv_READDIR_NEEDED" = x"yes"; then
- AC_MSG_RESULT(no)
- AC_MSG_WARN([the provided readdir() is broken])
-else
- AC_MSG_RESULT(yes)
-fi
diff --git a/lib/replace/strptime.m4 b/lib/replace/strptime.m4
deleted file mode 100644
index 8ac22f6342..0000000000
--- a/lib/replace/strptime.m4
+++ /dev/null
@@ -1,16 +0,0 @@
-AC_CHECK_FUNCS(strptime)
-AC_CHECK_DECLS(strptime, [], [], [#include <time.h>])
-AC_CACHE_CHECK([whether strptime is available and works],libreplace_cv_STRPTIME_OK,[
- AC_TRY_RUN([
- #define LIBREPLACE_CONFIGURE_TEST_STRPTIME
- #include "$libreplacedir/test/strptime.c"
- ],
- [libreplace_cv_STRPTIME_OK=yes],
- [libreplace_cv_STRPTIME_OK=no],
- [libreplace_cv_STRPTIME_OK="assuming not"])
-])
-if test x"$libreplace_cv_STRPTIME_OK" != x"yes"; then
- LIBREPLACEOBJ="${LIBREPLACEOBJ} $libreplacedir/strptime.o"
-else
- AC_DEFINE(HAVE_WORKING_STRPTIME,1,[Whether strptime is working correct])
-fi
diff --git a/lib/replace/system/config.m4 b/lib/replace/system/config.m4
deleted file mode 100644
index b7cdf1414a..0000000000
--- a/lib/replace/system/config.m4
+++ /dev/null
@@ -1,145 +0,0 @@
-# filesys
-AC_HEADER_DIRENT
-AC_CHECK_HEADERS(fcntl.h sys/fcntl.h sys/resource.h sys/ioctl.h sys/mode.h sys/filio.h sys/fs/s5param.h sys/filsys.h)
-AC_CHECK_HEADERS(sys/acl.h acl/libacl.h sys/file.h)
-
-# select
-AC_CHECK_HEADERS(sys/select.h)
-
-# poll
-AC_CHECK_HEADERS(poll.h)
-AC_CHECK_FUNCS(poll,[],[LIBREPLACEOBJ="${LIBREPLACEOBJ} $libreplacedir/poll.o"])
-
-# time
-AC_CHECK_HEADERS(sys/time.h utime.h)
-AC_HEADER_TIME
-AC_CHECK_FUNCS(utime utimes)
-
-AC_CACHE_CHECK([if gettimeofday takes TZ argument],libreplace_cv_HAVE_GETTIMEOFDAY_TZ,[
-AC_TRY_RUN([
-#include <sys/time.h>
-#include <unistd.h>
-main() { struct timeval tv; exit(gettimeofday(&tv, NULL));}],
- libreplace_cv_HAVE_GETTIMEOFDAY_TZ=yes,libreplace_cv_HAVE_GETTIMEOFDAY_TZ=no,libreplace_cv_HAVE_GETTIMEOFDAY_TZ=yes)])
-if test x"$libreplace_cv_HAVE_GETTIMEOFDAY_TZ" = x"yes"; then
- AC_DEFINE(HAVE_GETTIMEOFDAY_TZ,1,[Whether gettimeofday() is available])
-fi
-
-# wait
-AC_HEADER_SYS_WAIT
-
-# capability
-AC_CHECK_HEADERS(sys/capability.h)
-
-case "$host_os" in
-*linux*)
-AC_CACHE_CHECK([for broken RedHat 7.2 system header files],libreplace_cv_BROKEN_REDHAT_7_SYSTEM_HEADERS,[
-AC_TRY_COMPILE([
- #ifdef HAVE_SYS_VFS_H
- #include <sys/vfs.h>
- #endif
- #ifdef HAVE_SYS_CAPABILITY_H
- #include <sys/capability.h>
- #endif
- ],[
- int i;
- ],
- libreplace_cv_BROKEN_REDHAT_7_SYSTEM_HEADERS=no,
- libreplace_cv_BROKEN_REDHAT_7_SYSTEM_HEADERS=yes
-)])
-if test x"$libreplace_cv_BROKEN_REDHAT_7_SYSTEM_HEADERS" = x"yes"; then
- AC_DEFINE(BROKEN_REDHAT_7_SYSTEM_HEADERS,1,[Broken RedHat 7.2 system header files])
-fi
-
-AC_CACHE_CHECK([for broken RHEL5 sys/capability.h],libreplace_cv_BROKEN_RHEL5_SYS_CAP_HEADER,[
-AC_TRY_COMPILE([
- #ifdef HAVE_SYS_CAPABILITY_H
- #include <sys/capability.h>
- #endif
- #include <linux/types.h>
- ],[
- __s8 i;
- ],
- libreplace_cv_BROKEN_RHEL5_SYS_CAP_HEADER=no,
- libreplace_cv_BROKEN_RHEL5_SYS_CAP_HEADER=yes
-)])
-if test x"$libreplace_cv_BROKEN_RHEL5_SYS_CAP_HEADER" = x"yes"; then
- AC_DEFINE(BROKEN_RHEL5_SYS_CAP_HEADER,1,[Broken RHEL5 sys/capability.h])
-fi
-;;
-esac
-
-# passwd
-AC_CHECK_HEADERS(grp.h sys/id.h compat.h shadow.h sys/priv.h pwd.h sys/security.h)
-AC_CHECK_FUNCS(getpwnam_r getpwuid_r getpwent_r)
-AC_HAVE_DECL(getpwent_r, [
- #include <unistd.h>
- #include <pwd.h>
- ])
-AC_VERIFY_C_PROTOTYPE([struct passwd *getpwent_r(struct passwd *src, char *buf, int buflen)],
- [
- #ifndef HAVE_GETPWENT_R_DECL
- #error missing getpwent_r prototype
- #endif
- return NULL;
- ],[
- AC_DEFINE(SOLARIS_GETPWENT_R, 1, [getpwent_r solaris function prototype])
- ],[],[
- #include <unistd.h>
- #include <pwd.h>
- ])
-AC_VERIFY_C_PROTOTYPE([struct passwd *getpwent_r(struct passwd *src, char *buf, size_t buflen)],
- [
- #ifndef HAVE_GETPWENT_R_DECL
- #error missing getpwent_r prototype
- #endif
- return NULL;
- ],[
- AC_DEFINE(SOLARIS_GETPWENT_R, 1, [getpwent_r irix (similar to solaris) function prototype])
- ],[],[
- #include <unistd.h>
- #include <pwd.h>
- ])
-AC_CHECK_FUNCS(getgrnam_r getgrgid_r getgrent_r)
-AC_HAVE_DECL(getgrent_r, [
- #include <unistd.h>
- #include <grp.h>
- ])
-AC_VERIFY_C_PROTOTYPE([struct group *getgrent_r(struct group *src, char *buf, int buflen)],
- [
- #ifndef HAVE_GETGRENT_R_DECL
- #error missing getgrent_r prototype
- #endif
- return NULL;
- ],[
- AC_DEFINE(SOLARIS_GETGRENT_R, 1, [getgrent_r solaris function prototype])
- ],[],[
- #include <unistd.h>
- #include <grp.h>
- ])
-
-AC_VERIFY_C_PROTOTYPE([struct group *getgrent_r(struct group *src, char *buf, size_t buflen)],
- [
- #ifndef HAVE_GETGRENT_R_DECL
- #error missing getgrent_r prototype
- #endif
- return NULL;
- ],[
- AC_DEFINE(SOLARIS_GETGRENT_R, 1, [getgrent_r irix (similar to solaris) function prototype])
- ],[],[
- #include <unistd.h>
- #include <grp.h>
- ])
-AC_CHECK_FUNCS(getgrouplist)
-
-# locale
-AC_CHECK_HEADERS(ctype.h locale.h langinfo.h)
-
-# glob
-AC_CHECK_HEADERS(fnmatch.h)
-
-# shmem
-AC_CHECK_HEADERS(sys/ipc.h sys/mman.h sys/shm.h )
-
-# terminal
-AC_CHECK_HEADERS(termios.h termio.h sys/termio.h )
diff --git a/lib/replace/timegm.m4 b/lib/replace/timegm.m4
deleted file mode 100644
index 9b76d0c727..0000000000
--- a/lib/replace/timegm.m4
+++ /dev/null
@@ -1 +0,0 @@
-AC_CHECK_FUNCS(timegm,[],[LIBREPLACEOBJ="${LIBREPLACEOBJ} $libreplacedir/timegm.o"])
diff --git a/lib/replace/win32.m4 b/lib/replace/win32.m4
deleted file mode 100644
index eb364e2cb9..0000000000
--- a/lib/replace/win32.m4
+++ /dev/null
@@ -1,20 +0,0 @@
-AC_CHECK_HEADERS(direct.h windows.h winsock2.h ws2tcpip.h)
-
-#######################################
-# Check for mkdir mode
-AC_CACHE_CHECK( [whether mkdir supports mode], libreplace_cv_mkdir_has_mode,
- AC_TRY_COMPILE([
- #include <stdio.h>
- #ifdef HAVE_DIRECT_H
- #include <direct.h>
- #endif],[
- mkdir("foo",0777);
- return 0;
- ],
- libreplace_cv_mkdir_has_mode="yes",
- libreplace_cv_mkdir_has_mode="no") )
-
-if test "$libreplace_cv_mkdir_has_mode" = "yes"
-then
- AC_DEFINE(HAVE_MKDIR_MODE, 1, [Define if target mkdir supports mode option])
-fi
diff --git a/lib/socket_wrapper/config.m4 b/lib/socket_wrapper/config.m4
deleted file mode 100644
index ff6b67b277..0000000000
--- a/lib/socket_wrapper/config.m4
+++ /dev/null
@@ -1,22 +0,0 @@
-AC_ARG_ENABLE(socket-wrapper,
-AS_HELP_STRING([--enable-socket-wrapper], [Turn on socket wrapper library (default=no)]))
-
-DEFAULT_TEST_OPTIONS=
-HAVE_SOCKET_WRAPPER=no
-
-if eval "test x$developer = xyes -o x$selftest = xyes"; then
- enable_socket_wrapper=yes
-fi
-
-if eval "test x$enable_socket_wrapper = xyes"; then
- AC_DEFINE(SOCKET_WRAPPER,1,[Use socket wrapper library])
- DEFAULT_TEST_OPTIONS=--socket-wrapper
- HAVE_SOCKET_WRAPPER=yes
-
- # this is only used for samba3
- SOCKET_WRAPPER_OBJS="../lib/socket_wrapper/socket_wrapper.o"
-fi
-
-AC_SUBST(DEFAULT_TEST_OPTIONS)
-AC_SUBST(HAVE_SOCKET_WRAPPER)
-AC_SUBST(SOCKET_WRAPPER_OBJS)
diff --git a/lib/talloc/compat/talloc_compat1.m4 b/lib/talloc/compat/talloc_compat1.m4
deleted file mode 100644
index 2ec530e079..0000000000
--- a/lib/talloc/compat/talloc_compat1.m4
+++ /dev/null
@@ -1,14 +0,0 @@
-TALLOC_COMPAT1_MK=""
-AC_SUBST(TALLOC_COMPAT1_MK)
-
-AC_ARG_ENABLE(talloc-compat1,
- [AS_HELP_STRING([--enable-talloc-compat1],
- [Build talloc 1.x.x compat library [default=no]])],
- [ enable_talloc_compat1=$enableval ],
- [ enable_talloc_compat1=no ]
-)
-
-if test "x$enable_talloc_compat1" = x"yes"; then
- TALLOC_COMPAT1_MK='include $(tallocdir)/compat/talloc_compat1.mk'
-fi
-
diff --git a/lib/talloc/libtalloc.m4 b/lib/talloc/libtalloc.m4
deleted file mode 100644
index 4b22c8e41a..0000000000
--- a/lib/talloc/libtalloc.m4
+++ /dev/null
@@ -1,38 +0,0 @@
-dnl find the talloc sources. This is meant to work both for
-dnl talloc standalone builds, and builds of packages using talloc
-tallocdir=""
-tallocpaths=". lib/talloc talloc ../talloc ../lib/talloc"
-for d in $tallocpaths; do
- if test -f "$srcdir/$d/talloc.c"; then
- tallocdir="$d"
- AC_SUBST(tallocdir)
- break;
- fi
-done
-if test x"$tallocdir" = "x"; then
- AC_MSG_ERROR([cannot find talloc source in $tallocpaths])
-fi
-TALLOC_OBJ="talloc.o"
-AC_SUBST(TALLOC_OBJ)
-
-TALLOC_CFLAGS="-I$srcdir/$tallocdir"
-AC_SUBST(TALLOC_CFLAGS)
-
-TALLOC_LIBS=""
-AC_SUBST(TALLOC_LIBS)
-
-AC_CHECK_SIZEOF(size_t,cross)
-AC_CHECK_SIZEOF(void *,cross)
-
-if test $ac_cv_sizeof_size_t -lt $ac_cv_sizeof_void_p; then
- AC_WARN([size_t cannot represent the amount of used memory of a process])
- AC_WARN([please report this to <samba-technical@samba.org>])
- AC_WARN([sizeof(size_t) = $ac_cv_sizeof_size_t])
- AC_WARN([sizeof(void *) = $ac_cv_sizeof_void_p])
- AC_ERROR([sizeof(size_t) < sizeof(void *)])
-fi
-
-if test x"$VERSIONSCRIPT" != "x"; then
- EXPORTSFILE=talloc.exports
- AC_SUBST(EXPORTSFILE)
-fi
diff --git a/lib/tdb/libtdb.m4 b/lib/tdb/libtdb.m4
deleted file mode 100644
index 47f098ed32..0000000000
--- a/lib/tdb/libtdb.m4
+++ /dev/null
@@ -1,41 +0,0 @@
-dnl find the tdb sources. This is meant to work both for
-dnl tdb standalone builds, and builds of packages using tdb
-tdbdir=""
-tdbpaths=". lib/tdb tdb ../tdb ../lib/tdb"
-for d in $tdbpaths; do
- if test -f "$srcdir/$d/common/tdb.c"; then
- tdbdir="$d"
- AC_SUBST(tdbdir)
- break;
- fi
-done
-if test x"$tdbdir" = "x"; then
- AC_MSG_ERROR([cannot find tdb source in $tdbpaths])
-fi
-TDB_OBJ="common/tdb.o common/dump.o common/transaction.o common/error.o common/traverse.o"
-TDB_OBJ="$TDB_OBJ common/freelist.o common/freelistcheck.o common/io.o common/lock.o common/open.o common/check.o common/hash.o common/summary.o common/rescue.o"
-AC_SUBST(TDB_OBJ)
-AC_SUBST(LIBREPLACEOBJ)
-
-TDB_LIBS=""
-AC_SUBST(TDB_LIBS)
-
-TDB_DEPS=""
-if test x$libreplace_cv_HAVE_FDATASYNC_IN_LIBRT = xyes ; then
- TDB_DEPS="$TDB_DEPS -lrt"
-fi
-AC_SUBST(TDB_DEPS)
-
-TDB_CFLAGS="-I$tdbdir/include"
-AC_SUBST(TDB_CFLAGS)
-
-AC_CHECK_FUNCS(mmap pread pwrite getpagesize utime)
-AC_CHECK_HEADERS(getopt.h sys/select.h sys/time.h)
-
-AC_HAVE_DECL(pread, [#include <unistd.h>])
-AC_HAVE_DECL(pwrite, [#include <unistd.h>])
-
-if test x"$VERSIONSCRIPT" != "x"; then
- EXPORTSFILE=tdb.exports
- AC_SUBST(EXPORTSFILE)
-fi
diff --git a/lib/tevent/libtevent.m4 b/lib/tevent/libtevent.m4
deleted file mode 100644
index 4d4fd2bd77..0000000000
--- a/lib/tevent/libtevent.m4
+++ /dev/null
@@ -1,75 +0,0 @@
-dnl find the tevent sources. This is meant to work both for
-dnl standalone builds, and builds of packages using libtevent
-
-AC_SUBST(teventdir)
-
-if test x"$teventdir" = "x"; then
- teventdir=""
- teventpaths="$srcdir $srcdir/../lib/tevent $srcdir/tevent $srcdir/../tevent"
- for d in $teventpaths; do
- if test -f "$d/tevent.c"; then
- teventdir="$d"
- break;
- fi
- done
- if test x"$teventdir" = "x"; then
- AC_MSG_ERROR([cannot find libtevent source in $teventpaths])
- fi
-fi
-
-TEVENT_OBJ=""
-TEVENT_CFLAGS=""
-TEVENT_LIBS=""
-AC_SUBST(TEVENT_OBJ)
-AC_SUBST(TEVENT_CFLAGS)
-AC_SUBST(TEVENT_LIBS)
-
-TEVENT_CFLAGS="-I$teventdir"
-
-TEVENT_OBJ="tevent.o tevent_debug.o tevent_util.o"
-TEVENT_OBJ="$TEVENT_OBJ tevent_fd.o tevent_timed.o tevent_immediate.o tevent_signal.o"
-TEVENT_OBJ="$TEVENT_OBJ tevent_req.o tevent_wakeup.o tevent_queue.o"
-TEVENT_OBJ="$TEVENT_OBJ tevent_standard.o tevent_select.o"
-TEVENT_OBJ="$TEVENT_OBJ tevent_poll.o"
-
-AC_CHECK_HEADERS(sys/epoll.h)
-AC_CHECK_FUNCS(epoll_create)
-if test x"$ac_cv_header_sys_epoll_h" = x"yes" -a x"$ac_cv_func_epoll_create" = x"yes"; then
- TEVENT_OBJ="$TEVENT_OBJ tevent_epoll.o"
- AC_DEFINE(HAVE_EPOLL, 1, [Whether epoll available])
-fi
-
-tevent_num_signals_includes="$ac_includes_default
-#include <signal.h>
-"
-tevent_num_signals=64
-AC_CHECK_VALUEOF(NSIG, [$tevent_num_signals_includes])
-v=$ac_cv_valueof_NSIG
-test -n "$v" && test "$v" -gt "$tevent_num_signals" && {
- tevent_num_signals=$v
-}
-AC_CHECK_VALUEOF(_NSIG, [$tevent_num_signals_includes])
-v=$ac_cv_valueof__NSIG
-test -n "$v" && test "$v" -gt "$tevent_num_signals" && {
- tevent_num_signals=$v
-}
-AC_CHECK_VALUEOF(SIGRTMAX, [$tevent_num_signals_includes])
-v=$ac_cv_valueof_SIGRTMAX
-test -n "$v" && test "$v" -gt "$tevent_num_signals" && {
- tevent_num_signals=$v
-}
-AC_CHECK_VALUEOF(SIGRTMIN, [$tevent_num_signals_includes])
-v=$ac_cv_valueof_SIGRTMIN
-test -n "$v" && {
- v=`expr $v + $v`
-}
-test -n "$v" && test "$v" -gt "$tevent_num_signals" && {
- tevent_num_signals=$v
-}
-AC_DEFINE_UNQUOTED(TEVENT_NUM_SIGNALS, $tevent_num_signals, [Max signal number value])
-
-if test x"$VERSIONSCRIPT" != "x"; then
- EXPORTSFILE=tevent.exports
- AC_SUBST(EXPORTSFILE)
-fi
-
diff --git a/lib/uid_wrapper/config.m4 b/lib/uid_wrapper/config.m4
deleted file mode 100644
index a5652336f0..0000000000
--- a/lib/uid_wrapper/config.m4
+++ /dev/null
@@ -1,19 +0,0 @@
-AC_ARG_ENABLE(uid-wrapper,
-AS_HELP_STRING([--enable-uid-wrapper], [Turn on uid wrapper library (default=no)]))
-
-HAVE_UID_WRAPPER=no
-
-if eval "test x$developer = xyes -o x$selftest = xyes"; then
- enable_uid_wrapper=yes
-fi
-
-if eval "test x$enable_uid_wrapper = xyes"; then
- AC_DEFINE(UID_WRAPPER,1,[Use uid wrapper library])
- HAVE_UID_WRAPPER=yes
-
- # this is only used for samba3
- UID_WRAPPER_OBJS="../lib/uid_wrapper/uid_wrapper.o"
-fi
-
-AC_SUBST(HAVE_UID_WRAPPER)
-AC_SUBST(UID_WRAPPER_OBJS)
diff --git a/lib/zlib/zlib.m4 b/lib/zlib/zlib.m4
deleted file mode 100644
index 32d747c388..0000000000
--- a/lib/zlib/zlib.m4
+++ /dev/null
@@ -1,29 +0,0 @@
-AC_DEFUN([AC_ZLIB],[
-AC_CHECK_HEADERS(zlib.h)
-
-AC_CHECK_LIB_EXT(z, ZLIB_LIBS, zlibVersion)
-
-AC_CACHE_CHECK([for zlib >= 1.2.3], samba_cv_zlib_1_2_3, [
- AC_TRY_COMPILE([
- #include <zlib.h>
- ],[
- #if (ZLIB_VERNUM >= 0x1230)
- #else
- #error "ZLIB_VERNUM < 0x1230"
- #endif
- ],[
- samba_cv_zlib_1_2_3=yes
- ],[
- samba_cv_zlib_1_2_3=no
- ])
-])
-
-if test x"$ac_cv_header_zlib_h" = x"yes" -a \
- x"$ac_cv_lib_ext_z_zlibVersion" = x"yes" -a \
- x"$samba_cv_zlib_1_2_3" = x"yes"; then
- $1
-else
- $2
-fi
-])
-