[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[gnuastro-commits] master ef9e191 3/3: pkg-config file created for the l
From: |
Mohammad Akhlaghi |
Subject: |
[gnuastro-commits] master ef9e191 3/3: pkg-config file created for the libraries |
Date: |
Mon, 12 Sep 2016 16:41:06 +0000 (UTC) |
branch: master
commit ef9e191538bcfd9a8429d028da4f1880cd7a72c0
Author: Mohammad Akhlaghi <address@hidden>
Commit: Mohammad Akhlaghi <address@hidden>
pkg-config file created for the libraries
Following GSL's `Makefile.am', `lib/Makefile.am' now also creates a
pkg-config file (based on `lib/gnuastro.pc.in') and installs it.
The library version is now also set in `configure.ac' and used in
`lib/Makefile.am', it isn't directly hand-written in the latter. This was
also inspired from GSL's approach.
---
configure.ac | 12 ++++++++++++
doc/release-checklist.txt | 6 +++---
lib/Makefile.am | 27 +++++++++++++++++++++++++--
lib/gnuastro.pc.in | 12 ++++++++++++
4 files changed, 52 insertions(+), 5 deletions(-)
diff --git a/configure.ac b/configure.ac
index e68c95b..baafa55 100644
--- a/configure.ac
+++ b/configure.ac
@@ -48,6 +48,18 @@ AC_CONFIG_MACRO_DIRS([bootstrapped/m4])
+# Library version, see the GNU Libtool manual ("Library interface versions"
+# section for the exact definition of each) for
+GAL_CURRENT=0
+GAL_REVISION=0
+GAL_AGE=0
+GAL_LT_VERSION="${GAL_CURRENT}:${GAL_REVISION}:${GAL_AGE}"
+AC_SUBST(GAL_LT_VERSION)
+
+
+
+
+
# By default we assume no warnings
anywarnings=no
diff --git a/doc/release-checklist.txt b/doc/release-checklist.txt
index 1a5fa78..1f5e115 100644
--- a/doc/release-checklist.txt
+++ b/doc/release-checklist.txt
@@ -8,9 +8,9 @@ after all the commits needed for this release have been
completed.
IMPORTANT NOTE: This is currently a draft, it will be complete with the 0.2
version release.
- - Update the library version in (`lib/Makefile.am'). See the `Updating
- library version information' section of the GNU Libtool manual as a
- guide.
+ - Update the library version in (the values starting with `GAL_' in
+ `configure.ac'). See the `Updating library version information' section
+ of the GNU Libtool manual as a guide.
- Update the NEWS file (use `git log --reverse gnuastro_vA.B..HEAD').
diff --git a/lib/Makefile.am b/lib/Makefile.am
index f0b7dee..08babe1 100644
--- a/lib/Makefile.am
+++ b/lib/Makefile.am
@@ -25,15 +25,15 @@
AM_CPPFLAGS = -I\$(top_srcdir)/bootstrapped/lib
-# Define the main compiled library file
+# Define the main compiled library file and its Libtool version.
lib_LTLIBRARIES = libgnuastro.la
+libgnuastro_la_LDFLAGS = -version-info $(GAL_LT_VERSION)
# Specify the library .c files
libgnuastro_la_SOURCES = array.c box.c checkset.c configfiles.c fits.c \
gnuastro.c linkedlist.c mesh.c mode.c polygon.c qsort.c \
spatialconvolve.c statistics.c threads.c timing.c txtarray.c wcs.c
-libgnuastro_la_LDFLAGS = -version-info 0:0:0
# Specify the installed headers, note that we are not blindly including all
@@ -47,3 +47,26 @@ pkginclude_HEADERS = $(headersdir)/array.h
$(headersdir)/box.h \
$(headersdir)/qsort.h $(headersdir)/spatialconvolve.h
\
$(headersdir)/statistics.h $(headersdir)/threads.h \
$(headersdir)/timing.h $(headersdir)/txtarray.h $(headersdir)/wcs.h
+
+
+# Definitions for Gnuastro's the pkg-config file (inspired from GSL's
+# Makefile.am)
+CLEANFILES = gnuastro.pc
+EXTRA_DIST = gnuastro.pc.in
+pkgconfig_DATA = gnuastro.pc
+pkgconfigdir = $(libdir)/pkgconfig
+
+# Build Gnuastro's pkg-config file based on the information in the
+# Makefile after the Makefile has been built.
+gnuastro.pc: Makefile $(srcdir)/gnuastro.pc.in
+ rm -f $@ address@hidden
+ $(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|$(LIBS)|g' \
+ -e 's|@address@hidden|$(VERSION)|g' \
+ '$(srcdir)/address@hidden' >>address@hidden
+ chmod a-w address@hidden
+ mv address@hidden $@
diff --git a/lib/gnuastro.pc.in b/lib/gnuastro.pc.in
new file mode 100644
index 0000000..8607e88
--- /dev/null
+++ b/lib/gnuastro.pc.in
@@ -0,0 +1,12 @@
address@hidden@
address@hidden@
address@hidden@
address@hidden@
+
+Name: Gnuastro
+Description: GNU Astronomy Utilities
+URL: https://www.gnu.org/software/gnuastro/
+Version: @VERSION@
+Requires.private: wcs cfitsio gsl
+Cflags: -I${includedir}
+Libs: -L${libdir} -lgnuastro @LIBS@