4 # Note: When adding make options to this script, ensure that the source still
5 # compiles without those options! (and just with GNUstep.sh being
7 # We do not want to force people to run configure.
10 # ******************** variables ****************
12 CFG_ARGS="$0 $1 $2 $3 $4 $5 $6 $7 $8 $9"
17 ARG_GSMAKE="$GNUSTEP_MAKEFILES"
18 ARG_CFGMAKE="$PWD/config.make"
21 DARG_GNUSTEP_SH="$ARG_GSMAKE/GNUstep.sh"
24 # ******************** usage ********************
28 \`configure' configures a GNUstep-make based sourcetree for installation.
32 Note: You do not need to configure this source tree, as another option
33 just ensure that the GNUstep.sh of your GNUstep make installation
34 is properly sourced prior running make.
37 -h, --help display this help and exit
38 -q, --quiet, --silent do not print \`checking...' messages
39 -n, --no-create do not create output files
41 Installation directories:
42 --prefix=PREFIX install files in PREFIX [/usr/local]
43 --gsmake=PATH path to gnustep-make tree
44 --configmake=PATH path to the config file being created
45 --with-gnustep install in GNUstep tree
52 # ******************** running ********************
54 function printParas() {
56 if test $ARG_BEQUIET = 1; then echo " will be quite."; fi
57 if test $ARG_NOCREATE = 1; then echo " won't create files"; fi
58 if test $DARG_IS_FHS = 1; then
59 echo " FHS: install in FHS root";
61 echo " FHS: install in GNUstep tree";
64 echo " prefix: $ARG_PREFIX"
65 echo " gstep: $ARG_GSMAKE"
66 echo " config: $ARG_CFGMAKE"
67 echo " script: $DARG_GNUSTEP_SH"
71 function warnOnFHSPrefix() {
73 Warning: you are configuring for a non standard FHS style prefix.
76 Some code in SOPE only looks in /usr and /usr/local for resources and is
77 therefore incompatible with arbitary install pathes.
79 If you want to have the flexibility of installation in arbitary pathes just
80 configure GNUstep-make and source the GNUstep.sh script prior executing tools
81 to ensure a proper environment.
82 All SOPE based code is completely relocatable when being used in a GNUstep
88 function validateGNUstepArgs() {
90 if test -d $ARG_GSMAKE; then
91 if test -f $ARG_GSMAKE/GNUstep.sh; then
92 DARG_GNUSTEP_SH="$ARG_GSMAKE/GNUstep.sh"
93 elif test -f $ARG_GSMAKE/Library/Makefiles/GNUstep.sh; then
94 ARG_GSMAKE="$ARG_GSMAKE/Library/Makefiles"
95 DARG_GNUSTEP_SH="$ARG_GSMAKE/GNUstep.sh"
97 echo "error: specified directory contains no GNUstep.sh: $ARG_GSMAKE"
101 echo "error: specified GNUstep make tree does not exist: $ARG_GSMAKE"
106 function validateArgs() {
107 # validate prefix (could be better?)
108 case "x$ARG_PREFIX" in
109 "x/usr/local"|"x/usr/local/")
115 "x$GNUSTEP_USER_ROOT"|"x$GNUSTEP_LOCAL_ROOT"|"x$GNUSTEP_SYSTEM_ROOT")
120 if test $ARG_WITH_GNUSTEP = 1; then
122 ARG_PREFIX="$GNUSTEP_LOCAL_ROOT"
123 if test $ARG_BEQUIET != 1; then
124 echo "Note: will install in GNUSTEP_LOCAL_ROOT: $ARG_PREFIX"
129 ARG_PREFIX="/usr/local/"
130 echo "Note: will install in $ARG_PREFIX"
135 if test $ARG_WITH_GNUSTEP = 1; then
136 echo "error: specified --with-gnustep, but specified prefix is not"
137 echo " a GNUstep root: '$ARG_PREFIX'"
140 if test $ARG_BEQUIET != 1; then
148 if test $ARG_WITH_GNUSTEP = 1; then
149 if test $DARG_IS_FHS = 1; then
150 echo "error: configured for FHS root _and_ GNUstep tree. Choose one!"
156 function printGNUstepSetup() {
157 echo "GNUstep environment:"
158 echo " system: ${GNUSTEP_SYSTEM_ROOT}"
159 echo " local: ${GNUSTEP_LOCAL_ROOT}"
160 echo " user: ${GNUSTEP_USER_ROOT}"
161 echo " path: ${GNUSTEP_PATHLIST}"
162 echo " flat: ${GNUSTEP_FLATTENED}"
163 echo " arch: ${GNUSTEP_HOST}"
164 echo " combo: ${LIBRARY_COMBO}"
168 function cfgwrite() {
169 echo "$1" >> $ARG_CFGMAKE
172 function genConfigMake() {
173 # we ignore the following vars also patches by gstep-make:
179 if test $ARG_BEQUIET != 1; then
180 echo "creating: $ARG_CFGMAKE"
183 echo "# GNUstep environment configuration" > $ARG_CFGMAKE
184 cfgwrite "# created by: '$CFG_ARGS'";
187 if test $DARG_IS_FHS = 1; then
188 cfgwrite "# configured for FHS install";
189 cfgwrite "FHS_INSTALL_ROOT=$ARG_PREFIX"
193 cfgwrite "# GNUstep environment variables:";
194 for i in `env | grep GNUSTEP_ | sort`; do
195 MAKE_ASSI="`echo $i | sed s/=/:=/`"
196 cfgwrite "${MAKE_ASSI}";
198 cfgwrite "LIBRARY_COMBO=$LIBRARY_COMBO"
202 if test $ARG_BEQUIET != 1; then
206 if test $ARG_NOCREATE = 1; then
207 if test $ARG_BEQUIET != 1; then
208 echo "not creating the config file ...";
215 # ******************** options ********************
217 function extractFuncValue() {
218 VALUE="`echo "$1" | sed "s/[^=]*=//g"`"
221 function processOption() {
226 "x--quiet"|"x--silent"|"x-q") ARG_BEQUIET=1; ;;
227 "x--no-create"|"x-n") ARG_NOCREATE=1; ;;
238 ARG_CFGMAKE="$VALUE";
245 *) echo "error: cannot process argument: $1"; exit 1; ;;
253 # load GNUstep environment
255 # first we load the GNUstep.sh environment
256 source $DARG_GNUSTEP_SH
257 if test $ARG_BEQUIET != 1; then
261 # ensure the parameters make sense