Diff

Differences From Artifact [c37a69bddd]:

To Artifact [9552d0e034]:


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