configure.in: Properly set QOF_LIB_DIR et. al. for internal qof.

Chris Shoemaker c.shoemaker at cox.net
Fri Jan 13 21:44:43 EST 2006


On Fri, Jan 13, 2006 at 08:53:48PM -0500, Derek Atkins wrote:
> Modified: gnucash/trunk/configure.in
> ===================================================================
> --- gnucash/trunk/configure.in	2006-01-13 23:57:36 UTC (rev 12347)
> +++ gnucash/trunk/configure.in	2006-01-14 01:53:47 UTC (rev 12348)
> @@ -451,14 +451,12 @@
>    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_LIB_DIR='${libdir}'
> +	QOF_CFLAGS='-I${top_srcdir}/lib/libqof/qof'
> +	QOF_LIBS='${top_srcdir}/lib/libqof/qof/libqof.la'
>  	QOF_VERSION="internal"
>  	QOF_PREFIX="internal"
> -	QOF_XML_DIR=`eval echo ${datadir}/xml/qsf`
> +	QOF_XML_DIR='${datadir}/xml/qsf'
>  	LIBQOF_LIBRARY_VERSION=1:2:0
>  	LIBQOF_BACKEND_QSF_LIBRARY_VERSION=0:1:0
>  	AC_SUBST(LIBQOF_LIBRARY_VERSION)

According to the autoconf manual (1), "In order to support these
features [changing --prefix at make-time, et al.], it is essential
that datadir remains being defined as `${prefix}/share' to depend upon
the current value of prefix. A corollary is that you should not use
these variables [all of the "installation directory variables"] except
in Makefiles."

The CFLAGS and LIBS are fine, but not $datadir or $libdir.  The GNU
convention for Makefile's (2) allows the user to specify the
installation prefix to 'make'.  Of course, the Makefiles we generate
allow this conventional usage, but it won't work if we use $datadir in
configure.in.

That's why I like my change better.  It's almost identical to what
you've done, except it just moves the evaluation of $datadir and
$libdir from configure.in to the Makefiles, so as to not break the
make --prefix usage.

BTW, we're breaking this rule for goffice, too.  Maybe the fix is the
same.

-chris

(1) http://www.gnu.org/software/autoconf/manual/autoconf-2.57/html_mono/autoconf.html#SEC24

(2) http://www.gnu.org/software/make/manual/html_chapter/make_14.html#SEC130


More information about the gnucash-devel mailing list