This time around when searching for regex it will add additional
-llibrary flags if required.

For example on my linux it doesn't add any (prints none required) on
windows it should add a flag.

-- 
With best regards


Dmitrijs Ledkovs (for short Dima),
Ледков Дмитрий Юрьевич

()  ascii ribbon campaign - against html e-mail
/\  www.asciiribbon.org   - against proprietary attachments
------------------------------------------------------------
revno: 2436
committer: Dmitrijs Ledkovs <[email protected]>
branch nick: trunk
timestamp: Thu 2009-12-17 01:53:52 +0000
message:
  Adding option to build with/without sword regex
diff:
=== modified file 'configure.ac'
--- configure.ac	2009-12-10 03:20:14 +0000
+++ configure.ac	2009-12-17 01:53:52 +0000
@@ -19,8 +19,6 @@
 
 case $host_os in
      mingw*)
-	   # if we don't have system regex, use SWORD's copy
-           AC_CHECK_LIB(regex, regexec,,target_mingw32="yes")
 	   # both lines necessary to convince gcc to build dll
 	   LIBS="$LIBS -no-undefined";
 	   export lt_cv_deplibs_check_method=pass_all;
@@ -66,6 +64,8 @@
 	AC_HELP_STRING([--with-curl],[build install manager support using libcurl (default=yes)]),,with_curl=yes)
 #AC_ARG_WITH(lucene,
 #	AC_HELP_STRING([--with-lucene],[include lucene support for searching (default=no)]),,with_lucene=no)
+AC_ARG_WITH([regex],
+	AS_HELP_STRING([--with-regex], [Compile using internal copy of regex]))
 
 
 # ---------------------------------------------------------------------
@@ -123,6 +123,17 @@
 	AM_CXXFLAGS="$AM_CXXFLAGS -DEXCLUDEZLIB"
 fi
 
+AS_IF([test "x$with_regex" = "xyes"],
+      [have_systemregex=no],
+      [AC_SEARCH_LIBS(regexec, regex, [have_systemregex=yes], [have_systemregex=no])])
+
+AS_IF([test "x$have_systemregex" = "xyes"],
+      [AC_MSG_NOTICE([Using system regex.h])],
+      [AS_IF([test "x$with_regex" = "xno"],
+      	[AC_MSG_ERROR([System regex forced but not found])],
+	[AC_MSG_NOTICE([Using internal regex.h])])])
+
+AM_CONDITIONAL(SYSTEM_REGEX, test "$have_systemregex")
 
 # ---------------------------------------------------------------------
 # Find CppUnit

=== modified file 'examples/cmdline/Makefile.am'
--- examples/cmdline/Makefile.am	2009-02-17 02:31:04 +0000
+++ examples/cmdline/Makefile.am	2009-12-17 01:53:52 +0000
@@ -1,5 +1,5 @@
 AUTOMAKE_OPTIONS = 1.6
-INCLUDES = -I $(top_srcdir)/include
+include $(top_srcdir)/include/Makefile.am
 LDADD = $(top_builddir)/lib/libsword.la
 
 noinst_PROGRAMS = lookup search threaded_search listoptions verserangeparse outplain outrender

=== modified file 'include/Makefile.am'
--- include/Makefile.am	2009-12-03 22:36:02 +0000
+++ include/Makefile.am	2009-12-17 01:53:52 +0000
@@ -75,7 +75,8 @@
 pkginclude_HEADERS += $(swincludedir)/rawstr4.h
 pkginclude_HEADERS += $(swincludedir)/rawtext.h
 pkginclude_HEADERS += $(swincludedir)/rawverse.h
-if MINGW
+if SYSTEM_REGEX
+else
 pkginclude_HEADERS += $(swincludedir)/regex.h
 endif
 pkginclude_HEADERS += $(swincludedir)/roman.h

=== modified file 'include/config.h'
--- include/config.h	2009-12-07 04:02:43 +0000
+++ include/config.h	2009-12-17 01:53:52 +0000
@@ -59,6 +59,9 @@
 /* Define to the one symbol short name of this package. */
 #define PACKAGE_TARNAME "sword"
 
+/* Define to the home page for this package. */
+#define PACKAGE_URL ""
+
 /* Define to the version of this package. */
 #define PACKAGE_VERSION "1.6.0"
 

=== modified file 'lib/Makefile.am'
--- lib/Makefile.am	2009-12-03 22:36:02 +0000
+++ lib/Makefile.am	2009-12-17 01:53:52 +0000
@@ -1,6 +1,5 @@
 AUTOMAKE_OPTIONS = 1.6
-AM_CPPFLAGS = -I$(top_srcdir)/include -I$(includedir) 
-AM_CPPFLAGS += -DUSE_AUTOTOOLS -DUNIX -Dunix -D__unix__
+AM_CPPFLAGS = -DUSE_AUTOTOOLS -DUNIX -Dunix -D__unix__
 
 # Global config directory
 globalconfdir := @sysconfdir@

=== modified file 'src/utilfuns/Makefile.am'
--- src/utilfuns/Makefile.am	2009-12-03 22:36:02 +0000
+++ src/utilfuns/Makefile.am	2009-12-17 01:53:52 +0000
@@ -29,10 +29,10 @@
 libsword_la_SOURCES += $(UNTGZ) 
 libsword_la_SOURCES += $(ftpsrc)
 
-if MINGW
+if SYSTEM_REGEX
+SWREGEX =
+else
 SWREGEX = $(utilfunsdir)/regex.c
-else
-SWREGEX =
 endif
 libsword_la_SOURCES += $(SWREGEX)
 

=== modified file 'tests/Makefile.am'
--- tests/Makefile.am	2009-12-03 22:36:02 +0000
+++ tests/Makefile.am	2009-12-17 01:53:52 +0000
@@ -1,5 +1,5 @@
 AUTOMAKE_OPTIONS = 1.6
-INCLUDES = -I $(top_srcdir)/include
+include $(top_srcdir)/include/Makefile.am
 LDADD = $(top_builddir)/lib/libsword.la
 
 SUBDIRS = cppunit

=== modified file 'tests/cppunit/Makefile.am'
--- tests/cppunit/Makefile.am	2005-04-11 17:48:28 +0000
+++ tests/cppunit/Makefile.am	2009-12-17 01:53:52 +0000
@@ -8,9 +8,10 @@
 endif
 check_PROGRAMS = $(TESTS)
 LibSword_SOURCES = main.cpp stringmgr_test.cpp swbuf_test.cpp url_test.cpp versekey_test.cpp 
-LibSword_CXXFLAGS = $(CPPUNIT_CFLAGS) -I$(top_srcdir)/include
+LibSword_CXXFLAGS = $(CPPUNIT_CFLAGS)
 LibSword_LDFLAGS = $(CPPUNIT_LIBS)
 
 swcppunitpdir = $(top_srcdir)/tests/cppunit
 
+include $(top_srcdir)/include/Makefile.am
 #all: check

=== modified file 'utilities/Makefile.am'
--- utilities/Makefile.am	2009-12-03 22:36:02 +0000
+++ utilities/Makefile.am	2009-12-17 01:53:52 +0000
@@ -1,6 +1,6 @@
 AUTOMAKE_OPTIONS = 1.6
 SUBDIRS = diatheke
-INCLUDES = -I $(top_srcdir)/include
+include $(top_srcdir)/include/Makefile.am
 LDADD = $(top_builddir)/lib/libsword.la
 noinst_PROGRAMS = cipherraw lexdump \
 stepdump step2vpl gbfidx modwrite addvs emptyvss \
_______________________________________________
sword-devel mailing list: [email protected]
http://www.crosswire.org/mailman/listinfo/sword-devel
Instructions to unsubscribe/change your settings at above page

Reply via email to