POV-Ray : Newsgroups : povray.unix : Re: [patch] configure.in tirival patch Server Time
23 Dec 2024 08:29:43 EST (-0500)
  Re: [patch] configure.in tirival patch (Message 1 to 4 of 4)  
From: Wolfgang Wieser
Subject: Re: [patch] configure.in tirival patch
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

From: Nicolas Calimet
Subject: Re: [patch] configure.in tirival patch
Date: 31 Mar 2003 12:34:49
Message: <3E887C39.7020004@free.fr>
> +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"

	Okay, I'll fix that, thanks !

> Instead, I get unresolved symbols from libpng. 
> The reason is that the script only looks for "png12".

	Yes, that particular point about libpng has been discussed
in the thread about the new configure script. I wanted to add some
tests about which version of libpng (if any) is present.

> -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.])])

	Okay I can add this, but I will have to check on our SGI machines
since they were the reason why I specified libpng12 instead of libpng.
But I suppose it will be okay if to search the lib in this order.


> Furthermore, one should probably take action if a library is not 
> found.

	Yeah that was discussed as well. I guess best would be to
change the code so that no graphics library is _required_ as long
as at least one image file format is supported on any platform.
In this case I guess libpng should be the required library, while
all the others could be optional. And all those #ifdef HAVE_lib
should be inserted where necessary. But that's not only UNIX-
specific, so I don't know if it will be accepted (at least soon)
by the POV-Team. Maybe it's already in the code afterall...

> Otherwise, nice configure script. 
> Can it be included in the standard UNIX source package?

	AFAIK Mark Gordon wanted to get some "inspiration" from it :-)
	All those mods cannot be directly included in the official
UNIX distro since there are a few GPL scripts provided in my package.

> [And src/conf.h removed because it it automatically generated and 
> breaks builds with srcdir!=builddir.]

	I'll check if it's also in my package. Otherwise I cannot
do much but deleting the file at configure time.

	I hope to upload a new version of the configure within this
week with some more extra architecture-oriented optimization flags.

	- NC


Post a reply to this message

From: Wolfgang Wieser
Subject: Re: [patch] configure.in tirival patch
Date: 1 Apr 2003 17:45:29
Message: <3e8a1683@news.povray.org>
FYI: Just notized the following: 

POV_TRY_CFLAGS([-march=pentiumpro -mcpu=pentiumpro -fkadjfhsjldhf]

will not cause an error (i.e. "not supported") as it obviously should. 

Furthermore, 

case "$build" in
  i?86-* | k?-*)
    case "$build" in
      i386-*) POV_TRY_CFLAGS([-march=i386 -mcpu=i386]);;
etc...

will not necessarily choose any of the AMD processors even if an AMD 
is built into the system. I get PentiumPro instead of AthlonXP. 
(This is a minor issue and I don't mind if it stays as it is.) 

Wolfgang


Post a reply to this message

From: Nicolas Calimet
Subject: Re: [patch] configure.in tirival patch
Date: 2 Apr 2003 09:05:28
Message: <3E8AEE27.2030501@free.fr>
> POV_TRY_CFLAGS([-march=pentiumpro -mcpu=pentiumpro -fkadjfhsjldhf]
> 
> will not cause an error (i.e. "not supported") as it obviously should. 

	Ah, that's weird.
	Okay I'll try to fix it, but don't have much time for now...

> case "$build" in
>   i?86-* | k?-*)
>     case "$build" in
>       i386-*) POV_TRY_CFLAGS([-march=i386 -mcpu=i386]);;
> etc...
> 
> will not necessarily choose any of the AMD processors even if an AMD 
> is built into the system. I get PentiumPro instead of AthlonXP.

	Yes, I'm aware of this for quite long time since I'm always
running on AMD processors, but I didn't yet look which shell variable
will help finding the correct processor familly. I suppose I have to
look for the answer in config.guess.

	Thanks for testing  :-)
	- NC


Post a reply to this message

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