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

View file

@ -30,24 +30,29 @@
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"
SAVE_LDLIBPATH=$LD_LIBRARY_PATH
LD_LIBRARY_PATH="$XBPS_MASTERDIR/usr/lib"
CFLAGS="$CFLAGS $XBPS_CFLAGS"
CXXFLAGS="$CXXFLAGS $XBPS_CXXFLAGS"
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 CPPFLAGS="$CPPFLAGS" PKG_CONFIG="$PKG_CONFIG"
export PKG_CONFIG_LIBDIR="$PKG_CONFIG_LIBDIR"
export LDFLAGS="$LDFLAGS"
export CPPFLAGS="$CPPFLAGS" LDFLAGS="$LDFLAGS"
}
unset_build_vars()
{
unset LDFLAGS CFLAGS CXXFLAGS CPPFLAGS PKG_CONFIG LD_LIBRARY_PATH
export LD_LIBRARY_PATH=$SAVE_LDLIBPATH
if [ -z "$in_chroot" ]; then
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
if [ -z "$in_chroot" ]; then
. $XBPS_SHUTILSDIR/buildvars_funcs.sh
set_build_vars
fi
. $XBPS_SHUTILSDIR/buildvars_funcs.sh
set_build_vars
#
# Packages using GNU autoconf
@ -131,10 +129,6 @@ configure_src_phase()
# unset cross compiler vars.
[ -n "$cross_compiler" ] && cross_compile_unsetvars
if [ -z "$in_chroot" ]; then
unset_build_vars
fi
unset_build_vars
touch -f $XBPS_CONFIGURE_DONE
}

View file

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

View file

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