[opensuse-buildservice] OT: How to get path out of autoconf into source
----- Message Text ----- Hello, it is a bit off topic, but I don't know a better address. I try to fix my pavuk package so it builds correctly. Instead of doing workaroungs I wanted to fix it correctly. Now the main problem is: - How do I get a pathinformation (e.g. $localedir) from the configure-script into the configure header ac-config.h? When I do AC_DEFINE I get the path, but with e.g. "${prefix}" in it, which does not help. Is there some way (straightforward nonhacking way) to a) get an evaluated string into the config file (all variable levels replaced) b) pass the strings as define to the compiler call c) something else In the last three years I found no solution and always used workarounds. Maybe one of you can help. Ciao -- http://www.dstoecker.eu/ (PGP key available) --------------------------------------------------------------------- To unsubscribe, e-mail: opensuse-buildservice+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-buildservice+help@opensuse.org
On 2007-02-15 14:46:40 +0100, Dirk Stoecker wrote:
Date: Thu, 15 Feb 2007 14:46:40 +0100 (CET) From: Dirk Stoecker <opensuse@dstoecker.de> Subject: [opensuse-buildservice] OT: How to get path out of autoconf into source To: opensuse-buildservice@opensuse.org
----- Message Text ----- Hello,
it is a bit off topic, but I don't know a better address. I try to fix my pavuk package so it builds correctly. Instead of doing workaroungs I wanted to fix it correctly.
Now the main problem is: - How do I get a pathinformation (e.g. $localedir) from the configure-script into the configure header ac-config.h?
When I do AC_DEFINE I get the path, but with e.g. "${prefix}" in it, which does not help.
Is there some way (straightforward nonhacking way) to a) get an evaluated string into the config file (all variable levels replaced) b) pass the strings as define to the compiler call c) something else
In the last three years I found no solution and always used workarounds. Maybe one of you can help.
in ac-config.h.in #define localstatedir @localstatedir@ darix -- openSUSE - SUSE Linux is my linux openSUSE is good for you www.opensuse.org --------------------------------------------------------------------- To unsubscribe, e-mail: opensuse-buildservice+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-buildservice+help@opensuse.org
Hi,
in ac-config.h.in
#define localstatedir @localstatedir@
Doesn't work! configure, if run without arguments, will replace it with ${prefix}/var. rpm packagers (especially when using the %configure macro) never notice that because they run configure with the --localstatedir=/var argument (which forces it to get an absolute path), but it's wrong and will break for normal "./configure; make; make install" builds. The correct way to do that is via the Makefile.am. Write it like this: AM_CPPFLAGS = -DLOCALSTATEDIR="\"$(localstatedir)\"" Please also read http://www.gnu.org/software/autoconf/manual/html_node/Defining-Directories.h... and always verify that the package builds correctly even without rpm "specialties" like %configure. Andreas Hanke -- Der GMX SmartSurfer hilft bis zu 70% Ihrer Onlinekosten zu sparen! Ideal für Modem und ISDN: http://www.gmx.net/de/go/smartsurfer --------------------------------------------------------------------- To unsubscribe, e-mail: opensuse-buildservice+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-buildservice+help@opensuse.org
On 2007-02-15 17:01:03 +0100, andreas.hanke@gmx-topmail.de wrote:
Doesn't work! configure, if run without arguments, will replace it with ${prefix}/var.
localstatedir should be defined even for simple ./configure && make && make install ... as it is used in makefiles later on aswell right? darix -- openSUSE - SUSE Linux is my linux openSUSE is good for you www.opensuse.org --------------------------------------------------------------------- To unsubscribe, e-mail: opensuse-buildservice+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-buildservice+help@opensuse.org
Hi,
localstatedir should be defined even for simple ./configure && make && make install ... as it is used in makefiles later on aswell right?
what counts is the value it gets defined to. What you want is an absolute path, but what you get is a meaningless shell variable. I have attached two testcases. Build with ./autogen.sh ./configure make ./hello to see the difference. -- "Feel free" - 5 GB Mailbox, 50 FreeSMS/Monat ... Jetzt GMX ProMail testen: www.gmx.net/de/go/mailfooter/promail-out
Hi,
what counts is the value it gets defined to. What you want is an absolute path, but what you get is a meaningless shell variable.
Just for the records: This style of coding already broke at least 6 packages in the past: hal (#210297), inkscape (#204719), initial (#220321), dbus (#202854), glib-gettext (#213926) and just now enlightenment (#246294). Everyone who still does that will be hung up and burnt alive by me personally. Andreas Hanke -- Ist Ihr Browser Vista-kompatibel? Jetzt die neuesten Browser-Versionen downloaden: http://www.gmx.net/de/go/browser --------------------------------------------------------------------- To unsubscribe, e-mail: opensuse-buildservice+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-buildservice+help@opensuse.org
On Fri, 16 Feb 2007, andreas.hanke@gmx-topmail.de wrote:
what counts is the value it gets defined to. What you want is an absolute path, but what you get is a meaningless shell variable.
Just for the records: This style of coding already broke at least 6 packages in the past: hal (#210297), inkscape (#204719), initial (#220321), dbus (#202854), glib-gettext (#213926) and just now enlightenment (#246294).
Seems your AM_CPPFLAGS solution is much nicer, than the looped macro expansion in these bug reports. Thank's again for your help.
Everyone who still does that will be hung up and burnt alive by me personally.
As this and other problems will tend to come up again and again, what about a packager FAQ on the build service pages to collect these sort of questions related to package building? My question could be the first one there. P.S. It seems pavuk now builds completely even with socks, ssl and all the stuff it supports enabled. Next project will be pixieplus KDE tool. But I first need to find out how to make a release archive in KDE before I make RPM's. :-) Ciao -- http://www.dstoecker.eu/ (PGP key available) --------------------------------------------------------------------- To unsubscribe, e-mail: opensuse-buildservice+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-buildservice+help@opensuse.org
On Thu, 15 Feb 2007, andreas.hanke@gmx-topmail.de wrote:
in ac-config.h.in
#define localstatedir @localstatedir@
Doesn't work! configure, if run without arguments, will replace it with ${prefix}/var.
It also does not work, as ac-config.h.in is auto generated.
AM_CPPFLAGS = -DLOCALSTATEDIR="\"$(localstatedir)\""
Works. Thanks.
and always verify that the package builds correctly even without rpm "specialties" like %configure.
Other way round. Works fine for non-rpm, but I have problems with RPM. Also there is too much old stuff in the configure script which probably could be solved better and shorter (like the directory problem :-) I found autoupdate and cleaned some of the old stuff. Lots of stuff still left to be done. Ciao -- http://www.dstoecker.eu/ (PGP key available) --------------------------------------------------------------------- To unsubscribe, e-mail: opensuse-buildservice+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-buildservice+help@opensuse.org
participants (3)
-
andreas.hanke@gmx-topmail.de
-
Dirk Stoecker
-
Marcus Rueckert