Make (un)set_build_vars() work inside of the chroot.

This has the effect to really pass the XBPS_C(XX)FLAGS values from
xbps.conf to the packages built there.

--HG--
extra : convert_revision : 87ea9f6a755ba3f60a095391d2b0069ab22cb742
This commit is contained in:
Juan RP 2009-03-03 19:06:27 +01:00
parent 8c296e19ae
commit 5c8d0c01b3
5 changed files with 27 additions and 37 deletions

View File

@ -72,10 +72,11 @@ build_src_phase()
if [ -z "$in_chroot" ]; then if [ -z "$in_chroot" ]; then
. $XBPS_SHUTILSDIR/libtool_funcs.sh . $XBPS_SHUTILSDIR/libtool_funcs.sh
libtool_fixup_file libtool_fixup_file
. $XBPS_SHUTILSDIR/buildvars_funcs.sh
set_build_vars
fi fi
. $XBPS_SHUTILSDIR/buildvars_funcs.sh
set_build_vars
msg_normal "Running build phase for $pkg." msg_normal "Running build phase for $pkg."
# #
@ -100,10 +101,6 @@ build_src_phase()
# unset cross compiler vars. # unset cross compiler vars.
[ -n "$cross_compiler" ] && cross_compile_unsetvars [ -n "$cross_compiler" ] && cross_compile_unsetvars
unset_build_vars
if [ -z "$in_chroot" ]; then
unset_build_vars
fi
touch -f $XBPS_BUILD_DONE touch -f $XBPS_BUILD_DONE
} }

View File

@ -30,24 +30,29 @@
set_build_vars() set_build_vars()
{ {
if [ -z "$in_chroot" ]; then
SAVE_LDLIBPATH=$LD_LIBRARY_PATH
LD_LIBRARY_PATH="$XBPS_MASTERDIR/usr/lib"
PKG_CONFIG="$XBPS_MASTERDIR/usr/bin/pkg-config"
PKG_CONFIG_LIBDIR="$XBPS_MASTERDIR/usr/lib/pkgconfig"
export LD_LIBRARY_PATH="$LD_LIBRARY_PATH"
export PKG_CONFIG_LIBDIR="$PKG_CONFIG_LIBDIR"
export PKG_CONFIG="$PKG_CONFIG"
fi
LDFLAGS="-L$XBPS_MASTERDIR/usr/lib" LDFLAGS="-L$XBPS_MASTERDIR/usr/lib"
SAVE_LDLIBPATH=$LD_LIBRARY_PATH
LD_LIBRARY_PATH="$XBPS_MASTERDIR/usr/lib"
CFLAGS="$CFLAGS $XBPS_CFLAGS" CFLAGS="$CFLAGS $XBPS_CFLAGS"
CXXFLAGS="$CXXFLAGS $XBPS_CXXFLAGS" CXXFLAGS="$CXXFLAGS $XBPS_CXXFLAGS"
CPPFLAGS="-I$XBPS_MASTERDIR/usr/include $CPPFLAGS" CPPFLAGS="-I$XBPS_MASTERDIR/usr/include $CPPFLAGS"
PKG_CONFIG="$XBPS_MASTERDIR/usr/bin/pkg-config"
PKG_CONFIG_LIBDIR="$XBPS_MASTERDIR/usr/lib/pkgconfig"
export LD_LIBRARY_PATH="$LD_LIBRARY_PATH"
export CFLAGS="$CFLAGS" CXXFLAGS="$CXXFLAGS" export CFLAGS="$CFLAGS" CXXFLAGS="$CXXFLAGS"
export CPPFLAGS="$CPPFLAGS" PKG_CONFIG="$PKG_CONFIG" export CPPFLAGS="$CPPFLAGS" LDFLAGS="$LDFLAGS"
export PKG_CONFIG_LIBDIR="$PKG_CONFIG_LIBDIR"
export LDFLAGS="$LDFLAGS"
} }
unset_build_vars() unset_build_vars()
{ {
unset LDFLAGS CFLAGS CXXFLAGS CPPFLAGS PKG_CONFIG LD_LIBRARY_PATH if [ -z "$in_chroot" ]; then
export LD_LIBRARY_PATH=$SAVE_LDLIBPATH unset PKG_CONFIG LD_LIBRARY_PATH
export LD_LIBRARY_PATH=$SAVE_LDLIBPATH
fi
unset LDFLAGS CFLAGS CXXFLAGS CPPFLAGS
} }

View File

@ -78,10 +78,8 @@ configure_src_phase()
cd $wrksrc || exit 1 cd $wrksrc || exit 1
if [ -z "$in_chroot" ]; then . $XBPS_SHUTILSDIR/buildvars_funcs.sh
. $XBPS_SHUTILSDIR/buildvars_funcs.sh set_build_vars
set_build_vars
fi
# #
# Packages using GNU autoconf # Packages using GNU autoconf
@ -131,10 +129,6 @@ configure_src_phase()
# unset cross compiler vars. # unset cross compiler vars.
[ -n "$cross_compiler" ] && cross_compile_unsetvars [ -n "$cross_compiler" ] && cross_compile_unsetvars
unset_build_vars
if [ -z "$in_chroot" ]; then
unset_build_vars
fi
touch -f $XBPS_CONFIGURE_DONE touch -f $XBPS_CONFIGURE_DONE
} }

View File

@ -122,10 +122,8 @@ make_install()
[ -z "$make_cmd" ] && make_cmd=/usr/bin/make [ -z "$make_cmd" ] && make_cmd=/usr/bin/make
if [ -z "$in_chroot" ]; then . $XBPS_SHUTILSDIR/buildvars_funcs.sh
. $XBPS_SHUTILSDIR/buildvars_funcs.sh set_build_vars
set_build_vars
fi
# #
# Install package via make. # Install package via make.
@ -150,7 +148,5 @@ make_install()
done done
# Unset build vars. # Unset build vars.
if [ -z "$in_chroot" ]; then unset_build_vars
unset_build_vars
fi
} }

View File

@ -77,10 +77,8 @@ reset_tmpl_vars()
eval unset "$v" eval unset "$v"
done done
if [ -z "$in_chroot" ]; then . $XBPS_SHUTILSDIR/buildvars_funcs.sh
. $XBPS_SHUTILSDIR/buildvars_funcs.sh unset_build_vars
unset_build_vars
fi
} }
# #