Add the "buildflags" option, which is useful in its negative form
for disabling CFLAGS, CXXFLAGS and LDFLAGS when building a package.
This is useful when determining of one of these flags is causing
an issue with a package.
Signed-off-by: Allan McRae <allan@archlinux.org>
---
I doubt this option would ever be used in a "final" PKGBUILD, but it
is very useful when trying to figure out build issues.
diff --git a/contrib/PKGBUILD.vim b/contrib/PKGBUILD.vim
index a50ca12..f627a5e 100644
--- a/contrib/PKGBUILD.vim
+++ b/contrib/PKGBUILD.vim
@@ -172,7 +172,7 @@ hi def link pbValidSha1sums Number
" options
syn keyword pb_k_options options contained
-syn match pbOptions /(no)?(strip|docs|libtool|emptydirs|zipman|ccache|d istcc|makeflags)/ contained
+syn match pbOptions /(no)?(strip|docs|libtool|emptydirs|zipman|ccache|d istcc|makeflags|buildflags)/ contained
syn match pbOptionsNeg /!/ contained
syn match pbOptionsDeprec /no/ contained
syn region pbOptionsGroup start=/^options=(/ end=/)/ contains=pb_k_options,pbOptions,pbOptionsNeg,pbOpt ionsDeprec,pbIllegalOption,shDoubleQuote,shSingleQ uote
diff --git a/doc/PKGBUILD.5.txt b/doc/PKGBUILD.5.txt
index 2ccf0b2..e6c4a1f 100644
--- a/doc/PKGBUILD.5.txt
+++ b/doc/PKGBUILD.5.txt
@@ -233,6 +233,12 @@ name. The syntax is: `source=('filename::url')`.
form `!distcc` with select packages that have problems building
with distcc.
+ *buildflags*;;
+ Allow the use of user-specific buildflags (CFLAGS, CXXFLAGS, LDFLAGS)
+ during build as specified in linkman:makepkg.conf[5]. More useful in
+ its negative form `!buildflags` with select packages that have problems
+ building with custom buildflags.
+
*makeflags*;;
Allow the use of user-specific makeflags during build as specified
in linkman:makepkg.conf[5]. More useful in its negative form
diff --git a/scripts/makepkg.sh.in b/scripts/makepkg.sh.in
index c8f128c..4e60b62 100644
--- a/scripts/makepkg.sh.in
+++ b/scripts/makepkg.sh.in
@@ -45,7 +45,7 @@ srcdir="$startdir/src"
pkgdir="$startdir/pkg"
+ # clear user-specified buildflags if requested
+ if [[ $(check_option buildflags) = "n" ]]; then
+ CFLAGS=""
+ CXXFLAGS=""
+ LDFLAGS=""
+ fi
+
# clear user-specified makeflags if requested
if [[ $(check_option makeflags) = "n" ]]; then
MAKEFLAGS=""
--
1.7.3.4