-
Notifications
You must be signed in to change notification settings - Fork 160
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Generate and install libgap.pc
for use with pkg-config
#5080
Changes from all commits
89335ce
4502c27
5ba04f7
ace09ff
61ab1c2
6fef5de
5ceffbe
4215559
b65086f
a310a5d
3851869
dda5fea
5306b4f
22e8e22
4a637de
fd5af12
635262e
ebd754d
d132d7b
2bd19b0
c0b8513
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,6 +13,7 @@ | |
/confdefs.h | ||
/conftest* | ||
/libtool | ||
/libgap.pc | ||
/src/config.h.in | ||
/src/config.h.in~ | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -532,6 +532,7 @@ clean: | |
rm -f bin/gap.sh sysinfo.gap* | ||
rm -f gap$(EXEEXT) gac ffgen | ||
rm -f libgap.la | ||
rm -f libgap.pc | ||
fingolfin marked this conversation as resolved.
Show resolved
Hide resolved
|
||
rm -rf .libs | ||
rm -f doc/wsp.g | ||
rm -f cnf/GAP-* | ||
|
@@ -656,10 +657,12 @@ install-headers: $(FFDATA_H) build/version.h | |
# Create a symlink to support packages using `#include "src/compiled.h"` | ||
ln -sfn . $(DESTDIR)$(includedir)/gap/src | ||
|
||
install-libgap: libgap.la | ||
install-libgap: libgap.la libgap.pc | ||
@echo "Warning, 'make install-libgap' is incomplete" | ||
$(INSTALL) -d -m 0755 $(DESTDIR)$(libdir) | ||
$(LTINSTALL) -s libgap.la $(DESTDIR)$(libdir) | ||
$(INSTALL) -d -m 0755 $(DESTDIR)$(libdir)/pkgconfig | ||
$(INSTALL) -m 0644 libgap.pc $(DESTDIR)$(libdir)/pkgconfig | ||
|
||
|
||
.PHONY: install install-bin install-doc install-gaproot install-headers install-libgap | ||
|
@@ -1258,6 +1261,28 @@ testlibgap: ${LIBGAPTESTS} | |
$(v) -A -l $(top_srcdir) -q -T --nointeract >$(v).out && \ | ||
diff $(top_srcdir)/$(v).expect $(v).out && ) : | ||
|
||
# test libgap's pkg-config's libgap version reporting | ||
testpkgconfigversion: install-libgap | ||
ifeq ($(shell PKG_CONFIG_PATH=$(DESTDIR)$(libdir)/pkgconfig pkg-config --modversion libgap), $(PACKAGE_VERSION)) | ||
@echo "pkg-config reports correct version of libgap: "$(PACKAGE_VERSION) | ||
else | ||
@echo "pkg-config does not report version of libgap, or is not installed" | ||
dimpase marked this conversation as resolved.
Show resolved
Hide resolved
|
||
exit 1 | ||
endif | ||
|
||
# test libgap's pkg-config's libgap flags fetching | ||
testpkgconfigbuild: install-libgap install-headers | ||
$(eval PKG_REPORTED_CFLAGS := $(shell PKG_CONFIG_PATH=$(DESTDIR)$(libdir)/pkgconfig pkg-config --cflags libgap | cut -d' ' -f 1)/gap) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why the Ahh, I think it's to append There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. we need There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I have to add |
||
$(eval PKG_REPORTED_LDFLAGS := $(shell PKG_CONFIG_PATH=$(DESTDIR)$(libdir)/pkgconfig pkg-config --libs libgap)) | ||
$(eval v := "tst/testlibgap/basic") | ||
$(eval com := "tst/testlibgap/common") | ||
$(CC) -c $(v).c -o $(v).o $(PKG_REPORTED_CFLAGS) | ||
$(CC) -c $(com).c -o $(com).o $(PKG_REPORTED_CFLAGS) | ||
$(QUIET_LINK)$(LINK) $(v).o -o $(v) $(com).o $(PKG_REPORTED_LDFLAGS) | ||
$(v) -A -l $(top_srcdir) -q -T --nointeract >$(v).out && \ | ||
diff $(top_srcdir)/$(v).expect $(v).out | ||
dimpase marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
|
||
KERNELTESTS := $(addprefix tst/testkernel/,dstruct) | ||
|
||
# run a test in tst/testkernel | ||
|
@@ -1279,6 +1304,7 @@ testkernel: ${KERNELTESTS} | |
|
||
.PHONY: testinstall testmanuals testobsoletes teststandard testbugfix | ||
.PHONY: testpackage testpackages testpackagesload testpackagesvars | ||
.PHONY: testpkgconfigbuild testpkgconfigversion | ||
.PHONY: check | ||
|
||
######################################################################## | ||
|
@@ -1469,6 +1495,9 @@ build/stamp-h: $(srcdir)/src/config.h.in config.status | |
$(SHELL) ./config.status build/config.h | ||
echo > $@ | ||
|
||
libgap.pc: $(srcdir)/libgap.pc.in config.status | ||
@$(SHELL) ./config.status $@ | ||
|
||
ifneq ($(MAINTAINER_MODE),no) | ||
$(srcdir)/src/config.h.in: $(configure_deps) | ||
@if command -v autoheader >/dev/null 2>&1 ; then \ | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
prefix=@prefix@ | ||
exec_prefix=@exec_prefix@ | ||
libdir=@libdir@ | ||
includedir=@prefix@/include | ||
|
||
Name: GAP | ||
Description: Library containing the kernel of GAP, a computer algebra system | ||
dimpase marked this conversation as resolved.
Show resolved
Hide resolved
|
||
URL: https://www.gap-system.org | ||
Version: @GAP_VERSION@ | ||
Libs: -L${libdir} -lgap | ||
Cflags: -I${includedir} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
BTW, why
libgap.pc
and notgap.pc
? (I don't want to bikeshed, and I am fine with keeping it as-is! I am merely curious and wondering if there is a deeper rationale for these names that you are aware of. Looking at thepkgconfig
dir of one of my machines, I seegap.pc
,mpfr.pc
,zlib.pc
yetlibcurl.pc
andlibzmq.pc
-- so it seems pretty much random?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To me,
libgap.pc
is pretty much what's needed to includelibgap
in the project. Butgap.pc
is a bit unclear.