aboutsummaryrefslogtreecommitdiff
path: root/dev/build/windows/patches_coq
diff options
context:
space:
mode:
authorMichael Soegtrop2019-03-18 11:04:00 +0100
committerVincent Laporte2019-03-19 08:41:47 +0000
commitcef009d27d79b90ee42e0ea96c487d5a07d803de (patch)
tree433e9040660b7a19cc4920b413bdbc0bf42b74f2 /dev/build/windows/patches_coq
parent1f4a9071b3236b61642cbd5cf35f82a8fb15bf32 (diff)
Fixed incompatibility between new cygwin pkg-config and dune
Diffstat (limited to 'dev/build/windows/patches_coq')
-rwxr-xr-xdev/build/windows/patches_coq/pkg-config.c29
1 files changed, 29 insertions, 0 deletions
diff --git a/dev/build/windows/patches_coq/pkg-config.c b/dev/build/windows/patches_coq/pkg-config.c
new file mode 100755
index 0000000000..e4fdcd4d7d
--- /dev/null
+++ b/dev/build/windows/patches_coq/pkg-config.c
@@ -0,0 +1,29 @@
+// MinGW personality wrapper for pkgconf
+// This is an excutable replacement for the shell scripts /bin/ARCH-pkg-config
+// Compile with e.g.
+// gcc pkg-config.c -DARCH=x86_64-w64-mingw32 -o pkg-config.exe
+// gcc pkg-config.c -DARCH=i686-w64-mingw32 -o pkg-config.exe
+// ATTENTION: Do not compile with MinGW-gcc, compile with cygwin gcc!
+//
+// To test it execute e.g.
+// $ ./pkg-config --path zlib
+// /usr/x86_64-w64-mingw32/sys-root/mingw/lib/pkgconfig/zlib.pc
+
+#include <unistd.h>
+
+#define STRINGIFY1(arg) #arg
+#define STRINGIFY(arg) STRINGIFY1(arg)
+
+int main(int argc, char *argv[])
+{
+ // +1 for extra argument, +1 for trailing NULL
+ char * argvnew[argc+2];
+ int id=0, is=0;
+
+ argvnew[id++] = argv[is++];
+ argvnew[id++] = "--personality="STRINGIFY(ARCH);
+ while( is<argc ) argvnew[id++] = argv[is++];
+ argvnew[id++] = 0;
+
+ return execv("/usr/bin/pkgconf", argvnew);
+}