File emacs-23.1-glibc.patch of Package emacs

--- lib-src/Makefile.in
+++ lib-src/Makefile.in	2009-08-10 18:11:16.653901806 +0200
@@ -232,6 +232,8 @@ LOADLIBES=LIBS_SYSTEM LIBS_MACHINE
    the information in ../src/config.h.  */
 ALL_CFLAGS = C_SWITCH_SYSTEM C_SWITCH_MACHINE -DHAVE_CONFIG_H \
    -I. -I../src -I${srcdir} -I${srcdir}/../src ${LDFLAGS} ${CPPFLAGS} ${CFLAGS}
+ETAGS_CFLAGS = C_SWITCH_SYSTEM C_SWITCH_MACHINE -DHAVE_CONFIG_H \
+   -I. -I${srcdir} ${LDFLAGS} ${CPPFLAGS} ${CFLAGS}
 LINK_CFLAGS = C_SWITCH_SYSTEM C_SWITCH_MACHINE -DHAVE_CONFIG_H \
    -I. -I../src -I${srcdir} -I${srcdir}/../src ${LDFLAGS} ${CFLAGS}
 CPP_CFLAGS = C_SWITCH_SYSTEM C_SWITCH_MACHINE -DHAVE_CONFIG_H \
@@ -380,21 +382,31 @@ getopt.h: getopt_.h
 	cp $(srcdir)/getopt_.h $@-t
 	mv $@-t $@
 
+#ifdef GETOPT_IN_LIBC
+GETOPTOBJS =
+GETOPTDEPS =
+#else
 GETOPTOBJS = @GETOPTOBJS@
 GETOPTDEPS = $(GETOPTOBJS) $(GETOPT_H)
 getopt.o: ${srcdir}/getopt.c $(GETOPT_H) ${srcdir}/gettext.h
 	${CC} -c ${CPP_CFLAGS} ${srcdir}/getopt.c
 getopt1.o: ${srcdir}/getopt1.c $(GETOPT_H)
 	${CC} -c ${CPP_CFLAGS} ${srcdir}/getopt1.c
+#endif
 
+#ifdef REGEXP_IN_LIBC
+REGEXPOBJ =
+REGEXPDEPS =
+#else
 REGEXPOBJ = regex.o
 REGEXPDEPS = $(REGEXPOBJ) $(srcdir)/../src/regex.h
+#endif
 
 regex.o: $(srcdir)/../src/regex.c $(srcdir)/../src/regex.h ../src/config.h
 	${CC} -c ${BASE_CFLAGS} -DCONFIG_BROKETS -DINHIBIT_STRING_HEADER ${srcdir}/../src/regex.c
 
 etags${EXEEXT}: ${srcdir}/etags.c $(GETOPTDEPS) $(REGEXPDEPS) ../src/config.h
-	$(CC) ${ALL_CFLAGS} -DEMACS_NAME="\"GNU Emacs\"" -DVERSION="\"${version}\"" ${srcdir}/etags.c $(GETOPTOBJS) $(REGEXPOBJ) $(LOADLIBES) -o etags
+	$(CC) ${ETAGS_CFLAGS} -DEMACS_NAME="\"GNU Emacs\"" -DVERSION="\"${version}\"" ${srcdir}/etags.c $(GETOPTOBJS) $(REGEXPOBJ) $(LOADLIBES) -o etags
 
 ebrowse${EXEEXT}: ${srcdir}/ebrowse.c $(GETOPTDEPS) ../src/config.h
 	$(CC) ${ALL_CFLAGS} -DVERSION="\"${version}\"" ${srcdir}/ebrowse.c $(GETOPTOBJS) $(LOADLIBES) -o ebrowse
@@ -402,7 +414,7 @@ ebrowse${EXEEXT}: ${srcdir}/ebrowse.c $(
 /* We depend on etags to assure that parallel makes don\'t write two
    etags.o files on top of each other.  */
 ctags${EXEEXT}: etags${EXEEXT}
-	$(CC) ${ALL_CFLAGS} -DCTAGS -DEMACS_NAME="\"GNU Emacs\"" -DVERSION="\"${version}\"" ${srcdir}/etags.c $(GETOPTOBJS) $(REGEXPOBJ) $(LOADLIBES) -o ctags
+	$(CC) ${ETAGS_CFLAGS} -DCTAGS -DEMACS_NAME="\"GNU Emacs\"" -DVERSION="\"${version}\"" ${srcdir}/etags.c $(GETOPTOBJS) $(REGEXPOBJ) $(LOADLIBES) -o ctags
 
 profile${EXEEXT}: ${srcdir}/profile.c ../src/config.h
 	$(CC) ${ALL_CFLAGS} ${srcdir}/profile.c $(LOADLIBES) -o profile
--- lib-src/etags.c
+++ lib-src/etags.c	2001-10-24 18:13:46.000000000 +0200
@@ -93,7 +93,7 @@ char pot_etags_version[] = "@(#) pot rev
 #endif
 
 #ifdef HAVE_CONFIG_H
-# include <config.h>
+# include <../src/config.h>
   /* On some systems, Emacs defines static as nothing for the sake
      of unexec.  We don't want that here since we don't use unexec. */
 # undef static
--- src/s/gnu-linux.h
+++ src/s/gnu-linux.h	2009-08-10 18:12:23.537901415 +0200
@@ -275,5 +275,15 @@ along with GNU Emacs.  If not, see <http
 #endif
 #endif
 
+/* we also have getopt and regex in the GNU C-library. */
+#define REGEXP_IN_LIBC
+#define GETOPT_IN_LIBC
+
+/* Use system malloc from glibc and memory mappging */
+#if !defined(__ia64__)
+# define SYSTEM_MALLOC
+# define USE_MMAP_FOR_BUFFERS
+#endif
+
 /* arch-tag: 6244ea2a-abd0-44ec-abec-ff3dcc9afea9
    (do not change this comment) */