Re: configuration patch - Fix for bugs 386, 407, 392, 412 and notes on bugs 349, 408
Hi there! We're trying to fix our configure.in with Andreas. The latest CVS commit has a boat load of minor changes that require testing. Please refer to the subject line for BUG# numbers. On Sun, 23 Mar 2003, Andreas Schweitzer wrote:
Hi Jorge,
This patch - mainly against configure.in - fixes all these bugs - some of which are duplicates, actually.
Sure.
The startegy I implemented is : First check the headers, if not found return a big warning and don't bother anything else. If found, check how to link (that *should* work now). That last test puts some nice HAVE_LIBPNG etc. in config.h, but only if I don't fool with the "ACTION-IF-FOUND" and "ACTION-IF-NOT-FOUND" fields.
It is suggested to first check the headers and then the libraries, but every time I get into autoconf/automake I get a bad gut sensation. It is so confuse and messy... I checked the new code and decided to give more order to the whole stuff in there. This means some things changed, but the tests for jpeg and png remained (with some changes for zlib).
About libpng : Since version 1.2.2 it moved the headers to libpng/png.h which is correct on all platforms I tested. Since version 1.2.3 the install *should* create a link to the old location, and there *should* be a libpng-config script. Both these "shoulds" are only partially implemented depending on platform/system. sigh. But my libpng test should now find the header. See also http://www.libpng.org/pub/png/png2002.html
I added just a minor change. Hope it works!
The location of the system dillorc should NOT be put in config.h according to the GNU docs, instead everything with prefix/sysconfdir and similar stuff should be defined on the command line. Hence, my src/Makefile.am patch. This syntax of ' and " works on a variety of systems (bash, ksh, csh, GNU make) finally. Also, the current toplevel Makefile.am first tries $(DESTDIR)$(sysconfdir) and then falls back on /etc but the code in prefs.c does it the other way round. One of them should probably be reverted. And while writing this : the patch supplied on the list will make dillorc be installed ONLY in $(DESTDIR)$(sysconfdir) with no fall-back to /etc but I think $(DESTDIR)$(sysconfdir) will be created if necessary.
I'm not sure of what to do here :(. For now I added Patrice's patch that simply adds: sysconf_DATA = dillorc in Makefile.am, and it works! The problem is we don't know what directory it gets in. :-) Currently if it is /usr/local/etc/ or /etc, it works, but if someone chooses /opt/weird/etc, it won't be found. If your solution fixes this, I'll switch to it.
About 349 : not sure if this really causes trouble. I may have to do some major autoconf thing - like trying with default and then trying with /usr/local added - for each test, though (maybe a new macro ?).
I removed the /usr/local stuff: -CPPFLAGS="$CPPFLAGS -I/usr/local/include" -LDFLAGS="$LDFLAGS -L/usr/local/lib" IMHO, it shouldn't be there, as the system SHOULD be configured in a way that programs are able to find system resources. Maybe this serves as a workaround: CPPFLAGS="$CPPFLAGS -I/usr/local/include" ./configure :-)
About 408: this seems to be caused by using libpng 1.0.12 (i.e. the old libpng). On Debian it seems to be called that strangly. The person should probably give more details or use libpng 1.2.X.
Yes, that seems to be caused by an ancient libpng. We should give a warning.
Tested on OpenBSD 3.2 (gcc 2.95, autoconf2.13, automake1.4) FreeBSD 4.7 (gcc 2.95, autoconf2.13, automake1.4) Linux 2.4.20 (gcc 3.2, autoconf2.57, automake1.7)
Well, now without the forced "/usr/local/..." stuff, is different. I only hope we find the way to fix our configure stuff the right way...
To test it, it probably needs to go on a lot more platforms but I hesitated to send it to the list. Feel free to forward this mail as is to the list.
I'm doing it right now!!! ...and the CVS has the new version. All the helpful feedback is very welcomed! Cheers Jorge.- PS: Get a new copy from CVS, ./autogen.sh, ./configure ...
On Mon, Mar 31, Jorge Arellano Cid wrote:
The location of the system dillorc should NOT be put in config.h according to the GNU docs, instead everything with prefix/sysconfdir and similar stuff should be defined on the command line. Hence, my src/Makefile.am patch. This syntax of ' and " works on a variety of systems (bash, ksh, csh, GNU make) finally. Also, the current toplevel Makefile.am first tries $(DESTDIR)$(sysconfdir) and then falls back on /etc but the code in prefs.c does it the other way round. One of them should probably be reverted. And while writing this : the patch supplied on the list will make dillorc be installed ONLY in $(DESTDIR)$(sysconfdir) with no fall-back to /etc but I think $(DESTDIR)$(sysconfdir) will be created if necessary.
I'm not sure of what to do here :(. For now I added Patrice's patch that simply adds:
sysconf_DATA = dillorc
in Makefile.am, and it works!
The problem is we don't know what directory it gets in. :-)
Currently if it is /usr/local/etc/ or /etc, it works, but if someone chooses /opt/weird/etc, it won't be found.
Why not use $(sysconfdir) in the code, as in the attached patch? I'm not sure about the usage of the quotation marks in src/Makefile.am, they may cause problems on different environments, perhaps someone has a better idea. Sebastian
Hi there, On Wed, Apr 02, 2003 at 08:19:56PM +0200, Sebastian Geerken wrote:
On Mon, Mar 31, Jorge Arellano Cid wrote:
The location of the system dillorc should NOT be put in config.h according to the GNU docs, instead everything with prefix/sysconfdir and similar stuff should be defined on the command line. Hence, my src/Makefile.am patch. This syntax of ' and " works on a variety of systems (bash, ksh, csh, GNU make) finally. Also, the current toplevel Makefile.am first tries $(DESTDIR)$(sysconfdir) and then falls back on /etc but the code in prefs.c does it the other way round. One of them should probably be reverted.
Leaving the above intentionally :-) ... it contains more explanations (by me originally) for the following.
And while writing this : the patch supplied on the list will make dillorc be installed ONLY in $(DESTDIR)$(sysconfdir) with no fall-back to /etc but I think $(DESTDIR)$(sysconfdir) will be created if necessary.
I'm not sure of what to do here :(. For now I added Patrice's patch that simply adds:
sysconf_DATA = dillorc
in Makefile.am, and it works!
That can be done in conjunction with my suggestions for src/Makefile.am (NOT the toplevel Makefile.am)
The problem is we don't know what directory it gets in. :-)
Currently if it is /usr/local/etc/ or /etc, it works, but if someone chooses /opt/weird/etc, it won't be found.
Yes, it will be found. See below.
Why not use $(sysconfdir) in the code, as in the attached patch? I'm not sure about the usage of the quotation marks in src/Makefile.am, they may cause problems on different environments, perhaps someone has a better idea.
My original patch had something like that. Precisely : AM_CPPFLAGS=-DDILLORC_SYS='"$(sysconfdir)/dillorc"' for src/Makefile.am That way you can use fd = open(DILLORC_SYS, O_RDONLY) in src/prefs.c THIS combination of quotes worked for me :-) on Linux, FreeBSD and OpenBSD. It certainly needs testing - but it did take me a while to get that combo of quotes :-) .... Cheers Andreas -- **************************** NEW ADDRESS ****************************** Hamburger Sternwarte Universitaet Hamburg Gojenbergsweg 112 Tel. ++49 40 42891 4016 D-21029 Hamburg, Germany Fax. ++49 40 42891 4198
Andreas, On Wed, 2 Apr 2003, Andreas Schweitzer wrote:
Hi there,
On Wed, Apr 02, 2003 at 08:19:56PM +0200, Sebastian Geerken wrote:
On Mon, Mar 31, Jorge Arellano Cid wrote:
The location of the system dillorc should NOT be put in config.h according to the GNU docs, instead everything with prefix/sysconfdir and similar stuff should be defined on the command line. Hence, my src/Makefile.am patch. This syntax of ' and " works on a variety of systems (bash, ksh, csh, GNU make) finally. Also, the current toplevel Makefile.am first tries $(DESTDIR)$(sysconfdir) and then falls back on /etc but the code in prefs.c does it the other way round. One of them should probably be reverted.
Leaving the above intentionally :-) ... it contains more explanations (by me originally) for the following.
And while writing this : the patch supplied on the list will make dillorc be installed ONLY in $(DESTDIR)$(sysconfdir) with no fall-back to /etc but I think $(DESTDIR)$(sysconfdir) will be created if necessary.
I'm not sure of what to do here :(. For now I added Patrice's patch that simply adds:
sysconf_DATA = dillorc
in Makefile.am, and it works!
That can be done in conjunction with my suggestions for src/Makefile.am (NOT the toplevel Makefile.am)
Good!
[...] My original patch had something like that. Precisely :
AM_CPPFLAGS=-DDILLORC_SYS='"$(sysconfdir)/dillorc"' for src/Makefile.am
That way you can use fd = open(DILLORC_SYS, O_RDONLY) in src/prefs.c
THIS combination of quotes worked for me :-) on Linux, FreeBSD and OpenBSD. It certainly needs testing - but it did take me a while to get that combo of quotes :-) ....
I commited those changes to the CVS (with a new autogen.sh). Testing shows it works! At least dillo knows where the dillorc is placed by means of sysconfdir. Now, if you configure and make dillo, and later reconfigure with another sysconfdir, the data (dillorc) will be installed in the new directory correctly, but the binary will not be rebuilt so dillo will look for it in the old place. :( Touching prefs.c does the trick, but isn't this supossed to happen automagically? Cheers Jorge.-
participants (3)
-
Andreas Schweitzer
-
Jorge Arellano Cid
-
Sebastian Geerken