unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* configure's dependency on pkg-config
@ 2011-11-11 19:25 Stephen Berman
  2011-11-12 14:13 ` Jan Djärv
  0 siblings, 1 reply; 10+ messages in thread
From: Stephen Berman @ 2011-11-11 19:25 UTC (permalink / raw)
  To: emacs-devel

I built a GNU/Linux system from sources (Linux From Scratch) and then
built the current Emacs pretest on it with configure && make, but was
surprised that configure failed to use libxml2, although I had built and
installed the libxml2 files in the standard locations.  I then
reconfigured Emacs, passing the libxml2 requirements to configure via
CPPFLAGS, LDFLAGS and LIBS, but it still failed to use libxml2.  Then I
looked at configure and found the reason:

  if test "$PKG_CONFIG" = "no" ; then
     HAVE_LIBXML2=no

I don't have pkg-config installed on this system.  I tried passing
PKG_CONFIG=1 to configure, but that didn't help, because if that
variable is set, configure looks for the pkg-config executable.
Finally, I simply hacked out the pkg-config bits around the libxml2
tests in configure and passed the requirements via LIBXML2_CFLAGS and
LIBXML2_LIBS, and this worked.  

Is there a better way to override configure's dependency on pkg-config
for libraries such as libxml2, so that it would suffice to pass the
standard variable CPPFLAGS, LDFLAGS and LIBS?  Or if there isn't, should
there be?

Steve Berman




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

* Re: configure's dependency on pkg-config
  2011-11-11 19:25 configure's dependency on pkg-config Stephen Berman
@ 2011-11-12 14:13 ` Jan Djärv
  2011-11-12 22:33   ` Stephen Berman
  0 siblings, 1 reply; 10+ messages in thread
From: Jan Djärv @ 2011-11-12 14:13 UTC (permalink / raw)
  To: Stephen Berman; +Cc: emacs-devel

Hi.

11 nov 2011 kl. 20:25 skrev Stephen Berman:

> I built a GNU/Linux system from sources (Linux From Scratch) and then
> built the current Emacs pretest on it with configure && make, but was
> surprised that configure failed to use libxml2, although I had built and
> installed the libxml2 files in the standard locations.  I then
> reconfigured Emacs, passing the libxml2 requirements to configure via
> CPPFLAGS, LDFLAGS and LIBS, but it still failed to use libxml2.  Then I
> looked at configure and found the reason:
> 
>  if test "$PKG_CONFIG" = "no" ; then
>     HAVE_LIBXML2=no
> 
> I don't have pkg-config installed on this system.  I tried passing
> PKG_CONFIG=1 to configure, but that didn't help, because if that
> variable is set, configure looks for the pkg-config executable.
> Finally, I simply hacked out the pkg-config bits around the libxml2
> tests in configure and passed the requirements via LIBXML2_CFLAGS and
> LIBXML2_LIBS, and this worked.  
> 
> Is there a better way to override configure's dependency on pkg-config
> for libraries such as libxml2, so that it would suffice to pass the
> standard variable CPPFLAGS, LDFLAGS and LIBS?  Or if there isn't, should
> there be?

I would assume libxml2 installs its .pc-file in /usr/lib/pkgconfig (or similar) when you install it, so all the info is there.  So why not just install pkg-config?  It is a very small package.

	Jan D.




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

* Re: configure's dependency on pkg-config
  2011-11-12 14:13 ` Jan Djärv
@ 2011-11-12 22:33   ` Stephen Berman
  2011-11-12 22:59     ` Glenn Morris
                       ` (2 more replies)
  0 siblings, 3 replies; 10+ messages in thread
From: Stephen Berman @ 2011-11-12 22:33 UTC (permalink / raw)
  To: Jan Djärv; +Cc: emacs-devel

On Sat, 12 Nov 2011 15:13:49 +0100 Jan Djärv <jan.h.d@swipnet.se> wrote:

> Hi.
>
> 11 nov 2011 kl. 20:25 skrev Stephen Berman:
[...]
>> Is there a better way to override configure's dependency on pkg-config
>> for libraries such as libxml2, so that it would suffice to pass the
>> standard variable CPPFLAGS, LDFLAGS and LIBS?  Or if there isn't, should
>> there be?
>
> I would assume libxml2 installs its .pc-file in /usr/lib/pkgconfig (or
> similar) when you install it, so all the info is there.  So why not just
> install pkg-config?  It is a very small package.

No doubt pkg-config is convenient and of course I could install it; but
my experience shows that even though it's not necessary, you can't avoid
it by setting the recommended variables at configure time.  So this
seems to be at least a doc bug in INSTALL, which should explicitly say
that pkg-config is required in order for Emacs to use certain libraries
and also list all of these libraries.  The alternative would be to patch
configure (or rather configure.in) to allow setting the standard
configure time variables to override using pkg-config.  This seems
better to me in principle (though it might be judged not to be worth the
effort); are there any platforms Emacs runs on that cannot use
pkg-config but on which Emacs could use libxml2 etc.?

Steve Berman



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

* Re: configure's dependency on pkg-config
  2011-11-12 22:33   ` Stephen Berman
@ 2011-11-12 22:59     ` Glenn Morris
  2011-11-12 23:56       ` Stephen Berman
  2011-11-12 23:12     ` Jan Djärv
  2011-11-14 14:01     ` Stefan Monnier
  2 siblings, 1 reply; 10+ messages in thread
From: Glenn Morris @ 2011-11-12 22:59 UTC (permalink / raw)
  To: Stephen Berman; +Cc: Jan Djärv, emacs-devel

Stephen Berman wrote:

> seems to be at least a doc bug in INSTALL, which should explicitly say
> that pkg-config is required in order for Emacs to use certain libraries

It already says enough IMO

  For some libraries, like Gtk+, fontconfig and ALSA, `configure' uses
  pkg-config to find where those libraries are installed.

> The alternative would be to patch configure (or rather configure.in)
> to allow setting the standard configure time variables to override
> using pkg-config. This seems better to me in principle (though it
> might be judged not to be worth the effort);

It's not worth the effort. Just install pkg-config and move on.

> are there any platforms Emacs runs on that cannot use pkg-config but
> on which Emacs could use libxml2 etc.?

Not to my knowledge.



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

* Re: configure's dependency on pkg-config
  2011-11-12 22:33   ` Stephen Berman
  2011-11-12 22:59     ` Glenn Morris
@ 2011-11-12 23:12     ` Jan Djärv
  2011-11-12 23:56       ` Stephen Berman
  2011-11-14 14:01     ` Stefan Monnier
  2 siblings, 1 reply; 10+ messages in thread
From: Jan Djärv @ 2011-11-12 23:12 UTC (permalink / raw)
  To: Stephen Berman; +Cc: emacs-devel


12 nov 2011 kl. 23:33 skrev Stephen Berman:

> On Sat, 12 Nov 2011 15:13:49 +0100 Jan Djärv <jan.h.d@swipnet.se> wrote:
> 
>> Hi.
>> 
>> 11 nov 2011 kl. 20:25 skrev Stephen Berman:
> [...]
>>> Is there a better way to override configure's dependency on pkg-config
>>> for libraries such as libxml2, so that it would suffice to pass the
>>> standard variable CPPFLAGS, LDFLAGS and LIBS?  Or if there isn't, should
>>> there be?
>> 
>> I would assume libxml2 installs its .pc-file in /usr/lib/pkgconfig (or
>> similar) when you install it, so all the info is there.  So why not just
>> install pkg-config?  It is a very small package.
> 
> No doubt pkg-config is convenient and of course I could install it; but
> my experience shows that even though it's not necessary, you can't avoid
> it by setting the recommended variables at configure time.  So this
> seems to be at least a doc bug in INSTALL, which should explicitly say
> that pkg-config is required in order for Emacs to use certain libraries
> and also list all of these libraries.  The alternative would be to patch
> configure (or rather configure.in) to allow setting the standard
> configure time variables to override using pkg-config.  This seems
> better to me in principle (though it might be judged not to be worth the
> effort); are there any platforms Emacs runs on that cannot use
> pkg-config but on which Emacs could use libxml2 etc.?

I don't know why you are opposed to installing pkg-config, but it is not Emacs choice.  libxml2 has made pkg-config the way for users of that library to find out compiler and linker flags as well as dependencies on other libraries.  So of course Emacs uses that.  Who are we to argue about the validity of that descision?  Ditto for Gtk, dbus, and others.

If you wan't another way to use libxml2 without using pkg-config, you should take that up with libxml2-developers.  If they make another way to compile with their library, Emacs can use that.  But I don't understand why Emacs should take the trouble to make sure Emacs can use a library WITHOUT using the official, sanctioned way of using that library.

	Jan D.
 




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

* Re: configure's dependency on pkg-config
  2011-11-12 22:59     ` Glenn Morris
@ 2011-11-12 23:56       ` Stephen Berman
  2011-11-13  0:32         ` Paul Eggert
  0 siblings, 1 reply; 10+ messages in thread
From: Stephen Berman @ 2011-11-12 23:56 UTC (permalink / raw)
  To: Glenn Morris; +Cc: Jan Djärv, emacs-devel

On Sat, 12 Nov 2011 17:59:02 -0500 Glenn Morris <rgm@gnu.org> wrote:

> Stephen Berman wrote:
>
>> seems to be at least a doc bug in INSTALL, which should explicitly say
>> that pkg-config is required in order for Emacs to use certain libraries
>
> It already says enough IMO
>
>   For some libraries, like Gtk+, fontconfig and ALSA, `configure' uses
>   pkg-config to find where those libraries are installed.

Not enough, since it doesn't mention libxml2, which was the one I was
concerned with.  And it should just list them all; there aren't that
many.  (It would also be less confusing if this dependency were stated
before mentioning the configure time variables CPPFLAGS etc., making it
clear that these only work for libraries that Emacs doesn't use
pkg-config to locate.)

>> The alternative would be to patch configure (or rather configure.in)
>> to allow setting the standard configure time variables to override
>> using pkg-config. This seems better to me in principle (though it
>> might be judged not to be worth the effort);
>
> It's not worth the effort. Just install pkg-config and move on.

If it had been documented in INSTALL I would have.

Steve Berman



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

* Re: configure's dependency on pkg-config
  2011-11-12 23:12     ` Jan Djärv
@ 2011-11-12 23:56       ` Stephen Berman
  2011-11-13 11:08         ` Jan Djärv
  0 siblings, 1 reply; 10+ messages in thread
From: Stephen Berman @ 2011-11-12 23:56 UTC (permalink / raw)
  To: Jan Djärv; +Cc: emacs-devel

On Sun, 13 Nov 2011 00:12:43 +0100 Jan Djärv <jan.h.d@swipnet.se> wrote:

> I don't know why you are opposed to installing pkg-config, but it is not Emacs
> choice.  libxml2 has made pkg-config the way for users of that library to find
> out compiler and linker flags as well as dependencies on other libraries.  So
> of course Emacs uses that.  Who are we to argue about the validity of that
> descision?  Ditto for Gtk, dbus, and others.

I'm not opposed to installing pkg-config, I just didn't know I was
supposed to to get Emacs to use libxml2, until I looked in configure.
If it had been documented in INSTALL, I would have been spared that
effort and time.  (That libxml2 provides pkg-config data I also didn't
know: I just checked, and the only mention of "pkg-config" in the entire
libxml2-2.7.8 source tree is in the ChangeLog, which I didn't read
before installing libxml2.)

> If you wan't another way to use libxml2 without using pkg-config, you should
> take that up with libxml2-developers.  If they make another way to compile
> with their library, Emacs can use that.  But I don't understand why Emacs
> should take the trouble to make sure Emacs can use a library WITHOUT using the
> official, sanctioned way of using that library.

I don't want Emacs or its developers to go to such undue lengths, but
just to be clear about what lengths users need to go to.  Since I didn't
know pkg-config was supposed to be used for libxml2, I just went by the
INSTALL guidelines and hence was surprised when they failed for libxml2.

Steve Berman



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

* Re: configure's dependency on pkg-config
  2011-11-12 23:56       ` Stephen Berman
@ 2011-11-13  0:32         ` Paul Eggert
  0 siblings, 0 replies; 10+ messages in thread
From: Paul Eggert @ 2011-11-13  0:32 UTC (permalink / raw)
  To: Stephen Berman; +Cc: Jan Djärv, emacs-devel

On 11/12/11 15:56, Stephen Berman wrote:
> If it had been documented in INSTALL I would have.

It might be worth adding a section to INSTALL specifying
what's needed to build Emacs in the usual way.  This would
include a shell, make, a C compiler, standard Unix utilities
such as cp, and pkg-config.

pkg-config is not listed in the GNU coding standards as
one of the standard compilers and related programs that
Makefiles can use.  Perhaps it should be added to that list?
I'm referring to:

http://www.gnu.org/prep/standards/html_node/Utilities-in-Makefiles.html



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

* Re: configure's dependency on pkg-config
  2011-11-12 23:56       ` Stephen Berman
@ 2011-11-13 11:08         ` Jan Djärv
  0 siblings, 0 replies; 10+ messages in thread
From: Jan Djärv @ 2011-11-13 11:08 UTC (permalink / raw)
  To: Stephen Berman; +Cc: emacs-devel


Hello.

13 nov 2011 kl. 00:56 skrev Stephen Berman:

> On Sun, 13 Nov 2011 00:12:43 +0100 Jan Djärv <jan.h.d@swipnet.se> wrote:
> 
>> I don't know why you are opposed to installing pkg-config, but it is not Emacs
>> choice.  libxml2 has made pkg-config the way for users of that library to find
>> out compiler and linker flags as well as dependencies on other libraries.  So
>> of course Emacs uses that.  Who are we to argue about the validity of that
>> descision?  Ditto for Gtk, dbus, and others.
> 
> I'm not opposed to installing pkg-config, I just didn't know I was
> supposed to to get Emacs to use libxml2, until I looked in configure.
> If it had been documented in INSTALL, I would have been spared that
> effort and time.  (That libxml2 provides pkg-config data I also didn't
> know: I just checked, and the only mention of "pkg-config" in the entire
> libxml2-2.7.8 source tree is in the ChangeLog, which I didn't read
> before installing libxml2.)
> 

Every package that can be used provides the pkg-config data.  The one for libxml2 is generated from libxml-2.0.pc.in in the source.
I think pkg-config is considered standard, so along with tar, cp and other standard utilities, it is not mentioned.  It is only a problem for people building their own distributions, which is far fewer nowdays that say 10 years ago.  And if you are doing that, pkg-config is really something you need to install.  But adding it to INSTALL is not a big deal.

The reason for not mentioning all the libraries using pkg-config in INSTALL is that almost all new libraries support it.  So we would probably need to add every new library Emacs uses to INSTALL.

	Jan D.




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

* Re: configure's dependency on pkg-config
  2011-11-12 22:33   ` Stephen Berman
  2011-11-12 22:59     ` Glenn Morris
  2011-11-12 23:12     ` Jan Djärv
@ 2011-11-14 14:01     ` Stefan Monnier
  2 siblings, 0 replies; 10+ messages in thread
From: Stefan Monnier @ 2011-11-14 14:01 UTC (permalink / raw)
  To: Stephen Berman; +Cc: Jan Djärv, emacs-devel

> and also list all of these libraries.  The alternative would be to patch
> configure (or rather configure.in) to allow setting the standard
> configure time variables to override using pkg-config.

This would be good, indeed (tho not of high priority).  Patches welcome.


        Stefan



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

end of thread, other threads:[~2011-11-14 14:01 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-11-11 19:25 configure's dependency on pkg-config Stephen Berman
2011-11-12 14:13 ` Jan Djärv
2011-11-12 22:33   ` Stephen Berman
2011-11-12 22:59     ` Glenn Morris
2011-11-12 23:56       ` Stephen Berman
2011-11-13  0:32         ` Paul Eggert
2011-11-12 23:12     ` Jan Djärv
2011-11-12 23:56       ` Stephen Berman
2011-11-13 11:08         ` Jan Djärv
2011-11-14 14:01     ` Stefan Monnier

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

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 read-only IMAP folder(s) and NNTP newsgroup(s).