summaryrefslogtreecommitdiff
path: root/pkgtools
diff options
context:
space:
mode:
authorkhorben <khorben@pkgsrc.org>2017-11-07 16:50:52 +0000
committerkhorben <khorben@pkgsrc.org>2017-11-07 16:50:52 +0000
commit6bf807be1f84e0c8ac31b374c2d72995982bb631 (patch)
treeeaf4d177db69639c29f3402135c570d25acccd86 /pkgtools
parent099995545c532dad0aaffdf7129f55c750b70d1f (diff)
downloadpkgsrc-6bf807be1f84e0c8ac31b374c2d72995982bb631.tar.gz
Tokenize the contents of "append_executable"
This configuration parameter is used when linking executables, through cc(1) or ld(1) for instance. This allows passing multiple arguments via the "append_executable" option, like "-fPIC -pie" for instance. Committing this before joerg@'s approval since a call for testing PKGSRC_MKPIE has just been issued, and this helps with some packages.
Diffstat (limited to 'pkgtools')
-rw-r--r--pkgtools/cwrappers/files/bin/common.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/pkgtools/cwrappers/files/bin/common.c b/pkgtools/cwrappers/files/bin/common.c
index 4b704e1ae98..0b72bad1bc7 100644
--- a/pkgtools/cwrappers/files/bin/common.c
+++ b/pkgtools/cwrappers/files/bin/common.c
@@ -1,4 +1,4 @@
-/* $NetBSD: common.c,v 1.7 2017/06/11 19:34:43 joerg Exp $ */
+/* $NetBSD: common.c,v 1.8 2017/11/07 16:50:52 khorben Exp $ */
/*-
* Copyright (c) 2009, 2017 Joerg Sonnenberger <joerg@NetBSD.org>.
@@ -275,9 +275,14 @@ parse_config(const char *wrapper)
TAILQ_INSERT_TAIL(&prepend_executable_args, arg, link);
}
if (strncmp(line, "append_executable=", 18) == 0) {
+ char *last, *p;
+ unsigned int i;
struct argument *arg;
- arg = argument_copy(line + 18);
- TAILQ_INSERT_TAIL(&append_executable_args, arg, link);
+ for (p = strtok_r(line + 18, " ", &last), i = 0; p;
+ (p = strtok_r(NULL, " ", &last)), i++) {
+ arg = argument_copy(p);
+ TAILQ_INSERT_TAIL(&append_executable_args, arg, link);
+ }
}
if (strncmp(line, "prepend_shared=", 15) == 0) {
struct argument *arg;