Index: hooks.c =================================================================== --- hooks.c (revision 5978) +++ hooks.c (revision 5979) @@ -116,10 +116,19 @@ int hook_postarg() { char *tmp; + const char *libad; put("/local/csch/librnd_template", tmp = str_concat("", TO_STR(LIBRND_PREFIX), "/", get("/local/libarchdir"), "/librnd3/scconfig/template", NULL)); free(tmp); + /* if librnd is installed at some custom path, we'll need to have a -I on CFLAGS and -L on LDFLAGS */ + libad = get("/local/libarchdir"); + if (((strncasecmp(TO_STR(LIBRND_PREFIX), "/usr/include", 12) != 0) && (strncasecmp(TO_STR(LIBRND_PREFIX), "/usr/local/include", 18) != 0)) || (strcmp(libad, "lib") != 0)) { + put("/local/csch/librnd_extra_inc", "-I" TO_STR(LIBRND_PREFIX) "/include"); + put("/local/csch/librnd_extra_ldf", tmp = str_concat("", "-L" TO_STR(LIBRND_PREFIX) "/", libad, NULL)); + free(tmp); + } + return rnd_hook_postarg(TO_STR(LIBRND_PREFIX), "sch-rnd"); }