|
From: Mariano Suarez-A. <msu...@ar...> - 2003-06-19 06:15:17
|
Hi all,
As you probably know, the file src/libs/scrollkeeper.h.in has a couple
of configuration path automake variables in it (prefix and another one)
The intent is, clearly, that they be substituted at configure time:
indeed, the file is listed in the AC_CONFIG_FILES. That does not work...
From the autoconf texinfo doc, one learns that
Most of these variables have values that rely on `prefix' or
`exec_prefix'. It is deliberate that the directory output
variables keep them unexpanded: typically `@datadir@' will be
replaced by `${prefix}/share', not `/usr/local/share'.
This behavior is mandated by the GNU coding standards, [...]
A corollary is that you should not use these variables except in
Makefiles. [...]
Similarly you should not rely on `AC_OUTPUT_FILES' to replace
`datadir' and friends in your shell scripts and other files, rather
let `make' manage their replacement.
After that, the docs go on to give an example, which, for scrollkeeper, leads easily following
The docs go on to give an example, which is easily adapted to fix the above
scrollkeeper bug. This is not a perfect fix, since BUILT_SOURCES only works
for a few targets, but oh well, most people just make && make install, so
that should be ok.
Here is a patch (which you'll also find as an attachment) to the latest
version I could get my hands on (cvs was down)
Cheers,
-- m
--- scrollkeeper-0.3.12-orig/configure.in 2003-01-23 03:10:57.000000000 -0300
+++ scrollkeeper-0.3.12/configure.in 2003-06-17 04:43:15.000000000 -0300
@@ -211,7 +211,6 @@
AC_OUTPUT(
libs/Makefile
-libs/scrollkeeper.h
libuuid/Makefile
cl/Makefile
cl/src/Makefile
--- scrollkeeper-0.3.12-orig/libs/Makefile.am 2003-01-23 03:10:57.000000000 -0300
+++ scrollkeeper-0.3.12/libs/Makefile.am 2003-06-17 04:43:19.000000000 -0300
@@ -17,5 +17,14 @@
database.c \
uninstall.c \
update-url.c
+
+# Note BUILT_SOURCES is only taken into account for `make all' and `make check'
+# This sucks, but oh well..
+BUILT_SOURCES = scrollkeeper.h
libscrollkeeper_la_LIBADD = $(XML_LIBS) $(XSLT_LIBS)
+
+scrollkeeper.h : Makefile scrollkeeper.h.in
+ sed -e 's,@localstatedir\@,$(localstatedir),g' \
+ -e 's,@prefix\@,$(prefix),g' \
+ scrollkeeper.h.in > scrollkeeper.h
|