Re: [systemd-devel] [PATCH] build: generate pkg-config files during configure
On 12 March 2015 at 23:13, Jeff Waugh j...@bethesignal.org wrote: On Fri, Mar 13, 2015 at 10:07 AM, Michael Biebl mbi...@gmail.com wrote: Those are the as-installed versions (they're not manipulated again during make). And how does that improve cross-compilation? It allows you to successfully build other software that uses the library. A minor detail. :-) I don't buy this. When cross-compiling with pkg-config, you do need to ship the pkg-config files in a different place, in the same location one sets prefix to. and then use e.g. /usr/bin/arm-linux-gnueabihf-pkg-config (via wrapper) or simply set PKG_CONFIG_PATH correctly. Having done a few cross-bootstraps from scratch I don't recall any bugs/problems with crossbuilding systemd itself, or things that depend on libsystemd friends. Can you start from beginning as to how you are cross compiling things on the OpenWRT and why it is failing for you? What is your host? What is your cross-chroot? What are your PKG_CONFIG_PATH? What's the contents of the generated .pc file? Where do you install it, and how does it fail for you? -- Regards, Dimitri. Open Source Technology Center Intel Corporation (UK) Ltd. - Co. Reg. #1134945 - Pipers Way, Swindon SN3 1RJ. ___ systemd-devel mailing list systemd-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/systemd-devel
Re: [systemd-devel] [PATCH] build: generate pkg-config files during configure
Ok! I have another problem with pc files but I solve it downstream. When I configure systemd with --configure=/usr and set the DESTDIR to my host path, the pc files don't have the DESTDIR extension. I solve it manually by 'sed'ding the files after installation. I thought maybe your patch solves this problem too. Thanks! On Thu, Mar 12, 2015 at 8:27 AM, Jeff Waugh j...@bethesignal.org wrote: On Thu, Mar 12, 2015 at 6:16 PM, Umut Tezduyar Lindskog u...@tezduyar.com wrote: What does this fix Jeff, could you please explain? Here's the relevant part of a pkg-config file produced during make: prefix=/usr exec_prefix=/usr libdir=/usr/lib includedir=/usr/include Versus during configure: prefix=/usr exec_prefix=/usr libdir=${exec_prefix}/lib includedir=${prefix}/include Which disproportionately affects cross-compiling and similar build situations. OpenWrt includes an equivalent change for kmod (which Lucas mentioned as I've submitted it upstream), and without an upstream change will have to carry one for systemd too. Finally, a supporting appeal to authority: If you check GNOME-land, practically all pkg-config files are generated at configure time. :-) ___ systemd-devel mailing list systemd-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/systemd-devel
Re: [systemd-devel] [PATCH] build: generate pkg-config files during configure
On Thu, Mar 12, 2015 at 5:09 AM, Lucas De Marchi lucas.de.mar...@gmail.com wrote: On Tue, Mar 10, 2015 at 3:04 PM, Jeff Waugh j...@bethesignal.org wrote: Generate pkg-config files during configure as God (Havoc) intended. This fixes all of systemd's pkg-config files when cross-compiling (and possibly other use cases). Kay, please take a look on this. There's a similar patch pending to kmod on [1]. I'm still not sure what exactly it's fixing... seems like just that it would not replace/expand all occurrences of the variables... AC_CONFIG_FILES is usually meant to create/prepare autoconf/automake related files needed for the build process, and not to produce plain package content to ship. Not that quoting autoconf manuals would make the autotools mess any better, but there is also this. :) Similarly, you should not rely on AC_CONFIG_FILES to replace bindir and friends in your shell scripts and other files; instead, let make manage their replacement. For instance Autoconf ships templates of its shell scripts ending with ‘.in’, and uses a makefile snippet similar to the following to build scripts like autoheader and autom4te: edit = sed \ -e 's|@bindir[@]|$(bindir)|g' \ -e 's|@pkgdatadir[@]|$(pkgdatadir)|g' \ -e 's|@prefix[@]|$(prefix)|g' autoheader autom4te: Makefile rm -f $@ $@.tmp srcdir=''; \ test -f ./$@.in || srcdir=$(srcdir)/; \ $(edit) $${srcdir}$@.in $@.tmp chmod +x $@.tmp chmod a-w $@.tmp mv $@.tmp $@ autoheader: $(srcdir)/autoheader.in autom4te: $(srcdir)/autom4te.in http://www.gnu.org/software/autoconf/manual/autoconf.html#Installation-Directory-Variables Kay ___ systemd-devel mailing list systemd-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/systemd-devel
Re: [systemd-devel] [PATCH] build: generate pkg-config files during configure
On 12/03/15 07:50, Umut Tezduyar Lindskog wrote: Ok! I have another problem with pc files but I solve it downstream. When I configure systemd with --configure=/usr and set the DESTDIR to my host path, the pc files don't have the DESTDIR extension. I solve it manually by 'sed'ding the files after installation. .pc files intentionally do not contain the DESTDIR in their paths. DESTDIR should never be hard-coded into any installed file, since that would not work in situations where you have installed the headers, libraries etc. in their intended target path /usr/include, /usr/lib{,32,64,/MULTIARCH} etc., as is done on dpkg, rpm etc. systems. The DESTDIR is for staged installs as used by dpkg/rpm. Here is a massively oversimplified version of how dpkg packages are built: ./configure --prefix=/usr make make install DESTDIR=$(pwd)/debian/tmp tar -C $(pwd)/debian/tmp -czf data.tar.gz . # now data.tar.gz contains e.g. ./usr/bin/foo, ./usr/include/foo.h, # ./usr/lib/i386-linux-gnu/libfoo.so* and most other packaging systems are similar. -- Simon McVittie Collabora Ltd. http://www.collabora.com/ ___ systemd-devel mailing list systemd-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/systemd-devel
Re: [systemd-devel] [PATCH] build: generate pkg-config files during configure
2015-03-12 8:27 GMT+01:00 Jeff Waugh j...@bethesignal.org: On Thu, Mar 12, 2015 at 6:16 PM, Umut Tezduyar Lindskog u...@tezduyar.com wrote: What does this fix Jeff, could you please explain? Here's the relevant part of a pkg-config file produced during make: prefix=/usr exec_prefix=/usr libdir=/usr/lib includedir=/usr/include Versus during configure: prefix=/usr exec_prefix=/usr libdir=${exec_prefix}/lib includedir=${prefix}/include Which disproportionately affects cross-compiling and similar build situations. Why is the configure produced .pc file better for suited for cross-compilation? I must be missing something here. -- Why is it that all of the instruments seeking intelligent life in the universe are pointed away from Earth? ___ systemd-devel mailing list systemd-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/systemd-devel
Re: [systemd-devel] [PATCH] build: generate pkg-config files during configure
On 12/03/15 16:17, Philip Van Hoof wrote: I wonder if in a few years libsystemd.pc should have been libsystemd-1.0.pc because a libsystemd-2.0.pc became needed? If libsystemd breaks C API, the systemd developers would just have to declare that libsystemd actually meant libsystemd API 1.0, and so is superseded by libsystemd API 2.0. That wouldn't be the end of the world. It's how you name your *second* API version (i.e. not the same as the first) that really matters :-) ps. In GLib this isn't being done with a cp in Makefile.am GLib's API is expected to be long-term-stable (2.0 seems to have been released in or before 2002), so automating the handling of API breaks would be unnecessary effort. Tracker switched API version on a regular basis until recently, which is presumably why that automation was worth having. and yet other projects (dconf) don't do API versioning with the .pc filename. If dconf never breaks API, no problem; if it does, it will hopefully start including an API version in the .pc filename at that point. -- Simon McVittie Collabora Ltd. http://www.collabora.com/ ___ systemd-devel mailing list systemd-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/systemd-devel
Re: [systemd-devel] [PATCH] build: generate pkg-config files during configure
On Thu, Mar 12, 2015 at 11:00:55AM +0100, Kay Sievers wrote: On Thu, Mar 12, 2015 at 5:09 AM, Lucas De Marchi lucas.de.mar...@gmail.com wrote: On Tue, Mar 10, 2015 at 3:04 PM, Jeff Waugh j...@bethesignal.org wrote: Generate pkg-config files during configure as God (Havoc) intended. This fixes all of systemd's pkg-config files when cross-compiling (and possibly other use cases). Kay, please take a look on this. There's a similar patch pending to kmod on [1]. I'm still not sure what exactly it's fixing... seems like just that it would not replace/expand all occurrences of the variables... AC_CONFIG_FILES is usually meant to create/prepare autoconf/automake related files needed for the build process, and not to produce plain package content to ship. Not that quoting autoconf manuals would make the autotools mess any better, but there is also this. :) Similarly, you should not rely on AC_CONFIG_FILES to replace bindir and friends in your shell scripts and other files; instead, let make manage their replacement. For instance Autoconf ships templates of its shell scripts ending with ‘.in’, and uses a makefile snippet similar to the following to build scripts like autoheader and autom4te: OK, but is there any difference for us, in the normal non-cross case? (I guess that make is a bit more efficient, because it parallelizes, but that step is tiny in any case, so the difference is most likely negligible.) I asked some more questions about the motivation for this change in the other branch of the thread. I'm just thinking that if there's a good reason to change this for people who cross-compile, we should consider doing it. Zbyszek edit = sed \ -e 's|@bindir[@]|$(bindir)|g' \ -e 's|@pkgdatadir[@]|$(pkgdatadir)|g' \ -e 's|@prefix[@]|$(prefix)|g' autoheader autom4te: Makefile rm -f $@ $@.tmp srcdir=''; \ test -f ./$@.in || srcdir=$(srcdir)/; \ $(edit) $${srcdir}$@.in $@.tmp chmod +x $@.tmp chmod a-w $@.tmp mv $@.tmp $@ autoheader: $(srcdir)/autoheader.in autom4te: $(srcdir)/autom4te.in http://www.gnu.org/software/autoconf/manual/autoconf.html#Installation-Directory-Variables Kay ___ systemd-devel mailing list systemd-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/systemd-devel ___ systemd-devel mailing list systemd-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/systemd-devel
Re: [systemd-devel] [PATCH] build: generate pkg-config files during configure
On Fri, Mar 13, 2015 at 8:53 AM, Zbigniew Jędrzejewski-Szmek zbys...@in.waw.pl wrote: So you prefer the second version to the first, right? Does not exec_prefix get assigned and then substituted, leading to an identical result? Those are the as-installed versions (they're not manipulated again during make). Here's an example from GNOME land: https://git.gnome.org/browse/gjs/tree/configure.ac#n232 https://git.gnome.org/browse/gjs/tree/Makefile.am#n72 Thanks, Jeff ___ systemd-devel mailing list systemd-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/systemd-devel
Re: [systemd-devel] [PATCH] build: generate pkg-config files during configure
On Thu, Mar 12, 2015 at 6:57 PM, Zbigniew Jędrzejewski-Szmek zbys...@in.waw.pl wrote: On Thu, Mar 12, 2015 at 11:00:55AM +0100, Kay Sievers wrote: On Thu, Mar 12, 2015 at 5:09 AM, Lucas De Marchi lucas.de.mar...@gmail.com wrote: On Tue, Mar 10, 2015 at 3:04 PM, Jeff Waugh j...@bethesignal.org wrote: Generate pkg-config files during configure as God (Havoc) intended. This fixes all of systemd's pkg-config files when cross-compiling (and possibly other use cases). Kay, please take a look on this. There's a similar patch pending to kmod on [1]. I'm still not sure what exactly it's fixing... seems like just that it would not replace/expand all occurrences of the variables... AC_CONFIG_FILES is usually meant to create/prepare autoconf/automake related files needed for the build process, and not to produce plain package content to ship. Not that quoting autoconf manuals would make the autotools mess any better, but there is also this. :) Similarly, you should not rely on AC_CONFIG_FILES to replace bindir and friends in your shell scripts and other files; instead, let make manage their replacement. For instance Autoconf ships templates of its shell scripts ending with ‘.in’, and uses a makefile snippet similar to the following to build scripts like autoheader and autom4te: OK, but is there any difference for us, in the normal non-cross case? (I guess that make is a bit more efficient, because it parallelizes, but that step is tiny in any case, so the difference is most likely negligible.) I asked some more questions about the motivation for this change in the other branch of the thread. I'm just thinking that if there's a what branch? good reason to change this for people who cross-compile, we should consider doing it. Looking at it I still fail to see any problems and why one is better than the other. The only difference is that ours expands all variables and letting for configure they are not all expanded. There's no difference regarding crosscompilation. Both kmod and systemd are being crosscompiled for quite some time by yocto, buildroot, etc I can't but think this is just to conform to other (gnome) projects. -- Lucas De Marchi ___ systemd-devel mailing list systemd-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/systemd-devel
Re: [systemd-devel] [PATCH] build: generate pkg-config files during configure
On Fri, Mar 13, 2015 at 10:07 AM, Michael Biebl mbi...@gmail.com wrote: Those are the as-installed versions (they're not manipulated again during make). And how does that improve cross-compilation? It allows you to successfully build other software that uses the library. A minor detail. :-) Thanks, Jeff ___ systemd-devel mailing list systemd-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/systemd-devel
Re: [systemd-devel] [PATCH] build: generate pkg-config files during configure
On Fri, Mar 13, 2015 at 09:54:48AM +1100, Jeff Waugh wrote: On Fri, Mar 13, 2015 at 8:53 AM, Zbigniew Jędrzejewski-Szmek zbys...@in.waw.pl wrote: So you prefer the second version to the first, right? Does not exec_prefix get assigned and then substituted, leading to an identical result? Those are the as-installed versions (they're not manipulated again during make). I wasn't sufficiently clear. I meant substituted *by pkg-config*, leading to an identical result for anything which queries pkg-config for those values. And how does that improve cross-compilation? It allows you to successfully build other software that uses the library. A minor detail. :-) Well, I was looking for a more elaborate explanation, why that change makes a difference. To me, the resulting .pc are basically the same. So there must be something else I'm missing. Exactly my thoughts. Zbyszek ___ systemd-devel mailing list systemd-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/systemd-devel
Re: [systemd-devel] [PATCH] build: generate pkg-config files during configure
2015-03-12 23:54 GMT+01:00 Jeff Waugh j...@bethesignal.org: On Fri, Mar 13, 2015 at 8:53 AM, Zbigniew Jędrzejewski-Szmek zbys...@in.waw.pl wrote: So you prefer the second version to the first, right? Does not exec_prefix get assigned and then substituted, leading to an identical result? Those are the as-installed versions (they're not manipulated again during make). And how does that improve cross-compilation? -- Why is it that all of the instruments seeking intelligent life in the universe are pointed away from Earth? ___ systemd-devel mailing list systemd-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/systemd-devel
Re: [systemd-devel] [PATCH] build: generate pkg-config files during configure
On Fri, Mar 13, 2015 at 10:11 AM, Lucas De Marchi lucas.de.mar...@gmail.com wrote: I can't but think this is just to conform to other (gnome) projects. These patches come from an absolutely non-GNOME environment (OpenWrt), but I'm appealing to an authority in actively maintained GNOME code as that's where pkg-config comes from and a project I'm historically familiar with. ___ systemd-devel mailing list systemd-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/systemd-devel
Re: [systemd-devel] [PATCH] build: generate pkg-config files during configure
On Fri, Mar 13, 2015 at 10:11 AM, Lucas De Marchi lucas.de.mar...@gmail.com wrote: Both kmod and systemd are being crosscompiled for quite some time by yocto, buildroot, etc It does interest me that buildroot doesn't have an equivalent change, despite (at least) pciutils depending on it. ___ systemd-devel mailing list systemd-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/systemd-devel
Re: [systemd-devel] [PATCH] build: generate pkg-config files during configure
2015-03-13 0:13 GMT+01:00 Jeff Waugh j...@bethesignal.org: On Fri, Mar 13, 2015 at 10:07 AM, Michael Biebl mbi...@gmail.com wrote: Those are the as-installed versions (they're not manipulated again during make). And how does that improve cross-compilation? It allows you to successfully build other software that uses the library. A minor detail. :-) Well, I was looking for a more elaborate explanation, why that change makes a difference. To me, the resulting .pc are basically the same. So there must be something else I'm missing. -- Why is it that all of the instruments seeking intelligent life in the universe are pointed away from Earth? ___ systemd-devel mailing list systemd-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/systemd-devel
Re: [systemd-devel] [PATCH] build: generate pkg-config files during configure
What does this fix Jeff, could you please explain? On Tue, Mar 10, 2015 at 7:04 PM, Jeff Waugh j...@bethesignal.org wrote: Generate pkg-config files during configure as God (Havoc) intended. This fixes all of systemd's pkg-config files when cross-compiling (and possibly other use cases). (Note: I might've missed some things to tidy up in Makefile.am, but not 100% sure.) Signed-off-by: Jeff Waugh j...@bethesignal.org --- Makefile.am | 3 --- configure.ac | 10 ++ 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/Makefile.am b/Makefile.am index 3539e03..d2ebc81 100644 --- a/Makefile.am +++ b/Makefile.am @@ -6442,9 +6442,6 @@ man/%: man/%.in sysctl.d/%: sysctl.d/%.in $(SED_PROCESS) -%.pc: %.pc.in - $(SED_PROCESS) - %.conf: %.conf.in $(SED_PROCESS) diff --git a/configure.ac b/configure.ac index 29111f5..21b8008 100644 --- a/configure.ac +++ b/configure.ac @@ -1510,6 +1510,16 @@ AC_CONFIG_FILES([ docs/libudev/version.xml docs/gudev/Makefile docs/gudev/version.xml +src/libudev/libudev.pc +src/compat-libs/libsystemd-id128.pc +src/compat-libs/libsystemd-daemon.pc +src/compat-libs/libsystemd-login.pc +src/compat-libs/libsystemd-journal.pc +src/libsystemd/sd-id128/libsystemd-id128.pc +src/libsystemd/libsystemd.pc +src/udev/udev.pc +src/core/systemd.pc +src/gudev/gudev-1.0.pc ]) AC_OUTPUT -- 1.9.1 ___ systemd-devel mailing list systemd-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/systemd-devel ___ systemd-devel mailing list systemd-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/systemd-devel
Re: [systemd-devel] [PATCH] build: generate pkg-config files during configure
On Thu, Mar 12, 2015 at 6:16 PM, Umut Tezduyar Lindskog u...@tezduyar.com wrote: What does this fix Jeff, could you please explain? Here's the relevant part of a pkg-config file produced during make: prefix=/usr exec_prefix=/usr libdir=/usr/lib includedir=/usr/include Versus during configure: prefix=/usr exec_prefix=/usr libdir=${exec_prefix}/lib includedir=${prefix}/include Which disproportionately affects cross-compiling and similar build situations. OpenWrt includes an equivalent change for kmod (which Lucas mentioned as I've submitted it upstream), and without an upstream change will have to carry one for systemd too. Finally, a supporting appeal to authority: If you check GNOME-land, practically all pkg-config files are generated at configure time. :-) ___ systemd-devel mailing list systemd-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/systemd-devel
Re: [systemd-devel] [PATCH] build: generate pkg-config files during configure
On Wed, Mar 11, 2015 at 5:04 AM, Jeff Waugh j...@bethesignal.org wrote: Generate pkg-config files during configure as God (Havoc) intended. This fixes all of systemd's pkg-config files when cross-compiling (and possibly other use cases). Thoughts, feelings? ___ systemd-devel mailing list systemd-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/systemd-devel
[systemd-devel] [PATCH] build: generate pkg-config files during configure
Generate pkg-config files during configure as God (Havoc) intended. This fixes all of systemd's pkg-config files when cross-compiling (and possibly other use cases). (Note: I might've missed some things to tidy up in Makefile.am, but not 100% sure.) Signed-off-by: Jeff Waugh j...@bethesignal.org --- Makefile.am | 3 --- configure.ac | 10 ++ 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/Makefile.am b/Makefile.am index 3539e03..d2ebc81 100644 --- a/Makefile.am +++ b/Makefile.am @@ -6442,9 +6442,6 @@ man/%: man/%.in sysctl.d/%: sysctl.d/%.in $(SED_PROCESS) -%.pc: %.pc.in - $(SED_PROCESS) - %.conf: %.conf.in $(SED_PROCESS) diff --git a/configure.ac b/configure.ac index 29111f5..21b8008 100644 --- a/configure.ac +++ b/configure.ac @@ -1510,6 +1510,16 @@ AC_CONFIG_FILES([ docs/libudev/version.xml docs/gudev/Makefile docs/gudev/version.xml +src/libudev/libudev.pc +src/compat-libs/libsystemd-id128.pc +src/compat-libs/libsystemd-daemon.pc +src/compat-libs/libsystemd-login.pc +src/compat-libs/libsystemd-journal.pc +src/libsystemd/sd-id128/libsystemd-id128.pc +src/libsystemd/libsystemd.pc +src/udev/udev.pc +src/core/systemd.pc +src/gudev/gudev-1.0.pc ]) AC_OUTPUT -- 1.9.1 ___ systemd-devel mailing list systemd-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/systemd-devel