#!/bin/sh # This script returns the machine dependent options needed for Go4 # Main idea taken from root-config utility of ROOT arch=@go4arch@ vers=@go4vers@ topdir=@go4topdir@ bindir=@go4bindir@ libdir=@go4libdir@ incdir=@go4incdir@ mainlibs=@go4mainlibs@ guilibs=@go4guilibs@ cflags=@go4cflags@ usage="Usage: go4-config [--version] [--arch] [--go4sys] [--bindir] [--libdir] [--incdir] [--libs] [--glibs] [--cflags] [--help]" if test $# -eq 0; then echo "${usage}" 1>&2 exit 1 fi out="" while test $# -gt 0; do case $1 in --arch) ### Output Go4 architecture out="$out $arch" ;; --version) ### Output Go4 version number out="$out $vers" ;; --go4sys) ### output the main Go4 directory out="$out $topdir" ;; --bindir) ### output the executable directory out="$out $bindir" ;; --nativebindir) ### output the native execuatable directory if [ "$arch" = "Win32" ] ; then winbindir=`cygpath -m $bindir` out="$out $winbindir" else out="$out $bindir" fi ;; --libdir) ### output the library directory out="$out $libdir" ;; --incdir) ### output the headers directory out="$out $incdir" ;; --libs) ### output the analysis libraries out="$out $mainlibs" ;; --glibs) ### output the analysis libraries out="$out $guilibs" ;; --cflags) ### output the C/C++ flags out="$out $cflags" ;; --nativeincdir) ### output the native headers directory if [ "$arch" = "Win32" ] ; then winincdir=`cygpath -m $incdir` out="$out $winincdir" else out="$out $incdir" fi ;; --help) ### Print a help message echo "Usage: `basename $0` [options]" echo "" echo " --arch Print the architecture (OS)" echo " --go4sys Print the main Go4 directory" echo " --bindir Print the executable directory" echo " --nativebindir Print the executable directory for cygwin" echo " --libdir Print the library directory" echo " --incdir Print the headers directory" echo " --nativeincdir Print the headers directory for cygwin" echo " --libs Print the analysis libraries" echo " --glibs Print the go4 gui libraries" echo " --cflags Print the c flags for source files compilation" echo " --version Print the Go4 version" echo " --help Print this message" exit 0 ;; *) ### Give an error echo "Unknown argument \"$1\"!" 1>&2 echo "${usage}" 1>&2 exit 1 ;; esac shift done ### Output the stuff echo $out