So there's a two-fold failure during compile when handling paths with
spaces.

The first is that the build fails when the code is in a path that has
spaces in it. This is because instances of "-I${some_foo}/include" in
autotools are not wrapped with quotation marks.

The second is when you invoke: ./configure --prefix="/some/path with a
space/in/it" --sysconfdir="/som/other/path with spaces". This is because
SWICU_DATA and GLOBCONFPATH are not properly escaped for that situation,
either.

An additional frustration, since I was in the autotools already to fix this
(the path on the CI server has spaces in it, because I absentmindedly
created the job with spaces in it) is that I can't finish a compile with
autotools out of stream (I like to do my builds in a subdir of the main
source dir so that things build artifacts and generated objects aren't
being intermingled with the code).

So I've attached a patch that fixes all of these problems.

--Greg
Index: Makefile.am
===================================================================
--- Makefile.am	(revision 3705)
+++ Makefile.am	(working copy)
@@ -48,7 +48,8 @@
 endif
 
 noinst_PROGRAMS = buildtest
-buildtest_SOURCES = buildtest.cpp
+buildtest_SOURCES = ${top_srcdir}/buildtest.cpp
+buildtest_CXXFLAGS = -I"${top_srcdir}/include"
 
 
 include locales.d/Makefile.am
Index: configure.ac
===================================================================
--- configure.ac	(revision 3705)
+++ configure.ac	(working copy)
@@ -312,8 +312,8 @@
 with_clucene=no
 if test "x$CLUCENE2_LIBS" != x; then
    echo "clucene 2.x found - lucene searching options available"
-   AM_CXXFLAGS="$AM_CXXFLAGS $CLUCENE2_CFLAGS -DUSELUCENE -DCLUCENE2 -I$libdir"
-   AM_CFLAGS="$AM_CFLAGS $CLUCENE2_CFLAGS -DUSELUCENE -DCLUCENE2 -I$libdir"
+   AM_CXXFLAGS="$AM_CXXFLAGS $CLUCENE2_CFLAGS -DUSELUCENE -DCLUCENE2 -I\"$libdir\""
+   AM_CFLAGS="$AM_CFLAGS $CLUCENE2_CFLAGS -DUSELUCENE -DCLUCENE2 -I\"$libdir\""
    LIBS="$LIBS $CLUCENE2_LIBS"
    with_clucene="yes 2.x"
    CLUCENE_LIBS="$CLUCENE_LIBS $CLUCENE2_LIBS"
@@ -320,8 +320,8 @@
 else
 if test "x$CLUCENE_LIBS" != x; then
    echo "lucene 0.x found - lucene searching options available"
-   AM_CXXFLAGS="$AM_CXXFLAGS $CLUCENE_CXXFLAGS -DUSELUCENE -I$libdir"
-   AM_CFLAGS="$AM_CFLAGS -DUSELUCENE -I$libdir"
+   AM_CXXFLAGS="$AM_CXXFLAGS $CLUCENE_CXXFLAGS -DUSELUCENE -I\"$libdir\""
+   AM_CFLAGS="$AM_CFLAGS -DUSELUCENE -I\"$libdir\""
    LIBS="$LIBS $CLUCENE_LIBS"
    with_clucene="yes 0.x"
 else
Index: examples/cmdline/Makefile.am
===================================================================
--- examples/cmdline/Makefile.am	(revision 3705)
+++ examples/cmdline/Makefile.am	(working copy)
@@ -1,7 +1,7 @@
 AUTOMAKE_OPTIONS = 1.6
-AM_CPPFLAGS = -I $(top_srcdir)/include
+AM_CPPFLAGS = -I "$(top_srcdir)/include"
 if USE_INTERNAL_REGEX
-AM_CPPFLAGS += -I$(top_srcdir)/include/internal/regex
+AM_CPPFLAGS += -I"$(top_srcdir)/include/internal/regex"
 endif
 LDADD = $(top_builddir)/lib/libsword.la
 
Index: examples/tasks/Makefile.am
===================================================================
--- examples/tasks/Makefile.am	(revision 3705)
+++ examples/tasks/Makefile.am	(working copy)
@@ -1,7 +1,7 @@
 AUTOMAKE_OPTIONS = 1.6
-AM_CPPFLAGS = -I $(top_srcdir)/include
+AM_CPPFLAGS = -I "$(top_srcdir)/include"
 if USE_INTERNAL_REGEX
-AM_CPPFLAGS += -I$(top_srcdir)/include/internal/regex
+AM_CPPFLAGS += -I"$(top_srcdir)/include/internal/regex"
 endif
 LDADD = $(top_builddir)/lib/libsword.la
 
@@ -13,4 +13,4 @@
 
 distclean-local:
 	-rm -f Makefile.in
-	
\ No newline at end of file
+	
Index: lib/Makefile.am
===================================================================
--- lib/Makefile.am	(revision 3705)
+++ lib/Makefile.am	(working copy)
@@ -1,13 +1,13 @@
 AUTOMAKE_OPTIONS = 1.6
 
-AM_CPPFLAGS = -I$(top_srcdir)/include
+AM_CPPFLAGS = -I"$(top_srcdir)/include"
 
 #TODO: Where else do we need this?
 if USE_INTERNAL_REGEX
-AM_CPPFLAGS += -I$(top_srcdir)/include/internal/regex
+AM_CPPFLAGS += -I"$(top_srcdir)/include/internal/regex"
 endif
 
-AM_CPPFLAGS += -I$(includedir) -DUSE_AUTOTOOLS -DUNIX -Dunix -D__unix__
+AM_CPPFLAGS += -I"$(includedir)" -DUSE_AUTOTOOLS -DUNIX -Dunix -D__unix__
 
 # Global config directory
 globalconfdir := @sysconfdir@
@@ -16,7 +16,7 @@
 
 libsword_la_SOURCES =
 if HAVE_ICU
-ICUDEF = -DSWICU_DATA=\"${pkglibdir}/${VERSION}_icu_${ICU_VER}\" 
+ICUDEF = -DSWICU_DATA="\"${pkglibdir}/${VERSION}_icu_${ICU_VER}\"" 
 else
 ICUDEF =
 endif
@@ -31,8 +31,8 @@
 include ../src/frontend/Makefile.am
 include ../src/modules/Makefile.am
 #include ../bindings/Makefile.am
-bindingsdir = $(top_srcdir)/bindings
-libsword_la_SOURCES += $(bindingsdir)/flatapi.cpp
+bindingsdir = "$(top_srcdir)/bindings"
+libsword_la_SOURCES += "$(bindingsdir)/flatapi.cpp"
 include ../include/Makefile.am
 
 
Index: src/mgr/Makefile.am
===================================================================
--- src/mgr/Makefile.am	(revision 3705)
+++ src/mgr/Makefile.am	(working copy)
@@ -1,7 +1,7 @@
 mgrdir = $(top_srcdir)/src/mgr
 
 if CONFDEF
-globdef = -DGLOBCONFPATH=\"${globalconfdir}/sword.conf\"
+globdef = -DGLOBCONFPATH="\"${globalconfdir}/sword.conf\""
 else
 globdef =
 endif
Index: tests/Makefile.am
===================================================================
--- tests/Makefile.am	(revision 3705)
+++ tests/Makefile.am	(working copy)
@@ -1,7 +1,7 @@
 AUTOMAKE_OPTIONS = 1.6
-AM_CPPFLAGS = -I $(top_srcdir)/include
+AM_CPPFLAGS = -I "$(top_srcdir)/include"
 if USE_INTERNAL_REGEX
-AM_CPPFLAGS += -I$(top_srcdir)/include/internal/regex
+AM_CPPFLAGS += -I"$(top_srcdir)/include/internal/regex"
 endif
 LDADD = $(top_builddir)/lib/libsword.la
 
Index: tests/cppunit/Makefile.am
===================================================================
--- tests/cppunit/Makefile.am	(revision 3705)
+++ tests/cppunit/Makefile.am	(working copy)
@@ -8,7 +8,7 @@
 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) -I"$(top_srcdir)/include"
 LibSword_LDFLAGS = $(CPPUNIT_LIBS)
 
 swcppunitpdir = $(top_srcdir)/tests/cppunit
Index: utilities/Makefile.am
===================================================================
--- utilities/Makefile.am	(revision 3705)
+++ utilities/Makefile.am	(working copy)
@@ -1,8 +1,8 @@
 AUTOMAKE_OPTIONS = 1.6
 SUBDIRS = diatheke
-AM_CPPFLAGS = -I $(top_srcdir)/include
+AM_CPPFLAGS = -I "$(top_srcdir)/include"
 if USE_INTERNAL_REGEX
-AM_CPPFLAGS += -I$(top_srcdir)/include/internal/regex
+AM_CPPFLAGS += -I"$(top_srcdir)/include/internal/regex"
 endif
 LDADD = $(top_builddir)/lib/libsword.la
 noinst_PROGRAMS = lexdump \
Index: utilities/diatheke/Makefile.am
===================================================================
--- utilities/diatheke/Makefile.am	(revision 3705)
+++ utilities/diatheke/Makefile.am	(working copy)
@@ -1,5 +1,6 @@
 AUTOMAKE_OPTIONS = 1.6
 
+AM_CPPFLAGS = -I"${top_srcdir}/include"
 LDADD = $(top_builddir)/lib/libsword.la
 
 bin_PROGRAMS = diatheke
_______________________________________________
sword-devel mailing list: sword-devel@crosswire.org
http://www.crosswire.org/mailman/listinfo/sword-devel
Instructions to unsubscribe/change your settings at above page

Reply via email to