Can't save in r12331

Chris Shoemaker c.shoemaker at cox.net
Fri Jan 13 20:54:27 EST 2006


On Fri, Jan 13, 2006 at 08:44:29PM -0500, Derek Atkins wrote:
> Quoting Chris Shoemaker <c.shoemaker at cox.net>:
> 
> >>Index: src/engine/Makefile.am
> >>===================================================================
> >>--- src/engine/Makefile.am	(revision 12339)
> >>+++ src/engine/Makefile.am	(working copy)
> >>@@ -10,6 +10,7 @@
> >> 	-I${top_srcdir}/src/gnc-module \
> >> 	-I${top_srcdir}/src/business/business-core/ \
> >> 	${QOF_CFLAGS} \
> >>+	-DQOF_LIB_DIR=\"${QOF_LIB_DIR}\" \
> >> 	${GNUCASH_ENGINE_CFLAGS}
> >>
> >> libgncmod_engine_la_SOURCES = \
> >
> >Like Derek said, the symbol is already defined.  It's just wrong.
> >This patch raises an interesting question, though.  What does cpp do
> >if you supply a macro definition as a command line argument _and_ in a
> >#define?  I have no idea, but I'm curious.
> 
> I'm not sure.  I'm surprised it works at all -- I would've expected it
> to see a double define.   QOF_LIB_DIR is defined in qofla-dir.h which
> is pulled in from qof.h.

Yeah, I tried it and got a compiler error.  I'm not sure why it worked
for Thomas.

> >Anyway, either method is valid by itself, and I happen to like this
> >method better for a symbol that only needs to be visible in a few
> >places rather than many.  And I prefer a real #define in some header
> >for a symbol that is used in many places.
> 
> I disagree.  We should make sure that qofla-dir.h is correct.

Other than being the smallest change, why?  Is qofla-dir.h supposed to
be part of the public API of QOF?

> >I think the simplest solution to the current problem is along these lines:
> >
> >+   -DQOF_LIB_DIR=\"${libdir}\" \
> >
> >and just forget the configure.in stuff.  I'm going to test something
> >like this shortly.
> 
> I don't like this at all, and it would totally screw you over if you have
> an external QOF.
> 
> Actually, i think I know what the problem is.  I think we're evaluating the
> variable too early.  I think we want to say something like:
> 
>   QOF_LIB_DIR='$(libdir)'
> 
> and just leave it at that.  The single-quotes are the important part.  I
> think that will do the right thing.

The attached patch has been working for me, even for regular installs.
I think it's right.  And it's completely trivial.

-chris
-------------- next part --------------
Index: configure.in
===================================================================
--- configure.in	(revision 12347)
+++ configure.in	(working copy)
@@ -451,14 +451,10 @@
   AC_MSG_NOTICE([External QOF Disabled.  Using Internal QOF Code.])
 fi
 if test x$QOF_XML_DIR = x; then
-	QOF_LIB_DIR=`eval echo $libdir | sed "s%^NONE%$prefix%"`
-	QOF_LIB_DIR=`eval echo $QOF_LIB_DIR | sed "s%^NONE%$prefix%"`  
 	QOF_CFLAGS="-I\${top_srcdir}/lib/libqof/qof"
 	QOF_LIBS="\${top_srcdir}/lib/libqof/qof/libqof.la"
-#	QOF_LIB_DIR=`eval echo ${libdir}`
 	QOF_VERSION="internal"
 	QOF_PREFIX="internal"
-	QOF_XML_DIR=`eval echo ${datadir}/xml/qsf`
 	LIBQOF_LIBRARY_VERSION=1:2:0
 	LIBQOF_BACKEND_QSF_LIBRARY_VERSION=0:1:0
 	AC_SUBST(LIBQOF_LIBRARY_VERSION)
Index: lib/libqof/backend/file/Makefile.am
===================================================================
--- lib/libqof/backend/file/Makefile.am	(revision 12347)
+++ lib/libqof/backend/file/Makefile.am	(working copy)
@@ -19,7 +19,7 @@
  ${GLIB_LIBS} \
  ${LIBXML2_LIBS}
 
-qsfschemadir = $(QOF_XML_DIR)
+qsfschemadir = $(datadir)/xml/qsf
 qsfschema_DATA = \
  qsf-object.xsd.xml \
  qsf-map.xsd.xml \
@@ -31,10 +31,10 @@
   qof-backend-qsf.h \
   qsf-xml.h
 
-qsf-dir.h: qsf-dir.h.in
+qsf-dir.h: qsf-dir.h.in Makefile
 	rm -f $@.tmp
 	sed < $< > $@.tmp \
-	        -e 's:@-QSF_SCHEMA_DIR-@:${QOF_XML_DIR}:g'
+	        -e 's:@-QSF_SCHEMA_DIR-@:${qsfschemadir}:g'
 	mv $@.tmp $@
 
 BUILT_SOURCES = qsf-dir.h
Index: lib/libqof/qof/Makefile.am
===================================================================
--- lib/libqof/qof/Makefile.am	(revision 12347)
+++ lib/libqof/qof/Makefile.am	(working copy)
@@ -75,16 +75,14 @@
    qofquerycore-p.h \
    qofsession-p.h
 
-QOFLIBdir = $(QOF_LIB_DIR)
-
 EXTRA_DIST = \
   qofla-dir.h.in \
   qofmath128.c
 
-qofla-dir.h: qofla-dir.h.in
+qofla-dir.h: qofla-dir.h.in Makefile
 	rm -f $@.tmp
 	sed < $< > $@.tmp \
-                -e 's:@-libdir-@:${QOFLIBdir}:g'
+                -e 's:@-libdir-@:${libdir}:g'
 	 mv $@.tmp $@
 
 BUILT_SOURCES = qofla-dir.h


More information about the gnucash-devel mailing list