updated on Thu Jan 26 16:09:46 UTC 2012
[aur-mirror.git] / mingw32-ocaml / mingw32-ocaml-no-stdlib-dir.patch
blob35ac76df028193b7f8c79dd409ce05ffee73d693
1 Not sure if this is right, but OCAML_STDLIB_DIR can be undefined
2 in our cross-compiler. It's only used in a one place in the C
3 code so this works around it.
5 Index: build-tree/ocaml-3.12.0/byterun/dynlink.c
6 ===================================================================
7 --- build-tree.orig/ocaml-3.12.0/byterun/dynlink.c 2010-01-22 13:48:24.000000000 +0100
8 +++ build-tree/ocaml-3.12.0/byterun/dynlink.c 2010-06-23 19:30:27.000000000 +0200
9 @@ -80,7 +80,12 @@
11 stdlib = getenv("OCAMLLIB");
12 if (stdlib == NULL) stdlib = getenv("CAMLLIB");
13 - if (stdlib == NULL) stdlib = OCAML_STDLIB_DIR;
14 + if (stdlib == NULL)
15 +#ifdef OCAML_STDLIB_DIR
16 + stdlib = OCAML_STDLIB_DIR;
17 +#else
18 + stdlib = ".";
19 +#endif
20 ldconfname = caml_stat_alloc(strlen(stdlib) + 2 + sizeof(LD_CONF_NAME));
21 strcpy(ldconfname, stdlib);
22 strcat(ldconfname, "/" LD_CONF_NAME);