aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTiziano Müller <tiziano.mueller@stepping-stone.ch>2015-04-08 13:29:35 +0200
committerWayne Davison <wayned@samba.org>2015-04-26 17:54:06 -0700
commit066ad8c71918a2888bfb5939117e02eecdcae928 (patch)
treed075a9a668ca0cd3c693f5e9d1eebab154c81e38
parentec4f644d2f019da4667bf8bacf4b25e1bd498d76 (diff)
downloadandroid_external_rsync-066ad8c71918a2888bfb5939117e02eecdcae928.tar.gz
android_external_rsync-066ad8c71918a2888bfb5939117e02eecdcae928.tar.bz2
android_external_rsync-066ad8c71918a2888bfb5939117e02eecdcae928.zip
Modularize m4 macros
Split acinclude.m4 into one file per function in m4/
-rw-r--r--Makefile.in2
-rw-r--r--configure.ac2
-rw-r--r--m4/have_type.m422
-rw-r--r--m4/socklen_t.m4 (renamed from acinclude.m4)47
-rw-r--r--m4/validate_cache_system_type.m423
5 files changed, 48 insertions, 48 deletions
diff --git a/Makefile.in b/Makefile.in
index 5f825527..71a86f61 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -143,7 +143,7 @@ gensend: gen
conf:
cd $(srcdir) && $(MAKE) -f prepare-source.mak conf
-aclocal.m4: acinclude.m4
+aclocal.m4: m4/*.m4
aclocal
configure.sh config.h.in: configure.ac aclocal.m4
diff --git a/configure.ac b/configure.ac
index 5c557a89..2d638fce 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1,6 +1,8 @@
dnl Process this file with autoconf to produce a configure script.
AC_INIT()
+
+AC_CONFIG_MACRO_DIR([m4])
AC_CONFIG_SRCDIR([byteorder.h])
AC_CONFIG_HEADER(config.h)
AC_PREREQ(2.60)
diff --git a/m4/have_type.m4 b/m4/have_type.m4
new file mode 100644
index 00000000..704ca33b
--- /dev/null
+++ b/m4/have_type.m4
@@ -0,0 +1,22 @@
+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
+])
diff --git a/acinclude.m4 b/m4/socklen_t.m4
index cba16298..831820ca 100644
--- a/acinclude.m4
+++ b/m4/socklen_t.m4
@@ -1,27 +1,3 @@
-dnl AC_VALIDATE_CACHE_SYSTEM_TYPE[(cmd)]
-dnl if the cache file is inconsistent with the current host,
-dnl target and build system types, execute CMD or print a default
-dnl error message.
-AC_DEFUN([AC_VALIDATE_CACHE_SYSTEM_TYPE], [
- AC_REQUIRE([AC_CANONICAL_SYSTEM])
- AC_MSG_CHECKING([config.cache system type])
- if { test x"${ac_cv_host_system_type+set}" = x"set" &&
- test x"$ac_cv_host_system_type" != x"$host"; } ||
- { test x"${ac_cv_build_system_type+set}" = x"set" &&
- test x"$ac_cv_build_system_type" != x"$build"; } ||
- { test x"${ac_cv_target_system_type+set}" = x"set" &&
- test x"$ac_cv_target_system_type" != x"$target"; }; then
- AC_MSG_RESULT([different])
- ifelse($#, 1, [$1],
- [AC_MSG_ERROR(["you must remove config.cache and restart configure"])])
- else
- AC_MSG_RESULT([same])
- fi
- ac_cv_host_system_type="$host"
- ac_cv_build_system_type="$build"
- ac_cv_target_system_type="$target"
-])
-
dnl Check for socklen_t: historically on BSD it is an int, and in
dnl POSIX 1g it is a type of its own, but some platforms use different
dnl types for the argument to getsockopt, getpeername, etc. So we
@@ -67,26 +43,3 @@ AC_DEFUN([TYPE_SOCKLEN_T],
[#include <sys/types.h>
#include <sys/socket.h>])
])
-
-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
-])
diff --git a/m4/validate_cache_system_type.m4 b/m4/validate_cache_system_type.m4
new file mode 100644
index 00000000..dcb3b547
--- /dev/null
+++ b/m4/validate_cache_system_type.m4
@@ -0,0 +1,23 @@
+dnl AC_VALIDATE_CACHE_SYSTEM_TYPE[(cmd)]
+dnl if the cache file is inconsistent with the current host,
+dnl target and build system types, execute CMD or print a default
+dnl error message.
+AC_DEFUN([AC_VALIDATE_CACHE_SYSTEM_TYPE], [
+ AC_REQUIRE([AC_CANONICAL_SYSTEM])
+ AC_MSG_CHECKING([config.cache system type])
+ if { test x"${ac_cv_host_system_type+set}" = x"set" &&
+ test x"$ac_cv_host_system_type" != x"$host"; } ||
+ { test x"${ac_cv_build_system_type+set}" = x"set" &&
+ test x"$ac_cv_build_system_type" != x"$build"; } ||
+ { test x"${ac_cv_target_system_type+set}" = x"set" &&
+ test x"$ac_cv_target_system_type" != x"$target"; }; then
+ AC_MSG_RESULT([different])
+ ifelse($#, 1, [$1],
+ [AC_MSG_ERROR(["you must remove config.cache and restart configure"])])
+ else
+ AC_MSG_RESULT([same])
+ fi
+ ac_cv_host_system_type="$host"
+ ac_cv_build_system_type="$build"
+ ac_cv_target_system_type="$target"
+])