Subject: Strange thing with sed and SDL_mixer under NetBSD
To: None <tech-pkg@netbsd.org>
From: Vincent <10.50@free.fr>
List: tech-pkg
Date: 04/23/2006 12:55:19
Hi,

when I try to compile SDL_Mixer (in order to test Gnash), I have that 
message

checking for sdl-config... /usr/pkg/bin/sdl-config
checking for SDL - version >= 1.2.4... no
*** Could not run SDL test program, checking why...
*** The test program compiled, but did not run. This usually means
*** that the run-time linker is not finding SDL or finding the wrong
*** version of SDL. If it is not finding SDL, you'll need to set your
*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point
*** to the installed location  Also, make sure you have run ldconfig if that
*** is required on your system
***
*** If you have an old version installed, it is best to remove it, although
*** you may also be able to get things to work by modifying LD_LIBRARY_PATH
configure: error: *** SDL version 1.2.4 not found!

but, before:

===> Required installed package smpeg>=0.4.4nb12: smpeg-0.4.4nb12 found
===> Required installed package SDL>=1.2.9nb2: SDL-1.2.9nb2 found
===> Required installed package glu>=6.4.1nb1: glu-6.4.2 found

Obviously, there is something wrong. Indeed, what goes astray is the 
substitution of the Configure variable $sdl_major_version :

sdl_major_version=`$SDL_CONFIG $sdl_args --version | \
            sed 's/\([0-9]*\).\([0-9]*\).\([0-9]*\)/\1/'`

Normally, $sdl_major_version should be 1, whereas, if I add a debug 
"echo" in the configure script, I get:

checking for sdl-config... /usr/pkg/bin/sdl-config
checking for SDL - version >= 1.2.4... sdl_major_version = 1.2.9
no

Obviously, this is a bug, which leads the C compilation to fail:

configure:19766: cc -o conftest -O2 -march=pentium4 -msse2 -mfpmath=sse 
-DSYSCONFDIR="\"/usr/pkg/etc\"" -I/usr/pkg/include -DGLX_GLXEXT_LEGACY 
-I/usr/include -I/usr/pkg/include/freetype2 -I/usr/pkg/include/SDL 
-D_REENTRANT -Dunix=1 -I/usr/pkg/include -DGLX_GLXEXT_LEGACY 
-I/usr/include -I/usr/pkg/include/freetype2 -L/usr/pkg/xorg/lib 
-Wl,-R/usr/pkg/xorg/lib -L/usr/pkg/lib -Wl,-R/usr/pkg/lib -L/usr/lib 
-Wl,-R/usr/lib conftest.c  -L/usr/pkg/lib -Wl,-rpath,/usr/pkg/lib -lSDL 
-lossaudio -lpthread -L/usr/pkg/lib -Wl,-R/usr/pkg/lib 
-L/usr/pkg/xorg/lib -Wl,-R/usr/pkg/xorg/lib -lm -L/usr/pkg/xorg/lib 
-lX11 -lXext -laa -lusbhid >&5

conftest.c:64:9: too many decimal points in number
conftest.c:65:9: too many decimal points in number
conftest.c:65:29: too many decimal points in number
conftest.c:66:9: too many decimal points in number
conftest.c:66:29: too many decimal points in number
conftest.c:66:49: too many decimal points in number
conftest.c:72:91: too many decimal points in number
conftest.c:72:98: too many decimal points in number
conftest.c:72:105: too many decimal points in number

And configure breaks.

What I do not understand, is that when I directly type ./configure (and 
not "make configure") in work.../SDL.../ repertory, it works fine:

checking for sdl-config... /usr/pkg/bin/sdl-config
checking for SDL - version >= 1.2.4... sdl_major_version = 1
yes

Obviously there is something wrong with sed in the wrapping, but what?

Vincent