From kde-core-devel Wed Sep 29 17:27:49 2004 From: "Ian Reinhart Geiser" Date: Wed, 29 Sep 2004 17:27:49 +0000 To: kde-core-devel Subject: RFC: pkg-config for KDE Message-Id: <33431.66.92.236.216.1096478869.squirrel () 66 ! 92 ! 236 ! 216> X-MARC-Message: https://marc.info/?l=kde-core-devel&m=109647893708538 MIME-Version: 1 Content-Type: multipart/mixed; boundary="------=_20040929132749_96419" ------=_20040929132749_96419 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 8bit Greetings, I have been working with QMake to build KDE applications lately. One tool that has simplified development with QMake is pkg-config. It also can simplify autotools project files too since it will do most of the dirty work in figuring out where stuff is installed and what it needs to link. As a service to people who wish to develop 3rd party KDE applications but do not want to associate themselves with the emotional baggage of our build system I am proposing adding pkg-config support into KDE. I have already done kdeui, kdelibs and kdefx as an experiment. So far the results are extremely favorable. There are a few issues that have to be worked out to get as much as possible autogenerated, but at this point I am very optimistic that this wouldn't be more than a weekend task. The largest advantage of pkg-conf that I see at this time is it will significantly reduce the overhead of 3rd party developers who wish to build KDE applications. Example: g++ someapp.cpp `pkg-config --cflags --libs kdeui` vs g++ someapp.cpp -I/some/hardcoded/path -L/some/other/hardcoded/path -libkdeui -lkdecore pkg-config will figure out dependencies and include paths of required supporting libraries. since Qt already ships with a pkg-config file, this too can be included. Also there are quite a few applications already jumping on the pkg-config bandwagon, so I really see KDE following suit as a gain for adoption of the tool. The additions to the build system are quite trivial. I have attached a patch for kdecore,kdeui, and kspell to show how useful this is. So what do people think about this approach? Are people willing to help populate .pc.in files for their respective libraries? Are people against having such things in KDE cvs? Cheers -ian reinhart geiser -- ------=_20040929132749_96419 Content-Type: text/plain; name="kdecore.pc.in" Content-Transfer-Encoding: 8bit Content-Disposition: attachment; filename="kdecore.pc.in" prefix=@prefix@ exec_prefix=@exec_prefix@ libdir=@libdir@ includedir=@includedir@ Name: kdecore Description: Core KDE libraries Version: 3.4 Libs: -L${libdir} -lkdecore Cflags: -I${includedir} ------=_20040929132749_96419 Content-Type: text/plain; name="kspell.pc.in" Content-Transfer-Encoding: 8bit Content-Disposition: attachment; filename="kspell.pc.in" prefix=@prefix@ exec_prefix=@exec_prefix@ libdir=@libdir@ includedir=@includedir@ Name: kdeui Description: KDE Spellchecker libraries Requires: kdeui Version: 3.4 Libs: -L${libdir} -lkspell Cflags: -I${includedir} ------=_20040929132749_96419 Content-Type: text/plain; name="kdeui.pc.in" Content-Transfer-Encoding: 8bit Content-Disposition: attachment; filename="kdeui.pc.in" prefix=@prefix@ exec_prefix=@exec_prefix@ libdir=@libdir@ includedir=@includedir@ Name: kdeui Description: User Interface KDE libraries Requires: kdecore Version: 3.4 Libs: -L${libdir} -lkdeui Cflags: -I${includedir} ------=_20040929132749_96419 Content-Type: text/x-diff; name="pkg-config.patch" Content-Transfer-Encoding: 8bit Content-Disposition: attachment; filename="pkg-config.patch" Index: configure.in.in =================================================================== RCS file: /home/kde/kdelibs/configure.in.in,v retrieving revision 1.124 diff -u -u -r1.124 configure.in.in --- configure.in.in 9 Sep 2004 10:50:27 -0000 1.124 +++ configure.in.in 29 Sep 2004 17:25:34 -0000 @@ -343,3 +343,9 @@ KDE_INIT_DOXYGEN([The KDE API Reference], [Version $VERSION]) KDE_CHECK_BINUTILS + +dnl AC_OUTPUT(kdecore/kdecore.pc) +dnl AC_OUTPUT(kdeui/kdeui.pc) +dnl AC_OUTPUT(kdeui/kspell.pc) Index: kdecore/Makefile.am =================================================================== RCS file: /home/kde/kdelibs/kdecore/Makefile.am,v retrieving revision 1.355 diff -u -u -r1.355 Makefile.am --- kdecore/Makefile.am 10 Sep 2004 19:42:21 -0000 1.355 +++ kdecore/Makefile.am 29 Sep 2004 17:25:34 -0000 @@ -170,11 +170,12 @@ @echo "This is needed for konsole, etc. to ensure that they can't be eavesdroped." @echo "" -DISTCLEANFILES = kde-config.cpp +DISTCLEANFILES = kde-config.cpp kdecore.pc DOXYGEN_REFERENCES = dcop kdeui kparts kio DOXYGEN_EXCLUDE = malloc include ../admin/Doxyfile.am - +pkgconfigdir = $(DESTDIR)$(libdir)/pkgconfig +pkgconfig_DATA = kdecore.pc Index: kdeui/Makefile.am =================================================================== RCS file: /home/kde/kdelibs/kdeui/Makefile.am,v retrieving revision 1.333 diff -u -u -r1.333 Makefile.am --- kdeui/Makefile.am 1 Sep 2004 19:06:08 -0000 1.333 +++ kdeui/Makefile.am 29 Sep 2004 17:25:34 -0000 @@ -164,3 +164,7 @@ DOXYGEN_REFERENCES = kdecore kdefx dcop kio kutils include ../admin/Doxyfile.am + +DISTCLEANFILES = kspell.pc kdecore.pc +pkgconfigdir = $(DESTDIR)$(libdir)/pkgconfig +pkgconfig_DATA = kdeui.pc kspell.pc ------=_20040929132749_96419--