test/configure

changeset 88
0a663c3692a0
parent 83
868e0d4b0a57
child 94
002497e6c27d
equal deleted inserted replaced
87:60bd4f61e89f 88:0a663c3692a0
12 fi 12 fi
13 touch "$TEMP_DIR/options" 13 touch "$TEMP_DIR/options"
14 touch "$TEMP_DIR/features" 14 touch "$TEMP_DIR/features"
15 15
16 # define standard variables 16 # define standard variables
17 PREFIX=/usr 17 # also define standard prefix (this is where we will search for config.site)
18 EPREFIX= 18 prefix=/usr
19 BINDIR= 19 exec_prefix=
20 SBINDIR= 20 bindir=
21 LIBDIR= 21 sbindir=
22 LIBEXECDIR= 22 libdir=
23 DATADIR= 23 libexecdir=
24 SYSCONFDIR= 24 datarootdir=
25 SHAREDSTATEDIR= 25 datadir=
26 LOCALSTATEDIR= 26 sysconfdir=
27 INCLUDEDIR= 27 sharedstatedir=
28 INFODIR= 28 localstatedir=
29 MANDIR= 29 runstatedir=
30 includedir=
31 infodir=
32 localedir=
33 mandir=
30 34
31 # custom variables 35 # custom variables
32 HOST=`uname -n` 36 HOST=`uname -n`
33 PREFIX="`pwd`/work" 37 prefix="`pwd`/work"
34 INSTALL_DIR="$PREFIX" 38 install_dir="$prefix"
35 39
36 # features 40 # features
37 FEATURE_PG=auto 41 FEATURE_PG=auto
38 42
39 # clean abort 43 # clean abort
58 --sbindir=DIR system admin executables [EPREFIX/sbin] 62 --sbindir=DIR system admin executables [EPREFIX/sbin]
59 --libexecdir=DIR program executables [EPREFIX/libexec] 63 --libexecdir=DIR program executables [EPREFIX/libexec]
60 --sysconfdir=DIR system configuration files [PREFIX/etc] 64 --sysconfdir=DIR system configuration files [PREFIX/etc]
61 --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] 65 --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com]
62 --localstatedir=DIR modifiable single-machine data [PREFIX/var] 66 --localstatedir=DIR modifiable single-machine data [PREFIX/var]
67 --runstatedir=DIR run-time variable data [LOCALSTATEDIR/run]
63 --libdir=DIR object code libraries [EPREFIX/lib] 68 --libdir=DIR object code libraries [EPREFIX/lib]
64 --includedir=DIR C header files [PREFIX/include] 69 --includedir=DIR C header files [PREFIX/include]
65 --datarootdir=DIR read-only arch.-independent data root [PREFIX/share] 70 --datarootdir=DIR read-only arch.-independent data root [PREFIX/share]
66 --datadir=DIR read-only architecture-independent data [DATAROOTDIR] 71 --datadir=DIR read-only architecture-independent data [DATAROOTDIR]
67 --infodir=DIR info documentation [DATAROOTDIR/info] 72 --infodir=DIR info documentation [DATAROOTDIR/info]
68 --mandir=DIR man documentation [DATAROOTDIR/man] 73 --mandir=DIR man documentation [DATAROOTDIR/man]
74 --localedir=DIR locale-dependent data [DATAROOTDIR/locale]
69 75
70 Optional Features: 76 Optional Features:
71 --disable-pg 77 --disable-pg
72 78
73 __EOF__ 79 __EOF__
78 # 84 #
79 BUILD_TYPE="default" 85 BUILD_TYPE="default"
80 for ARG in "$@" 86 for ARG in "$@"
81 do 87 do
82 case "$ARG" in 88 case "$ARG" in
83 "--prefix="*) PREFIX=${ARG#--prefix=} ;; 89 "--prefix="*) prefix=${ARG#--prefix=} ;;
84 "--exec-prefix="*) EPREFIX=${ARG#--exec-prefix=} ;; 90 "--exec-prefix="*) exec_prefix=${ARG#--exec-prefix=} ;;
85 "--bindir="*) BINDIR=${ARG#----bindir=} ;; 91 "--bindir="*) bindir=${ARG#----bindir=} ;;
86 "--sbindir="*) SBINDIR=${ARG#--sbindir=} ;; 92 "--sbindir="*) sbindir=${ARG#--sbindir=} ;;
87 "--libdir="*) LIBDIR=${ARG#--libdir=} ;; 93 "--libdir="*) libdir=${ARG#--libdir=} ;;
88 "--libexecdir="*) LIBEXECDIR=${ARG#--libexecdir=} ;; 94 "--libexecdir="*) libexecdir=${ARG#--libexecdir=} ;;
89 "--datadir="*) DATADIR=${ARG#--datadir=} ;; 95 "--datarootdir="*) datarootdir=${ARG#--datarootdir=} ;;
90 "--sysconfdir="*) SYSCONFDIR=${ARG#--sysconfdir=} ;; 96 "--datadir="*) datadir=${ARG#--datadir=} ;;
91 "--sharedstatedir="*) SHAREDSTATEDIR=${ARG#--sharedstatedir=} ;; 97 "--sysconfdir="*) sysconfdir=${ARG#--sysconfdir=} ;;
92 "--localstatedir="*) LOCALSTATEDIR=${ARG#--localstatedir=} ;; 98 "--sharedstatedir="*) sharedstatedir=${ARG#--sharedstatedir=} ;;
93 "--includedir="*) INCLUDEDIR=${ARG#--includedir=} ;; 99 "--localstatedir="*) localstatedir=${ARG#--localstatedir=} ;;
94 "--infodir="*) INFODIR=${ARG#--infodir=} ;; 100 "--includedir="*) includedir=${ARG#--includedir=} ;;
95 "--mandir"*) MANDIR=${ARG#--mandir} ;; 101 "--infodir="*) infodir=${ARG#--infodir=} ;;
102 "--mandir"*) mandir=${ARG#--mandir} ;;
103 "--localedir"*) localedir=${ARG#--localedir} ;;
96 "--help"*) printhelp; abort_configure ;; 104 "--help"*) printhelp; abort_configure ;;
97 "--debug") BUILD_TYPE="debug" ;; 105 "--debug") BUILD_TYPE="debug" ;;
98 "--release") BUILD_TYPE="release" ;; 106 "--release") BUILD_TYPE="release" ;;
99 "--enable-pg") FEATURE_PG=on ;; 107 "--enable-pg") FEATURE_PG=on ;;
100 "--disable-pg") unset FEATURE_PG ;; 108 "--disable-pg") unset FEATURE_PG ;;
101 "-"*) echo "unknown option: $ARG"; abort_configure ;; 109 "-"*) echo "unknown option: $ARG"; abort_configure ;;
102 esac 110 esac
103 done 111 done
104 112
105 113
106 # set dir variables 114
107 : ${EPREFIX:="$PREFIX"} 115 # set defaults for dir variables
108 : ${BINDIR:="$EPREFIX/bin"} 116 : ${exec_prefix:="$prefix"}
109 : ${SBINDIR:="$EPREFIX/sbin"} 117 : ${bindir:='${exec_prefix}/bin'}
110 : ${LIBDIR:="$EPREFIX/lib"} 118 : ${sbindir:='${exec_prefix}/sbin'}
111 : ${LIBEXECDIR:="$EPREFIX/libexec"} 119 : ${libdir:='${exec_prefix}/lib'}
112 : ${DATADIR:="$PREFIX/share"} 120 : ${libexecdir:='${exec_prefix}/libexec'}
113 : ${SYSCONFDIR:="$PREFIX/etc"} 121 : ${datarootdir:='${prefix}/share'}
114 : ${SHAREDSTATEDIR:="$PREFIX/com"} 122 : ${datadir:='${datarootdir}'}
115 : ${LOCALSTATEDIR:="$PREFIX/var"} 123 : ${sysconfdir:='${prefix}/etc'}
116 : ${INCLUDEDIR:="$PREFIX/include"} 124 : ${sharedstatedir:='${prefix}/com'}
117 : ${INFODIR:="$PREFIX/info"} 125 : ${localstatedir:='${prefix}/var'}
118 : ${MANDIR:="$PREFIX/man"} 126 : ${runstatedir:='${localstatedir}/run'}
127 : ${includedir:='${prefix}/include'}
128 : ${infodir:='${datarootdir}/info'}
129 : ${mandir:='${datarootdir}/man'}
130 : ${localedir:='${datarootdir}/locale'}
131
132 # check if a config.site exists and load it
133 if [ -n "$CONFIG_SITE" ]; then
134 # CONFIG_SITE may contain space separated file names
135 for cs in $CONFIG_SITE; do
136 printf "loading defaults from $cs... "
137 . "$cs"
138 echo ok
139 done
140 elif [ -f "$prefix/share/config.site" ]; then
141 printf "loading site defaults... "
142 . "$prefix/share/config.site"
143 echo ok
144 elif [ -f "$prefix/etc/config.site" ]; then
145 printf "loading site defaults... "
146 . "$prefix/etc/config.site"
147 echo ok
148 fi
119 149
120 # Test for availability of pkg-config 150 # Test for availability of pkg-config
121 PKG_CONFIG=`command -v pkg-config` 151 PKG_CONFIG=`command -v pkg-config`
122 : ${PKG_CONFIG:="false"} 152 : ${PKG_CONFIG:="false"}
123 153
168 } 198 }
169 199
170 200
171 # generate vars.mk 201 # generate vars.mk
172 cat > "$TEMP_DIR/vars.mk" << __EOF__ 202 cat > "$TEMP_DIR/vars.mk" << __EOF__
173 PREFIX="$PREFIX" 203 prefix="$prefix"
174 EPREFIX="$EPREFIX" 204 exec_prefix="$exec_prefix"
175 BINDIR="$BINDIR" 205 bindir="$bindir"
176 SBINDIR="$SBINDIR" 206 sbindir="$sbindir"
177 LIBDIR="$LIBDIR" 207 libdir="$libdir"
178 LIBEXECDIR="$LIBEXECDIR" 208 libexecdir="$libexecdir"
179 DATADIR="$DATADIR" 209 datarootdir="$datarootdir"
180 SYSCONFDIR="$SYSCONFDIR" 210 datadir="$datadir"
181 SHAREDSTATEDIR="$SHAREDSTATEDIR" 211 sysconfdir="$sysconfdir"
182 LOCALSTATEDIR="$LOCALSTATEDIR" 212 sharedstatedir="$sharedstatedir"
183 INCLUDEDIR="$INCLUDEDIR" 213 localstatedir="$localstatedir"
184 INFODIR="$INFODIR" 214 runstatedir="$runstatedir"
185 MANDIR="$MANDIR" 215 includedir="$includedir"
216 infodir="$infodir"
217 mandir="$mandir"
218 localedir="$localedir"
186 HOST="$HOST" 219 HOST="$HOST"
187 PREFIX="$PREFIX" 220 prefix="$prefix"
188 INSTALL_DIR="$INSTALL_DIR" 221 install_dir="$install_dir"
189 __EOF__ 222 __EOF__
190 sort -u -o "$TEMP_DIR/vars.mk" "$TEMP_DIR/vars.mk"
191
192 223
193 # toolchain detection utilities 224 # toolchain detection utilities
194 . make/toolchain.sh 225 . make/toolchain.sh
195 226
196 # 227 #
466 fi 497 fi
467 498
468 echo "configure finished" 499 echo "configure finished"
469 echo 500 echo
470 echo "Build Config:" 501 echo "Build Config:"
471 echo " PREFIX: $PREFIX" 502 echo " PREFIX: $prefix"
472 echo " TOOLCHAIN: $TOOLCHAIN_NAME" 503 echo " TOOLCHAIN: $TOOLCHAIN_NAME"
473 echo "Features:" 504 echo "Features:"
474 if [ -n "$FEATURE_PG" ]; then 505 if [ -n "$FEATURE_PG" ]; then
475 echo " pg: on" 506 echo " pg: on"
476 else 507 else
477 echo " pg: off" 508 echo " pg: off"

mercurial