182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
|
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
|
+
+
+
+
+
+
+
+
+
-
+
+
+
+
+
+
-
+
|
}
function postconfigure() {
:
}
function configure_gcc() {
local glibcdir linuxheadersdir
local dynlinker
local gcc_default_headers
glibcdir="/opt/appfs/core.appfs.rkeene.org/glibc/platform/latest"
glibcdir="$(readlink -f "${glibcdir}")"
linuxheadersdir="/opt/appfs/core.appfs.rkeene.org/linux-headers/platform/latest"
linuxheadersdir="$(readlink -f "${linuxheadersdir}")"
dynlinker="$(ls "${glibcdir}"/lib/ld-linux*.so.* | tail -n 1)"
if [ ! -f "${dynlinker}" ]; then
die 'glibc directory is not available (appfs running/working?)'
fi
gcc_default_headers="$(echo '' | ${CPP:-cpp} -v 2>&1 | sed '/^End of search list/,$ d;0,/search starts here:$/ d' | grep '/gcc/' | sed 's@^ *@-I@' | tr $'\n' ' ')"
CC="${CC:-gcc} -nostdinc -I${glibcdir}/include"
CC="${CC:-gcc} -nostdinc ${gcc_default_headers} -I${glibcdir}/include"
if ! echo " ${require[*]} " | grep ' linux-headers[/@: ]' >/dev/null; then
CC="${CC} -I${linuxheadersdir}/include"
fi
BUILD_CC="${CC}"
HOST_CC="${CC}"
LDFLAGS="${LDFLAGS} -Wl,--rpath,${glibcdir}/lib -Wl,--dynamic-linker,${dynlinker}"
LDFLAGS="${LDFLAGS} -L${glibcdir}/lib -Wl,--rpath,${glibcdir}/lib -Wl,--dynamic-linker,${dynlinker}"
PKG_CONFIG_LIBDIR="${glibcdir}/lib/pkgconfig"
export CC BUILD_CC HOST_CC LDFLAGS PKG_CONFIG_LIBDIR
}
function configure() {
configure_gcc
./configure --prefix="${prefix}" --sysconfdir="${prefix}/etc" --libdir="${prefix}/lib" --localstatedir=/var "${configure_extra[@]}"
|