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"
22 DARG_GNUSTEP_SH="$ARG_GSMAKE/GNUstep.sh"
25 # ******************** usage ********************
29 \`configure' configures a GNUstep-make based sourcetree for installation.
33 Note: You do not need to configure this source tree, as another option
34 just ensure that the GNUstep.sh of your GNUstep make installation
35 is properly sourced prior running make.
38 -h, --help display this help and exit
39 -q, --quiet, --silent do not print \`checking...' messages
40 -n, --no-create do not create output files
42 Installation directories:
43 --prefix=PREFIX install files in PREFIX [/usr/local]
44 --gsmake=PATH path to gnustep-make tree
45 --configmake=PATH path to the config file being created
46 --with-gnustep install in GNUstep tree
47 --enable-debug turn on debugging and compile time warnings
54 # ******************** running ********************
56 function printParas() {
58 if test $ARG_BEQUIET = 1; then echo " will be quite."; fi
59 if test $ARG_NOCREATE = 1; then echo " won't create files"; fi
60 if test $DARG_IS_FHS = 1; then
61 echo " FHS: install in FHS root";
63 echo " FHS: install in GNUstep tree";
66 if test $ARG_WITH_DEBUG = 1; then
72 echo " prefix: $ARG_PREFIX"
73 echo " gstep: $ARG_GSMAKE"
74 echo " config: $ARG_CFGMAKE"
75 echo " script: $DARG_GNUSTEP_SH"
79 function warnOnFHSPrefix() {
81 Warning: you are configuring for a non standard FHS style prefix.
84 Some code in SOPE only looks in /usr and /usr/local for resources and is
85 therefore incompatible with arbitary install pathes.
87 If you want to have the flexibility of installation in arbitary pathes just
88 configure GNUstep-make and source the GNUstep.sh script prior executing tools
89 to ensure a proper environment.
90 All SOPE based code is completely relocatable when being used in a GNUstep
96 function validateGNUstepArgs() {
98 if test "x$ARG_GSMAKE" = "x"; then
99 echo "error: did not specify a GNUstep make tree!"
101 elif test -d $ARG_GSMAKE; then
102 if test -f $ARG_GSMAKE/GNUstep.sh; then
103 DARG_GNUSTEP_SH="$ARG_GSMAKE/GNUstep.sh"
104 elif test -f $ARG_GSMAKE/Library/Makefiles/GNUstep.sh; then
105 ARG_GSMAKE="$ARG_GSMAKE/Library/Makefiles"
106 DARG_GNUSTEP_SH="$ARG_GSMAKE/GNUstep.sh"
108 echo "error: specified directory contains no GNUstep.sh: $ARG_GSMAKE"
112 echo "error: specified GNUstep make tree does not exist: $ARG_GSMAKE"
117 function validateArgs() {
118 # validate prefix (could be better?)
119 case "x$ARG_PREFIX" in
120 "x/usr/local"|"x/usr/local/")
126 "x$GNUSTEP_USER_ROOT"|"x$GNUSTEP_LOCAL_ROOT"|"x$GNUSTEP_SYSTEM_ROOT")
131 if test $ARG_WITH_GNUSTEP = 1; then
133 ARG_PREFIX="$GNUSTEP_LOCAL_ROOT"
134 if test $ARG_BEQUIET != 1; then
135 echo "Note: will install in GNUSTEP_LOCAL_ROOT: $ARG_PREFIX"
140 ARG_PREFIX="/usr/local/"
141 echo "Note: will install in default location: $ARG_PREFIX"
146 if test $ARG_WITH_GNUSTEP = 1; then
147 echo "error: specified --with-gnustep, but specified prefix is not"
148 echo " a GNUstep root: '$ARG_PREFIX'"
151 if test $ARG_BEQUIET != 1; then
159 if test $ARG_WITH_GNUSTEP = 1; then
160 if test $DARG_IS_FHS = 1; then
161 echo "error: configured for FHS root _and_ GNUstep tree. Choose one!"
167 function printGNUstepSetup() {
168 echo "GNUstep environment:"
169 echo " system: ${GNUSTEP_SYSTEM_ROOT}"
170 echo " local: ${GNUSTEP_LOCAL_ROOT}"
171 echo " user: ${GNUSTEP_USER_ROOT}"
172 echo " path: ${GNUSTEP_PATHLIST}"
173 echo " flat: ${GNUSTEP_FLATTENED}"
174 echo " arch: ${GNUSTEP_HOST}"
175 echo " combo: ${LIBRARY_COMBO}"
179 function cfgwrite() {
180 echo "$1" >> $ARG_CFGMAKE
183 function genConfigMake() {
184 # we ignore the following vars also patches by gstep-make:
190 if test $ARG_BEQUIET != 1; then
191 echo "creating: $ARG_CFGMAKE"
194 echo "# GNUstep environment configuration" > $ARG_CFGMAKE
195 cfgwrite "# created by: '$CFG_ARGS'"
198 cfgwrite "# Note: you can override any option as a 'make' parameter, eg:"
199 cfgwrite "# make debug=yes"
202 cfgwrite "# print on the cmdline that this file is being used"
203 cfgwrite "before-all :: "
204 cfgwrite " @echo Local GNUstep config.make is active"
207 # TODO: should be also write a GNUSTEP_INSTALLATION_DIR / BUNDLE_INSTALL_DIR?
209 if test $DARG_IS_FHS = 1; then
210 cfgwrite "# configured for FHS install"
211 cfgwrite "FHS_INSTALL_ROOT:=$ARG_PREFIX"
215 if test $ARG_WITH_DEBUG = 1; then
216 cfgwrite "# configured to produce debugging code";
217 cfgwrite "debug:=yes"
219 cfgwrite "# configured to produce non-debugging code";
224 cfgwrite "# enforce shared libraries";
225 cfgwrite "shared:=yes"
228 cfgwrite "# GNUstep environment variables:";
229 for i in `env | grep GNUSTEP_ | sort`; do
230 MAKE_ASSI="`echo $i | sed s/=/:=/`"
231 cfgwrite "${MAKE_ASSI}";
233 cfgwrite "LIBRARY_COMBO=$LIBRARY_COMBO"
237 if test $ARG_BEQUIET != 1; then
241 if test $ARG_NOCREATE = 1; then
242 if test $ARG_BEQUIET != 1; then
243 echo "not creating the config file ...";
250 # ******************** options ********************
252 function extractFuncValue() {
253 VALUE="`echo "$1" | sed "s/[^=]*=//g"`"
256 function processOption() {
261 "x--quiet"|"x--silent"|"x-q") ARG_BEQUIET=1; ;;
262 "x--no-create"|"x-n") ARG_NOCREATE=1; ;;
273 ARG_CFGMAKE="$VALUE";
283 *) echo "error: cannot process argument: $1"; exit 1; ;;
291 # load GNUstep environment
293 # first we load the GNUstep.sh environment
294 source $DARG_GNUSTEP_SH
295 if test $ARG_BEQUIET != 1; then
299 # ensure the parameters make sense