DIST_COMMON = Makefile.am Makefile.in alloca.c chown.c error.c error.h \
euidaccess.c fileblocks.c fnmatch.c fsusage.c ftruncate.c getdate.c \
getgroups.c getline.c group-member.c lstat.c memcmp.c memcpy.c memset.c \
-mkdir.c mktime.c mountlist.c obstack.c obstack.h posixtm.c regex.c \
-regex.h rename.c rmdir.c rpmatch.c rx.c rx.h stat.c stpcpy.c stpncpy.c \
-strcasecmp.c strdup.c strftime.c strndup.c strstr.c strtol.c strtoul.c \
-strverscmp.c ylwrap
+mkdir.c mktime.c mountlist.c obstack.c obstack.h posixtm.c realloc.c \
+regex.c regex.h rename.c rmdir.c rpmatch.c rx.c rx.h stat.c stpcpy.c \
+stpncpy.c strcasecmp.c strdup.c strftime.c strndup.c strstr.c strtol.c \
+strtoul.c strverscmp.c ylwrap
DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST)
.deps/long-options.P .deps/lstat.P .deps/makepath.P .deps/memcmp.P \
.deps/memcpy.P .deps/memset.P .deps/mkdir.P .deps/mktime.P \
.deps/modechange.P .deps/mountlist.P .deps/oa-hash.P .deps/obstack.P \
-.deps/path-concat.P .deps/posixtm.P .deps/regex.P .deps/rename.P \
-.deps/rmdir.P .deps/rpmatch.P .deps/rx.P .deps/safe-read.P \
-.deps/save-cwd.P .deps/savedir.P .deps/stat.P .deps/stpcpy.P \
-.deps/stpncpy.P .deps/strcasecmp.P .deps/strdup.P .deps/strftime.P \
-.deps/stripslash.P .deps/strndup.P .deps/strstr.P .deps/strtol.P \
-.deps/strtoul.P .deps/strverscmp.P .deps/userspec.P .deps/xgetcwd.P \
-.deps/xmalloc.P .deps/xstrdup.P .deps/xstrtol.P .deps/xstrtoul.P \
-.deps/yesno.P
+.deps/path-concat.P .deps/posixtm.P .deps/realloc.P .deps/regex.P \
+.deps/rename.P .deps/rmdir.P .deps/rpmatch.P .deps/rx.P \
+.deps/safe-read.P .deps/save-cwd.P .deps/savedir.P .deps/stat.P \
+.deps/stpcpy.P .deps/stpncpy.P .deps/strcasecmp.P .deps/strdup.P \
+.deps/strftime.P .deps/stripslash.P .deps/strndup.P .deps/strstr.P \
+.deps/strtol.P .deps/strtoul.P .deps/strverscmp.P .deps/userspec.P \
+.deps/xgetcwd.P .deps/xmalloc.P .deps/xstrdup.P .deps/xstrtol.P \
+.deps/xstrtoul.P .deps/yesno.P
SOURCES = $(libfu_a_SOURCES)
OBJECTS = $(libfu_a_OBJECTS)
EXTRA_DIST = README \
chown.m4 d-ino.m4 d-type.m4 getgroups.m4 getline.m4 getloadavg.m4 \
-jm-mktime.m4 jm-winsz1.m4 jm-winsz2.m4 lstat.m4 memcmp.m4 putenv.m4 \
-stat.m4 strftime.m4 uptime.m4
+jm-mktime.m4 jm-winsz1.m4 jm-winsz2.m4 lstat.m4 memcmp.m4 realloc.m4 \
+putenv.m4 stat.m4 strftime.m4 uptime.m4
mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
CONFIG_HEADER = ../config.h
CONFIG_CLEAN_FILES =
--- /dev/null
+#serial 1
+
+dnl From Jim Meyering.
+dnl Determine whether realloc accepts 0 as its first 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_realloc if the replacement function should be used. */
+dnl #undef realloc
+dnl
+
+AC_DEFUN(jm_FUNC_REALLOC,
+[
+ AC_CACHE_CHECK([for working realloc], jm_cv_func_working_realloc,
+ [AC_TRY_RUN([
+ char *realloc ();
+ int
+ main ()
+ {
+ exit (realloc (0, 1) ? 0 : 1);
+ }
+ ],
+ jm_cv_func_working_realloc=yes,
+ jm_cv_func_working_realloc=no,
+ dnl When crosscompiling, assume realloc is broken.
+ 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)
+ fi
+])