Browse Source

contrib/gpg-error: simplify darwin triplet handling

Instead of copying the header files around, change the triplet
canonicalization function to correctly remove version numbers for
darwin triplets.
pull/104/head
Marvin Scholz 7 years ago
parent
commit
ebd6b48b5f
  1. 25
      contrib/src/gpg-error/darwin-triplet.patch
  2. 24
      contrib/src/gpg-error/rules.mak

25
contrib/src/gpg-error/darwin-triplet.patch

@ -0,0 +1,25 @@
--- libgpg-error-1.27_orig/src/mkheader.c 2017-02-28 13:32:33.000000000 +0100
+++ libgpg-error-1.27/src/mkheader.c 2020-01-23 11:36:50.000000000 +0100
@@ -107,7 +107,21 @@
return xstrdup (lastalias);
}
}
- return xstrdup (triplet);
+ /* Darwin triplet de-versioning */
+ char *res_triplet = xstrdup (triplet);
+
+ char *triplet_last = strrchr(res_triplet, '-');
+ if (triplet_last == NULL) {
+ fprintf (stderr, PGM ": unexpected host triplet missing any separator: '%s'",
+ res_triplet);
+ exit (1);
+ }
+ triplet_last++; /* Advance past the dash */
+ if (strncmp("darwin", triplet_last, 6) == 0) {
+ triplet_last[6] = '\0';
+ }
+
+ return res_triplet;
}

24
contrib/src/gpg-error/rules.mak

@ -24,6 +24,7 @@ endif
$(APPLY) $(SRC)/gpg-error/win32-unicode.patch
$(APPLY) $(SRC)/gpg-error/version-bump-gawk-5.patch
$(APPLY) $(SRC)/gpg-error/win32-extern-struct.patch
$(APPLY) $(SRC)/gpg-error/darwin-triplet.patch
$(MOVE)
ifdef HAVE_ANDROID
ifeq ($(ARCH),aarch64)
@ -33,29 +34,6 @@ else
cp $@/src/syscfg/lock-obj-pub.arm-unknown-linux-androideabi.h $@/src/syscfg/lock-obj-pub.linux-android.h
endif
endif
ifdef HAVE_DARWIN_OS
ifdef HAVE_ARMV7A
ifneq ($(HOST),arm-apple-darwin)
cp $@/src/syscfg/lock-obj-pub.arm-apple-darwin.h $@/src/syscfg/lock-obj-pub.$(HOST).h
endif
else
ifeq ($(ARCH),aarch64)
ifneq ($(HOST),aarch64-apple-darwin)
cp $@/src/syscfg/lock-obj-pub.aarch64-apple-darwin.h $@/src/syscfg/lock-obj-pub.$(HOST).h
endif
else
ifeq ($(ARCH),x86_64)
ifneq ($(HOST),x86_64-apple-darwin)
cp $@/src/syscfg/lock-obj-pub.x86_64-apple-darwin.h $@/src/syscfg/lock-obj-pub.$(HOST).h
endif
else
ifneq ($(HOST),i386-apple-darwin)
cp $@/src/syscfg/lock-obj-pub.x86_64-apple-darwin.h $@/src/syscfg/lock-obj-pub.$(HOST).h
endif
endif
endif
endif
endif
ifdef HAVE_NACL
ifeq ($(ARCH),i386) # 32bits intel
cp $@/src/syscfg/lock-obj-pub.i686-pc-linux-gnu.h $@/src/syscfg/lock-obj-pub.nacl.h

Loading…
Cancel
Save