New patches from Fedora.
[fedora-mingw.git] / ocaml / mingw32-ocaml-3.11.0+beta1-no-stdlib-dir.patch
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.
4
5 diff --exclude _build -urN ocaml-3.11.0+beta1.orig/byterun/dynlink.c ocaml-3.11.0+beta1.mingw/byterun/dynlink.c
6 --- ocaml-3.11.0+beta1.orig/byterun/dynlink.c   2008-04-22 13:24:10.000000000 +0100
7 +++ ocaml-3.11.0+beta1.mingw/byterun/dynlink.c  2008-11-15 15:43:52.000000000 +0000
8 @@ -80,7 +80,12 @@
9  
10    stdlib = getenv("OCAMLLIB");
11    if (stdlib == NULL) stdlib = getenv("CAMLLIB");
12 -  if (stdlib == NULL) stdlib = OCAML_STDLIB_DIR;
13 +  if (stdlib == NULL)
14 +#ifdef OCAML_STDLIB_DIR
15 +    stdlib = OCAML_STDLIB_DIR;
16 +#else
17 +    stdlib = ".";
18 +#endif
19    ldconfname = caml_stat_alloc(strlen(stdlib) + 2 + sizeof(LD_CONF_NAME));
20    strcpy(ldconfname, stdlib);
21    strcat(ldconfname, "/" LD_CONF_NAME);