Hello,

I tried building GSL as follows
$ ./configure
$ make prefix=/home/peter
after which
$ /bin/sh gsl-config --prefix
returns '/usr/local' a bit unexpectedly. I could, of course, set the prefix at configure time instead and everything would work as expected, but AFAICU the GNU Coding Standards requires that builders can set installations directories at make time:

http://www.gnu.org/prep/standards/standards.html#Directory-Variables

The Autoconf manual discusses this further and suggests a solution, in which make creates the script by "sed massaging" a script.in, rather than through config.status:

http://www.gnu.org/software/autoconf/manual/autoconf.html#Installation-Directory-Variables

Please find attached a patch that implements the solution suggested by the Autoconf people.

Thank you,

--
Peter Johansson

svndigest maintainer, http://dev.thep.lu.se/svndigest
yat maintainer,       http://dev.thep.lu.se/yat

Index: Makefile.am
===================================================================
RCS file: /srv/git/gsl.git/HEAD/Makefile.am,v
retrieving revision 1.132
diff -u Makefile.am
--- Makefile.am revision 1.132
+++ Makefile.am working copy
@@ -13,6 +13,8 @@
 pkgconfigdir = $(libdir)/pkgconfig
 pkgconfig_DATA= gsl.pc
 
+CLEANFILES = gsl.pc gsl-config
+
 EXTRA_DIST = autogen.sh gsl-config.in gsl.pc.in configure.ac THANKS BUGS SUPPORT gsl.spec.in gsl.m4 test_gsl_histogram.sh
 
 lib_LTLIBRARIES = libgsl.la
@@ -46,3 +48,24 @@
 #dummy_LDADD = $(SUBLIBS)
 #main_SOURCES = version.c env.c
 #main_LDADD = libgsl.la
+
+edit = $(SED) \
+	-e 's|@pref...@]|$(prefix)|g' \
+	-e 's|@exec_pref...@]|$(exec_prefix)|g' \
+	-e 's|@libd...@]|$(libdir)|g' \
+	-e 's|@included...@]|$(includedir)|g' \
+	-e 's|@gsl_cfla...@]|$(GSL_CFLAGS)|g' \
+	-e 's|@gsl_li...@]|$(GSL_LIBS)|g' \
+	-e 's|@li...@]|$(LIBS)|g' \
+	-e 's|@versi...@]|$(VERSION)|g'
+
+gsl-config gsl.pc: Makefile 
+	@rm -f $@ [email protected]
+	@$(edit) '$(srcdir)/[email protected]' >>[email protected]
+	@chmod a-w [email protected]
+	@mv [email protected] $@
+	@echo creating $@
+
+gsl-config: $(srcdir)/gsl-config.in
+gsl.pc: $(srcdir)/gsl.pc.in
+
Index: configure.ac
===================================================================
RCS file: /srv/git/gsl.git/HEAD/configure.ac,v
retrieving revision 1.50
diff -u configure.ac
--- configure.ac revision 1.50
+++ configure.ac working copy
@@ -534,5 +534,5 @@
 #define GSL_DISABLE_DEPRECATED 1])
 
 dnl
-AC_CONFIG_FILES([gsl-config gsl.pc gsl_version.h gsl.spec gsl/Makefile test/Makefile err/Makefile sys/Makefile utils/Makefile const/Makefile min/Makefile multimin/Makefile ieee-utils/Makefile fft/Makefile specfunc/Makefile dht/Makefile fit/Makefile multifit/Makefile bspline/Makefile statistics/Makefile sum/Makefile roots/Makefile multiroots/Makefile ntuple/Makefile poly/Makefile qrng/Makefile rng/Makefile randist/Makefile siman/Makefile integration/Makefile interpolation/Makefile doc/Makefile block/Makefile vector/Makefile matrix/Makefile histogram/Makefile monte/Makefile ode-initval/Makefile cblas/Makefile blas/Makefile linalg/Makefile eigen/Makefile permutation/Makefile combination/Makefile sort/Makefile complex/Makefile diff/Makefile deriv/Makefile cheb/Makefile cdf/Makefile wavelet/Makefile Makefile])
+AC_CONFIG_FILES([gsl_version.h gsl.spec gsl/Makefile test/Makefile err/Makefile sys/Makefile utils/Makefile const/Makefile min/Makefile multimin/Makefile ieee-utils/Makefile fft/Makefile specfunc/Makefile dht/Makefile fit/Makefile multifit/Makefile bspline/Makefile statistics/Makefile sum/Makefile roots/Makefile multiroots/Makefile ntuple/Makefile poly/Makefile qrng/Makefile rng/Makefile randist/Makefile siman/Makefile integration/Makefile interpolation/Makefile doc/Makefile block/Makefile vector/Makefile matrix/Makefile histogram/Makefile monte/Makefile ode-initval/Makefile cblas/Makefile blas/Makefile linalg/Makefile eigen/Makefile permutation/Makefile combination/Makefile sort/Makefile complex/Makefile diff/Makefile deriv/Makefile cheb/Makefile cdf/Makefile wavelet/Makefile Makefile])
 AC_OUTPUT
_______________________________________________
Bug-gsl mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/bug-gsl

Reply via email to