[Snort-devel] Patch to allow cross-compiling with PCRE

Erik de Castro Lopo erikd+snort at ...2292...
Mon Jul 5 18:02:02 EDT 2004


Hi People,

Please accept the following patch (below my .sig) which has allows
the ./configure options of:

    --with-libpcre-includes
    --with-libpcre-libraries

to enable cross-compiling. I basically took the existing code to
do --with-pcap-* and hacked it.

This does not fix cross-compiling, but is a step closer. Hopefully 
more patches to come.

Cheers,
Erik
-- 
------------------------------------------------------
[N] Erik de Castro Lopo, Senior Computer Engineer
[E] erik.de.castro.lopo at ...2292...
[W] http://www.sensorynetworks.com
[T] +61 2 83022726 
[F] +61 2 94750316 
[A] L4/140 William St, East Sydney NSW 2011, Australia
------------------------------------------------------
A good debugger is no substitute for a good test suite.



? configure-pcre.diff
Index: configure.in
===================================================================
RCS file: /cvsroot/snort/configure.in,v
retrieving revision 1.136
diff -u -r1.136 configure.in
--- configure.in	21 Jun 2004 19:26:17 -0000	1.136
+++ configure.in	6 Jul 2004 00:48:52 -0000
@@ -303,9 +303,28 @@
    exit
 ])
 
+AC_ARG_WITH(libpcre_includes,
+	[  --with-libpcre-includes=DIR  libpcre include directory],
+	[with_libpcre_includes="$withval"],[with_libpcre_includes=no])
+
+AC_ARG_WITH(libpcre_libraries,
+	[  --with-libpcre-libraries=DIR  libpcre library directory],
+	[with_libpcre_libraries="$withval"],[with_libpcre_libraries=no])
+
+if test "$with_libpcre_includes" != "no"; then
+   CPPFLAGS="${CPPFLAGS} -I${with_libpcre_includes}"
+else
+   CPPFLAGS="${CPPFLAGS} `pcre-config --cflags`"
+fi
+
+if test "$with_libpcre_libraries" != "no"; then
+   LDFLAGS="${LDFLAGS}  -L${with_libpcre_libraries}"
+else
+   LDFLAGS="${LDFLAGS} `pcre-config --libs`"
+fi
+
 # PCRE configuration (required)
 # Verify that we have the headers
-CPPFLAGS="${CPPFLAGS} `pcre-config --cflags`"
 PCRE_H=""
 AC_CHECK_HEADERS(pcre.h,, PCRE_H="no")
 if test "$PCRE_H" = "no"; then
@@ -316,7 +335,6 @@
 fi
 
 # Verify that we have the library
-LDFLAGS="${LDFLAGS} `pcre-config --libs`"
 PCRE_L=""
 AC_CHECK_LIB(pcre, pcre_compile, ,PCRE_L="no")
 if test "$PCRE_L" = "no"; then




More information about the Snort-devel mailing list