summaryrefslogtreecommitdiff
path: root/pkgtools
diff options
context:
space:
mode:
authorkhorben <khorben@pkgsrc.org>2017-10-27 20:59:59 +0000
committerkhorben <khorben@pkgsrc.org>2017-10-27 20:59:59 +0000
commit6c852d582ad2bab9cc42427190462db731416254 (patch)
treee3f3b2363397d9ec70c79c0133296c862de6c1db /pkgtools
parent0a5c16211c079bdd3c7d81cad0691dd39427ab97 (diff)
downloadpkgsrc-6c852d582ad2bab9cc42427190462db731416254.tar.gz
Set the correct operation mode in the wrapper for as(1)
This notably fixes building lang/g95 with PKGSRC_MKPIE=yes. Reviewed by joerg@
Diffstat (limited to 'pkgtools')
-rw-r--r--pkgtools/cwrappers/Makefile4
-rw-r--r--pkgtools/cwrappers/files/bin/Makefile4
-rw-r--r--pkgtools/cwrappers/files/bin/base-wrapper.c6
-rw-r--r--pkgtools/cwrappers/files/bin/common.h4
-rw-r--r--pkgtools/cwrappers/files/bin/normalise-as.c38
5 files changed, 49 insertions, 7 deletions
diff --git a/pkgtools/cwrappers/Makefile b/pkgtools/cwrappers/Makefile
index 2eccbaad64c..3cf1e207fce 100644
--- a/pkgtools/cwrappers/Makefile
+++ b/pkgtools/cwrappers/Makefile
@@ -1,6 +1,6 @@
-# $NetBSD: Makefile,v 1.20 2017/06/11 19:34:43 joerg Exp $
+# $NetBSD: Makefile,v 1.21 2017/10/27 20:59:59 khorben Exp $
-PKGNAME= cwrappers-20170611
+PKGNAME= cwrappers-20171027
CATEGORIES= pkgtools sysutils
MAINTAINER= joerg@NetBSD.org
diff --git a/pkgtools/cwrappers/files/bin/Makefile b/pkgtools/cwrappers/files/bin/Makefile
index 5fc05c1e6df..02e7fd4526b 100644
--- a/pkgtools/cwrappers/files/bin/Makefile
+++ b/pkgtools/cwrappers/files/bin/Makefile
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.5 2016/12/09 22:25:28 joerg Exp $
+# $NetBSD: Makefile,v 1.6 2017/10/27 20:59:59 khorben Exp $
#
PROGS= as-wrapper cc-wrapper c++-wrapper cpp-wrapper f77-wrapper \
imake-wrapper ld-wrapper libtool-wrapper shlibtool-wrapper
@@ -16,7 +16,7 @@ LDADD+= -lnbcompat
CC_SRCS= ${LIB_SRCS} generic-transform-cc.c normalise-cc.c
-SRCS.as-wrapper= ${CC_SRCS} as-wrapper.c
+SRCS.as-wrapper= ${CC_SRCS} as-wrapper.c normalise-as.c
SRCS.cc-wrapper= ${CC_SRCS} cc-wrapper.c transform-cc.c
SRCS.c++-wrapper= ${CC_SRCS} c++-wrapper.c transform-cc.c
SRCS.cpp-wrapper= ${CC_SRCS} cpp-wrapper.c
diff --git a/pkgtools/cwrappers/files/bin/base-wrapper.c b/pkgtools/cwrappers/files/bin/base-wrapper.c
index b15ea6068fc..8ec08379a45 100644
--- a/pkgtools/cwrappers/files/bin/base-wrapper.c
+++ b/pkgtools/cwrappers/files/bin/base-wrapper.c
@@ -1,4 +1,4 @@
-/* $NetBSD: base-wrapper.c,v 1.5 2017/06/11 19:34:43 joerg Exp $ */
+/* $NetBSD: base-wrapper.c,v 1.6 2017/10/27 20:59:59 khorben Exp $ */
/*-
* Copyright (c) 2007, 2017 Joerg Sonnenberger <joerg@NetBSD.org>.
@@ -128,7 +128,9 @@ main(int argc, char **argv)
goto skip_transforms;
#endif
-#if defined(WRAPPER_LD)
+#if defined(WRAPPER_AS)
+ operation_mode_as();
+#elif defined(WRAPPER_LD)
operation_mode_ld(&args);
#else
operation_mode_cc(&args);
diff --git a/pkgtools/cwrappers/files/bin/common.h b/pkgtools/cwrappers/files/bin/common.h
index a1c22a7b6fd..1f1e26ceef3 100644
--- a/pkgtools/cwrappers/files/bin/common.h
+++ b/pkgtools/cwrappers/files/bin/common.h
@@ -1,4 +1,4 @@
-/* $NetBSD: common.h,v 1.6 2017/06/11 19:34:43 joerg Exp $ */
+/* $NetBSD: common.h,v 1.7 2017/10/27 20:59:59 khorben Exp $ */
/*-
* Copyright (c) 2009, 2017 Joerg Sonnenberger <joerg@NetBSD.org>.
@@ -94,6 +94,8 @@ void *xrealloc(void *, size_t);
char *xstrdup(const char *);
char *xstrndup(const char *, size_t);
+void operation_mode_as(void);
+
void operation_mode_cc(struct arglist *);
void normalise_cc(struct arglist *);
void cleanup_cc(struct arglist *args);
diff --git a/pkgtools/cwrappers/files/bin/normalise-as.c b/pkgtools/cwrappers/files/bin/normalise-as.c
new file mode 100644
index 00000000000..15dd53d269d
--- /dev/null
+++ b/pkgtools/cwrappers/files/bin/normalise-as.c
@@ -0,0 +1,38 @@
+/* $NetBSD: normalise-as.c,v 1.1 2017/10/27 20:59:59 khorben Exp $ */
+
+/*-
+ * Copyright (c) 2017 Pierre Pronchery <khorben@defora.org>.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in
+ * the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY OR CONSEQUENTIAL DAMAGES (INCLUDING,
+ * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
+ * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+ * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+#include "common.h"
+
+void
+operation_mode_as(void)
+{
+ current_operation_mode = mode_assemble;
+}