* m4: update directory

This commit is contained in:
Kevin Dalley 2000-04-05 08:09:48 +00:00
parent 73caeaa281
commit c0ad35e1cd
25 changed files with 316 additions and 245 deletions

View File

@ -1,13 +1,13 @@
#serial 1
#serial 2
dnl based on code from Eleftherios Gkioulekas
AC_DEFUN(jm_ASSERT,
[
AC_MSG_CHECKING(whether to enable assertions)
AC_ARG_ENABLE(assert,
[ --disable-assert turn off assertions],
[ AC_MSG_RESULT(no)
AC_DEFINE(NDEBUG) ],
[ AC_MSG_RESULT(yes) ]
[ --disable-assert turn off assertions],
[ AC_MSG_RESULT(no)
AC_DEFINE(NDEBUG,1,[Define to 1 if assertions should be disabled.]) ],
[ AC_MSG_RESULT(yes) ]
)
])

View File

@ -1,4 +1,4 @@
#serial 4
#serial 5
dnl This is just a wrapper function to encapsulate this kludge.
dnl Putting it in a separate file like this helps share it between
@ -24,15 +24,22 @@ AC_DEFUN(jm_CHECK_DECLS,
# include <unistd.h>
#endif
'
if test x = y; then
dnl This code is deliberately never run via ./configure.
dnl FIXME: this is a gross hack to make autoheader put entries
dnl for each of these symbols in the config.h.in.
dnl Otherwise, I'd have to update acconfig.h every time I change
dnl this list of functions.
AC_CHECK_FUNCS(DECL_FREE DECL_LSEEK DECL_MALLOC DECL_MEMCHR DECL_REALLOC \
DECL_STPCPY DECL_STRSTR)
AC_DEFINE(HAVE_DECL_FREE, 1, [Define if this function is declared.])
AC_DEFINE(HAVE_DECL_LSEEK, 1, [Define if this function is declared.])
AC_DEFINE(HAVE_DECL_MALLOC, 1, [Define if this function is declared.])
AC_DEFINE(HAVE_DECL_MEMCHR, 1, [Define if this function is declared.])
AC_DEFINE(HAVE_DECL_REALLOC, 1, [Define if this function is declared.])
AC_DEFINE(HAVE_DECL_STPCPY, 1, [Define if this function is declared.])
AC_DEFINE(HAVE_DECL_STRSTR, 1, [Define if this function is declared.])
fi
jm_CHECK_DECLARATIONS($headers, free lseek malloc \
memchr realloc stpcpy strstr)
])

View File

@ -1,13 +1,8 @@
#serial 1
#serial 2
dnl Determine whether to add fnmatch.o to LIBOBJS and to
dnl define fnmatch to rpl_fnmatch.
dnl
dnl If you use this macro in a package, you should
dnl add the following two lines to acconfig.h:
dnl /* Define to rpl_fnmatch if the replacement function should be used. */
dnl #undef fnmatch
dnl
AC_DEFUN(jm_FUNC_FNMATCH,
[
@ -15,7 +10,9 @@ AC_DEFUN(jm_FUNC_FNMATCH,
AC_FUNC_FNMATCH
if test $ac_cv_func_fnmatch_works = no \
&& test $ac_cv_gnu_library = no; then
LIBOBJS="$LIBOBJS fnmatch.o"
AC_DEFINE_UNQUOTED(fnmatch, rpl_fnmatch)
AC_SUBST(LIBOBJS)
LIBOBJS="$LIBOBJS fnmatch.$ac_objext"
AC_DEFINE_UNQUOTED(fnmatch, rpl_fnmatch,
[Define to rpl_fnmatch if the replacement function should be used.])
fi
])

View File

@ -1,4 +1,4 @@
#serial 1
#serial 2
dnl From Jim Meyering.
dnl
@ -25,18 +25,8 @@ AC_DEFUN(jm_FSTYPENAME,
)
if test $fu_cv_sys_f_fstypename_in_statfs = yes; then
if test x = y; then
# This code is deliberately never run via ./configure.
# FIXME: this is a hack to make autoheader put the corresponding
# HAVE_* undef for this symbol in config.h.in. This saves me the
# trouble of having to maintain the #undef in acconfig.h manually.
AC_CHECK_FUNCS(F_FSTYPENAME_IN_STATFS)
fi
# Defining it this way (rather than via AC_DEFINE) short-circuits the
# autoheader check -- autoheader doesn't know it's already been taken
# care of by the hack above.
ac_kludge=HAVE_F_FSTYPENAME_IN_STATFS
AC_DEFINE_UNQUOTED($ac_kludge)
AC_DEFINE_UNQUOTED(HAVE_F_FSTYPENAME_IN_STATFS, 1,
[Define if struct statfs has the f_fstypename member.])
fi
]
)

View File

@ -14,7 +14,7 @@ AC_DEFUN(AM_FUNC_GETLINE,
if test $am_getline_needs_run_time_check = yes; then
AC_CHECK_HEADERS(string.h)
AC_CACHE_CHECK([for working getline function], am_cv_func_working_getline,
[echo fooN |tr -d '\012'|tr N '\012' > conftestdata
[echo fooN |tr -d '\012'|tr N '\012' > conftest.data
AC_TRY_RUN([
# include <stdio.h>
# include <sys/types.h>
@ -26,7 +26,7 @@ AC_DEFUN(AM_FUNC_GETLINE,
char *line = NULL;
size_t siz = 0;
int len;
FILE *in = fopen ("./conftestdata", "r");
FILE *in = fopen ("./conftest.data", "r");
if (!in)
return 1;
len = getline (&line, &siz, in);
@ -38,8 +38,8 @@ AC_DEFUN(AM_FUNC_GETLINE,
)])
fi
if test $am_cv_func_working_getline = no; then
LIBOBJS="$LIBOBJS getline.o"
AC_SUBST(LIBOBJS)dnl
if test $am_cv_func_working_getline = yes; then
AC_DEFINE(HAVE_GETLINE, 1,
[Define if you have the GETLINE function.])dnl
fi
])

View File

@ -1,4 +1,4 @@
#serial 2
#serial 3
dnl From Paul Eggert.
@ -7,12 +7,6 @@ dnl From Paul Eggert.
AC_DEFUN(jm_AC_HEADER_INTTYPES_H,
[
if test x = y; then
dnl This code is deliberately never run via ./configure.
dnl FIXME: this is a gross hack to make autoheader put an entry
dnl for `HAVE_INTTYPES_H' in config.h.in.
AC_CHECK_FUNCS(INTTYPES_H)
fi
AC_CACHE_CHECK([for inttypes.h], jm_ac_cv_header_inttypes_h,
[AC_TRY_COMPILE(
[#include <sys/types.h>
@ -21,7 +15,8 @@ AC_DEFUN(jm_AC_HEADER_INTTYPES_H,
jm_ac_cv_header_inttypes_h=yes,
jm_ac_cv_header_inttypes_h=no)])
if test $jm_ac_cv_header_inttypes_h = yes; then
ac_kludge=HAVE_INTTYPES_H
AC_DEFINE_UNQUOTED($ac_kludge)
AC_DEFINE_UNQUOTED(HAVE_INTTYPES_H, 1,
[Define if <inttypes.h> exists, doesn't clash with <sys/types.h>,
and declares uintmax_t. ])
fi
])

View File

@ -1,23 +1,28 @@
#serial 1
#serial 2
dnl From Jim Meyering.
dnl
dnl See if the glibc *_unlocked I/O macros are available.
dnl Use only those *_unlocked macros that are declared.
dnl
AC_DEFUN(jm_FUNC_GLIBC_UNLOCKED_IO,
[AC_CHECK_FUNCS( \
clearerr_unlocked \
feof_unlocked \
ferror_unlocked \
fflush_unlocked \
fputc_unlocked \
fread_unlocked \
fwrite_unlocked \
getc_unlocked \
getchar_unlocked \
putc_unlocked \
putchar_unlocked \
)
[
io_functions='clearerr_unlocked feof_unlocked ferror_unlocked
fflush_unlocked fputc_unlocked fread_unlocked fwrite_unlocked
getc_unlocked getchar_unlocked putc_unlocked putchar_unlocked'
for jm_io_func in $io_functions; do
# Check for the existence of each function only if its declared.
# Otherwise, we'd get the Solaris5.5.1 functions that are not
# declared, and that have been removed from Solaris5.6. The resulting
# 5.5.1 binaries would not run on 5.6 due to shared library differences.
jm_CHECK_DECLARATIONS([#include <stdio.h>
], $jm_io_func,
jm_declared=yes,
jm_declared=no)
if test $jm_declared = yes; then
AC_CHECK_FUNCS($jm_io_func)
fi
done
]
)

View File

@ -1,24 +1,32 @@
#serial 2
#serial 11
dnl Misc type-related macros for fileutils, sh-utils, textutils.
AC_DEFUN(jm_MACROS,
[
AC_PREREQ(2.14a)
GNU_PACKAGE="GNU $PACKAGE"
AC_DEFINE_UNQUOTED(GNU_PACKAGE, "$GNU_PACKAGE",
[The concatenation of the strings `GNU ', and PACKAGE.])
AC_SUBST(GNU_PACKAGE)
dnl This macro actually runs replacement code. See isc-posix.m4.
AC_REQUIRE([AC_ISC_POSIX])dnl
AC_REQUIRE([jm_WITH_REGEX])
jm_INCLUDED_REGEX([lib/regex.c])
AC_REQUIRE([jm_ASSERT])
AC_REQUIRE([jm_AC_HEADER_INTTYPES_H])
AC_REQUIRE([jm_AC_TYPE_UINTMAX_T])
AC_CHECK_TYPE(ssize_t, int)
AC_REQUIRE([jm_STRUCT_UTIMBUF])
AC_REQUIRE([jm_STRUCT_DIRENT_D_TYPE])
AC_REQUIRE([jm_STRUCT_DIRENT_D_INO])
AC_REQUIRE([jm_CHECK_DECLS])
AC_REQUIRE([jm_PREREQ])
AC_REQUIRE([jm_FUNC_MKTIME])
AC_REQUIRE([jm_FUNC_LSTAT])
AC_REQUIRE([jm_FUNC_LSTAT_FOLLOWS_SLASHED_SYMLINK])
AC_REQUIRE([jm_FUNC_STAT])
AC_REQUIRE([jm_FUNC_REALLOC])
AC_REQUIRE([jm_FUNC_MALLOC])
@ -26,4 +34,71 @@ AC_DEFUN(jm_MACROS,
AC_REQUIRE([jm_FUNC_MEMCMP])
AC_REQUIRE([jm_FUNC_GLIBC_UNLOCKED_IO])
AC_REQUIRE([jm_FUNC_FNMATCH])
AC_REQUIRE([jm_AFS])
AC_REPLACE_FUNCS(strcasecmp strncasecmp)
dnl used by e.g. intl/*domain.c and lib/canon-host.c
AC_REPLACE_FUNCS(strdup)
AC_CHECK_FUNCS(getpagesize)
# By default, argmatch should fail calling usage (1).
AC_DEFINE(ARGMATCH_DIE, [usage (1)],
[Define to the function xargmatch calls on failures.])
AC_DEFINE(ARGMATCH_DIE_DECL, [extern void usage ()],
[Define to the declaration of the xargmatch failure function.])
dnl Used to define SETVBUF in sys2.h.
dnl This evokes the following warning from autoconf:
dnl ...: warning: AC_TRY_RUN called without default to allow cross compiling
AC_FUNC_SETVBUF_REVERSED
# used by sleep and shred
# Solaris 2.5.1 needs -lposix4 to get the clock_gettime function.
# Solaris 7 prefers the library name -lrt to the obsolescent name -lposix4.
AC_SEARCH_LIBS(clock_gettime, [rt posix4])
AC_CHECK_FUNCS(clock_gettime)
AC_CHECK_FUNCS(gettimeofday)
AM_FUNC_GETLINE
AC_CHECK_FUNCS(getdelim)
])
AC_DEFUN(jm_CHECK_ALL_TYPES,
[
dnl Checks for typedefs, structures, and compiler characteristics.
AC_C_BIGENDIAN
AC_C_CONST
AC_C_INLINE
AC_C_LONG_DOUBLE
AC_HEADER_DIRENT
AC_HEADER_STDC
AC_CHECK_MEMBERS((struct stat.st_blksize))
AC_STRUCT_ST_BLOCKS
AC_STRUCT_TM
AC_HEADER_TIME
AC_STRUCT_TIMEZONE
AC_HEADER_STAT
AC_STRUCT_ST_MTIM_NSEC
AC_STRUCT_ST_DM_MODE
AC_TYPE_GETGROUPS
AC_TYPE_MODE_T
AC_TYPE_OFF_T
AC_TYPE_PID_T
AC_TYPE_SIGNAL
AC_TYPE_SIZE_T
AC_TYPE_UID_T
AC_CHECK_TYPE(ino_t, unsigned long)
dnl This relies on the fact that autoconf 2.14a's implementation of
dnl AC_CHECK_TYPE checks includes unistd.h.
AC_CHECK_TYPE(ssize_t, int)
AC_REQUIRE([jm_AC_TYPE_UINTMAX_T])
AC_REQUIRE([jm_AC_TYPE_UNSIGNED_LONG_LONG])
])

View File

@ -1,4 +1,4 @@
#serial 1
#serial 3
dnl From Jim Meyering.
dnl
@ -11,6 +11,8 @@ dnl FIXME: add AC_REQUIRE uses to pull in all definitions required
dnl for all uses of $ac_cv_func_* and $ac_cv_header_* variables below.
dnl
AC_PREREQ(2.14a)
AC_DEFUN(jm_LIST_MOUNTED_FILESYSTEMS,
[
# Determine how to get the list of mounted filesystems.
@ -46,7 +48,9 @@ yes
AC_MSG_RESULT($fu_cv_sys_mounted_cray_listmntent)
if test $fu_cv_sys_mounted_cray_listmntent = yes; then
list_mounted_fs=found
AC_DEFINE(MOUNTED_LISTMNTENT)
AC_DEFINE(MOUNTED_LISTMNTENT, 1,
[Define if there is a function named listmntent that can be used to
list all mounted filesystems. (UNICOS)])
fi
fi
@ -65,7 +69,10 @@ if test $ac_cv_func_getmntent = yes; then
AC_MSG_RESULT($fu_cv_sys_mounted_getmntent1)
if test $fu_cv_sys_mounted_getmntent1 = yes; then
list_mounted_fs=found
AC_DEFINE(MOUNTED_GETMNTENT1)
AC_DEFINE(MOUNTED_GETMNTENT1, 1,
[Define if there is a function named getmntent for reading the list
of mounted filesystems, and that function takes a single argument.
(4.3BSD, SunOS, HP-UX, Dynix, Irix)])
fi
fi
@ -79,7 +86,9 @@ if test $ac_cv_func_getmntent = yes; then
AC_MSG_RESULT($fu_cv_sys_mounted_getmntent2)
if test $fu_cv_sys_mounted_getmntent2 = yes; then
list_mounted_fs=found
AC_DEFINE(MOUNTED_GETMNTENT2)
AC_DEFINE(MOUNTED_GETMNTENT2, 1,
[Define if there is a function named getmntent for reading the list of
mounted filesystems, and that function takes two arguments. (SVR4)])
fi
fi
@ -104,7 +113,9 @@ if test -z "$list_mounted_fs"; then
AC_MSG_RESULT($fu_cv_sys_mounted_getsstat)
if test $fu_cv_sys_mounted_getsstat = yes; then
list_mounted_fs=found
AC_DEFINE(MOUNTED_GETFSSTAT)
AC_DEFINE(MOUNTED_GETFSSTAT, 1,
[Define if there is a function named getfsstat for reading the
list of mounted filesystems. (DEC Alpha running OSF/1)])
fi
fi
@ -118,7 +129,10 @@ if test -z "$list_mounted_fs"; then
AC_MSG_RESULT($fu_cv_sys_mounted_vmount)
if test $fu_cv_sys_mounted_vmount = yes; then
list_mounted_fs=found
AC_DEFINE(MOUNTED_VMOUNT)
AC_DEFINE(MOUNTED_VMOUNT, 1,
[Define if there is a function named mntctl that can be used to read
the list of mounted filesystems, and there is a system header file
that declares `struct vmount.' (AIX)])
fi
fi
@ -135,7 +149,10 @@ if test -z "$list_mounted_fs"; then
AC_MSG_RESULT($fu_cv_sys_mounted_fread_fstyp)
if test $fu_cv_sys_mounted_fread_fstyp = yes; then
list_mounted_fs=found
AC_DEFINE(MOUNTED_FREAD_FSTYP)
AC_DEFINE(MOUNTED_FREAD_FSTYP, 1,
[Define if (like SVR2) there is no specific function for reading the
list of mounted filesystems, and your system has these header files:
<sys/fstyp.h> and <sys/statfs.h>. (SVR3)])
fi
fi
@ -156,7 +173,9 @@ if test -z "$list_mounted_fs"; then
AC_MSG_RESULT($fu_cv_sys_mounted_getmntinfo)
if test $fu_cv_sys_mounted_getmntinfo = yes; then
list_mounted_fs=found
AC_DEFINE(MOUNTED_GETMNTINFO)
AC_DEFINE(MOUNTED_GETMNTINFO, 1,
[Define if there is a function named getmntinfo for reading the
list of mounted filesystems. (4.4BSD)])
fi
fi
@ -174,7 +193,9 @@ if test -z "$list_mounted_fs"; then
AC_MSG_RESULT($fu_cv_sys_mounted_getmnt)
if test $fu_cv_sys_mounted_getmnt = yes; then
list_mounted_fs=found
AC_DEFINE(MOUNTED_GETMNT)
AC_DEFINE(MOUNTED_GETMNT, 1,
[Define if there is a function named getmnt for reading the list of
mounted filesystems. (Ultrix)])
fi
fi
@ -188,7 +209,9 @@ if test -z "$list_mounted_fs"; then
AC_MSG_RESULT($fu_cv_sys_mounted_fread)
if test $fu_cv_sys_mounted_fread = yes; then
list_mounted_fs=found
AC_DEFINE(MOUNTED_FREAD)
AC_DEFINE(MOUNTED_FREAD, 1,
[Define if there is no specific function for reading the list of
mounted filesystems. fread will be used to read /etc/mnttab. (SVR2) ])
fi
fi

View File

@ -1,4 +1,4 @@
#serial 2
#serial 3
dnl From Jim Meyering.
dnl Determine whether lstat has the bug that it succeeds when given the
@ -30,22 +30,11 @@ AC_DEFUN(jm_FUNC_LSTAT,
jm_cv_func_lstat_empty_string_bug=yes)
])
if test $jm_cv_func_lstat_empty_string_bug = yes; then
LIBOBJS="$LIBOBJS lstat.o"
if test $jm_cv_func_lstat_empty_string_bug = yes; then
if test x = y; then
# This code is deliberately never run via ./configure.
# FIXME: this is a hack to make autoheader put the corresponding
# HAVE_* undef for this symbol in config.h.in. This saves me the
# trouble of having to maintain the #undef in acconfig.h manually.
AC_CHECK_FUNCS(LSTAT_EMPTY_STRING_BUG)
fi
# Defining it this way (rather than via AC_DEFINE) short-circuits the
# autoheader check -- autoheader doesn't know it's already been taken
# care of by the hack above.
ac_kludge=HAVE_LSTAT_EMPTY_STRING_BUG
AC_DEFINE_UNQUOTED($ac_kludge)
fi
AC_SUBST(LIBOBJS)
LIBOBJS="$LIBOBJS lstat.$ac_objext"
AC_DEFINE_UNQUOTED(HAVE_LSTAT_EMPTY_STRING_BUG, 1,
[Define if lstat has the bug that it succeeds when given the zero-length
file name argument. The lstat from SunOS4.1.4 and the Hurd as of 1998-11-01)
do this. ])
fi
])

View File

@ -1,27 +1,16 @@
#serial 1
#serial 3
dnl From Jim Meyering.
dnl Determine whether malloc accepts 0 as its argument.
dnl If it doesn't, arrange to use the replacement function.
dnl
dnl If you use this macro in a package, you should
dnl add the following two lines to acconfig.h:
dnl /* Define to rpl_malloc if the replacement function should be used. */
dnl #undef malloc
dnl
AC_DEFUN(jm_FUNC_MALLOC,
[
if test x = y; then
dnl This code is deliberately never run via ./configure.
dnl FIXME: this is a gross hack to make autoheader put an entry
dnl for this symbol in config.h.in.
AC_CHECK_FUNCS(DONE_WORKING_MALLOC_CHECK)
fi
dnl xmalloc.c requires that this symbol be defined so it doesn't
dnl mistakenly use a broken malloc -- as it might if this test were omitted.
ac_kludge=HAVE_DONE_WORKING_MALLOC_CHECK
AC_DEFINE_UNQUOTED($ac_kludge)
AC_DEFINE_UNQUOTED(HAVE_DONE_WORKING_MALLOC_CHECK, 1,
[Define if the malloc check has been performed. ])
AC_CACHE_CHECK([for working malloc], jm_cv_func_working_malloc,
[AC_TRY_RUN([
@ -38,7 +27,9 @@ AC_DEFUN(jm_FUNC_MALLOC,
jm_cv_func_working_malloc=no)
])
if test $jm_cv_func_working_malloc = no; then
LIBOBJS="$LIBOBJS malloc.o"
AC_DEFINE_UNQUOTED(malloc, rpl_malloc)
AC_SUBST(LIBOBJS)
LIBOBJS="$LIBOBJS malloc.$ac_objext"
AC_DEFINE_UNQUOTED(malloc, rpl_malloc,
[Define to rpl_malloc if the replacement function should be used.])
fi
])

View File

@ -1,4 +1,4 @@
#serial 2
#serial 3
dnl A replacement for autoconf's AC_FUNC_MEMCMP that detects
dnl the losing memcmp on some x86 Next systems.
@ -38,18 +38,15 @@ changequote([, ])dnl
jm_cv_func_memcmp_working=yes,
jm_cv_func_memcmp_working=no,
jm_cv_func_memcmp_working=no)])
test $jm_cv_func_memcmp_working = no && LIBOBJS="$LIBOBJS memcmp.o"
test $jm_cv_func_memcmp_working = no \
&& LIBOBJS="$LIBOBJS memcmp.$ac_objext"
AC_SUBST(LIBOBJS)dnl
])
dnl If you use this macro in a package, you should
dnl add the following two lines to acconfig.h:
dnl /* Define to rpl_memcmp if the replacement function should be used. */
dnl #undef memcmp
dnl
AC_DEFUN(jm_FUNC_MEMCMP,
[AC_REQUIRE([jm_AC_FUNC_MEMCMP])dnl
if test $jm_cv_func_memcmp_working = no; then
AC_DEFINE_UNQUOTED(memcmp, rpl_memcmp)
AC_DEFINE_UNQUOTED(memcmp, rpl_memcmp,
[Define to rpl_memcmp if the replacement function should be used.])
fi
])

View File

@ -1,4 +1,4 @@
#serial 1
#serial 2
dnl From Jim Meyering.
dnl Find a new-enough version of Perl.
@ -24,7 +24,7 @@ AC_DEFUN(jm_PERL,
for perl in $candidate_perl_names; do
# Run test in a subshell; some versions of sh will print an error if
# an executable is not found, even if stderr is redirected.
if ( $perl -e 'require 5.003' ) > /dev/null 2>&1; then
if ( $perl -e 'require 5.003; use File::Compare' ) > /dev/null 2>&1; then
PERL=$perl
found=yes
break
@ -33,7 +33,9 @@ AC_DEFUN(jm_PERL,
AC_MSG_RESULT($found)
test $found = no && AC_MSG_WARN([
*** You don't seem to have perl5.003 or newer installed.
*** Because of that, you may be unable to regenerate certain files
*** if you modify the sources from which they are derived.] )
*** You don't seem to have perl5.003 or newer installed, or you lack
*** a usable version of the Perl File::Compare module. As a result,
*** you may be unable to run a few tests or to regenerate certain
*** files if you modify the sources from which they are derived.
] )
])

View File

@ -1,15 +1,10 @@
#serial 1
#serial 3
dnl From Jim Meyering.
dnl
dnl Check whether putenv ("FOO") removes FOO from the environment.
dnl The putenv in libc on at least SunOS 4.1.4 does *not* do that.
dnl
dnl If you use this macro in a package, you should
dnl add the following two lines to acconfig.h:
dnl /* Define to rpl_putenv if the replacement function should be used. */
dnl #undef putenv
dnl
AC_DEFUN(jm_FUNC_PUTENV,
[AC_CACHE_CHECK([for SVID conformant putenv], jm_cv_func_svid_putenv,
@ -38,7 +33,9 @@ AC_DEFUN(jm_FUNC_PUTENV,
jm_cv_func_svid_putenv=no)
])
if test $jm_cv_func_svid_putenv = no; then
LIBOBJS="$LIBOBJS putenv.o"
AC_DEFINE_UNQUOTED(putenv, rpl_putenv)
AC_SUBST(LIBOBJS)
LIBOBJS="$LIBOBJS putenv.$ac_objext"
AC_DEFINE_UNQUOTED(putenv, rpl_putenv,
[Define to rpl_putenv if the replacement function should be used.])
fi
])

View File

@ -1,4 +1,4 @@
#serial 1
#serial 2
dnl SunOS's readdir is broken in such a way that rm.c has to add extra code
dnl to test whether a NULL return value really means there are no more files
@ -126,16 +126,8 @@ AC_CACHE_CHECK([for working readdir], jm_cv_func_working_readdir,
jm_cv_func_working_readdir=no,
jm_cv_func_working_readdir=no)])
if test x = y; then
dnl This code is deliberately never run via ./configure.
dnl FIXME: this is a gross hack to make autoheader put an entry
dnl for this HAVE_-prefixed symbol in config.h.in.
AC_CHECK_FUNCS(WORKING_READDIR)
fi
if test $jm_cv_func_working_readdir = yes; then
ac_kludge=HAVE_WORKING_READDIR
AC_DEFINE_UNQUOTED($ac_kludge)
AC_DEFINE_UNQUOTED(HAVE_WORKING_READDIR, 1,
[Define if readdir is found to work properly in some unusual cases. ])
fi
])

View File

@ -1,27 +1,16 @@
#serial 1
#serial 3
dnl From Jim Meyering.
dnl Determine whether realloc works when both arguments are 0.
dnl If it doesn't, arrange to use the replacement function.
dnl
dnl If you use this macro in a package, you should
dnl add the following two lines to acconfig.h:
dnl /* Define to rpl_realloc if the replacement function should be used. */
dnl #undef realloc
dnl
AC_DEFUN(jm_FUNC_REALLOC,
[
if test x = y; then
dnl This code is deliberately never run via ./configure.
dnl FIXME: this is a gross hack to make autoheader put an entry
dnl for this symbol in config.h.in.
AC_CHECK_FUNCS(DONE_WORKING_REALLOC_CHECK)
fi
dnl xmalloc.c requires that this symbol be defined so it doesn't
dnl mistakenly use a broken realloc -- as it might if this test were omitted.
ac_kludge=HAVE_DONE_WORKING_REALLOC_CHECK
AC_DEFINE_UNQUOTED($ac_kludge)
AC_DEFINE_UNQUOTED(HAVE_DONE_WORKING_REALLOC_CHECK, 1,
[Define if the realloc check has been performed. ])
AC_CACHE_CHECK([for working realloc], jm_cv_func_working_realloc,
[AC_TRY_RUN([
@ -38,7 +27,9 @@ AC_DEFUN(jm_FUNC_REALLOC,
jm_cv_func_working_realloc=no)
])
if test $jm_cv_func_working_realloc = no; then
LIBOBJS="$LIBOBJS realloc.o"
AC_DEFINE_UNQUOTED(realloc, rpl_realloc)
AC_SUBST(LIBOBJS)
LIBOBJS="$LIBOBJS realloc.$ac_objext"
AC_DEFINE_UNQUOTED(realloc, rpl_realloc,
[Define to rpl_realloc if the replacement function should be used.])
fi
])

View File

@ -1,21 +1,67 @@
#serial 2
#serial 5
dnl Derived from code in GNU grep.
dnl Initially derived from code in GNU grep.
dnl Mostly written by Jim Meyering.
AC_DEFUN(jm_WITH_REGEX,
dnl Usage: jm_INCLUDED_REGEX([lib/regex.c])
dnl
AC_DEFUN(jm_INCLUDED_REGEX,
[
dnl Even packages that don't use regex.c can use this macro.
dnl Of course, for them it doesn't do anything.
syscmd([test -f lib/regex.c])
# Assume we'll default to using the included regex.c.
ac_use_included_regex=yes
# However, if the system regex support is good enough that it passes the
# the following run test, then default to *not* using the included regex.c.
# If cross compiling, assume the test would fail and use the included
# regex.c. The failing regular expression is from `Spencer ere test #75'
# in grep-2.3.
AC_CACHE_CHECK([for working re_compile_pattern],
jm_cv_func_working_re_compile_pattern,
AC_TRY_RUN(
changequote(<<, >>)dnl
<<
#include <stdio.h>
#include <regex.h>
int
main ()
{
static struct re_pattern_buffer regex;
const char *s;
re_set_syntax (RE_SYNTAX_POSIX_EGREP);
/* Add this third left square bracket, [, to balance the
three right ones below. Otherwise autoconf-2.14 chokes. */
s = re_compile_pattern ("a[[:]:]]b\n", 9, &regex);
/* This should fail with _Invalid character class name_ error. */
exit (s ? 0 : 1);
}
>>,
changequote([, ])dnl
jm_cv_func_working_re_compile_pattern=yes,
jm_cv_func_working_re_compile_pattern=no,
dnl When crosscompiling, assume it's broken.
jm_cv_func_working_re_compile_pattern=no))
if test $jm_cv_func_working_re_compile_pattern = yes; then
ac_use_included_regex=no
fi
test -n "$1" || AC_MSG_ERROR([missing argument])
syscmd([test -f $1])
ifelse(sysval, 0,
[
AC_ARG_WITH(included-regex,
[ --without-included-regex don't compile regex (use with caution)],
[ --without-included-regex don't compile regex; this is the default on
systems with version 2 of the GNU C library
(use with caution on other system)],
jm_with_regex=$withval,
jm_with_regex=yes)
jm_with_regex=$ac_use_included_regex)
if test "$jm_with_regex" = yes; then
LIBOBJS="$LIBOBJS regex.o"
AC_SUBST(LIBOBJS)
LIBOBJS="$LIBOBJS regex.$ac_objext"
fi
],
)

View File

@ -1,3 +1,5 @@
#serial 2
# Define HAVE_ST_DM_MODE if struct stat has an st_dm_mode member.
AC_DEFUN(AC_STRUCT_ST_DM_MODE,
@ -8,18 +10,8 @@ AC_DEFUN(AC_STRUCT_ST_DM_MODE,
ac_cv_struct_st_dm_mode=no)])
if test $ac_cv_struct_st_dm_mode = yes; then
if test x = y; then
# This code is deliberately never run via ./configure.
# FIXME: this is a hack to make autoheader put the corresponding
# HAVE_* undef for this symbol in config.h.in. This saves me the
# trouble of having to add the #undef in acconfig.h manually.
AC_CHECK_FUNCS(ST_DM_MODE)
fi
# Defining it this way (rather than via AC_DEFINE) short-circuits the
# autoheader check -- autoheader doesn't know it's already been taken
# care of by the hack above.
ac_kludge=HAVE_ST_DM_MODE
AC_DEFINE_UNQUOTED($ac_kludge)
AC_DEFINE_UNQUOTED(HAVE_ST_DM_MODE, 1,
[Define if struct stat has an st_dm_mode member. ])
fi
]
)

View File

@ -1,4 +1,4 @@
#serial 3
#serial 4
dnl From Paul Eggert.
@ -24,7 +24,9 @@ AC_DEFUN(AC_STRUCT_ST_MTIM_NSEC,
CPPFLAGS="$ac_save_CPPFLAGS"])
if test $ac_cv_struct_st_mtim_nsec != no; then
AC_DEFINE_UNQUOTED(ST_MTIM_NSEC, $ac_cv_struct_st_mtim_nsec)
AC_DEFINE_UNQUOTED(ST_MTIM_NSEC, $ac_cv_struct_st_mtim_nsec,
[Define to be the nanoseconds member of struct stat's st_mtim,
if it exists.])
fi
]
)

View File

@ -1,4 +1,4 @@
#serial 2
#serial 3
dnl From Jim Meyering.
dnl Determine whether stat has the bug that it succeeds when given the
@ -30,22 +30,11 @@ AC_DEFUN(jm_FUNC_STAT,
jm_cv_func_stat_empty_string_bug=yes)
])
if test $jm_cv_func_stat_empty_string_bug = yes; then
LIBOBJS="$LIBOBJS stat.o"
if test $jm_cv_func_stat_empty_string_bug = yes; then
if test x = y; then
# This code is deliberately never run via ./configure.
# FIXME: this is a hack to make autoheader put the corresponding
# HAVE_* undef for this symbol in config.h.in. This saves me the
# trouble of having to maintain the #undef in acconfig.h manually.
AC_CHECK_FUNCS(STAT_EMPTY_STRING_BUG)
fi
# Defining it this way (rather than via AC_DEFINE) short-circuits the
# autoheader check -- autoheader doesn't know it's already been taken
# care of by the hack above.
ac_kludge=HAVE_STAT_EMPTY_STRING_BUG
AC_DEFINE_UNQUOTED($ac_kludge)
fi
AC_SUBST(LIBOBJS)
LIBOBJS="$LIBOBJS stat.$ac_objext"
AC_DEFINE_UNQUOTED(HAVE_STAT_EMPTY_STRING_BUG, 1,
[Define if stat has the bug that it succeeds when given the zero-length
file name argument. The stat from SunOS4.1.4 and the Hurd as of 1998-11-01)
do this. ])
fi
])

View File

@ -1,23 +1,29 @@
#serial 5
#serial 8
dnl This macro is intended to be used solely in this file.
dnl These are the prerequisite macros for GNU's strftime.c replacement.
dnl FIXME: the list is far from complete
AC_DEFUN(_jm_STRFTIME_PREREQS,
[
dnl strftime.c uses localtime_r if it exists. Check for it.
AC_CHECK_FUNCS(localtime_r)
dnl FIXME: add tests for everything in strftime.c: e.g., HAVE_BCOPY,
dnl HAVE_TZNAME, HAVE_TZSET, HAVE_TM_ZONE, etc.
AC_CHECK_HEADERS(limits.h)
AC_CHECK_FUNCS(bcopy tzset mempcpy memcpy memset)
# This defines (or not) HAVE_TZNAME and HAVE_TM_ZONE.
AC_STRUCT_TIMEZONE
AC_CHECK_FUNCS(mblen mbrlen)
AC_CHECK_MEMBER(struct tm.tm_gmtoff,
[AC_DEFINE(HAVE_TM_GMTOFF, 1,
[Define if struct tm has the tm_gmtoff member.])],
,
[#include <time.h>])
])
dnl Determine if the strftime function has all the features of the GNU one.
dnl
dnl If you use this macro in a package, you should
dnl add the following two lines to acconfig.h:
dnl /* Define to gnu_strftime if the replacement function should be used. */
dnl #undef strftime
dnl
dnl From Jim Meyering.
dnl
AC_DEFUN(jm_FUNC_GNU_STRFTIME,
@ -109,7 +115,6 @@ main ()
CMP ("%^c", "FRI JAN 9 13:06:07 1970");
CMP ("%d", "09");
CMP ("%e", " 9"); /* POSIX.2 */
CMP ("%f", "5"); /* POSIX.2 */
CMP ("%g", "70"); /* GNU */
CMP ("%h", "Jan"); /* POSIX.2 */
CMP ("%^h", "JAN");
@ -138,8 +143,10 @@ changequote([, ])dnl
jm_cv_func_working_gnu_strftime=no)
])
if test $jm_cv_func_working_gnu_strftime = no; then
LIBOBJS="$LIBOBJS strftime.o"
AC_DEFINE_UNQUOTED(strftime, gnu_strftime)
AC_SUBST(LIBOBJS)
LIBOBJS="$LIBOBJS strftime.$ac_objext"
AC_DEFINE_UNQUOTED(strftime, gnu_strftime,
[Define to gnu_strftime if the replacement function should be used.])
fi
])

View File

@ -1,7 +1,9 @@
#serial 1
#serial 4
dnl From Paul Eggert.
AC_PREREQ(2.14a)
# Define uintmax_t to `unsigned long' or `unsigned long long'
# if <inttypes.h> does not exist.
@ -9,15 +11,12 @@ AC_DEFUN(jm_AC_TYPE_UINTMAX_T,
[
AC_REQUIRE([jm_AC_HEADER_INTTYPES_H])
if test $jm_ac_cv_header_inttypes_h = no; then
AC_CACHE_CHECK([for unsigned long long], ac_cv_type_unsigned_long_long,
[AC_TRY_COMPILE([],
[unsigned long long i = (unsigned long long) -1;],
ac_cv_type_unsigned_long_long=yes,
ac_cv_type_unsigned_long_long=no)])
if test $ac_cv_type_unsigned_long_long = yes; then
AC_DEFINE(uintmax_t, unsigned long long)
else
AC_DEFINE(uintmax_t, unsigned long)
fi
AC_REQUIRE([jm_AC_TYPE_UNSIGNED_LONG_LONG])
test $ac_cv_type_unsigned_long_long = yes \
&& ac_type='unsigned long long' \
|| ac_type='unsigned long'
AC_DEFINE_UNQUOTED(uintmax_t, $ac_type,
[ Define to `unsigned long' or `unsigned long long'
if <inttypes.h> doesn't define.])
fi
])

View File

@ -1,4 +1,6 @@
#serial 1
#serial 2
AC_PREREQ(2.13)
AC_DEFUN(jm_SYS_PROC_UPTIME,
[ dnl Require AC_PROG_CC to see if we're cross compiling.
@ -10,6 +12,7 @@ AC_DEFUN(jm_SYS_PROC_UPTIME,
&& cat < /proc/uptime >/dev/null 2>/dev/null \
&& jm_cv_have_proc_uptime=yes])
if test $jm_cv_have_proc_uptime = yes; then
AC_DEFINE(HAVE_PROC_UPTIME)
AC_DEFINE(HAVE_PROC_UPTIME, 1,
[ Define if your system has the /proc/uptime special file.])
fi
])

View File

@ -1,4 +1,4 @@
#serial 1
#serial 2
dnl From Jim Meyering
@ -33,17 +33,8 @@ AC_DEFUN(jm_STRUCT_UTIMBUF,
])
if test $fu_cv_sys_struct_utimbuf = yes; then
if test x = y; then
# This code is deliberately never run via ./configure.
# FIXME: this is a hack to make autoheader put the corresponding
# HAVE_* undef for this symbol in config.h.in. This saves me the
# trouble of having to maintain the #undef in acconfig.h manually.
AC_CHECK_FUNCS(STRUCT_UTIMBUF)
fi
# Defining it this way (rather than via AC_DEFINE) short-circuits the
# autoheader check -- autoheader doesn't know it's already been taken
# care of by the hack above.
ac_kludge=HAVE_STRUCT_UTIMBUF
AC_DEFINE_UNQUOTED($ac_kludge)
AC_DEFINE_UNQUOTED(HAVE_STRUCT_UTIMBUF, 1,
[Define if struct utimbuf is declared -- usually in <utime.h>.
Some systems have utime.h but don't declare the struct anywhere. ])
fi
])

View File

@ -1,6 +1,7 @@
#serial 2
#serial 3
dnl Shamelessly cloned from acspecific.m4's AC_FUNC_UTIME_NULL.
dnl Shamelessly cloned from acspecific.m4's AC_FUNC_UTIME_NULL,
dnl then do case-insensitive s/utime/utimes/.
AC_DEFUN(jm_FUNC_UTIMES_NULL,
[AC_CACHE_CHECK(whether utimes accepts a null argument, ac_cv_func_utimes_null,
@ -22,18 +23,8 @@ exit(!(stat ("conftestdata", &s) == 0 && utimes("conftestdata", (long *)0) == 0
rm -f core core.* *.core])
if test $ac_cv_func_utimes_null = yes; then
if test x = y; then
# This code is deliberately never run via ./configure.
# FIXME: this is a hack to make autoheader put the corresponding
# HAVE_* undef for this symbol in config.h.in. This saves me the
# trouble of having to maintain the #undef in acconfig.h manually.
AC_CHECK_FUNCS(UTIMES_NULL)
fi
# Defining it this way (rather than via AC_DEFINE) short-circuits the
# autoheader check -- autoheader doesn't know it's already been taken
# care of by the hack above.
ac_kludge=HAVE_UTIMES_NULL
AC_DEFINE_UNQUOTED($ac_kludge)
AC_DEFINE_UNQUOTED(HAVE_UTIMES_NULL, 1,
[Define if utimes accepts a null argument])
fi
]
)