Now that I was told that the SPARC part of the fox-gate might really be 
used for something, I began eating some coffee powder and am now 
determined to get that merge finished soon (next days).
I'm finally in the process of systematically paging through the entire 
buildit-XW logfiles in all three of my current worspaces.
And aha, some coffe powder and voila, the solution to the bash versus 
Bourne /bin/sh problem with mesalibs (which normally weren't built under 
SPARC before I enabled them).
Q: I wonder if nobody ever got that problem under x86??

For some strange reason

if [ -e ../../lib/libGL.so ]; then \
        ../../bin/minstall ../../lib/libGL* /usr/X11/lib; \
fi

### which is equivalent to ###

if test ! -e "../../lib/libGL.so"; then \
        ../../bin/minstall ../../lib/libGL* /usr/X11/lib; \
fi

does *not* work with Bourne shell, which is odd.
("make install" would work, if /bin/sh happened to be bash).
If we test for

*-s* FileName 
### -- FileName has a size greater than 0.###

instead of 

*-e* FileName -- FileName exists.

it suddenly works as expected, also with /bin/sh being the default outdated 
Bourne.
As "-s" is actually much better test, than "-e", I added a patch to 
/FOX/MERCURIAL_20070830thu/fox-gate__Aha_Testing__pre20070913thu/XW_NV/open-src/lib/mesa
 which changes lines 

Makefile:157:   @if [ -e $(TOP)/$(LIB_DIR)/$(GL_LIB_NAME) ]; then \
Makefile:160:   @if [ -e $(TOP)/$(LIB_DIR)/$(OSMESA_LIB_NAME) ]; then \

in 
/FOX/MERCURIAL_20070830thu/fox-gate__Aha_Testing__pre20070913thu/XW_NV/open-src/lib/mesa/build_32/Mesa-6.5.2/src/mesa/Makefile
 

to

Makefile:157:   @if [ -s $(TOP)/$(LIB_DIR)/$(GL_LIB_NAME) ]; then \
Makefile:160:   @if [ -s $(TOP)/$(LIB_DIR)/$(OSMESA_LIB_NAME) ]; then \

before each archive extraction.

See below:

-bash-3.00$ pwd
/FOX/MERCURIAL_20070830thu/fox-gate__Aha_Testing__pre20070913thu/XW_NV/open-src/lib/mesa/build_32/Mesa-6.5.2/src/mesa
-bash-3.00$ make
-bash-3.00$ make install
../../bin/minstall -d /usr/X11/include/GL
../../bin/minstall -d /usr/X11/lib
../../bin/minstall -m 644 ../../include/GL/*.h /usr/X11/include/GL
sh: test: argument expected
*** Error code 1
The following command caused the error:
if [ -e ../../lib/libGL.so ]; then \
        ../../bin/minstall ../../lib/libGL* /usr/X11/lib; \
fi
make: Fatal error: Command failed for target `install'
-bash-3.00$  if test ! -e "../../lib/libGL.so"; then \
 >         ../../bin/minstall ../../lib/libGL* /usr/X11/lib; \
 > fi
-bash-3.00$ sh
$  if test ! -e "../../lib/libGL.so"; then \
        ../../bin/minstall ../../lib/libGL* /usr/X11/lib; \
fi
 > > test: argument expected
$  if test ! -s "../../lib/libGL.so"; then \
        ../../bin/minstall ../../lib/libGL* /usr/X11/lib; \
fi
 > > $  grep -n "if \[ -e" *
Makefile:157:   @if [ -e $(TOP)/$(LIB_DIR)/$(GL_LIB_NAME) ]; then \
Makefile:160:   @if [ -e $(TOP)/$(LIB_DIR)/$(OSMESA_LIB_NAME) ]; then \
Makefile__ORIG_preBourne:157:   @if [ -e 
$(TOP)/$(LIB_DIR)/$(GL_LIB_NAME) ]; then \
Makefile__ORIG_preBourne:160:   @if [ -e 
$(TOP)/$(LIB_DIR)/$(OSMESA_LIB_NAME) ]; then \
$ pwd
/FOX/MERCURIAL_20070830thu/fox-gate__Aha_Testing__pre20070913thu/XW_NV/open-src/lib/mesa/build_32/Mesa-6.5.2/src/mesa
$


References:
http://en.wikipedia.org/wiki/Test_(Unix)


Regards,
Martin

Reply via email to