POV-Ray : Newsgroups : povray.unix : Re: [patch] configure.in tirival patch : Re: [patch] configure.in tirival patch Server Time
8 Jul 2024 18:27:57 EDT (-0400)
  Re: [patch] configure.in tirival patch  
From: Wolfgang Wieser
Date: 31 Mar 2003 07:00:03
Message: <3e882dc2@news.povray.org>
Nicolas Calimet wrote:

> Could you try the configure script I posted last februray in
> p.unix ? -- actually a small package to be downloaded from:
> http://pov4grasp.free.fr/download/povray-3.50c-config.tar.gz
> 
Thanks, okay. 

First of all, it does not work smoothly when using srcdir != builddir 
(as I always do because that's recommended anyways): 

Please apply the following patch so that output.h is found. 
This modifies optout.h in source dir (what it should not) but if we 
do that in dest dir it has no effect because the compiler reads optout.h 
from source dir in case it exists in src and dest dir. 

----------------------<patch>-----------------------------------------
--- old/configure.ac        2003-02-10 00:26:32.000000000 +0100
+++ new/configure.ac     2003-03-31 13:41:14.000000000 +0200
@@ -139,18 +139,20 @@
 

###############################################################################
 
+OPTOUTSRC="$srcdir/src/optout.h"
+
 echo "
-Update src/optout.h
+Update $OPTOUTSRC
 -------------------
 Program compiled by: $USER@$ac_hostname"
 
-if ! test -e src/optout.h.bak; then
-  cat src/optout.h > src/optout.h.bak
+if ! test -e "$OPTOUTSRC"".bak" ; then
+  cat "$OPTOUTSRC" > "$OPTOUTSRC"".bak"
 fi
-cat src/optout.h.bak | sed \
+sed \
   -e 's@#error@// &@' \
   -e s/"FILL IN NAME HERE........................."/$USER@$ac_hostname/ \
-  > src/optout.h
+  < "$OPTOUTSRC"".bak" > "$OPTOUTSRC"
 
 
 
----------------------------------------------------

> Since the order of the checks have been changed, I don't have
> this problem you mention (i.e. w/o adding the -L$x_libraries of your
> patch). I'd like to know if my mods work for you. I didn't update this
> package since
> I posted it {shame on me}, so it would be a good reason  :-)
> 
Oh yes, the problem I mentioned does not show up. 
Instead, I get unresolved symbols from libpng. 
The reason is that the script only looks for "png12". 
Please apply this patch: 

---------------------<patch>-------------------
--- old/configure.ac        2003-02-10 00:26:32.000000000 +0100
+++ new/configure.ac     2003-03-31 13:51:29.000000000 +0200
@@ -82,7 +82,8 @@
 
 AC_CHECK_LIB([m],[sin])
 AC_CHECK_LIB([z],[inflate])
-AC_CHECK_LIB([png12],[png_get_libpng_ver])
+AC_SEARCH_LIBS([png_get_libpng_ver],[png12 png],,
+       [AC_MSG_ERROR([Required PNG library (libpng) not detected.])])
 AC_CHECK_LIB([jpeg],[jpeg_std_error])
 AC_CHECK_LIB([tiff],[TIFFSetWarningHandler])
 AC_CHECK_LIB([vga],[vga_init])
------------------------------------------------

Furthermore, one should probably take action if a library is not 
found. Either there is code which cuts out all referneces to a 
apecial library in the source (i.e. #if HAVE_LIBPNG\n blah blah\n #endif)
so that the library is actually not needed if it is not present, or 
one should write an AC_MSG_ERROR. 
Maybe one could also add an AC_MSG_WARNING in case important libs 
are not detected. 

Otherwise, nice configure script. 
Can it be included in the standard UNIX source package?
[And src/conf.h removed because it it automatically generated and 
breaks builds with srcdir!=builddir.]

Wolfgang


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.