diff --git a/Makefile b/Makefile index b9b5081..a13048d 100755 --- a/Makefile +++ b/Makefile @@ -152,13 +152,20 @@ uninstall-lib: $(CHECKCFG) install-cfgtool: $(CHECKCFG) $(call imsg,Installing the configuration tool.) $(call qcmd,$(INST) -m 755 -d "$(IBINDIR)") - $(call bcmd,write-cfg-tool,lib$(NAME),\ - tools/write-config --name=lib$(NAME) --version=$(VERSION) \ + $(call qcmd,tools/write-config --name=lib$(NAME) --version=$(VERSION) \ --author-name="$(AUTHOR)" --author-mail="$(AUTHOR_MAIL)" \ --incdir="$(IINCDIR)" --libdir="$(IBINDIR)" \ >"$(IBINDIR)/lib$(NAME)-config" \ && chmod 755 "$(IBINDIR)/lib$(NAME)-config") + $(call imsg,Installing the pkg-config configuration.) + $(call qcmd,$(INST) -m 755 -d "$(IPKGDIR)") + $(call qcmd,tools/write-pkg-config --name=$(NAME) --version=$(VERSION) \ + --description="$(DESCRIPTION)" \ + --incdir="$(OIINCDIR)" --libdir="$(OILIBDIR)" \ + >"$(IPKGDIR)/lib$(NAME).pc" \ + && chmod 644 "$(IPKGDIR)/lib$(NAME).pc") + # Uninstall it uninstall-cfgtool: $(CHECKCFG) $(call rmsg,Uninstalling configuration tool.) diff --git a/Makefile.vars b/Makefile.vars index 8432bf0..1d0e8e2 100755 --- a/Makefile.vars +++ b/Makefile.vars @@ -14,8 +14,9 @@ #******************************************************************************# # Project main information # #******************************************************************************# -# Project name +# Project name and description NAME := g1m + DESCRIPTION := Library for reading and writing CASIO files # Author information AUTHOR := Thomas \"Cakeisalie5\" Touhey @@ -114,8 +115,7 @@ $(eval $(call get-module-source,$(mod)))) # Look for headers # #******************************************************************************# # All headers - INC := \ - $(basename $(shell find $(INCDIR) -name "*.h" -printf "%P\n")) + INC := $(basename $(shell find $(INCDIR) -name "*.h" -printf "%P\n")) # Public headers only (not internals.h or internals/**/*.h) INCPUB := \ @@ -142,10 +142,15 @@ $(eval $(call check-man,$(patsubst .%,%,$(suffix $(doc))),$(basename $(doc))))) #******************************************************************************# # Check for DESTDIR (add as prefix to installation root) # #******************************************************************************# +# Save original library and include dir. + OIINCDIR := $(IINCDIR) + OILIBDIR := $(ILIBDIR) + +# Make it. define add-dest-dir $1 = $(DESTDIR)$($1) endef -$(if $(DESTDIR), $(foreach idir,IBINDIR ILIBDIR IINCDIR IMANDIR, \ +$(if $(DESTDIR), $(foreach idir,IBINDIR IPKGDIR ILIBDIR IINCDIR IMANDIR, \ $(eval $(call add-dest-dir,$(idir))))) # END OF FILE diff --git a/configure b/configure index 5f4ed27..7f40246 100755 --- a/configure +++ b/configure @@ -31,6 +31,7 @@ prefix_set= bindir='${prefix}/bin' libdir='${prefix}/lib'"$platform" includedir='${prefix}/include'"$platform" +pkgdir='${libdir}/pkgconfig' mandir='${prefix}/share/man' # Installation options @@ -66,6 +67,7 @@ Installation directories: Fine tuning of the installation directories: --bindir=DIR executables [$bindir] + --pkgdir=DIR pkg-config configurations directory [$pkgdir] --libdir=DIR library files of the linker [$libdir] --includedir=DIR include files for the compiler [$includedir] --mandir=DIR man root [$mandir] @@ -126,6 +128,7 @@ got '$level'" --root=*) root="${arg#*=}" ;; --prefix=*) prefix="${arg#*=}"; prefix_set=y ;; --bindir=*) bindir="${arg#*=}" ;; +--pkgdir=*) pkgdir="${arg#*=}" ;; --libdir=*) libdir="${arg#*=}" ;; --includedir=*) includedir="${arg#*=}" ;; --mandir=*) mandir="${arg#*=}" ;; @@ -143,7 +146,7 @@ fi #******************************************************************************# # Evaluate variables # #******************************************************************************# -for var in prefix sysconfdir bindir libdir includedir mandir udevrulesdir; do +for var in prefix sysconfdir bindir libdir pkgdir includedir mandir; do eval $var'='$(eval 'echo $'$var) done @@ -166,6 +169,7 @@ cat <