aboutsummaryrefslogtreecommitdiff
Enables generating Lua's pkg-config file.

http://lua-users.org/lists/lua-l/2015-03/msg00338.html

--- a/Makefile	2014-10-30 00:14:41.000000000 +0100
+++ b/Makefile	2015-03-26 18:54:37.678374827 +0100
@@ -14,6 +14,7 @@
 INSTALL_BIN= $(INSTALL_TOP)/bin
 INSTALL_INC= $(INSTALL_TOP)/include
 INSTALL_LIB= $(INSTALL_TOP)/lib
+INSTALL_PC= $(INSTALL_LIB)/pkgconfig
 INSTALL_MAN= $(INSTALL_TOP)/man/man1
 INSTALL_LMOD= $(INSTALL_TOP)/share/lua/$V
 INSTALL_CMOD= $(INSTALL_TOP)/lib/lua/$V
@@ -39,9 +40,12 @@
 PLATS= aix bsd c89 freebsd generic linux macosx mingw posix solaris

 # What to install.
-TO_BIN= lua luac
+INTERPRETER= lua
+COMPILER= luac
+TO_BIN= $(INTERPRETER) $(COMPILER)
 TO_INC= lua.h luaconf.h lualib.h lauxlib.h lua.hpp
 TO_LIB= liblua.a
+TO_PC=  lua-$(V).pc
 TO_MAN= lua.1 luac.1

 # Lua version and release.
@@ -51,23 +55,29 @@
 # Targets start here.
 all:	$(PLAT)

-$(PLATS) clean:
+$(PLATS):
 	cd src && $(MAKE) $@

+clean:
+	cd src && $(MAKE) $@
+	$(RM) $(TO_PC)
+
 test:	dummy
 	src/lua -v

-install: dummy
-	cd src && $(MKDIR) $(INSTALL_BIN) $(INSTALL_INC) $(INSTALL_LIB) $(INSTALL_MAN) $(INSTALL_LMOD) $(INSTALL_CMOD)
+install: dummy $(TO_PC)
+	cd src && $(MKDIR) $(INSTALL_BIN) $(INSTALL_INC) $(INSTALL_LIB) $(INSTALL_PC) $(INSTALL_MAN) $(INSTALL_LMOD) $(INSTALL_CMOD)
 	cd src && $(INSTALL_EXEC) $(TO_BIN) $(INSTALL_BIN)
 	cd src && $(INSTALL_DATA) $(TO_INC) $(INSTALL_INC)
 	cd src && $(INSTALL_DATA) $(TO_LIB) $(INSTALL_LIB)
+	cd src && $(INSTALL_DATA) ../$(TO_PC) $(INSTALL_PC)
 	cd doc && $(INSTALL_DATA) $(TO_MAN) $(INSTALL_MAN)

 uninstall:
 	cd src && cd $(INSTALL_BIN) && $(RM) $(TO_BIN)
 	cd src && cd $(INSTALL_INC) && $(RM) $(TO_INC)
 	cd src && cd $(INSTALL_LIB) && $(RM) $(TO_LIB)
+	cd src && cd $(INSTALL_PC)  && $(RM) $(TO_PC)
 	cd doc && cd $(INSTALL_MAN) && $(RM) $(TO_MAN)

 local:
@@ -90,11 +100,13 @@
 	@echo "TO_BIN= $(TO_BIN)"
 	@echo "TO_INC= $(TO_INC)"
 	@echo "TO_LIB= $(TO_LIB)"
+	@echo "TO_PC= $(TO_PC)"
 	@echo "TO_MAN= $(TO_MAN)"
 	@echo "INSTALL_TOP= $(INSTALL_TOP)"
 	@echo "INSTALL_BIN= $(INSTALL_BIN)"
 	@echo "INSTALL_INC= $(INSTALL_INC)"
 	@echo "INSTALL_LIB= $(INSTALL_LIB)"
+	@echo "INSTALL_PC= $(INSTALL_PC)"
 	@echo "INSTALL_MAN= $(INSTALL_MAN)"
 	@echo "INSTALL_LMOD= $(INSTALL_LMOD)"
 	@echo "INSTALL_CMOD= $(INSTALL_CMOD)"
@@ -103,12 +115,28 @@

 # echo pkg-config data
 pc:
-	@echo "version=$R"
-	@echo "prefix=$(INSTALL_TOP)"
-	@echo "libdir=$(INSTALL_LIB)"
-	@echo "includedir=$(INSTALL_INC)"
+	@echo 'prefix=$(INSTALL_TOP)'
+	@echo 'libdir=$(INSTALL_LIB)'
+	@echo 'includedir=$(INSTALL_INC)'
+	@echo 'bindir=$(INSTALL_BIN)'
+	@echo
+	@echo 'INSTALL_LMOD=$(INSTALL_LMOD)'
+	@echo 'INSTALL_CMOD=$(INSTALL_CMOD)'
+	@echo 'INTERPRETER=$${bindir}/$(INTERPRETER)'
+	@echo 'COMPILER=$${bindir}/$(COMPILER)'
+	@echo
+	@echo 'Name: Lua'
+	@echo 'Description: A powerful, fast, lightweight, embeddable scripting language'
+	@echo 'Version: $(R)'
+	@echo
+	@echo 'Libs: -L$${libdir} -llua -lm'
+	@echo 'Cflags: -I$${includedir}'
+
+pkg-config: $(TO_PC)
+$(TO_PC):
+	@$(MAKE) -s pc > $@

 # list targets that do not create files (but not all makes understand .PHONY)
-.PHONY: all $(PLATS) clean test install local none dummy echo pecho lecho
+.PHONY: all $(PLATS) clean test install local none dummy echo pecho lecho pkg-config

 # (end of Makefile)
8:48:47 +0100'>2018-11-16gnu: gp2c: Update to 0.0.11pl1....* gnu/packages/algebra.scm (gp2c): Update to 0.0.11pl1. Andreas Enge 2018-08-22Merge branch 'master' into stagingMarius Bakke 2018-08-21gnu: fftw: Update to 3.3.8....* gnu/packages/algebra.scm (fftw): Update to 3.3.8. Tobias Geerinckx-Rice 2018-08-18gnu: xtensor: Update to 0.17.1....* gnu/packages/algebra.scm (xtensor): Update to 0.17.1. [source]: Use git-fetch. Kei Kebreau 2018-08-18gnu: singular: Update to 4.1.1p3....* gnu/packages/algebra.scm (singular): Update to 4.1.1p3. Kei Kebreau 2018-08-18gnu: eigen: Update to 3.3.5....* gnu/packages/algebra.scm (eigen): Update to 3.3.5. [source]: Remove upstreamed ARM patch and obsolete substitutions. * gnu/packages/patches/eigen-arm-neon-fixes.patch: Delete file. * gnu/local.mk (dist_patch_DATA): Remove it. Tobias Geerinckx-Rice 2018-08-18gnu: eigen: Throw exceptions on test failure....* gnu/packages/algebra.scm (eigen)[arguments]: Substitute INVOKE for SYSTEM*. Tobias Geerinckx-Rice 2018-07-23gnu: arb: Update to 2.14.0....* gnu/packages/algebra.scm (arb): Update to 2.14.0. [arguments]: Substitute invoke for system*. [license]: Change to lgpl2.1+. Kei Kebreau 2018-07-20gnu: gp2c: Update to 0.0.11....* gnu/packages/algebra.scm (gp2c): Update to 0.0.11. Andreas Enge 2018-07-20gnu: pari-gp: Update to 2.11.0....* gnu/packages/algebra.scm (pari-gp): Update to 2.11.0. Andreas Enge 2018-07-05gnu: arb: Update to 2.13.0....* gnu/packages/algebra.scm (arb): Update to 2.13.0. Andreas Enge 2018-06-22gnu: Use more HTTPS....* gnu/packages/admin.scm (net-base, wakelan, pam-krb5) [home-page]: Use HTTPS. (dfc, libpcap, tcpdump, wpa-supplicant-minimal, libcap-ng, audit) [source, home-page]: Likewise. * gnu/packages/algebra.scm (eigen)[home-page]: Likewise. (gp2c, pari-gp)[source, home-page]: Likewise. * gnu/packages/animation.scm (etl, synfig, synfigstudio, papagayo) [home-page]: Likewise. * gnu/packages/bioinformatics.scm (tadbit)[home-page]: Likewise. Tobias Geerinckx-Rice 2018-05-29Merge branch 'master' into core-updatesMark H Weaver 2018-05-29gnu: eigen: Include unsupported features....* gnu/packages/algebra.scm (eigen)[source]: Do not build the tests for unsupported features, but include the files. Signed-off-by: Kei Kebreau <kkebreau@posteo.net> Ricardo Wurmus 2018-05-28Merge branch 'master' into core-updatesMark H Weaver 2018-05-28gnu: Add xtensor....* gnu/packages/algebra.scm (xtensor): New variable. Signed-off-by: Ludovic Courtès <ludo@gnu.org> Fis Trivial 2018-05-27Merge branch 'master' into core-updatesMark H Weaver 2018-05-25gnu: mpfrcx: Update to 0.5....* gnu/packages/algebra.scm (mpfrcx): Update to 0.5 and change licence to lgpl3+. Andreas Enge 2018-05-08gnu: fftw: Fix configure flags for armhf, aarch64, and mips....This is a followup to commit 65bb22796f854cbc3eae053a80b1d64365dad376. * gnu/packages/algebra.scm (fftw)[arguments]: In the configure-flags, avoid two-layer quasiquotation by changing the inner quasiquote to a normal quote. Remove "--enable-armv7a-cntvct" on 32-bit ARM, and "--enable-armv8-cntvct-el0" on 64-bit ARM, since these generate instructions that are not normally available from user mode. Remove "--enable-mips-zbus-timer" on MIPS, since the needed hardware support may not be available. Add a default case to the conditional to support unrecognized targets. (fftwf)[arguments]: Restore the "--enable-single" flag, which was present prior to commit 65bb22796. Mark H Weaver 2018-05-06Merge branch 'master' into core-updatesMarius Bakke 2018-05-06gnu: giac-xcas: Update to 1.4.9-59....* gnu/packages/algebra.scm (giac-xcas): Update to 1.4.9-59. Nicolas Goaziou 2018-04-17gnu: fftw: Build SIMD codelets....* gnu/packages/algebra.scm (fftw)[arguments]: Remove 'no-native phase; use configure cache value instead. Add configure flags for SIMD codelets. (fftwf)[arguments]: Add neon configuration flag for 32-bit arm. (fftw-avx): Remove variable. Eric Bavier 2018-03-29Merge branch 'master' into core-updatesMarius Bakke 2018-03-20gnu: gmp-ecm: Update to 7.0.4....* gnu/packages/algebra.scm (gmp-ecm): Update to 7.0.4. [source]: Use predictable URI. Tobias Geerinckx-Rice 2018-03-16gnu: All snippets report errors using exceptions, else return #t....* gnu/packages/admin.scm, gnu/packages/algebra.scm, gnu/packages/audio.scm, gnu/packages/backup.scm, gnu/packages/base.scm, gnu/packages/bioinformatics.scm, gnu/packages/cdrom.scm, gnu/packages/chez.scm, gnu/packages/code.scm, gnu/packages/compression.scm, gnu/packages/cross-base.scm, gnu/packages/crypto.scm, gnu/packages/cups.scm, gnu/packages/databases.scm, gnu/packages/dns.scm, gnu/packages/emacs.scm, gnu/packages/emulators.scm, gnu/packages/engineering.scm, gnu/packages/enlightenment.scm, gnu/packages/fpga.scm, gnu/packages/freedesktop.scm, gnu/packages/ftp.scm, gnu/packages/games.scm, gnu/packages/gcc.scm, gnu/packages/geo.scm, gnu/packages/ghostscript.scm, gnu/packages/gl.scm, gnu/packages/glib.scm, gnu/packages/gnome.scm, gnu/packages/gnuzilla.scm, gnu/packages/graphics.scm, gnu/packages/gtk.scm, gnu/packages/guile.scm, gnu/packages/irc.scm, gnu/packages/java.scm, gnu/packages/kerberos.scm, gnu/packages/linux.scm, gnu/packages/lisp.scm, gnu/packages/lxde.scm, gnu/packages/machine-learning.scm, gnu/packages/mail.scm, gnu/packages/maths.scm, gnu/packages/messaging.scm, gnu/packages/monitoring.scm, gnu/packages/mp3.scm, gnu/packages/music.scm, gnu/packages/netpbm.scm, gnu/packages/networking.scm, gnu/packages/node.scm, gnu/packages/nvi.scm, gnu/packages/ocaml.scm, gnu/packages/pdf.scm, gnu/packages/perl.scm, gnu/packages/php.scm, gnu/packages/plotutils.scm, gnu/packages/pretty-print.scm, gnu/packages/profiling.scm, gnu/packages/pulseaudio.scm, gnu/packages/python-crypto.scm, gnu/packages/python.scm, gnu/packages/qt.scm, gnu/packages/robotics.scm, gnu/packages/sawfish.scm, gnu/packages/scanner.scm, gnu/packages/scheme.scm, gnu/packages/scribus.scm, gnu/packages/sdl.scm, gnu/packages/serialization.scm, gnu/packages/shells.scm, gnu/packages/slang.scm, gnu/packages/smalltalk.scm, gnu/packages/ssh.scm, gnu/packages/sync.scm, gnu/packages/syncthing.scm, gnu/packages/tbb.scm, gnu/packages/terminals.scm, gnu/packages/texinfo.scm, gnu/packages/text-editors.scm, gnu/packages/textutils.scm, gnu/packages/tls.scm, gnu/packages/unrtf.scm, gnu/packages/version-control.scm, gnu/packages/video.scm, gnu/packages/vpn.scm, gnu/packages/web.scm, gnu/packages/wm.scm, gnu/packages/wxwidgets.scm, gnu/packages/xdisorg.scm, gnu/packages/xorg.scm: In all snippets, report errors using exceptions, or else return #t. Mark H Weaver 2018-03-14Merge branch 'master' into core-updatesRicardo Wurmus 2018-03-03gnu: Add java-jtransforms....* gnu/packages/algebra.scm (java-jtransforms): New variable. Ricardo Wurmus 2018-03-03gnu: Add java-jlargearrays....* gnu/packages/algebra.scm (java-jlargearrays): New variable. Ricardo Wurmus 2018-03-03gnu: Add java-la4j....* gnu/packages/algebra.scm (java-la4j): New variable. Ricardo Wurmus 2018-02-20gnu: fftw: Update phase style....* gnu/packages/algebra.scm (fftw)[arguments]: Use MODIFY-PHASES syntax and end phase with #t. Tobias Geerinckx-Rice 2018-02-20gnu: fftw: Update to 3.3.7....* gnu/packages/algebra.scm (fftw): Update to 3.3.7. (fftw-3.3.7): Remove, and... (fftw-avx): ...update the only caller. Tobias Geerinckx-Rice 2018-02-04gnu: giac-xcas: Update to 1.4.9-45....* gnu/packages/algebra.scm (giac-xcas): Update to 1.4.9-45. Nicolas Goaziou 2018-01-30gnu: fftw: Add "fftw-avx" optimized variant....* gnu/packages/algebra.scm (fftw-avx): New variable. Ludovic Courtès 2018-01-30gnu: fftw: Add version 3.3.7....* gnu/packages/algebra.scm (fftw-3.3.7): New variable. Ludovic Courtès 2018-01-14arb: Update to 2.12.0....* gnu/packages/algebra.scm (arb): Update to 2.12.0. Andreas Enge 2018-01-14gnu: pari-gp: Update to 2.9.4....* gnu/packages/algebra.scm (pari-gp): Update to 2.9.4. Andreas Enge 2018-01-04gnu: giac-xcas: Update to 1.4.9-43....* gnu/packages/algebra.scm (giac-xcas): Update to 1.4.9-43. Nicolas Goaziou 2017-12-15gnu: eigen: Update to 3.3.4....* gnu/packages/patches/eigen-arm-neon-fixes.patch: New patch. * gnu/packages/algebra.scm (eigen): Update to 3.3.4. [source]: Use patch. Disable svd-preallocation test for BDCSVD. [arguments]: Set "EIGEN_SEED" environment variable in check phase. * gnu/local.mk (dist_patch_DATA): Add patch. Eric Bavier 2017-12-03gnu: giac-xcas: Update to 1.4.9-33....* gnu/packages/algebra.scm (giac-xcas): Update to 1.4.9-33. Nicolas Goaziou