linux-modules.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] build: generate libkmod.pc during autoconf
@ 2015-03-05 21:05 Jeff Waugh
  2015-03-10 17:04 ` Lucas De Marchi
  0 siblings, 1 reply; 4+ messages in thread
From: Jeff Waugh @ 2015-03-05 21:05 UTC (permalink / raw)
  To: linux-modules

The pkgconfig file is generated at make-time, leading to absolute /usr/include
& /usr/lib search paths. The patch lets autoconf handle pkgconfig file subst,
like other packages do. (Patch from OpenWrt's contributed packages project.)

Signed-off-by: Nicolas Thill <nico@openwrt.org>
Signed-off-by: Jeff Waugh <jdub@bethesignal.org>
---
 Makefile.am  | 3 ---
 configure.ac | 1 +
 2 files changed, 1 insertion(+), 3 deletions(-)

diff --git a/Makefile.am b/Makefile.am
index caf18b6..32aea73 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -36,9 +36,6 @@ SED_PROCESS = \
 	-e 's,@zlib_LIBS\@,${zlib_LIBS},g' \
 	< $< > $@ || rm $@
 
-%.pc: %.pc.in Makefile
-	$(SED_PROCESS)
-
 LIBKMOD_CURRENT=4
 LIBKMOD_REVISION=10
 LIBKMOD_AGE=2
diff --git a/configure.ac b/configure.ac
index be597b4..8500cad 100644
--- a/configure.ac
+++ b/configure.ac
@@ -250,6 +250,7 @@ AC_SUBST([OUR_LDFLAGS], $with_ldflags)
 AC_CONFIG_FILES([
 	Makefile
 	man/Makefile
+	libkmod/libkmod.pc
 	libkmod/docs/Makefile
 	libkmod/docs/version.xml
 ])
-- 
1.9.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] build: generate libkmod.pc during autoconf
  2015-03-05 21:05 [PATCH] build: generate libkmod.pc during autoconf Jeff Waugh
@ 2015-03-10 17:04 ` Lucas De Marchi
  2015-03-11  0:26   ` Jeff Waugh
  2015-03-11  0:30   ` Jeff Waugh
  0 siblings, 2 replies; 4+ messages in thread
From: Lucas De Marchi @ 2015-03-10 17:04 UTC (permalink / raw)
  To: Jeff Waugh; +Cc: linux-modules

Hi Jeff,

On Thu, Mar 5, 2015 at 6:05 PM, Jeff Waugh <jdub@bethesignal.org> wrote:
> The pkgconfig file is generated at make-time, leading to absolute /usr/include
> & /usr/lib search paths. The patch lets autoconf handle pkgconfig file subst,

what exactly are you solving here? What's the problem with doing it
during make not during configure?
We have it in Makefile.am exactly so it's processed by make, not
configure. Make runs after configure so it will use whatever is
configured to make the substitution.

$ ./configure --includedir=/tmp/bla
$ make
$ grep includedir= ./libkmod/libkmod.pc
$ includedir=/tmp/bla

> like other packages do. (Patch from OpenWrt's contributed packages project.)

others do like we do, too:
https://git.kernel.org/cgit/linux/kernel/git/kay/libabc.git/tree/Makefile.am
http://cgit.freedesktop.org/systemd/systemd/tree/Makefile.am

should they be changed, too?

-- 
Lucas De Marchi

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] build: generate libkmod.pc during autoconf
  2015-03-10 17:04 ` Lucas De Marchi
@ 2015-03-11  0:26   ` Jeff Waugh
  2015-03-11  0:30   ` Jeff Waugh
  1 sibling, 0 replies; 4+ messages in thread
From: Jeff Waugh @ 2015-03-11  0:26 UTC (permalink / raw)
  To: Lucas De Marchi; +Cc: linux-modules

[-- Attachment #1: Type: text/plain, Size: 1009 bytes --]

Hi Lucas,

On Wed, Mar 11, 2015 at 4:04 AM, Lucas De Marchi <lucas.de.marchi@gmail.com>
wrote:

> what exactly are you solving here? What's the problem with doing it
> during make not during configure?
>

It certainly affects cross-compiling. Possibly other stuff.


Here's the relevant part of libkmod.pc when produced during make:

prefix=/usr
exec_prefix=/usr
libdir=/usr/lib
includedir=/usr/include


And during configure:

prefix=/usr
exec_prefix=/usr
libdir=${exec_prefix}/lib
includedir=${prefix}/include



> > like other packages do. (Patch from OpenWrt's contributed packages
> project.)
>
> others do like we do, too:
>
> https://git.kernel.org/cgit/linux/kernel/git/kay/libabc.git/tree/Makefile.am
> http://cgit.freedesktop.org/systemd/systemd/tree/Makefile.am
>
> should they be changed, too?
>

Yes! I was just about to send a fix for systemd, as that burned me too. :-)

(If you check any of the libraries on git.gnome.org, their pkg-config files
are generated during configure.)

Thanks,
Jeff

[-- Attachment #2: Type: text/html, Size: 2337 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] build: generate libkmod.pc during autoconf
  2015-03-10 17:04 ` Lucas De Marchi
  2015-03-11  0:26   ` Jeff Waugh
@ 2015-03-11  0:30   ` Jeff Waugh
  1 sibling, 0 replies; 4+ messages in thread
From: Jeff Waugh @ 2015-03-11  0:30 UTC (permalink / raw)
  To: Lucas De Marchi; +Cc: linux-modules

Hi Lucas,

On Wed, Mar 11, 2015 at 4:04 AM, Lucas De Marchi
<lucas.de.marchi@gmail.com> wrote:
> what exactly are you solving here? What's the problem with doing it
> during make not during configure?


It certainly affects cross-compiling. Possibly other stuff.


Here's the relevant part of libkmod.pc when produced during make:

prefix=/usr
exec_prefix=/usr
libdir=/usr/lib
includedir=/usr/include


And during configure:

prefix=/usr
exec_prefix=/usr
libdir=${exec_prefix}/lib
includedir=${prefix}/include


> > like other packages do. (Patch from OpenWrt's contributed packages project.)
>
> others do like we do, too:
> https://git.kernel.org/cgit/linux/kernel/git/kay/libabc.git/tree/Makefile.am
> http://cgit.freedesktop.org/systemd/systemd/tree/Makefile.am
>
> should they be changed, too?


Yes! I was just about to send a fix for systemd, as that burned me too. :-)

(If you check any of the libraries on git.gnome.org, their pkg-config
files are generated during configure.)

Thanks,
Jeff

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2015-03-11  0:30 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-03-05 21:05 [PATCH] build: generate libkmod.pc during autoconf Jeff Waugh
2015-03-10 17:04 ` Lucas De Marchi
2015-03-11  0:26   ` Jeff Waugh
2015-03-11  0:30   ` Jeff Waugh

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).