diff options
author | jperkin <jperkin@pkgsrc.org> | 2015-07-07 15:00:25 +0000 |
---|---|---|
committer | jperkin <jperkin@pkgsrc.org> | 2015-07-07 15:00:25 +0000 |
commit | fe4e5ffedac2ec1551a97dcdbc818705b6770652 (patch) | |
tree | 15dbd97857924d5a756f1ca8d00dfedb60a755e9 /pkgtools | |
parent | c8b7f65ea812bfd9cdb0de26ea45a660586d9d78 (diff) | |
download | pkgsrc-fe4e5ffedac2ec1551a97dcdbc818705b6770652.tar.gz |
cwrappers-20150707: handle .dylib extension and Darwin linker flags.
Diffstat (limited to 'pkgtools')
-rw-r--r-- | pkgtools/cwrappers/Makefile | 6 | ||||
-rw-r--r-- | pkgtools/cwrappers/files/bin/normalise-cc.c | 18 |
2 files changed, 16 insertions, 8 deletions
diff --git a/pkgtools/cwrappers/Makefile b/pkgtools/cwrappers/Makefile index 147b3aefaea..07a047083d3 100644 --- a/pkgtools/cwrappers/Makefile +++ b/pkgtools/cwrappers/Makefile @@ -1,6 +1,6 @@ -# $NetBSD: Makefile,v 1.12 2015/04/29 14:23:58 jperkin Exp $ +# $NetBSD: Makefile,v 1.13 2015/07/07 15:00:25 jperkin Exp $ -PKGNAME= cwrappers-20150318 +PKGNAME= cwrappers-20150707 CATEGORIES= pkgtools sysutils MAINTAINER= joerg@NetBSD.org @@ -22,7 +22,7 @@ MAKE_ENV+= NEED_MI_VECTOR_HASH=1 .endif CFLAGS.FreeBSD+= -D_WITH_GETLINE -CFLAGS.Linux+= -D_GNU_SOURCE=1 +CFLAGS.Linux+= -D_GNU_SOURCE=1 do-extract: ${CP} -R ${FILESDIR}/bin ${WRKSRC} diff --git a/pkgtools/cwrappers/files/bin/normalise-cc.c b/pkgtools/cwrappers/files/bin/normalise-cc.c index 39b05839664..9bced81ab29 100644 --- a/pkgtools/cwrappers/files/bin/normalise-cc.c +++ b/pkgtools/cwrappers/files/bin/normalise-cc.c @@ -1,4 +1,4 @@ -/* $NetBSD: normalise-cc.c,v 1.2 2015/04/19 14:30:07 jperkin Exp $ */ +/* $NetBSD: normalise-cc.c,v 1.3 2015/07/07 15:00:25 jperkin Exp $ */ /*- * Copyright (c) 2009 Joerg Sonnenberger <joerg@NetBSD.org>. @@ -105,6 +105,10 @@ normalise_cc(struct arglist *args) TAILQ_FOREACH_SAFE(arg, args, link, arg2) { if (strcmp(arg->val, "-o") == 0 || + strcmp(arg->val, "-dylib_file") == 0 || + strcmp(arg->val, "-dylib_install_name") == 0 || + strcmp(arg->val, "-install_name") == 0 || + strcmp(arg->val, "-seg_addr_table_filename") == 0 || strcmp(arg->val, "--dynamic-linker") == 0) { if (arg2 == NULL || arg2->val[0] == '-') errx(255, "Missing argument for %s", arg->val); @@ -121,11 +125,15 @@ normalise_cc(struct arglist *args) if (len == 0) continue; last = next + len; - if (strncmp(last, ".so", 3) && - strncmp(last, ".sl", 3)) + if (strncmp(last, ".so", 3) == 0 || + strncmp(last, ".sl", 3) == 0) + last += 3; + else if (strncmp(last, ".dylib", 6) == 0) + last += 6; + else continue; - if (last[3] && - (last[3] != '.' || last[4] < '0' || last[4] > '9')) + if (last[0] && + (last[0] != '.' || last[1] < '0' || last[1] > '9')) continue; arg3 = argument_new(xasprintf("-l%*.*s", (int)len, (int)len, next)); |