Check-in [7c4247cf4b]
Overview
Comment:Updated to create a better build environment
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | packages
Files: files | file ages | folders
SHA1:7c4247cf4bb2ba54e263d3ff0011c81be764e373
User & Date: rkeene on 2014-11-12 07:25:28
Other Links: manifest | tags
Context
2014-11-12
07:25
Added ncurses package check-in: c6e2e3505b user: rkeene tags: packages
07:25
Updated to create a better build environment check-in: 7c4247cf4b user: rkeene tags: packages
07:00
Updated to not cleanup work directory if build fails and created a function to configure gcc check-in: 7c62241f33 user: rkeene tags: packages
Changes

Modified build from [c37a69bddd] to [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[@]}"