.
authorJim Meyering <jim@meyering.net>
Mon, 15 Sep 1997 03:20:53 +0000 (03:20 +0000)
committerJim Meyering <jim@meyering.net>
Mon, 15 Sep 1997 03:20:53 +0000 (03:20 +0000)
lib/Makefile.in
m4/Makefile.in
m4/realloc.m4 [new file with mode: 0644]

index 8d6a160724999dd68d5d7cbfaaa8c22cfbaf0a2d..ca536388597ffcd006b0fa19c21cc7ab7973355c 100644 (file)
@@ -135,10 +135,10 @@ HEADERS =  $(noinst_HEADERS)
 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)
@@ -154,14 +154,14 @@ DEP_FILES =  .deps/addext.P .deps/alloca.P .deps/argmatch.P \
 .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)
 
index 67eabf07d3decbe77dc5a1170f6e603a437ab7c4..163adbb125d824a2cd902a6ee3e225f861e7a44f 100644 (file)
@@ -94,8 +94,8 @@ l = @l@
 
 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 = 
diff --git a/m4/realloc.m4 b/m4/realloc.m4
new file mode 100644 (file)
index 0000000..b4afe93
--- /dev/null
@@ -0,0 +1,33 @@
+#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
+])