xbps-src: introduce build profiles and use it by default.
common/build-profiles contains the compilation flags used in native builds, and are defined per architecture: - x86_64 (glibc) - x86_64-musl (musl) If XBPS_CFLAGS or XBPS_CXXFLAGS are set in `etc/conf`, the settings from the build profile will be overrided.
This commit is contained in:
parent
aa4d7feb93
commit
c2bd01c8d3
11 changed files with 27 additions and 4 deletions
2
common/build-profiles/armv6l-musl.sh
Normal file
2
common/build-profiles/armv6l-musl.sh
Normal file
|
@ -0,0 +1,2 @@
|
|||
XBPS_CFLAGS="-O2 -pipe -fstack-protector -march=armv6 -mfpu=vfp -mfloat-abi=hard"
|
||||
XBPS_CXXFLAGS="$XBPS_CFLAGS"
|
2
common/build-profiles/armv6l.sh
Normal file
2
common/build-profiles/armv6l.sh
Normal file
|
@ -0,0 +1,2 @@
|
|||
XBPS_CFLAGS="-O2 -pipe -fstack-protector-strong -march=armv6 -mfpu=vfp -mfloat-abi=hard"
|
||||
XBPS_CXXFLAGS="$XBPS_CFLAGS"
|
2
common/build-profiles/armv7l-musl.sh
Normal file
2
common/build-profiles/armv7l-musl.sh
Normal file
|
@ -0,0 +1,2 @@
|
|||
XBPS_CFLAGS="-O2 -pipe -fstack-protector -march=armv7-a -mfpu=vfpv3 -mfloat-abi=hard"
|
||||
XBPS_CXXFLAGS="$XBPS_CFLAGS"
|
2
common/build-profiles/armv7l.sh
Normal file
2
common/build-profiles/armv7l.sh
Normal file
|
@ -0,0 +1,2 @@
|
|||
XBPS_CFLAGS="-O2 -pipe -fstack-protector-strong -march=armv7-a -mfpu=vfpv3 -mfloat-abi=hard"
|
||||
XBPS_CXXFLAGS="$XBPS_CFLAGS"
|
2
common/build-profiles/i686-musl.sh
Normal file
2
common/build-profiles/i686-musl.sh
Normal file
|
@ -0,0 +1,2 @@
|
|||
XBPS_CFLAGS="-O2 -pipe -mtune=i686 -fstack-protector"
|
||||
XBPS_CXXFLAGS="$XBPS_CFLAGS"
|
2
common/build-profiles/i686.sh
Normal file
2
common/build-profiles/i686.sh
Normal file
|
@ -0,0 +1,2 @@
|
|||
XBPS_CFLAGS="-O2 -pipe -mtune=i686 -fstack-protector-strong"
|
||||
XBPS_CXXFLAGS="$XBPS_CFLAGS"
|
2
common/build-profiles/x86_64-musl.sh
Normal file
2
common/build-profiles/x86_64-musl.sh
Normal file
|
@ -0,0 +1,2 @@
|
|||
XBPS_CFLAGS="-O2 -pipe -fstack-protector"
|
||||
XBPS_CXXFLAGS="$XBPS_CFLAGS"
|
2
common/build-profiles/x86_64.sh
Normal file
2
common/build-profiles/x86_64.sh
Normal file
|
@ -0,0 +1,2 @@
|
|||
XBPS_CFLAGS="-O2 -pipe -fstack-protector-strong"
|
||||
XBPS_CXXFLAGS="$XBPS_CFLAGS"
|
|
@ -331,6 +331,11 @@ setup_pkg() {
|
|||
dbgflags="-g"
|
||||
fi
|
||||
|
||||
if [ -z "$XBPS_CFLAGS" -a -z "$XBPS_CXXFLAGS" -a -z "$bootstrap" ]; then
|
||||
if [ -s ${XBPS_COMMONDIR}/build-profiles/${XBPS_MACHINE}.sh ]; then
|
||||
. ${XBPS_COMMONDIR}/build-profiles/${XBPS_MACHINE}.sh
|
||||
fi
|
||||
fi
|
||||
export CFLAGS="$XBPS_CFLAGS $XBPS_CROSS_CFLAGS $CFLAGS $dbgflags"
|
||||
export CXXFLAGS="$XBPS_CXXFLAGS $XBPS_CROSS_CXXFLAGS $CXXFLAGS $dbgflags"
|
||||
export CPPFLAGS="$XBPS_CPPFLAGS $XBPS_CROSS_CPPFLAGS $CPPFLAGS"
|
||||
|
|
|
@ -21,10 +21,11 @@
|
|||
XBPS_INSTALL_ARGS="--repository=http://repo.voidlinux.eu/current"
|
||||
|
||||
# [OPTIONAL]
|
||||
# Compilation flags for C and C++.
|
||||
# Native Compilation flags for C and C++. Note that these settings override
|
||||
# the pre-defined for the target architecture in common/build-profiles/arch.sh.
|
||||
#
|
||||
XBPS_CFLAGS="-O2 -pipe -fstack-protector-strong"
|
||||
XBPS_CXXFLAGS="${XBPS_CFLAGS}"
|
||||
#XBPS_CFLAGS="-O2 -pipe -fstack-protector-strong"
|
||||
#XBPS_CXXFLAGS="${XBPS_CFLAGS}"
|
||||
|
||||
# [OPTIONAL]
|
||||
# Linker flags passed to the compiler. By default we use --as-needed to
|
||||
|
|
3
xbps-src
3
xbps-src
|
@ -308,7 +308,7 @@ readonly XBPS_VERSION_REQ="0.41"
|
|||
|
||||
readonly XBPS_VERSION=$(xbps-uhelper -V|awk '{print $2}')
|
||||
readonly XBPS_SRC_VERSION="113"
|
||||
readonly XBPS_MACHINE=$(uname -m)
|
||||
export XBPS_MACHINE=$(uname -m)
|
||||
|
||||
#
|
||||
# main()
|
||||
|
@ -447,6 +447,7 @@ fi
|
|||
|
||||
if [ -s $XBPS_MASTERDIR/.xbps_chroot_init ]; then
|
||||
export XBPS_ARCH=$(cat $XBPS_MASTERDIR/.xbps_chroot_init)
|
||||
export XBPS_MACHINE=$XBPS_ARCH
|
||||
if [ "$XBPS_MACHINE" = "x86_64" -a "$XBPS_ARCH" = "i686" -a -z "$IN_CHROOT" ]; then
|
||||
# reconfigure pkgs via linux32
|
||||
linux32 xbps-reconfigure -r ${XBPS_MASTERDIR} -a &>/dev/null
|
||||
|
|
Loading…
Reference in a new issue