diff options
-rw-r--r-- | ChangeLog | 9 | ||||
-rw-r--r-- | Makefile.am | 2 | ||||
-rw-r--r-- | bootstrap/Makefile.try | 135 | ||||
-rw-r--r-- | lib/Makefile.am | 2 |
4 files changed, 107 insertions, 41 deletions
@@ -14,7 +14,14 @@ (main) : Register with atexit() to check for error on stdout. * configure.in : Check for atexit(), call jm_MALLOC, jm_RELLOC and jm_PREREQ_ERROR. - + * tests/bre.awk : Removed the hack to drain the buffer since we + always fclose(stdout) atexit. + * tests/ere.awk : Likewise. + * tests/spencer1.awk : Likewise. + * bootstrap/Makefile.try : Update the Makefile to reflect the changes + in the new hierarchy. + + * README-alpha : New File. * m4/realloc.m4 : New File. * m4/malloc.m4 : New File. * m4/error.m4 : New File. diff --git a/Makefile.am b/Makefile.am index 0a5d1803..204509f9 100644 --- a/Makefile.am +++ b/Makefile.am @@ -3,7 +3,7 @@ AUTOMAKE_OPTIONS = no-dependencies SUBDIRS = intl po lib doc src tests djgpp m4 vms bootstrap -EXTRA_DIST = TODO README PATCHES.AC PATCHES.AM +EXTRA_DIST = TODO README README-alpha PATCHES.AC PATCHES.AM # We should be able to just define `ACLOCAL_AMFLAGS = --acdir=m4', # but this runs afoul of a bug in automake 1. diff --git a/bootstrap/Makefile.try b/bootstrap/Makefile.try index b34f0b2d..50fa51be 100644 --- a/bootstrap/Makefile.try +++ b/bootstrap/Makefile.try @@ -1,28 +1,55 @@ # -## DOS/WIN (not including DJGPP): -# OBJEXT = obj -# EXEEXT = .exe -EXEEXT = +# Define for DOS/WIN (not including DJGPP): +#OBJEXT = obj +#EXEEXT = .exe +EXEEXT = OBJEXT = o - -OBJS = alloca.$(OBJEXT) \ +# Source of grep. +OBJS = \ dfa.$(OBJEXT) \ - getopt.$(OBJEXT) \ - getopt1.$(OBJEXT) \ grep.$(OBJEXT) \ kwset.$(OBJEXT) \ - hard-local.$(OBJEXT) \ - isdir.$(OBJEXT) \ - memchr.$(OBJEXT) \ - obstack.$(OBJEXT) \ - regex.$(OBJEXT) \ - savedir.$(OBJEXT) \ - search.$(OBJEXT) \ - xstrtol.$(OBJEXT) \ - xstrtoumax.$(OBJEXT) \ - stpcpy.$(OBJEXT) + search.$(OBJEXT) + +# Supporting routines. +LIB_OBJS_core = \ + $(libdir)/closeout.$(OBJEXT) \ + $(libdir)/error.$(OBJEXT) \ + $(libdir)/exclude.$(OBJEXT) \ + $(libdir)/hard-locale.$(OBJEXT) \ + $(libdir)/isdir.$(OBJEXT) \ + $(libdir)/quotearg.$(OBJEXT) \ + $(libdir)/regex.$(OBJEXT) \ + $(libdir)/savedir.$(OBJEXT) \ + $(libdir)/strtoumax.$(OBJEXT) \ + $(libdir)/xmalloc.$(OBJEXT) \ + $(libdir)/xstrtol.$(OBJEXT) \ + $(libdir)/xstrtoumax.$(OBJEXT) + +# Comment out functions already supported as needed. +#LIB_OBJ_atexit = $(libdir)/atexit.$(OBJEXT) +#LIB_OBJ_alloca = $(libdir)/alloca.$(OBJEXT) +#LIB_OBJ_fnmatch = $(libdir)/fnmatch.$(OBJEXT) +#LIB_OBJ_getopt = $(libdir)/getopt.$(OBJEXT) $(libdir)/getopt1.$(OBJEXT) +#LIB_OBJ_memchr = $(libdir)/memchr.$(OBJEXT) +#LIB_OBJ_obstack = $(libdir)/obstack.$(OBJEXT) +#LIB_OBJ_strtoul = $(libdir)/strtoul.$(OBJEXT) +LIB_OBJ_stpcpy = $(libdir)/stpcpy.$(OBJEXT) +LIB_OBJ_strtoull = $(libdir)/strtoull.$(OBJEXT) + +LIB_OBJS = $(LIB_OBJS_core) $(LIB_OBJ_atexit) $(LIB_OBJ_alloca) \ + $(LIB_OBJ_fnmatch) $(LIB_OBJ_getopt) $(LIB_OBJ_memchr) \ + $(LIB_OBJ_obstack) $(LIB_OBJ_strtoul) $(LIB_OBJ_stpcpy) \ + $(LIB_OBJ_strtoull) + +# For Linux +#LIB_OBJS = $(LIB_OBJS_core) + +# For QNX/Neutrino +#LIB_OBJS = $(LIB_OBJS_core) $(LIB_OBJ_getopt) $(LIB_OBJ_obstack) \ +# $(LIB_OBJ_stpcpy) $(LIB_OBJ_strtoull) # Where is DIR and opendir/readdir defined. # or -DHAVE_DIRENT_H @@ -35,44 +62,74 @@ OBJS = alloca.$(OBJEXT) \ # # default dry run -DEFS = -I. \ - -DSTDC_HEADERS \ - -DHAVE_MEMCHR \ - -DHAVE_DIRENT_H \ - -DHAVE_STRERROR \ - -Dconst= \ - -Dsize_t=unsigned +DEFS_core = \ + -DSTDC_HEADERS \ + -DHAVE_MEMCHR \ + -DHAVE_DIRENT_H \ + -DHAVE_STRERROR \ + -Dconst= \ + -Dsize_t=unsigned \ + -Duintmax_t=long # SunOS-4.1.x k&r cc -#DEFS = -DSTDC_HEADERS -DHAVE_MEMCHR -DHAVE_DIRENT_H -Dconst= +#DEFS_sunos = -DSTDC_HEADERS -DHAVE_MEMCHR -DHAVE_DIRENT_H -Dconst= # Solaris -#DEFS = -DSTDC_HEADERS -DHAVE_MEMCHR -DHAVE_DIRENT_H -DHAVE_STRERROR +#DEFS_solaris = -DSTDC_HEADERS -DHAVE_MEMCHR -DHAVE_DIRENT_H -DHAVE_STRERROR # DOS/WIN (change also OBJEXT/EXEEXT, see above) # DOS/DJGPP -DEFS = -DSTDC_HEADERS -DHAVE_MEMCHR -DHAVE_STRERROR -DHAVE_DIRENT_H \ - -DHAVE_DOS_FILE_CONTENTS \ - -DHAVE_DOS_FILE_NAMES -DHAVE_UNISTD_H -DHAVE_SETMODE +DEFS_dos = -DSTDC_HEADERS -DHAVE_MEMCHR -DHAVE_STRERROR -DHAVE_DIRENT_H \ + -DHAVE_DOS_FILE_CONTENTS \ + -DHAVE_DOS_FILE_NAMES -DHAVE_UNISTD_H -DHAVE_SETMODE + +# If support ANSI C prototypes +DEFS_ansi_c = -DPROTOTYPES + +# No wchar support +# DEFS_wchar = -DUSE_WIDE_CHAR -DHAVE_WCHAR_H +DEFS_wchar = -Dwchar_t=int -Dmbstate_t=int + +# Is strtol() and strtoul() declarared ? +#DEFS_strtol = -DHAVE_DECL_STRTOULL=0 -DHAVE_DECL_STRTOUL=0 +DEFS_strtol = -DHAVE_DECL_STRTOULL=1 -DHAVE_DECL_STRTOUL=1 + +# Define if malloc(0)/realloc(0) works +#DEFS_alloc = -DHAVE_DONE_WORKING_MALLOC_CHECK=0 \ +# -DHAVE_DONE_WORKING_REALLOC_CHECK=0 +DEFS_alloc = -DHAVE_DONE_WORKING_MALLOC_CHECK=1 \ + -DHAVE_DONE_WORKING_REALLOC_CHECK=1 + +DEFS = $(DEFS_core) $(DEFS_ansi_c) $(DEFS_wchar) $(DEFS_strtol) $(DEFS_alloc) \ + -DHAVE_DECL_STRERROR_R=0 -DHAVE_VPRINTF -DCHAR_BIT=8 + #### -CFLAGS = $(DEFS) -I. -DVERSION=\"bootstrap\" -DPACKAGE=\"grep\" +CFLAGS = $(DEFS) -I. -I.. -I$(libdir) -DVERSION=\"bootstrap\" -DPACKAGE=\"grep\" + +libdir = ../lib PROGS = grep$(EXEEXT) egrep$(EXEEXT) fgrep$(EXEEXT) -all : $(PROGS) +libgreputils_a = $(libdir)/libgreputils.a + +all : $(libgreputils_a) $(PROGS) + +grep$(EXEEXT) : $(OBJS) grepmat.$(OBJEXT) $(libgreputils_a) + $(CC) $(OBJS) grepmat.$(OBJEXT) -o grep $(libgreputils_a) -grep$(EXEEXT) : $(OBJS) grepmat.$(OBJEXT) - $(CC) $(OBJS) grepmat.$(OBJEXT) -o grep +egrep$(EXEEXT) : $(OBJS) egrepmat.$(OBJEXT) $(libgreputils_a) + $(CC) $(OBJS) egrepmat.$(OBJEXT) -o egrep $(libgreputils_a) -egrep$(EXEEXT) : $(OBJS) egrepmat.$(OBJEXT) - $(CC) $(OBJS) egrepmat.$(OBJEXT) -o egrep +fgrep$(EXEEXT) : $(OBJS) fgrepmat.$(OBJEXT) $(libgreputils_a) + $(CC) $(OBJS) fgrepmat.$(OBJEXT) -o fgrep $(libgreputils_a) -fgrep$(EXEEXT) : $(OBJS) fgrepmat.$(OBJEXT) - $(CC) $(OBJS) fgrepmat.$(OBJEXT) -o fgrep +$(libgreputils_a) : $(LIB_OBJS) + $(AR) $(ARFLAGS) $(libgreputils_a) $(LIB_OBJS) clean : $(RM) grepmat.$(OBJEXT) egrepmat.$(OBJEXT) fgrepmat.$(OBJEXT) - $(RM) $(OBJS) + $(RM) $(OBJS) $(RM) $(PROGS) + $(RM) $(libgreputils_a) $(LIB_OBJS) diff --git a/lib/Makefile.am b/lib/Makefile.am index c7f08ec5..fb5985aa 100644 --- a/lib/Makefile.am +++ b/lib/Makefile.am @@ -18,3 +18,5 @@ noinst_HEADERS = \ closeout.h error.h exclude.h fnmatch.h getopt.h \ hard-locale.h obstack.h quotearg.h regex.h savedir.h xalloc.h xstrtol.h +EXTRA_DIST = strtol.c + |