configure

changeset 1
e3113d4e2fc0
parent 0
593b60458157
equal deleted inserted replaced
0:593b60458157 1:e3113d4e2fc0
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 36
33 # features 37 # features
34 38
54 --sbindir=DIR system admin executables [EPREFIX/sbin] 58 --sbindir=DIR system admin executables [EPREFIX/sbin]
55 --libexecdir=DIR program executables [EPREFIX/libexec] 59 --libexecdir=DIR program executables [EPREFIX/libexec]
56 --sysconfdir=DIR system configuration files [PREFIX/etc] 60 --sysconfdir=DIR system configuration files [PREFIX/etc]
57 --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] 61 --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com]
58 --localstatedir=DIR modifiable single-machine data [PREFIX/var] 62 --localstatedir=DIR modifiable single-machine data [PREFIX/var]
63 --runstatedir=DIR run-time variable data [LOCALSTATEDIR/run]
59 --libdir=DIR object code libraries [EPREFIX/lib] 64 --libdir=DIR object code libraries [EPREFIX/lib]
60 --includedir=DIR C header files [PREFIX/include] 65 --includedir=DIR C header files [PREFIX/include]
61 --datarootdir=DIR read-only arch.-independent data root [PREFIX/share] 66 --datarootdir=DIR read-only arch.-independent data root [PREFIX/share]
62 --datadir=DIR read-only architecture-independent data [DATAROOTDIR] 67 --datadir=DIR read-only architecture-independent data [DATAROOTDIR]
63 --infodir=DIR info documentation [DATAROOTDIR/info] 68 --infodir=DIR info documentation [DATAROOTDIR/info]
64 --mandir=DIR man documentation [DATAROOTDIR/man] 69 --mandir=DIR man documentation [DATAROOTDIR/man]
70 --localedir=DIR locale-dependent data [DATAROOTDIR/locale]
65 71
66 __EOF__ 72 __EOF__
67 } 73 }
68 74
69 # 75 #
71 # 77 #
72 BUILD_TYPE="default" 78 BUILD_TYPE="default"
73 for ARG in "$@" 79 for ARG in "$@"
74 do 80 do
75 case "$ARG" in 81 case "$ARG" in
76 "--prefix="*) PREFIX=${ARG#--prefix=} ;; 82 "--prefix="*) prefix=${ARG#--prefix=} ;;
77 "--exec-prefix="*) EPREFIX=${ARG#--exec-prefix=} ;; 83 "--exec-prefix="*) exec_prefix=${ARG#--exec-prefix=} ;;
78 "--bindir="*) BINDIR=${ARG#----bindir=} ;; 84 "--bindir="*) bindir=${ARG#----bindir=} ;;
79 "--sbindir="*) SBINDIR=${ARG#--sbindir=} ;; 85 "--sbindir="*) sbindir=${ARG#--sbindir=} ;;
80 "--libdir="*) LIBDIR=${ARG#--libdir=} ;; 86 "--libdir="*) libdir=${ARG#--libdir=} ;;
81 "--libexecdir="*) LIBEXECDIR=${ARG#--libexecdir=} ;; 87 "--libexecdir="*) libexecdir=${ARG#--libexecdir=} ;;
82 "--datadir="*) DATADIR=${ARG#--datadir=} ;; 88 "--datarootdir="*) datarootdir=${ARG#--datarootdir=} ;;
83 "--sysconfdir="*) SYSCONFDIR=${ARG#--sysconfdir=} ;; 89 "--datadir="*) datadir=${ARG#--datadir=} ;;
84 "--sharedstatedir="*) SHAREDSTATEDIR=${ARG#--sharedstatedir=} ;; 90 "--sysconfdir="*) sysconfdir=${ARG#--sysconfdir=} ;;
85 "--localstatedir="*) LOCALSTATEDIR=${ARG#--localstatedir=} ;; 91 "--sharedstatedir="*) sharedstatedir=${ARG#--sharedstatedir=} ;;
86 "--includedir="*) INCLUDEDIR=${ARG#--includedir=} ;; 92 "--localstatedir="*) localstatedir=${ARG#--localstatedir=} ;;
87 "--infodir="*) INFODIR=${ARG#--infodir=} ;; 93 "--includedir="*) includedir=${ARG#--includedir=} ;;
88 "--mandir"*) MANDIR=${ARG#--mandir} ;; 94 "--infodir="*) infodir=${ARG#--infodir=} ;;
95 "--mandir"*) mandir=${ARG#--mandir} ;;
96 "--localedir"*) localedir=${ARG#--localedir} ;;
89 "--help"*) printhelp; abort_configure ;; 97 "--help"*) printhelp; abort_configure ;;
90 "--debug") BUILD_TYPE="debug" ;; 98 "--debug") BUILD_TYPE="debug" ;;
91 "--release") BUILD_TYPE="release" ;; 99 "--release") BUILD_TYPE="release" ;;
92 "-"*) echo "unknown option: $ARG"; abort_configure ;; 100 "-"*) echo "unknown option: $ARG"; abort_configure ;;
93 esac 101 esac
94 done 102 done
95 103
96 104
97 # set dir variables 105
98 : ${EPREFIX:="$PREFIX"} 106 # set defaults for dir variables
99 : ${BINDIR:="$EPREFIX/bin"} 107 : ${exec_prefix:="$prefix"}
100 : ${SBINDIR:="$EPREFIX/sbin"} 108 : ${bindir:='${exec_prefix}/bin'}
101 : ${LIBDIR:="$EPREFIX/lib"} 109 : ${sbindir:='${exec_prefix}/sbin'}
102 : ${LIBEXECDIR:="$EPREFIX/libexec"} 110 : ${libdir:='${exec_prefix}/lib'}
103 : ${DATADIR:="$PREFIX/share"} 111 : ${libexecdir:='${exec_prefix}/libexec'}
104 : ${SYSCONFDIR:="$PREFIX/etc"} 112 : ${datarootdir:='${prefix}/share'}
105 : ${SHAREDSTATEDIR:="$PREFIX/com"} 113 : ${datadir:='${datarootdir}'}
106 : ${LOCALSTATEDIR:="$PREFIX/var"} 114 : ${sysconfdir:='${prefix}/etc'}
107 : ${INCLUDEDIR:="$PREFIX/include"} 115 : ${sharedstatedir:='${prefix}/com'}
108 : ${INFODIR:="$PREFIX/info"} 116 : ${localstatedir:='${prefix}/var'}
109 : ${MANDIR:="$PREFIX/man"} 117 : ${runstatedir:='${localstatedir}/run'}
118 : ${includedir:='${prefix}/include'}
119 : ${infodir:='${datarootdir}/info'}
120 : ${mandir:='${datarootdir}/man'}
121 : ${localedir:='${datarootdir}/locale'}
122
123 # check if a config.site exists and load it
124 if [ -n "$CONFIG_SITE" ]; then
125 # CONFIG_SITE may contain space separated file names
126 for cs in $CONFIG_SITE; do
127 printf "loading defaults from $cs... "
128 . "$cs"
129 echo ok
130 done
131 elif [ -f "$prefix/share/config.site" ]; then
132 printf "loading site defaults... "
133 . "$prefix/share/config.site"
134 echo ok
135 elif [ -f "$prefix/etc/config.site" ]; then
136 printf "loading site defaults... "
137 . "$prefix/etc/config.site"
138 echo ok
139 fi
110 140
111 # Test for availability of pkg-config 141 # Test for availability of pkg-config
112 PKG_CONFIG=`command -v pkg-config` 142 PKG_CONFIG=`command -v pkg-config`
113 : ${PKG_CONFIG:="false"} 143 : ${PKG_CONFIG:="false"}
114 144
159 } 189 }
160 190
161 191
162 # generate vars.mk 192 # generate vars.mk
163 cat > "$TEMP_DIR/vars.mk" << __EOF__ 193 cat > "$TEMP_DIR/vars.mk" << __EOF__
164 PREFIX="$PREFIX" 194 prefix="$prefix"
165 EPREFIX="$EPREFIX" 195 exec_prefix="$exec_prefix"
166 BINDIR="$BINDIR" 196 bindir="$bindir"
167 SBINDIR="$SBINDIR" 197 sbindir="$sbindir"
168 LIBDIR="$LIBDIR" 198 libdir="$libdir"
169 LIBEXECDIR="$LIBEXECDIR" 199 libexecdir="$libexecdir"
170 DATADIR="$DATADIR" 200 datarootdir="$datarootdir"
171 SYSCONFDIR="$SYSCONFDIR" 201 datadir="$datadir"
172 SHAREDSTATEDIR="$SHAREDSTATEDIR" 202 sysconfdir="$sysconfdir"
173 LOCALSTATEDIR="$LOCALSTATEDIR" 203 sharedstatedir="$sharedstatedir"
174 INCLUDEDIR="$INCLUDEDIR" 204 localstatedir="$localstatedir"
175 INFODIR="$INFODIR" 205 runstatedir="$runstatedir"
176 MANDIR="$MANDIR" 206 includedir="$includedir"
207 infodir="$infodir"
208 mandir="$mandir"
209 localedir="$localedir"
177 __EOF__ 210 __EOF__
178 sort -u -o "$TEMP_DIR/vars.mk" "$TEMP_DIR/vars.mk"
179
180 211
181 # toolchain detection utilities 212 # toolchain detection utilities
182 . make/toolchain.sh 213 . make/toolchain.sh
183 214
184 # 215 #
403 fi 434 fi
404 435
405 echo "configure finished" 436 echo "configure finished"
406 echo 437 echo
407 echo "Build Config:" 438 echo "Build Config:"
408 echo " PREFIX: $PREFIX" 439 echo " PREFIX: $prefix"
409 echo " TOOLCHAIN: $TOOLCHAIN_NAME" 440 echo " TOOLCHAIN: $TOOLCHAIN_NAME"
410 echo 441 echo
411 442
412 # generate the config.mk file 443 # generate the config.mk file
413 cat > "$TEMP_DIR/config.mk" << __EOF__ 444 cat > "$TEMP_DIR/config.mk" << __EOF__
414 # 445 #

mercurial