Fix install deps and win32 pkg-config file contents

- Make the gkrellm.pc install target depend on its input file, fixes
  install target with parallel make

- Use a single rule for writing gkrellm.pc. Having a separate rule for
  windows breaks parallel builds, for some reason a parallel build of just
  the install_windows target ends up having unix gkrellm.pc contents.
  Avoid this possible build race by using a single rule with optional
  contents at the end of the file.

- Enforce static linking against libgkrellm.a on win32, otherwise plugin
  sources using autotools/libtool fail to link. libtool tries very hard
  to avoid mixing static and shared libraries so we will have to fall back
  to raw linker flags (libgkrellm.a on win32 is kind of a static
  convenience library)
This commit is contained in:
Stefan Gehn 2015-05-31 16:21:20 +02:00
parent 14c4cc4ba0
commit 624d667e46
1 changed files with 12 additions and 20 deletions

View File

@ -123,30 +123,21 @@ debug=0
export enable_nls export enable_nls
export debug export debug
GKRELLM_PC_EXTRA=
all gkrellm: gkrellm.pc all gkrellm: gkrellm.pc
(cd po && ${MAKE} all) (cd po && ${MAKE} all)
(cd src && ${MAKE} gkrellm) (cd src && ${MAKE} gkrellm)
(cd server && ${MAKE} gkrellmd) (cd server && ${MAKE} gkrellmd)
# win32 needs a Libs: line and ${prefix} for paths so we install a different
# pkg-config file than what gets used on unix
# TODO: move to src/Makefile and install a gkrellmd.pc from server/Makefile
gkrellm.pc_win: Makefile
echo "prefix=$(INSTALLROOT)" > gkrellm.pc
echo "Name: GKrellM" >> gkrellm.pc
echo "Description: Extensible GTK system monitoring application" >> gkrellm.pc
echo "Version: $(VERSION)" >> gkrellm.pc
echo "Requires: gtk+-2.0 >= 2.4.0" >> gkrellm.pc
echo 'Cflags: -I$${prefix}/include' >> gkrellm.pc
echo 'Libs: -L$${prefix}/lib -lgkrellm' >> gkrellm.pc
gkrellm.pc: Makefile gkrellm.pc: Makefile
echo "prefix=$(INSTALLROOT)" > gkrellm.pc echo 'prefix=$(INSTALLROOT)\n'\
echo "Name: GKrellM" >> gkrellm.pc 'Name: GKrellM\n'\
echo "Description: Extensible GTK system monitoring application" >> gkrellm.pc 'Description: Extensible GTK system monitoring application\n'\
echo "Version: $(VERSION)" >> gkrellm.pc 'Version: $(VERSION)\n'\
echo "Requires: gtk+-2.0 >= 2.4.0" >> gkrellm.pc 'Requires: gtk+-2.0 >= 2.4.0\n'\
echo "Cflags: -I$(INCLUDEDIR)" >> gkrellm.pc 'Cflags: -I$(INCLUDEDIR)\n'\
'$(GKRELLM_PC_EXTRA)' > gkrellm.pc
install: install_gkrellm.pc install: install_gkrellm.pc
(cd po && ${MAKE} install) (cd po && ${MAKE} install)
@ -159,7 +150,7 @@ uninstall:
(cd server && ${MAKE} uninstall) (cd server && ${MAKE} uninstall)
rm -f $(PKGCONFIGDIR)/gkrellm.pc rm -f $(PKGCONFIGDIR)/gkrellm.pc
install_gkrellm.pc: install_gkrellm.pc: gkrellm.pc
$(INSTALL) -d $(PKGCONFIGDIR) $(INSTALL) -d $(PKGCONFIGDIR)
$(INSTALL) -m $(INCLUDEMODE) -c gkrellm.pc $(PKGCONFIGDIR) $(INSTALL) -m $(INCLUDEMODE) -c gkrellm.pc $(PKGCONFIGDIR)
@ -293,7 +284,8 @@ gtop1.0: gkrellm.pc
(cd src && ${MAKE} gkrellm ) (cd src && ${MAKE} gkrellm )
(cd server && ${MAKE} gkrellmd ) (cd server && ${MAKE} gkrellmd )
windows: gkrellm.pc_win windows: GKRELLM_PC_EXTRA:=Libs: -L$${prefix}/lib -Wl,-Bstatic,-lgkrellm,-Bdynamic
windows: gkrellm.pc
(cd po && ${MAKE} LOCALEDIR="share/locale" all) (cd po && ${MAKE} LOCALEDIR="share/locale" all)
(cd src && ${MAKE} LOCALEDIR="share/locale" windows ) (cd src && ${MAKE} LOCALEDIR="share/locale" windows )
(cd server && ${MAKE} LOCALEDIR="share/locale" windows) (cd server && ${MAKE} LOCALEDIR="share/locale" windows)