sgl

diff configure @ 28:f5e83de47903

added --prefix and --without-whatever args in configure script
author John Tsiombikas <nuclear@member.fsf.org>
date Mon, 27 Jun 2011 01:59:26 +0300
parents 12ce0cef7ebf
children 3d6ee9fb9ac1
line diff
     1.1 --- a/configure	Sun Jun 26 23:59:40 2011 +0300
     1.2 +++ b/configure	Mon Jun 27 01:59:26 2011 +0300
     1.3 @@ -1,12 +1,13 @@
     1.4  #!/bin/sh
     1.5  
     1.6 +prefix=/usr/local
     1.7 +ignore=
     1.8  cfgfile=src/config.h
     1.9  modfile=src/modules.c
    1.10  logfile=config.log
    1.11  echobin=`which echo`
    1.12  
    1.13  rm -f $logfile
    1.14 -
    1.15  message()
    1.16  {
    1.17  	$echobin $* | tee -a $logfile
    1.18 @@ -48,6 +49,23 @@
    1.19  	return $res
    1.20  }
    1.21  
    1.22 +message "configuring SimplyGL ..."
    1.23 +
    1.24 +for arg; do
    1.25 +	case "$arg" in
    1.26 +	--prefix=*)
    1.27 +		value=`echo $arg | awk -F= '{print $2}'`
    1.28 +		prefix=${value:-$prefix}
    1.29 +		;;
    1.30 +
    1.31 +	--without-*)
    1.32 +		value=`echo $arg | awk -F- '{print $4}'`
    1.33 +		ignore="$ignore $value"
    1.34 +		message "without: $value"
    1.35 +		;;
    1.36 +	esac
    1.37 +done
    1.38 +
    1.39  # write beginning of config.h
    1.40  echo '#ifndef CONFIG_H_' >$cfgfile
    1.41  echo '#define CONFIG_H_' >>$cfgfile
    1.42 @@ -89,7 +107,10 @@
    1.43  	name=`echo $m | sort | sed 's/src\/wsys_//' | sed 's/\.c//' | sed 's/\.m//'`
    1.44  	message -n "-> trying module $name (needs: $dep) ... "
    1.45  
    1.46 -	if try_link "$dep"; then
    1.47 +	if echo $ignore | grep $name >/dev/null; then
    1.48 +		message ignored
    1.49 +
    1.50 +	elif try_link "$dep"; then
    1.51  		message ok
    1.52  
    1.53  		libs="$libs $dep"
    1.54 @@ -104,7 +125,8 @@
    1.55  		message failed
    1.56  	fi
    1.57  done
    1.58 -echo "Will link with: $libs"
    1.59 +
    1.60 +message "Will link with: $libs"
    1.61  
    1.62  # wrap up the modules.c file
    1.63  echo '}' >>$modfile
    1.64 @@ -115,8 +137,8 @@
    1.65  # generate makefile
    1.66  message Generating makefile ...
    1.67  
    1.68 -# hardcode prefix for now, too lazy to actually add an option...
    1.69 -echo 'PREFIX = /usr/local' >Makefile
    1.70 +message "install prefix: $prefix"
    1.71 +echo "PREFIX = $prefix" >Makefile
    1.72  echo "wsys_libs = $libs" >>Makefile
    1.73  cat Makefile.in >>Makefile
    1.74