sgl

diff configure @ 19:12ce0cef7ebf

foo
author John Tsiombikas <nuclear@member.fsf.org>
date Sun, 26 Jun 2011 02:30:37 +0300
parents a16b34ac3f2a
children f5e83de47903
line diff
     1.1 --- a/configure	Sat Jun 25 05:24:49 2011 +0300
     1.2 +++ b/configure	Sun Jun 26 02:30:37 2011 +0300
     1.3 @@ -2,6 +2,15 @@
     1.4  
     1.5  cfgfile=src/config.h
     1.6  modfile=src/modules.c
     1.7 +logfile=config.log
     1.8 +echobin=`which echo`
     1.9 +
    1.10 +rm -f $logfile
    1.11 +
    1.12 +message()
    1.13 +{
    1.14 +	$echobin $* | tee -a $logfile
    1.15 +}
    1.16  
    1.17  extract()
    1.18  {
    1.19 @@ -28,8 +37,11 @@
    1.20  	srcfile=/tmp/sgl-trylink.c
    1.21  	aout=/tmp/sgl-a.out
    1.22  
    1.23 +	echo >>$logfile
    1.24 +	echo "trying command line: cc -o $aout $srcfile $*" >>$logfile 
    1.25 +
    1.26  	echo 'int main(void) { return 0; }' >$srcfile
    1.27 -	cc -o $aout $srcfile $1 >/dev/null 2>/dev/null
    1.28 +	eval cc -o $aout $srcfile $1 >>$logfile 2>>$logfile
    1.29  	res=$?
    1.30  
    1.31  	rm -f $srcfile $aout
    1.32 @@ -52,7 +64,7 @@
    1.33  
    1.34  
    1.35  # start scanning for modules
    1.36 -echo 'Looking for usable window system modules ...'
    1.37 +message 'Looking for usable window system modules ...'
    1.38  
    1.39  # collect all src/wsys_whatever.c files
    1.40  all_files=`ls src/wsys_*.c src/wsys_*.m 2>/dev/null`
    1.41 @@ -75,10 +87,10 @@
    1.42  	fi
    1.43  
    1.44  	name=`echo $m | sort | sed 's/src\/wsys_//' | sed 's/\.c//' | sed 's/\.m//'`
    1.45 -	`which echo` -n "-> trying module $name (needs: $dep) ... "
    1.46 +	message -n "-> trying module $name (needs: $dep) ... "
    1.47  
    1.48  	if try_link "$dep"; then
    1.49 -		echo ok
    1.50 +		message ok
    1.51  
    1.52  		libs="$libs $dep"
    1.53  
    1.54 @@ -89,7 +101,7 @@
    1.55  		# make the registration call in modules.c
    1.56  		echo "	REGISTER_MODULE($name);" >>$modfile
    1.57  	else
    1.58 -		echo failed
    1.59 +		message failed
    1.60  	fi
    1.61  done
    1.62  echo "Will link with: $libs"
    1.63 @@ -101,11 +113,11 @@
    1.64  echo '#endif	/* CONFIG_H_ */' >>$cfgfile
    1.65  
    1.66  # generate makefile
    1.67 -echo Generating makefile ...
    1.68 +message Generating makefile ...
    1.69  
    1.70  # hardcode prefix for now, too lazy to actually add an option...
    1.71  echo 'PREFIX = /usr/local' >Makefile
    1.72  echo "wsys_libs = $libs" >>Makefile
    1.73  cat Makefile.in >>Makefile
    1.74  
    1.75 -echo 'Configuration complete. Run make (or gmake) to compile.'
    1.76 +message 'Configuration complete. Run make (or gmake) to compile.'