FreeBSD, as well as -- I'm sure -- all Linux distributions already have
both the GNU getopt and the GNU regex functionality available -- either
as part of (g)libc or as additional libraries.

Using those will help cut the m4-executable's size (30% on my
FreeBSD/amd64), as well as avoid the bugs already fixed by the later
revisions of these libraries.

m4's configure should check for these and avoid compiling m4's own
regex.o and getopt*.o

Attached is the patch, I'm trying to include into FreeBSD port of m4 --
it should help illustrate, what I'm talking about.

Thanks! Yours,

        -mi

--- lib/Makefile.in	Wed Feb  9 15:48:35 2005
+++ lib/Makefile.in	Tue Sep 13 00:46:36 2005
@@ -39,8 +39,8 @@
 INCLUDES = -I.. -I$(srcdir)
 
-HEADERS = getopt.h obstack.h regex.h
-SOURCES = regex.c getopt.c getopt1.c error.c obstack.c xmalloc.c \
+HEADERS = obstack.h
+SOURCES = error.c obstack.c xmalloc.c \
 xstrdup.c alloca.c strtol.c
-OBJECTS = regex.o getopt.o getopt1.o error.o obstack.o xmalloc.o \
+OBJECTS = error.o obstack.o xmalloc.o \
 xstrdup.o @ALLOCA@ @LIBOBJS@
 
--- src/Makefile.in	Thu Mar 31 04:46:09 2005
+++ src/Makefile.in	Tue Sep 13 01:25:38 2005
@@ -79,5 +79,4 @@
 
 $(OBJECTS): $(ANSI2KNR) ../config.h m4.h ../lib/obstack.h
-builtin$O: ../lib/regex.h
 
 ansi2knr: ansi2knr.o
--- Makefile.in	Thu Mar 31 06:56:34 2005
+++ Makefile.in	Tue Sep 13 01:39:46 2005
@@ -37,5 +37,5 @@
 INSTALL_PROGRAM = @INSTALL_PROGRAM@
 LDFLAGS = @LDFLAGS@
-LIBS = @LIBS@
+LIBS = @LIBS@ -lgnuregex
 
 prefix = @prefix@
_______________________________________________
Bug-m4 mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/bug-m4

Reply via email to