diff options
Diffstat (limited to 'sntp/libopts/m4/libopts.m4')
| -rw-r--r-- | sntp/libopts/m4/libopts.m4 | 243 |
1 files changed, 158 insertions, 85 deletions
diff --git a/sntp/libopts/m4/libopts.m4 b/sntp/libopts/m4/libopts.m4 index adc3235d25d3..7a52b5e33dbd 100644 --- a/sntp/libopts/m4/libopts.m4 +++ b/sntp/libopts/m4/libopts.m4 @@ -2,30 +2,52 @@ dnl -*- buffer-read-only: t -*- vi: set ro: dnl dnl DO NOT EDIT THIS FILE (libopts.m4) dnl -dnl It has been AutoGen-ed Saturday May 5, 2007 at 12:02:37 PM PDT +dnl It has been AutoGen-ed April 29, 2011 at 03:43:56 PM by AutoGen 5.11.9 dnl From the definitions libopts.def dnl and the template file conftest.tpl dnl dnl do always before generated macros: dnl AC_DEFUN([INVOKE_LIBOPTS_MACROS_FIRST],[ -[if test X${INVOKE_LIBOPTS_MACROS_FIRST_done} != Xyes ; then] - # ================= - # AC_HEADER_STDC - # ================= - AC_HEADER_STDC - # ================= - # AC_HEADER_DIRENT - # ================= + AC_REQUIRE([AC_HEADER_STDC]) AC_HEADER_DIRENT # ================= # AC_CHECK_HEADERS # ================= - AC_CHECK_HEADERS(dlfcn.h errno.h fcntl.h libgen.h memory.h netinet/in.h \ - setjmp.h sys/mman.h sys/param.h sys/poll.h sys/procset.h sys/select.h \ - sys/socket.h sys/stropts.h sys/time.h sys/un.h sys/wait.h unistd.h \ - utime.h sysexits.h) + AC_CHECK_HEADERS([ \ + dlfcn.h errno.h fcntl.h libgen.h \ + memory.h netinet/in.h setjmp.h sys/mman.h \ + sys/param.h sys/poll.h sys/procset.h sys/select.h \ + sys/socket.h sys/stropts.h sys/time.h sys/un.h \ + sys/wait.h unistd.h utime.h sysexits.h ]) + + AC_CHECK_HEADERS([stdarg.h varargs.h], + [lo_have_arg_hdr=true;break], + [lo_have_arg_hdr=false]) + + AC_CHECK_HEADERS([string.h strings.h], + [lo_have_str_hdr=true;break], + [lo_have_str_hdr=false]) + + AC_CHECK_HEADERS([limits.h sys/limits.h values.h], + [lo_have_lim_hdr=true;break], + [lo_have_lim_hdr=false]) + + AC_CHECK_HEADERS([inttypes.h stdint.h], + [lo_have_typ_hdr=true;break], + [lo_have_typ_hdr=false]) + + # ---------------------------------------------------------------------- + # check for various programs used during the build. + # On OS/X, "wchar.h" needs "runetype.h" to work properly. + # ---------------------------------------------------------------------- + AC_CHECK_HEADERS([runetype.h wchar.h], [], [],[ + AC_INCLUDES_DEFAULT + #if HAVE_RUNETYPE_H + # include <runetype.h> + #endif + ]) # -------------------------------------------- # Verify certain entries from AC_CHECK_HEADERS @@ -33,51 +55,46 @@ AC_DEFUN([INVOKE_LIBOPTS_MACROS_FIRST],[ [for f in sys_types sys_mman sys_param sys_stat sys_wait \ string errno stdlib memory setjmp do eval as_ac_var=\${ac_cv_header_${f}_h+set} - test "${as_ac_var}" = set] || \ - AC_MSG_ERROR([You must have ${f}.h on your system]) + test "${as_ac_var}" = set || { + ]AC_MSG_ERROR([You must have ${f}.h on your system])[ + } done - # ================================================ - # AC_CHECK_HEADERS: stdarg.h is present define HAVE_STDARG_H, otherwise - # if varargs.h is present define HAVE_VARARGS_H. - # ================================================ - AC_CHECK_HEADERS(stdarg.h varargs.h, break) - [if test `eval echo '${'$as_ac_Header'}'` != yes; then] - AC_MSG_ERROR([You must have stdarg.h or varargs.h on your system]) - fi + ${lo_have_arg_hdr} || \ + ]AC_MSG_ERROR([You must have stdarg.h or varargs.h on your system])[ - # ================================================ - # Similarly for the string.h and strings.h headers - # ================================================ - AC_CHECK_HEADERS(string.h strings.h, break) - [if test `eval echo '${'$as_ac_Header'}'` != yes; then] - AC_MSG_ERROR([You must have string.h or strings.h on your system]) - fi + ${lo_have_str_hdr} || \ + ]AC_MSG_ERROR([You must have string.h or strings.h on your system])[ - # ===================== - # ...and limits headers - # ===================== - AC_CHECK_HEADERS(limits.h sys/limits.h values.h, break) - [if test `eval echo '${'$as_ac_Header'}'` != yes; then] - AC_MSG_ERROR([You must have one of limits.h, sys/limits.h or values.h]) - fi + ${lo_have_lim_hdr} || \ + ]AC_MSG_ERROR( + [You must have one of limits.h, sys/limits.h or values.h])[ - # ======================== - # ...and int types headers - # ======================== - AC_CHECK_HEADERS(stdint.h inttypes.h, break) + ${lo_have_typ_hdr} || \ + ]AC_MSG_ERROR([You must have inttypes.h or stdint.h on your system]) + + # ---------------------------------------------------------------------- + # Checks for typedefs + # ---------------------------------------------------------------------- + AC_CHECK_TYPES(wchar_t) + AC_CHECK_TYPES(wint_t, [], [], [ + AC_INCLUDES_DEFAULT + #if HAVE_RUNETYPE_H + # include <runetype.h> + #endif + #if HAVE_WCHAR_H + # include <wchar.h> + #endif + ]) AC_CHECK_TYPES([int8_t, uint8_t, int16_t, uint16_t, int32_t, uint32_t, - intptr_t, uint_t]) + intptr_t, uintptr_t, uint_t, pid_t, size_t]) - # ==================== - # uintptr type & sizes - # ==================== - AC_CHECK_TYPES([uintptr_t], , - [AC_DEFINE([uintptr_t], unsigned long, - [Alternate uintptr_t for systems without it.])]) - AC_CHECK_SIZEOF(char*, 4) + # ===== + # sizes + # ===== + AC_CHECK_SIZEOF(char*, 8) AC_CHECK_SIZEOF(int, 4) - AC_CHECK_SIZEOF(long, 4) + AC_CHECK_SIZEOF(long, 8) AC_CHECK_SIZEOF(short, 2) # ---------------------------------------------------------------------- @@ -85,9 +102,29 @@ AC_DEFUN([INVOKE_LIBOPTS_MACROS_FIRST],[ # ---------------------------------------------------------------------- AC_CHECK_LIB(gen, pathfind) AC_FUNC_VPRINTF - AC_CHECK_FUNCS([mmap canonicalize_file_name snprintf strdup strchr strrchr]) -[ INVOKE_LIBOPTS_MACROS_FIRST_done=yes -fi]]) + AC_FUNC_FORK + AC_CHECK_FUNCS([mmap canonicalize_file_name snprintf strdup strchr \ + strrchr strsignal]) + AC_PROG_SED + [while : + do + POSIX_SHELL=`which bash` + test -x "$POSIX_SHELL" && break + POSIX_SHELL=`which dash` + test -x "$POSIX_SHELL" && break + POSIX_SHELL=/usr/xpg4/bin/sh + test -x "$POSIX_SHELL" && break + POSIX_SHELL=`/bin/sh -c ' + exec 2>/dev/null + if ! true ; then exit 1 ; fi + echo /bin/sh'` + test -x "$POSIX_SHELL" && break + ]AC_ERROR([Cannot locate a working POSIX shell])[ + done] + AC_DEFINE_UNQUOTED([POSIX_SHELL], ["${POSIX_SHELL}"], + [define to a working POSIX compliant shell]) + AC_SUBST([POSIX_SHELL]) +]) dnl dnl @synopsis INVOKE_LIBOPTS_MACROS @@ -97,12 +134,11 @@ dnl that have not been disabled with "omit-invocation". dnl AC_DEFUN([LIBOPTS_WITH_REGEX_HEADER],[ AC_ARG_WITH([regex-header], - AC_HELP_STRING([--with-regex-header], [a reg expr header is specified]), + AS_HELP_STRING([--with-regex-header], [a reg expr header is specified]), [libopts_cv_with_regex_header=${with_regex_header}], AC_CACHE_CHECK([whether a reg expr header is specified], libopts_cv_with_regex_header, libopts_cv_with_regex_header=no) ) # end of AC_ARG_WITH - if test "X${libopts_cv_with_regex_header}" != Xno then AC_DEFINE_UNQUOTED([REGEX_HEADER],[<${libopts_cv_with_regex_header}>]) @@ -115,13 +151,13 @@ AC_DEFUN([LIBOPTS_WITH_REGEX_HEADER],[ AC_DEFUN([LIBOPTS_WITHLIB_REGEX],[ AC_ARG_WITH([libregex], - AC_HELP_STRING([--with-libregex], [libregex installation prefix]), + AS_HELP_STRING([--with-libregex], [libregex installation prefix]), [libopts_cv_with_libregex_root=${with_libregex}], AC_CACHE_CHECK([whether with-libregex was specified], libopts_cv_with_libregex_root, libopts_cv_with_libregex_root=no) ) # end of AC_ARG_WITH libregex - if test "${with_libguile+set}" = set && \ + if test "${with_libregex+set}" = set && \ test "${withval}" = no then ## disabled by request libopts_cv_with_libregex_root=no @@ -130,14 +166,14 @@ AC_DEFUN([LIBOPTS_WITHLIB_REGEX],[ else AC_ARG_WITH([libregex-cflags], - AC_HELP_STRING([--with-libregex-cflags], [libregex compile flags]), + AS_HELP_STRING([--with-libregex-cflags], [libregex compile flags]), [libopts_cv_with_libregex_cflags=${with_regex_cflags}], AC_CACHE_CHECK([whether with-libregex-cflags was specified], libopts_cv_with_libregex_cflags, libopts_cv_with_libregex_cflags=no) ) # end of AC_ARG_WITH libregex-cflags AC_ARG_WITH([libregex-libs], - AC_HELP_STRING([--with-libregex-libs], [libregex link command arguments]), + AS_HELP_STRING([--with-libregex-libs], [libregex link command arguments]), [libopts_cv_with_libregex_libs=${with_regex_libs}], AC_CACHE_CHECK([whether with-libregex-libs was specified], libopts_cv_with_libregex_libs, libopts_cv_with_libregex_libs=no) @@ -200,7 +236,6 @@ int main() { [libopts_cv_with_libregex=no]) # end of AC_TRY_RUN ]) # end of AC_CACHE_VAL for libopts_cv_with_libregex AC_MSG_RESULT([${libopts_cv_with_libregex}]) - if test "X${libopts_cv_with_libregex}" != Xno then AC_DEFINE([WITH_LIBREGEX],[1], @@ -226,7 +261,6 @@ int main (int argc, char** argv) { ) # end of TRY_RUN ]) # end of AC_CACHE_VAL for libopts_cv_run_pathfind AC_MSG_RESULT([${libopts_cv_run_pathfind}]) - if test "X${libopts_cv_run_pathfind}" != Xno then AC_DEFINE([HAVE_PATHFIND],[1], @@ -243,14 +277,11 @@ AC_DEFUN([LIBOPTS_TEST_DEV_ZERO],[ dzero=\`ls -lL /dev/zero | egrep ^c......r\` test -z "${dzero}" && exit 1 echo ${dzero}` - if test $? -ne 0 - then libopts_cv_test_dev_zero=no - elif test -z "$libopts_cv_test_dev_zero" + if test $? -ne 0 || test -z "$libopts_cv_test_dev_zero" then libopts_cv_test_dev_zero=no fi ]) # end of CACHE_VAL of libopts_cv_test_dev_zero AC_MSG_RESULT([${libopts_cv_test_dev_zero}]) - if test "X${libopts_cv_test_dev_zero}" != Xno then AC_DEFINE([HAVE_DEV_ZERO],[1], @@ -278,7 +309,6 @@ choke me!! ) # end of TRY_RUN ]) # end of AC_CACHE_VAL for libopts_cv_run_realpath AC_MSG_RESULT([${libopts_cv_run_realpath}]) - if test "X${libopts_cv_run_realpath}" != Xno then AC_DEFINE([HAVE_REALPATH],[1], @@ -312,7 +342,6 @@ int main() { ) # end of TRY_RUN ]) # end of AC_CACHE_VAL for libopts_cv_run_strftime AC_MSG_RESULT([${libopts_cv_run_strftime}]) - if test "X${libopts_cv_run_strftime}" != Xno then AC_DEFINE([HAVE_STRFTIME],[1], @@ -333,7 +362,6 @@ return (fp == NULL) ? 1 : fclose(fp); }], ) # end of TRY_RUN ]) # end of AC_CACHE_VAL for libopts_cv_run_fopen_binary AC_MSG_RESULT([${libopts_cv_run_fopen_binary}]) - if test "X${libopts_cv_run_fopen_binary}" != Xno then AC_DEFINE([FOPEN_BINARY_FLAG],"b", @@ -357,7 +385,6 @@ return (fp == NULL) ? 1 : fclose(fp); }], ) # end of TRY_RUN ]) # end of AC_CACHE_VAL for libopts_cv_run_fopen_text AC_MSG_RESULT([${libopts_cv_run_fopen_text}]) - if test "X${libopts_cv_run_fopen_text}" != Xno then AC_DEFINE([FOPEN_TEXT_FLAG],"t", @@ -372,12 +399,11 @@ return (fp == NULL) ? 1 : fclose(fp); }], AC_DEFUN([LIBOPTS_DISABLE_OPTIONAL_ARGS],[ AC_ARG_ENABLE([optional-args], - AC_HELP_STRING([--disable-optional-args], [not wanting optional option args]), + AS_HELP_STRING([--disable-optional-args], [not wanting optional option args]), [libopts_cv_enable_optional_args=${enable_optional_args}], AC_CACHE_CHECK([whether not wanting optional option args], libopts_cv_enable_optional_args, libopts_cv_enable_optional_args=yes) ) # end of AC_ARG_ENABLE - if test "X${libopts_cv_enable_optional_args}" = Xno then AC_DEFINE([NO_OPTIONAL_OPT_ARGS], [1], @@ -388,7 +414,7 @@ AC_DEFUN([LIBOPTS_DISABLE_OPTIONAL_ARGS],[ AC_DEFUN([INVOKE_LIBOPTS_MACROS],[ - INVOKE_LIBOPTS_MACROS_FIRST + AC_REQUIRE([INVOKE_LIBOPTS_MACROS_FIRST]) # Check to see if a reg expr header is specified. LIBOPTS_WITH_REGEX_HEADER @@ -420,21 +446,36 @@ AC_DEFUN([INVOKE_LIBOPTS_MACROS],[ dnl @synopsis LIBOPTS_CHECK dnl -dnl Time-stamp: "2006-09-23 19:36:24 bkorb" -dnl Last Committed: $Date: 2006/09/24 02:59:00 $ +dnl Time-stamp: "2010-11-29 15:45:54 bkorb" dnl dnl If autoopts-config works, add the linking information to LIBS. dnl Otherwise, add ``libopts-${ao_rev}'' to SUBDIRS and run all dnl the config tests that the library needs. Invoke the dnl "INVOKE_LIBOPTS_MACROS" macro iff we are building libopts. dnl +dnl This file is part of AutoGen. +dnl AutoGen Copyright (c) 1992-2011 by Bruce Korb - all rights reserved +dnl +dnl AutoGen is free software: you can redistribute it and/or modify it +dnl under the terms of the GNU General Public License as published by the +dnl Free Software Foundation, either version 3 of the License, or +dnl (at your option) any later version. +dnl +dnl AutoGen is distributed in the hope that it will be useful, but +dnl WITHOUT ANY WARRANTY; without even the implied warranty of +dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +dnl See the GNU General Public License for more details. +dnl +dnl You should have received a copy of the GNU General Public License along +dnl with this program. If not, see <http://www.gnu.org/licenses/>. +dnl dnl Default to system libopts dnl -AC_DEFUN([LIBOPTS_CHECK],[ +AC_DEFUN([LIBOPTS_CHECK_COMMON],[ + AC_REQUIRE([INVOKE_LIBOPTS_MACROS_FIRST]) [NEED_LIBOPTS_DIR=''] m4_pushdef([AO_Libopts_Dir], [ifelse($1, , [libopts], [$1])]) - AC_SUBST(LIBOPTS_DIR, AO_Libopts_Dir) AC_ARG_ENABLE([local-libopts], AC_HELP_STRING([--enable-local-libopts], [Force using the supplied libopts tearoff code]),[ @@ -491,19 +532,51 @@ AC_DEFUN([LIBOPTS_CHECK],[ LIBOPTS_CFLAGS='-I$(top_srcdir)/]AO_Libopts_Dir[' NEED_LIBOPTS_DIR=true fi - fi # end of if test -z "${NEED_LIBOPTS_DIR}"] - + fi # end of if test -z "${NEED_LIBOPTS_DIR}" + if test -n "${LIBOPTS_BUILD_BLOCKED}" ; then + NEED_LIBOPTS_DIR='' + fi] AM_CONDITIONAL([NEED_LIBOPTS], [test -n "${NEED_LIBOPTS_DIR}"]) AC_SUBST(LIBOPTS_LDADD) AC_SUBST(LIBOPTS_CFLAGS) AC_SUBST(LIBOPTS_DIR, AO_Libopts_Dir) - AC_CONFIG_FILES(AO_Libopts_Dir/Makefile) m4_popdef([AO_Libopts_Dir]) - - [if test -n "${NEED_LIBOPTS_DIR}" ; then] +[# end of AC_DEFUN of LIBOPTS_CHECK_COMMON] +]) +dnl AC_CONFIG_FILES conditionalization requires using AM_COND_IF, however +dnl AM_COND_IF is new to Automake 1.11. To use it on new Automake without +dnl requiring same, a fallback implementation for older Automake is provided. +dnl Note that disabling of AC_CONFIG_FILES requires Automake 1.11, this code +dnl is correct only in terms of m4sh generated script. +m4_ifndef([AM_COND_IF], [AC_DEFUN([AM_COND_IF], [ +if test -z "$$1_TRUE"; then : + m4_n([$2])[]dnl +m4_ifval([$3], +[else + $3 +])dnl +fi[]dnl +])]) +dnl +AC_DEFUN([LIBOPTS_CHECK_NOBUILD], [ + m4_pushdef([AO_Libopts_Dir], + [ifelse($1, , [libopts], [$1])]) + LIBOPTS_BUILD_BLOCKED=true + LIBOPTS_CHECK_COMMON(AO_Libopts_Dir) + m4_popdef([AO_Libopts_Dir])dnl +# end of AC_DEFUN of LIBOPTS_CHECK_NOBUILD +]) +dnl +AC_DEFUN([LIBOPTS_CHECK], [ + m4_pushdef([AO_Libopts_Dir], + [ifelse($1, , [libopts], [$1])]) + LIBOPTS_BUILD_BLOCKED='' + LIBOPTS_CHECK_COMMON(AO_Libopts_Dir) + AM_COND_IF([NEED_LIBOPTS], [ INVOKE_LIBOPTS_MACROS - else - INVOKE_LIBOPTS_MACROS_FIRST - [fi -# end of AC_DEFUN of LIBOPTS_CHECK] + AC_CONFIG_FILES(AO_Libopts_Dir/Makefile) + ])dnl + m4_popdef([AO_Libopts_Dir])dnl +# end of AC_DEFUN of LIBOPTS_CHECK ]) + |
