From 9a43e5394cf652c1f40e0c158ff1c60025f05f3a Mon Sep 17 00:00:00 2001 From: david Date: Wed, 3 Oct 2007 08:11:45 +0000 Subject: [PATCH] Disable auto-generation of libpcre/pcre_chartables.c. That file is meant to be automatically generated by the makefile; however we include a copy to enable the Windows build to work. On Unix, the makefile was overwriting the file with a symbolic link to libpcre/pcre_chartables.c.dist, which was causing revision-control headaches. Now that file is copied instead of linked to, so its contents don't change. It is safe to use a static copy of the file instead of an auto-generated one because Nmap has never used the auto-generation feature. You need to use a special flag --enable-rebuild-chartables to get that. So copying the file has the same behavior as creating a link. Furthermore, it's not desirable to generate that file (using dftables, an auxiliary program that uses the current locale) because we don't want our regular expressions to be locale-dependent. pcre_chartables.c was also removed from CLEANFILES so it's not deleted by "make clean" or "make distclean". pcre.h is still deleted by "make distclean" because it's included in AC_CONFIG_FILES. That's not as big a deal. --- libpcre/Makefile.am | 4 +--- libpcre/Makefile.in | 17 ++++++++--------- libpcre/NMAP_MODIFICATIONS | 4 +++- 3 files changed, 12 insertions(+), 13 deletions(-) diff --git a/libpcre/Makefile.am b/libpcre/Makefile.am index b15fe6dcc..8e422f98a 100644 --- a/libpcre/Makefile.am +++ b/libpcre/Makefile.am @@ -42,7 +42,7 @@ else pcre_chartables.c: $(srcdir)/pcre_chartables.c.dist rm -f $@ - $(LN_S) $(srcdir)/pcre_chartables.c.dist $@ + cp -p $(srcdir)/pcre_chartables.c.dist $@ endif # WITH_REBUILD_CHARTABLES @@ -77,8 +77,6 @@ libpcre_a_SOURCES = \ ## This file is generated as part of the building process, so don't distribute. nodist_libpcre_a_SOURCES = pcre_chartables.c -CLEANFILES += pcre_chartables.c - # A compatibility line, the old build system worked with 'make test' test: check ; diff --git a/libpcre/Makefile.in b/libpcre/Makefile.in index 787c9b875..990628e8c 100644 --- a/libpcre/Makefile.in +++ b/libpcre/Makefile.in @@ -42,9 +42,8 @@ subdir = . DIST_COMMON = README $(am__configure_deps) $(include_HEADERS) \ $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ $(srcdir)/config.h.in $(srcdir)/pcre-config.in \ - $(srcdir)/pcre.h.in $(top_srcdir)/configure AUTHORS COPYING \ - ChangeLog INSTALL NEWS config.guess config.sub depcomp \ - install-sh missing + $(srcdir)/pcre.h.in $(top_srcdir)/configure AUTHORS INSTALL \ + config.guess config.sub depcomp install-sh missing ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ @@ -224,7 +223,7 @@ top_srcdir = @top_srcdir@ lib_LIBRARIES = libpcre.a # Additional files to delete on 'make clean' and 'make maintainer-clean'. -CLEANFILES = pcre_chartables.c +CLEANFILES = MAINTAINERCLEANFILES = pcre.h.generic # These are the header files we'll install. We do not distribute pcre.h because @@ -270,15 +269,15 @@ $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ - echo ' cd $(srcdir) && $(AUTOMAKE) --gnu '; \ - cd $(srcdir) && $(AUTOMAKE) --gnu \ + echo ' cd $(srcdir) && $(AUTOMAKE) --foreign '; \ + cd $(srcdir) && $(AUTOMAKE) --foreign \ && exit 0; \ exit 1;; \ esac; \ done; \ - echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu Makefile'; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign Makefile'; \ cd $(top_srcdir) && \ - $(AUTOMAKE) --gnu Makefile + $(AUTOMAKE) --foreign Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ @@ -780,7 +779,7 @@ pcre.h.generic: configure.ac @WITH_REBUILD_CHARTABLES_FALSE@pcre_chartables.c: $(srcdir)/pcre_chartables.c.dist @WITH_REBUILD_CHARTABLES_FALSE@ rm -f $@ -@WITH_REBUILD_CHARTABLES_FALSE@ $(LN_S) $(srcdir)/pcre_chartables.c.dist $@ +@WITH_REBUILD_CHARTABLES_FALSE@ cp -p $(srcdir)/pcre_chartables.c.dist $@ # A compatibility line, the old build system worked with 'make test' test: check ; diff --git a/libpcre/NMAP_MODIFICATIONS b/libpcre/NMAP_MODIFICATIONS index 89dc4bc79..8362d6e4c 100644 --- a/libpcre/NMAP_MODIFICATIONS +++ b/libpcre/NMAP_MODIFICATIONS @@ -40,7 +40,9 @@ o Got rid of the C++ wrapper, which included this step: o Copied pcre.h.generic to pcre.h and pcre_chartables.c.dist to, you guessed it, pcre_chartables.c (for Windows). Running ./configure in - UNIX just overwrites them with other ones. + UNIX just overwrites them with other ones. Made the rule that makes + pcre_chartables.c copy pcre_chartables.c.dist instead of making a + symbolic link to it. Remove pcre_chartables.c from CLEANFILES. o Stripped down Makefile.am and configure.ac substantially to remove libtool dependency (was having trouble on Mac OS X), remove Windows