123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487 |
- 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 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
- 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]),
- [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}>])
- else
- AC_DEFINE([REGEX_HEADER],[<regex.h>],[name of regex header file])
- fi
-
- ]) # end of AC_DEFUN of LIBOPTS_WITH_REGEX_HEADER
- AC_DEFUN([LIBOPTS_WITHLIB_REGEX],[
- AC_ARG_WITH([libregex],
- AC_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 && \
- test "${withval}" = no
- then ## disabled by request
- libopts_cv_with_libregex_root=no
- libopts_cv_with_libregex_cflags=no
- libopts_cv_with_libregex_libs=no
- else
- AC_ARG_WITH([libregex-cflags],
- AC_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]),
- [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)
- ) # end of AC_ARG_WITH libregex-libs
- case "X${libopts_cv_with_libregex_cflags}" in
- Xyes|Xno|X )
- case "X${libopts_cv_with_libregex_root}" in
- Xyes|Xno|X ) libopts_cv_with_libregex_cflags=no ;;
- * ) libopts_cv_with_libregex_cflags=-I${libopts_cv_with_libregex_root}/include ;;
- esac
- esac
- case "X${libopts_cv_with_libregex_libs}" in
- Xyes|Xno|X )
- case "X${libopts_cv_with_libregex_root}" in
- Xyes|Xno|X ) libopts_cv_with_libregex_libs=no ;;
- * ) libopts_cv_with_libregex_libs="-L${libopts_cv_with_libregex_root}/lib -lregex";;
- esac
- esac
- libopts_save_CPPFLAGS="${CPPFLAGS}"
- libopts_save_LIBS="${LIBS}"
- fi ## disabled by request
- case "X${libopts_cv_with_libregex_cflags}" in
- Xyes|Xno|X )
- libopts_cv_with_libregex_cflags="" ;;
- * ) CPPFLAGS="${CPPFLAGS} ${libopts_cv_with_libregex_cflags}" ;;
- esac
- case "X${libopts_cv_with_libregex_libs}" in
- Xyes|Xno|X )
- libopts_cv_with_libregex_libs="" ;;
- * )
- LIBS="${LIBS} ${libopts_cv_with_libregex_libs}" ;;
- esac
- LIBREGEX_CFLAGS=""
- LIBREGEX_LIBS=""
- AC_MSG_CHECKING([whether libregex functions properly])
- AC_CACHE_VAL([libopts_cv_with_libregex],[
- AC_TRY_RUN([@%:@include <stdio.h>
- @%:@include <stdlib.h>
- @%:@include <sys/types.h>
- @%:@include REGEX_HEADER
- static regex_t re;
- void comp_re( const char* pzPat ) {
- int res = regcomp( &re, pzPat, REG_EXTENDED|REG_ICASE|REG_NEWLINE );
- if (res == 0) return;
- exit( res ); }
- int main() {
- regmatch_t m@<:@2@:>@;
- comp_re( "^.*\@S|@" );
- comp_re( "()|no.*" );
- comp_re( "." );
- if (regexec( &re, "X", 2, m, 0 ) != 0) return 1;
- if ((m@<:@0@:>@.rm_so != 0) || (m@<:@0@:>@.rm_eo != 1)) {
- fputs( "error: regex -->.<-- did not match\n", stderr );
- return 1;
- }
- return 0; }],
- [libopts_cv_with_libregex=yes], [libopts_cv_with_libregex=no],
- [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
- CPPFLAGS="${libopts_save_CPPFLAGS}"
- LIBS="${libopts_save_LIBS}"
- cat >&2 <<'_EOF_'
- I cannot detect POSIX compliant regcomp/regexec routines.
- These are required for AutoGen to work correctly. If you have
- such a library present on your system, you must specify it by
- setting the LIBS environment variable, e.g., "LIBS='-lregex'".
- If you do not have such a library on your system, then you should
- download and install, for example, the one from:
- ftp://ftp.gnu.org/gnu/rx/
- _EOF_
- AC_MSG_ERROR([Cannot find working POSIX regex library])
- fi
-
- ]) # end of AC_DEFUN of LIBOPTS_WITHLIB_REGEX
- AC_DEFUN([LIBOPTS_RUN_PATHFIND],[
- AC_MSG_CHECKING([whether pathfind(3) works])
- AC_CACHE_VAL([libopts_cv_run_pathfind],[
- AC_TRY_RUN([@%:@include <string.h>
- @%:@include <stdlib.h>
- int main (int argc, char** argv) {
- char* pz = pathfind( getenv( "PATH" ), "sh", "x" );
- return (pz == 0) ? 1 : 0;
- }],
- [libopts_cv_run_pathfind=yes],[libopts_cv_run_pathfind=no],[libopts_cv_run_pathfind=no]
- ) # 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],
- [Define this if pathfind(3) works])
- fi
-
- ]) # 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],[
- AC_TRY_RUN([@%:@include <time.h>
- @%:@include <string.h>
- char t_buf@<:@ 64 @:>@;
- int main() {
- static const char z@<:@@:>@ = "Thursday Aug 28 240";
- struct tm tm;
- tm.tm_sec = 36; /* seconds after the minute @<:@0, 61@:>@ */
- tm.tm_min = 44; /* minutes after the hour @<:@0, 59@:>@ */
- tm.tm_hour = 12; /* hour since midnight @<:@0, 23@:>@ */
- tm.tm_mday = 28; /* day of the month @<:@1, 31@:>@ */
- tm.tm_mon = 7; /* months since January @<:@0, 11@:>@ */
- tm.tm_year = 86; /* years since 1900 */
- tm.tm_wday = 4; /* days since Sunday @<:@0, 6@:>@ */
- tm.tm_yday = 239; /* days since January 1 @<:@0, 365@:>@ */
- tm.tm_isdst = 1; /* flag for daylight savings time */
- strftime( t_buf, sizeof( t_buf ), "%A %b %d %j", &tm );
- return (strcmp( t_buf, z ) != 0); }],
- [libopts_cv_run_strftime=yes],[libopts_cv_run_strftime=no],[libopts_cv_run_strftime=no]
- ) # 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],
- [Define this if strftime() works])
- fi
-
- ]) # end of AC_DEFUN of LIBOPTS_RUN_STRFTIME
- AC_DEFUN([LIBOPTS_RUN_FOPEN_BINARY],[
- AC_MSG_CHECKING([whether fopen accepts "b" mode])
- AC_CACHE_VAL([libopts_cv_run_fopen_binary],[
- AC_TRY_RUN([@%:@include <stdio.h>
- int main (int argc, char** argv) {
- FILE* fp = fopen("conftest.@S|@ac_ext", "rb");
- return (fp == NULL) ? 1 : fclose(fp); }],
- [libopts_cv_run_fopen_binary=yes],[libopts_cv_run_fopen_binary=no],[libopts_cv_run_fopen_binary=no]
- ) # 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",
- [fopen(3) accepts a 'b' in the mode flag])
- else
- AC_DEFINE([FOPEN_BINARY_FLAG],"",
- [fopen(3) accepts a 'b' in the mode flag])
- fi
-
- ]) # end of AC_DEFUN of LIBOPTS_RUN_FOPEN_BINARY
- AC_DEFUN([LIBOPTS_RUN_FOPEN_TEXT],[
- AC_MSG_CHECKING([whether fopen accepts "t" mode])
- AC_CACHE_VAL([libopts_cv_run_fopen_text],[
- AC_TRY_RUN([@%:@include <stdio.h>
- int main (int argc, char** argv) {
- FILE* fp = fopen("conftest.@S|@ac_ext", "rt");
- return (fp == NULL) ? 1 : fclose(fp); }],
- [libopts_cv_run_fopen_text=yes],[libopts_cv_run_fopen_text=no],[libopts_cv_run_fopen_text=no]
- ) # 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",
- [fopen(3) accepts a 't' in the mode flag])
- else
- AC_DEFINE([FOPEN_TEXT_FLAG],"",
- [fopen(3) accepts a 't' in the mode flag])
- fi
-
- ]) # end of AC_DEFUN of LIBOPTS_RUN_FOPEN_TEXT
- AC_DEFUN([INVOKE_LIBOPTS_MACROS],[
- INVOKE_LIBOPTS_MACROS_FIRST
- # Check to see if a reg expr header is specified.
- LIBOPTS_WITH_REGEX_HEADER
- # Check to see if a working libregex can be found.
- LIBOPTS_WITHLIB_REGEX
- # 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
- # Check to see if fopen accepts "b" mode.
- LIBOPTS_RUN_FOPEN_BINARY
- # Check to see if fopen accepts "t" mode.
- LIBOPTS_RUN_FOPEN_TEXT
- ]) # 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_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
- 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)/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_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]
- ])
|