pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/pkgtools/cwrappers/files/bin Tokenize the contents of ...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/4947c0d4ca14
branches:  trunk
changeset: 371220:4947c0d4ca14
user:      khorben <khorben%pkgsrc.org@localhost>
date:      Tue Nov 07 16:50:52 2017 +0000

description:
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:

 pkgtools/cwrappers/files/bin/common.c |  11 ++++++++---
 1 files changed, 8 insertions(+), 3 deletions(-)

diffs (26 lines):

diff -r 82dcdb20541c -r 4947c0d4ca14 pkgtools/cwrappers/files/bin/common.c
--- a/pkgtools/cwrappers/files/bin/common.c     Tue Nov 07 16:49:22 2017 +0000
+++ b/pkgtools/cwrappers/files/bin/common.c     Tue Nov 07 16:50:52 2017 +0000
@@ -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@localhost>.
@@ -275,9 +275,14 @@
                        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;



Home | Main Index | Thread Index | Old Index