pkgsrc-Changes-HG archive

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

[pkgsrc/trunk]: pkgsrc/pkgtools/cwrappers Add cwrappers-20100308 with minimal...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/33c2978e619f
branches:  trunk
changeset: 639577:33c2978e619f
user:      joerg <joerg%pkgsrc.org@localhost>
date:      Wed Sep 17 12:40:56 2014 +0000

description:
Add cwrappers-20100308 with minimal compat changes. Developed as part of
GSoC 2007, initial test suite parts from schmonz@, nagging by jperkin,
approval for addition during freeze by agc@.

diffstat:

 pkgtools/cwrappers/DESCR                                  |    4 +
 pkgtools/cwrappers/Makefile                               |   30 +
 pkgtools/cwrappers/PLIST                                  |   10 +
 pkgtools/cwrappers/files/bin/Makefile                     |   45 +
 pkgtools/cwrappers/files/bin/alloc.c                      |   95 ++
 pkgtools/cwrappers/files/bin/as-wrapper.c                 |    4 +
 pkgtools/cwrappers/files/bin/base-wrapper.c               |  179 +++++
 pkgtools/cwrappers/files/bin/c++-wrapper.c                |    4 +
 pkgtools/cwrappers/files/bin/cc-wrapper.c                 |    4 +
 pkgtools/cwrappers/files/bin/cleanup-cc.c                 |   80 ++
 pkgtools/cwrappers/files/bin/common.c                     |  359 +++++++++++
 pkgtools/cwrappers/files/bin/common.h                     |  109 +++
 pkgtools/cwrappers/files/bin/cpp-wrapper.c                |    4 +
 pkgtools/cwrappers/files/bin/f77-wrapper.c                |    4 +
 pkgtools/cwrappers/files/bin/fixup-libtool.c              |  411 ++++++++++++
 pkgtools/cwrappers/files/bin/generic-transform-cc.c       |  451 ++++++++++++++
 pkgtools/cwrappers/files/bin/generic-transform-ld.c       |    3 +
 pkgtools/cwrappers/files/bin/generic-transform-libtool.c  |    3 +
 pkgtools/cwrappers/files/bin/getline.c                    |   51 +
 pkgtools/cwrappers/files/bin/imake-wrapper.c              |    4 +
 pkgtools/cwrappers/files/bin/ld-wrapper.c                 |    4 +
 pkgtools/cwrappers/files/bin/libtool-wrapper.c            |    4 +
 pkgtools/cwrappers/files/bin/mi_vector_hash.c             |  179 +++++
 pkgtools/cwrappers/files/bin/normalise-cc.c               |  204 ++++++
 pkgtools/cwrappers/files/bin/normalise-ld.c               |   68 ++
 pkgtools/cwrappers/files/bin/reorder-cc.c                 |  108 +++
 pkgtools/cwrappers/files/bin/rules2src.awk                |   94 ++
 pkgtools/cwrappers/files/bin/shlibtool-wrapper.c          |    4 +
 pkgtools/cwrappers/files/bin/transform-cc.c               |  112 +++
 pkgtools/cwrappers/files/bin/transform-gcc-rules          |  172 +++++
 pkgtools/cwrappers/files/bin/transform-gcc.c              |  172 +++++
 pkgtools/cwrappers/files/doc/cleanup.txt                  |   16 +
 pkgtools/cwrappers/files/doc/configuration.txt            |   28 +
 pkgtools/cwrappers/files/doc/fixup-libtool.txt            |    1 +
 pkgtools/cwrappers/files/doc/generic-transform-ld.txt     |    6 +
 pkgtools/cwrappers/files/doc/generic-transform.txt        |   38 +
 pkgtools/cwrappers/files/doc/normalise-ld.txt             |   21 +
 pkgtools/cwrappers/files/doc/normalise.txt                |   32 +
 pkgtools/cwrappers/files/doc/reorder.txt                  |   13 +
 pkgtools/cwrappers/files/doc/transform.txt                |   13 +
 pkgtools/cwrappers/files/doc/unimplemented.txt            |   44 +
 pkgtools/cwrappers/files/test/Makefile                    |   29 +
 pkgtools/cwrappers/files/test/TODO                        |    5 +
 pkgtools/cwrappers/files/test/setup_common.sh             |   25 +
 pkgtools/cwrappers/files/test/test-include_pkgdir.sh      |   45 +
 pkgtools/cwrappers/files/test/test-include_usr_include.sh |   45 +
 pkgtools/cwrappers/files/test/test-lib_expand.sh          |   20 +
 pkgtools/cwrappers/files/test/test-libdir_pkgdir.sh       |   45 +
 pkgtools/cwrappers/files/test/test-libdir_usr_lib.sh      |   45 +
 pkgtools/cwrappers/files/test/test-libpath.sh             |   58 +
 pkgtools/cwrappers/files/test/test-no_abspath.sh          |   19 +
 pkgtools/cwrappers/files/test/test-option.sh              |   32 +
 pkgtools/cwrappers/files/test/test-quoted_arg.sh          |   19 +
 pkgtools/cwrappers/files/test/test-remove_dir.sh          |   19 +
 pkgtools/cwrappers/files/test/test-repeated_arg.sh        |   19 +
 pkgtools/cwrappers/files/test/test-rpath_merge.sh         |   26 +
 pkgtools/cwrappers/files/test/test-rpath_pkgdir.sh        |   66 ++
 pkgtools/cwrappers/files/test/test-rpath_split.sh         |   26 +
 pkgtools/cwrappers/files/test/test-rpath_usr_lib.sh       |   52 +
 59 files changed, 3782 insertions(+), 0 deletions(-)

diffs (truncated from 4018 to 300 lines):

diff -r f283060eddf6 -r 33c2978e619f pkgtools/cwrappers/DESCR
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/pkgtools/cwrappers/DESCR  Wed Sep 17 12:40:56 2014 +0000
@@ -0,0 +1,4 @@
+The cwrappers package implements the compiler wrappers for pkgsrc.
+They are the fundation of the buildlink framework. They also allow
+various transformations of arguments to simplify
+cross-platform portability.
diff -r f283060eddf6 -r 33c2978e619f pkgtools/cwrappers/Makefile
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/pkgtools/cwrappers/Makefile       Wed Sep 17 12:40:56 2014 +0000
@@ -0,0 +1,30 @@
+# $NetBSD: Makefile,v 1.1 2014/09/17 12:40:56 joerg Exp $
+
+PKGNAME=               cwrappers-20100308
+CATEGORIES=            pkgtools sysutils
+
+MAINTAINER=            joerg%NetBSD.org@localhost
+HOMEPAGE=              http://www.NetBSD.org/
+COMMENT=               pkgsrc compiler wrappers
+LICENSE=               modified-bsd
+
+USE_BSD_MAKEFILE=      yes
+USE_FEATURES=          nbcompat
+
+INSTALLATION_DIRS=     libexec/cwrappers
+
+.include "../../mk/bsd.prefs.mk"
+
+.if ${OPSYS} != "NetBSD" || !empty(MACHINE_PLATFORM:MNetBSD-[0-5].*)
+MAKE_ENV+=     NEED_MI_VECTOR_HASH=1
+.endif
+.if !empty(MACHINE_PLATFORM:MDarwin-10.*)
+MAKE_ENV+=     NEED_GETLINE=1
+.endif
+
+CFLAGS.Linux+= -D_GNU_SOURCE=1
+
+do-extract:
+       ${CP} -R ${FILESDIR}/bin ${WRKSRC}
+
+.include "../../mk/bsd.pkg.mk"
diff -r f283060eddf6 -r 33c2978e619f pkgtools/cwrappers/PLIST
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/pkgtools/cwrappers/PLIST  Wed Sep 17 12:40:56 2014 +0000
@@ -0,0 +1,10 @@
+@comment $NetBSD: PLIST,v 1.1 2014/09/17 12:40:56 joerg Exp $
+libexec/cwrappers/as-wrapper
+libexec/cwrappers/c++-wrapper
+libexec/cwrappers/cc-wrapper
+libexec/cwrappers/cpp-wrapper
+libexec/cwrappers/f77-wrapper
+libexec/cwrappers/imake-wrapper
+libexec/cwrappers/ld-wrapper
+libexec/cwrappers/libtool-wrapper
+libexec/cwrappers/shlibtool-wrapper
diff -r f283060eddf6 -r 33c2978e619f pkgtools/cwrappers/files/bin/Makefile
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/pkgtools/cwrappers/files/bin/Makefile     Wed Sep 17 12:40:56 2014 +0000
@@ -0,0 +1,45 @@
+PROGS= as-wrapper cc-wrapper c++-wrapper cpp-wrapper f77-wrapper \
+       imake-wrapper ld-wrapper libtool-wrapper shlibtool-wrapper
+
+LIB_SRCS=      alloc.c cleanup-cc.c common.c reorder-cc.c
+
+.ifdef NEED_MI_VECTOR_HASH
+LIB_SRCS+=     mi_vector_hash.c
+CPPFLAGS+=     -DNEED_MI_VECTOR_HASH
+.endif
+.ifdef NEED_GETLINE
+LIB_SRCS+=     getline.c
+CPPFLAGS+=     -DNEED_GETLINE
+.endif
+
+LDADD+=                -lnbcompat
+
+CC_SRCS=       ${LIB_SRCS} generic-transform-cc.c normalise-cc.c
+
+SRCS.as-wrapper=       ${CC_SRCS} as-wrapper.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
+SRCS.f77-wrapper=      ${CC_SRCS} f77-wrapper.c
+SRCS.imake-wrapper=    ${CC_SRCS} imake-wrapper.c
+SRCS.ld-wrapper=       ${LIB_SRCS} generic-transform-ld.c \
+                       normalise-ld.c ld-wrapper.c
+SRCS.libtool-wrapper=  ${LIB_SRCS} generic-transform-libtool.c \
+                       normalise-cc.c libtool-wrapper.c fixup-libtool.c
+SRCS.shlibtool-wrapper=        ${LIB_SRCS} generic-transform-libtool.c \
+                       normalise-cc.c shlibtool-wrapper.c fixup-libtool.c
+
+WARNS= 4
+NOMAN=
+
+CLEANFILES+=   .work-new.log \
+               transform-gcc-rules-fixed.map \
+               transform-gcc-rules-fixed1.c \
+               transform-gcc-rules-fixed2.c
+
+transform-cc.c: transform-gcc.c
+
+transform-gcc.c: transform-gcc-rules rules2src.awk
+       awk -v output=transform-gcc.c -f rules2src.awk transform-gcc-rules
+
+.include <bsd.prog.mk>
diff -r f283060eddf6 -r 33c2978e619f pkgtools/cwrappers/files/bin/alloc.c
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/pkgtools/cwrappers/files/bin/alloc.c      Wed Sep 17 12:40:56 2014 +0000
@@ -0,0 +1,95 @@
+/* $NetBSD: alloc.c,v 1.1 2014/09/17 12:40:56 joerg Exp $ */
+
+/*-
+ * Copyright (c) 2007 Joerg Sonnenberger <joerg%NetBSD.org@localhost>.
+ * All rights reserved.
+ *
+ * This code was developed as part of Google's Summer of Code 2007 program.
+ *
+ * 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 <err.h>
+#include <stdarg.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+#include "common.h"
+
+char *
+xasprintf(const char *fmt, ...)
+{
+       va_list ap;
+       char *buf;
+       
+       va_start(ap, fmt);
+       if (vasprintf(&buf, fmt, ap) == -1)
+               err(1, "asprintf failed");
+       va_end(ap);
+       return buf;
+}
+
+void *
+xmalloc(size_t len)
+{
+       void *ptr;
+
+       if ((ptr = malloc(len)) == NULL)
+               err(1, "malloc failed");
+       return ptr;
+}
+
+void *
+xrealloc(void *buf, size_t len)
+{
+       void *ptr;
+
+       if ((ptr = realloc(buf, len)) == NULL)
+               err(1, "realloc failed");
+       return ptr;
+}
+
+char *
+xstrdup(const char *str)
+{
+       char *buf;
+
+       if ((buf = strdup(str)) == NULL)
+               err(1, "strdup failed");
+       return buf;
+}
+
+char *
+xstrndup(const char *str, size_t len)
+{
+       char *buf;
+
+       buf = xmalloc(len + 1);
+       strncpy(buf, str, len);
+       buf[len] = '\0';
+
+       return buf;
+}
diff -r f283060eddf6 -r 33c2978e619f pkgtools/cwrappers/files/bin/as-wrapper.c
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/pkgtools/cwrappers/files/bin/as-wrapper.c Wed Sep 17 12:40:56 2014 +0000
@@ -0,0 +1,4 @@
+#define        WRAPPER_AS
+#define        WRAPPER_NAME "as"
+
+#include "base-wrapper.c"
diff -r f283060eddf6 -r 33c2978e619f pkgtools/cwrappers/files/bin/base-wrapper.c
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/pkgtools/cwrappers/files/bin/base-wrapper.c       Wed Sep 17 12:40:56 2014 +0000
@@ -0,0 +1,179 @@
+/* $NetBSD: base-wrapper.c,v 1.1 2014/09/17 12:40:56 joerg Exp $ */
+
+/*-
+ * Copyright (c) 2007 Joerg Sonnenberger <joerg%NetBSD.org@localhost>.
+ * All rights reserved.
+ *
+ * This code was developed as part of Google's Summer of Code 2007 program.
+ *
+ * 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 <sys/wait.h>
+#include <err.h>
+#include <stdarg.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
+
+#include "common.h"
+
+static const char wrapper_name[] = WRAPPER_NAME;
+
+#if !defined(WRAPPER_LIBTOOL) && !defined(WRAPPER_SHLIBTOOL)
+void
+register_unwrap(const char *rule)
+{
+}
+#endif
+
+#if defined(WRAPPER_LIBTOOL) || defined(WRAPPER_SHLIBTOOL)
+static int
+libtool_mode(struct arglist *args)
+{
+       struct argument *arg;
+       const char *mode = NULL;
+
+       mode = NULL;
+       TAILQ_FOREACH(arg, args, link) {
+               if (arg->val[0] != '-') {
+                       prepend_after = arg;
+                       break;
+               }
+               if (strncmp(arg->val, "--mode=", 7) == 0) {
+                       mode = arg->val + 7;
+                       continue;
+               }
+               if (strcmp(arg->val, "--mode") == 0) {
+                       arg = TAILQ_NEXT(arg, link);
+                       if (arg == NULL || *arg->val == '-')
+                               errx(255, "Misssing --mode argument");
+                       mode = arg->val;
+                       continue;
+               }
+               if (strcmp(arg->val, "--finish") == 0) {
+                       mode = arg->val + 2;
+                       continue;
+               }
+               if (strcmp(arg->val, "--tag") == 0) {
+                       arg = TAILQ_NEXT(arg, link);
+                       if (arg == NULL || *arg->val == '-')
+                               errx(255, "Misssing --tag argument");



Home | Main Index | Thread Index | Old Index