diff --git a/build-aux/pre-inst-env.in b/build-aux/pre-inst-env.in index b8ef1151..59258dfd 100644 --- a/build-aux/pre-inst-env.in +++ b/build-aux/pre-inst-env.in @@ -48,6 +48,9 @@ export bindir GUIX_PACKAGE_PATH="$abs_top_srcdir/guix${GUIX_PACKAGE_PATH:+:}$GUIX_PACKAGE_PATH" export GUIX_PACKAGE_PATH +MES_UNINSTALLED=1 +export MES_UNINSTALLED + LANG= LC_ALL= diff --git a/module/mescc/mescc.scm b/module/mescc/mescc.scm index 9ef23d7d..6f334945 100644 --- a/module/mescc/mescc.scm +++ b/module/mescc/mescc.scm @@ -267,11 +267,21 @@ (define* (arch-find options file-name #:key kernel) (let* ((srcdest (or (getenv "srcdest") "")) (srcdir-lib (string-append srcdest "lib")) + (srcdir-mescc-lib (string-append srcdest "mescc-lib")) + (libdir (option-ref options 'libdir "lib")) + (libdir-mescc (string-append + (dirname (option-ref options 'libdir "lib")) + "/mescc-lib")) (arch (string-append (arch-get options) "-mes")) - (path (cons* "." - srcdir-lib - (option-ref options 'libdir "lib") - (filter-map (multi-opt 'library-dir) options))) + (path (append (if (getenv "MES_UNINSTALLED") + (list srcdir-mescc-lib + srcdir-lib + libdir-mescc) + '()) + (list libdir) + (or (and=> (getenv "LIBRARY_PATH") + (cut string-split <> #\:)) '()) + (filter-map (multi-opt 'library-dir) options))) (arch-file-name (string-append arch "/" file-name)) (arch-file-name (if kernel (string-append kernel "/" arch-file-name) arch-file-name)) diff --git a/scripts/mescc.in b/scripts/mescc.in index 0780968a..039f1f4c 100644 --- a/scripts/mescc.in +++ b/scripts/mescc.in @@ -37,6 +37,11 @@ export MES_PREFIX GUILE_LOAD_PATH=@guile_site_dir@${GUILE_LOAD_PATH+:}${GUILE_LOAD_PATH} export GUILE_LOAD_PATH +if test -n "$MES_UNINSTALLED"; then + includedir=${includedir-${abs_top_srcdir}/include} + libdir=${libdir-${abs_top_builddir}/lib} +fi + MES=${MES-@prefix@/bin/mes} bindir=${bindir-@bindir@} includedir=${includedir-@includedir@}