bug-gsl
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Bug-gsl] [PATCH] honor prefix et al variables at make time when buildin


From: Peter Johansson
Subject: [Bug-gsl] [PATCH] honor prefix et al variables at make time when building gsl-config
Date: Thu, 09 Apr 2009 14:05:53 -0400
User-agent: Thunderbird 2.0.0.19 (X11/20090105)

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|@address@hidden|$(prefix)|g' \
+       -e 's|@address@hidden|$(exec_prefix)|g' \
+       -e 's|@address@hidden|$(libdir)|g' \
+       -e 's|@address@hidden|$(includedir)|g' \
+       -e 's|@address@hidden|$(GSL_CFLAGS)|g' \
+       -e 's|@address@hidden|$(GSL_LIBS)|g' \
+       -e 's|@address@hidden|$(LIBS)|g' \
+       -e 's|@address@hidden|$(VERSION)|g'
+
+gsl-config gsl.pc: Makefile 
+       @rm -f $@ address@hidden
+       @$(edit) '$(srcdir)/address@hidden' >>address@hidden
+       @chmod a-w address@hidden
+       @mv address@hidden $@
+       @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

reply via email to

[Prev in Thread] Current Thread [Next in Thread]