|
@@ -2,10 +2,93 @@ dnl -*- buffer-read-only: t -*- vi: set ro:
|
|
|
dnl
|
|
|
dnl DO NOT EDIT THIS FILE (libopts.m4)
|
|
|
dnl
|
|
|
-dnl It has been AutoGen-ed Sunday April 17, 2005 at 11:55:00 AM PDT
|
|
|
+dnl It has been AutoGen-ed Sunday April 9, 2006 at 11:49:18 AM PDT
|
|
|
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_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)
|
|
|
+
|
|
|
+ # --------------------------------------------
|
|
|
+ # Verify certain entries from AC_CHECK_HEADERS
|
|
|
+ # --------------------------------------------
|
|
|
+ [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])
|
|
|
+ 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
|
|
|
+
|
|
|
+ # ================================================
|
|
|
+ # 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
|
|
|
+
|
|
|
+ # =====================
|
|
|
+ # ...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
|
|
|
+
|
|
|
+ # ========================
|
|
|
+ # ...and int types headers
|
|
|
+ # ========================
|
|
|
+ AC_CHECK_HEADERS(stdint.h inttypes.h, break)
|
|
|
+ AC_CHECK_TYPES([int8_t, uint8_t, int16_t, uint16_t, int32_t, uint32_t,
|
|
|
+ intptr_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)
|
|
|
+ AC_CHECK_SIZEOF(int, 4)
|
|
|
+ AC_CHECK_SIZEOF(long, 4)
|
|
|
+ AC_CHECK_SIZEOF(short, 2)
|
|
|
+
|
|
|
+ # ----------------------------------------------------------------------
|
|
|
+ # AC_CHECK_LIB for SVR4 libgen, and use it if it defines pathfind.
|
|
|
+ # ----------------------------------------------------------------------
|
|
|
+ AC_CHECK_LIB(gen, pathfind)
|
|
|
+ AC_FUNC_VPRINTF
|
|
|
+ AC_CHECK_FUNCS([mmap canonicalize_file_name snprintf strdup])
|
|
|
+[ INVOKE_LIBOPTS_MACROS_FIRST_done=yes
|
|
|
+fi]])
|
|
|
+
|
|
|
+dnl
|
|
|
dnl @synopsis INVOKE_LIBOPTS_MACROS
|
|
|
dnl
|
|
|
dnl This macro will invoke the AutoConf macros specified in libopts.def
|
|
@@ -159,6 +242,58 @@ int main (int argc, char** argv) {
|
|
|
]) # end of AC_DEFUN of LIBOPTS_RUN_PATHFIND
|
|
|
|
|
|
|
|
|
+AC_DEFUN([LIBOPTS_TEST_DEV_ZERO],[
|
|
|
+ AC_MSG_CHECKING([whether /dev/zero is readable device])
|
|
|
+ AC_CACHE_VAL([libopts_cv_test_dev_zero],[
|
|
|
+ libopts_cv_test_dev_zero=`exec 2> /dev/null
|
|
|
+dzero=\`ls -l /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"
|
|
|
+ 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],
|
|
|
+ [Define this if /dev/zero is readable device])
|
|
|
+ fi
|
|
|
+
|
|
|
+]) # end of AC_DEFUN of LIBOPTS_TEST_DEV_ZERO
|
|
|
+
|
|
|
+
|
|
|
+AC_DEFUN([LIBOPTS_RUN_REALPATH],[
|
|
|
+ AC_MSG_CHECKING([whether we have a functional realpath(3C)])
|
|
|
+ AC_CACHE_VAL([libopts_cv_run_realpath],[
|
|
|
+ AC_TRY_RUN([@%:@include <limits.h>
|
|
|
+@%:@include <stdlib.h>
|
|
|
+int main (int argc, char** argv) {
|
|
|
+@%:@ifndef PATH_MAX
|
|
|
+choke me!!
|
|
|
+@%:@else
|
|
|
+ char zPath@<:@PATH_MAX+1@:>@;
|
|
|
+@%:@endif
|
|
|
+ char *pz = realpath(argv@<:@0@:>@, zPath);
|
|
|
+ return (pz == zPath) ? 0 : 1;
|
|
|
+}],
|
|
|
+ [libopts_cv_run_realpath=yes],[libopts_cv_run_realpath=no],[libopts_cv_run_realpath=no]
|
|
|
+ ) # 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],
|
|
|
+ [Define this if we have a functional realpath(3C)])
|
|
|
+ fi
|
|
|
+
|
|
|
+]) # end of AC_DEFUN of LIBOPTS_RUN_REALPATH
|
|
|
+
|
|
|
+
|
|
|
AC_DEFUN([LIBOPTS_RUN_STRFTIME],[
|
|
|
AC_MSG_CHECKING([whether strftime() works])
|
|
|
AC_CACHE_VAL([libopts_cv_run_strftime],[
|
|
@@ -242,6 +377,7 @@ return (fp == NULL) ? 1 : fclose(fp); }],
|
|
|
|
|
|
|
|
|
AC_DEFUN([INVOKE_LIBOPTS_MACROS],[
|
|
|
+ INVOKE_LIBOPTS_MACROS_FIRST
|
|
|
# Check to see if a reg expr header is specified.
|
|
|
LIBOPTS_WITH_REGEX_HEADER
|
|
|
|
|
@@ -251,6 +387,12 @@ AC_DEFUN([INVOKE_LIBOPTS_MACROS],[
|
|
|
# Check to see if pathfind(3) works.
|
|
|
LIBOPTS_RUN_PATHFIND
|
|
|
|
|
|
+ # Check to see if /dev/zero is readable device.
|
|
|
+ LIBOPTS_TEST_DEV_ZERO
|
|
|
+
|
|
|
+ # Check to see if we have a functional realpath(3C).
|
|
|
+ LIBOPTS_RUN_REALPATH
|
|
|
+
|
|
|
# Check to see if strftime() works.
|
|
|
LIBOPTS_RUN_STRFTIME
|
|
|
|
|
@@ -259,136 +401,87 @@ AC_DEFUN([INVOKE_LIBOPTS_MACROS],[
|
|
|
|
|
|
# Check to see if fopen accepts "t" mode.
|
|
|
LIBOPTS_RUN_FOPEN_TEXT
|
|
|
-
|
|
|
- # ----------------------------------------------------------------------
|
|
|
- # Check for standard headers.
|
|
|
- # ----------------------------------------------------------------------
|
|
|
- # =================
|
|
|
- # AC_HEADER_STDC
|
|
|
- # =================
|
|
|
- AC_HEADER_STDC
|
|
|
- # =================
|
|
|
- # AC_HEADER_DIRENT
|
|
|
- # =================
|
|
|
- AC_HEADER_DIRENT
|
|
|
-
|
|
|
- # ----------------------------------------------------------------------
|
|
|
- # AC_CHECK_HEADERS Check for list of 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)
|
|
|
-
|
|
|
- # --------------------------------------------
|
|
|
- # Verify certain entries from AC_CHECK_HEADERS
|
|
|
- # --------------------------------------------
|
|
|
- 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])
|
|
|
- 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
|
|
|
-
|
|
|
- # =================
|
|
|
- # 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
|
|
|
-
|
|
|
- # =================
|
|
|
- # ...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
|
|
|
-
|
|
|
- # =================
|
|
|
- # ...and int types headers
|
|
|
- # =================
|
|
|
- AC_CHECK_HEADERS(stdint.h inttypes.h, break)
|
|
|
- if test `eval echo '${'$as_ac_Header'}'` != yes; then
|
|
|
- AC_MSG_ERROR([You must have stdint.h or inttypes.h on your system])
|
|
|
- fi
|
|
|
-
|
|
|
- # =================
|
|
|
- # ...and directory read headers
|
|
|
- # =================
|
|
|
- AC_CHECK_HEADERS(dirent.h ndir.h sys/ndir.h, break)
|
|
|
-
|
|
|
- # ----------------------------------------------------------------------
|
|
|
- # AC_CHECK_LIB for SVR4 libgen, and use it if it defines pathfind.
|
|
|
- # ----------------------------------------------------------------------
|
|
|
- AC_CHECK_LIB(gen, pathfind)
|
|
|
- AC_CHECK_FUNCS(mmap)
|
|
|
+
|
|
|
]) # end AC_DEFUN of INVOKE_LIBOPTS_MACROS
|
|
|
|
|
|
dnl @synopsis LIBOPTS_CHECK
|
|
|
dnl
|
|
|
dnl If autoopts-config works, add the linking information to LIBS.
|
|
|
-dnl Otherwise, add \`\`libopts-${AO_CURRENT}.${AO_REVISION}.${AO_AGE}''
|
|
|
-dnl to SUBDIRS and run all the config tests that the library needs.
|
|
|
+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 Default to system libopts
|
|
|
dnl
|
|
|
-
|
|
|
- dnl Default to system libopts
|
|
|
- NEED_LIBOPTS_DIR=''
|
|
|
-
|
|
|
AC_DEFUN([LIBOPTS_CHECK],[
|
|
|
+ [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]),
|
|
|
- [ if test x$enableval = xyes ; then
|
|
|
- AC_MSG_NOTICE([Using supplied libopts tearoff])
|
|
|
-LIBOPTS_LDADD='$(top_builddir)/libopts/libopts.la'
|
|
|
-LIBOPTS_CFLAGS='-I$(top_srcdir)/libopts'
|
|
|
-INVOKE_LIBOPTS_MACROS
|
|
|
-NEED_LIBOPTS_DIR=true
|
|
|
- fi])
|
|
|
-
|
|
|
- if test -z "${NEED_LIBOPTS_DIR}" ; then
|
|
|
- AC_MSG_CHECKING([whether autoopts-config can be found])
|
|
|
- AC_ARG_WITH([autoopts-config],
|
|
|
- AC_HELP_STRING([--with-autoopts-config],
|
|
|
- [specify the config-info script]),
|
|
|
- [lo_cv_with_autoopts_config=${with_autoopts_config}],
|
|
|
- AC_CACHE_CHECK([whether autoopts-config is specified],
|
|
|
- lo_cv_with_autoopts_config,
|
|
|
- lo_cv_with_autoopts_config=autoopts-config)
|
|
|
-) # end of AC_ARG_WITH
|
|
|
-AC_CACHE_VAL([lo_cv_test_autoopts],[
|
|
|
- aoconfig=${lo_cv_with_autoopts_config}
|
|
|
- lo_cv_test_autoopts=`${aoconfig} --libs` 2> /dev/null
|
|
|
- if test $? -ne 0 -o -z "${lo_cv_test_autoopts}"
|
|
|
-then lo_cv_test_autoopts=no ; fi
|
|
|
-]) # end of CACHE_VAL
|
|
|
-AC_MSG_RESULT([${lo_cv_test_autoopts}])
|
|
|
-
|
|
|
-if test "X${lo_cv_test_autoopts}" != Xno
|
|
|
-then
|
|
|
- LIBOPTS_LDADD="${lo_cv_test_autoopts}"
|
|
|
- LIBOPTS_CFLAGS="`${aoconfig} --cflags`"
|
|
|
-else
|
|
|
- LIBOPTS_LDADD='$(top_builddir)/libopts/libopts.la'
|
|
|
- LIBOPTS_CFLAGS='-I$(top_srcdir)/libopts'
|
|
|
- INVOKE_LIBOPTS_MACROS
|
|
|
- NEED_LIBOPTS_DIR=true
|
|
|
-fi
|
|
|
-
|
|
|
- fi # end of if test -z "${NEED_LIBOPTS_DIR}"
|
|
|
+ AC_HELP_STRING([--enable-local-libopts],
|
|
|
+ [Force using the supplied libopts tearoff code]),[
|
|
|
+ if test x$enableval = xyes ; then
|
|
|
+ AC_MSG_NOTICE([Using supplied libopts tearoff])
|
|
|
+ LIBOPTS_LDADD='$(top_builddir)/AO_Libopts_Dir/libopts.la'
|
|
|
+ LIBOPTS_CFLAGS='-I$(top_srcdir)/AO_Libopts_Dir'
|
|
|
+ NEED_LIBOPTS_DIR=true
|
|
|
+ fi])
|
|
|
+
|
|
|
+ [if test -z "${NEED_LIBOPTS_DIR}" ; then]
|
|
|
+ AC_MSG_CHECKING([whether autoopts-config can be found])
|
|
|
+ AC_ARG_WITH([autoopts-config],
|
|
|
+ AC_HELP_STRING([--with-autoopts-config],
|
|
|
+ [specify the config-info script]),
|
|
|
+ [lo_cv_with_autoopts_config=${with_autoopts_config}],
|
|
|
+ AC_CACHE_CHECK([whether autoopts-config is specified],
|
|
|
+ [lo_cv_with_autoopts_config],
|
|
|
+ [if autoopts-config --help 2>/dev/null 1>&2
|
|
|
+ then lo_cv_with_autoopts_config=autoopts-config
|
|
|
+ elif libopts-config --help 2>/dev/null 1>&2
|
|
|
+ then lo_cv_with_autoopts_config=libopts-config
|
|
|
+ else lo_cv_with_autoopts_config=no ; fi])
|
|
|
+ ) # end of AC_ARG_WITH
|
|
|
+
|
|
|
+ AC_CACHE_VAL([lo_cv_test_autoopts],[
|
|
|
+ if test -z "${lo_cv_with_autoopts_config}" \
|
|
|
+ -o X"${lo_cv_with_autoopts_config}" = Xno
|
|
|
+ then
|
|
|
+ if autoopts-config --help 2>/dev/null 1>&2
|
|
|
+ then lo_cv_with_autoopts_config=autoopts-config
|
|
|
+ elif libopts-config --help 2>/dev/null 1>&2
|
|
|
+ then lo_cv_with_autoopts_config=libopts-config
|
|
|
+ else lo_cv_with_autoopts_config=false ; fi
|
|
|
+ fi
|
|
|
+ lo_cv_test_autoopts=`
|
|
|
+ ${lo_cv_with_autoopts_config} --libs` 2> /dev/null
|
|
|
+ if test $? -ne 0 -o -z "${lo_cv_test_autoopts}"
|
|
|
+ then lo_cv_test_autoopts=no ; fi
|
|
|
+ ]) # end of CACHE_VAL
|
|
|
+ AC_MSG_RESULT([${lo_cv_test_autoopts}])
|
|
|
+
|
|
|
+ [if test "X${lo_cv_test_autoopts}" != Xno
|
|
|
+ then
|
|
|
+ LIBOPTS_LDADD="${lo_cv_test_autoopts}"
|
|
|
+ LIBOPTS_CFLAGS="`${lo_cv_with_autoopts_config} --cflags`"
|
|
|
+ else
|
|
|
+ LIBOPTS_LDADD='$(top_builddir)/]AO_Libopts_Dir[/libopts.la'
|
|
|
+ LIBOPTS_CFLAGS='-I$(top_srcdir)/]AO_Libopts_Dir['
|
|
|
+ NEED_LIBOPTS_DIR=true
|
|
|
+ fi
|
|
|
+ fi # end of if test -z "${NEED_LIBOPTS_DIR}"]
|
|
|
|
|
|
AM_CONDITIONAL([NEED_LIBOPTS], [test -n "${NEED_LIBOPTS_DIR}"])
|
|
|
AC_SUBST(LIBOPTS_LDADD)
|
|
|
AC_SUBST(LIBOPTS_CFLAGS)
|
|
|
- AC_CONFIG_FILES([libopts/Makefile])
|
|
|
-]) # end of AC_DEFUN of LIBOPTS_CHECK
|
|
|
+ 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]
|
|
|
+ INVOKE_LIBOPTS_MACROS
|
|
|
+ else
|
|
|
+ INVOKE_LIBOPTS_MACROS_FIRST
|
|
|
+ [fi
|
|
|
+# end of AC_DEFUN of LIBOPTS_CHECK]
|
|
|
+])
|