From ceeaa6b50cb43786bfa29fb53e3379bff9f686ec Mon Sep 17 00:00:00 2001 From: Jan Nieuwenhuizen Date: Sun, 22 Jul 2018 14:44:50 +0200 Subject: [PATCH] build: Respect --docdir. * configure: Respect --docdir. --- build-aux/export.make | 29 ++++++++++-------- configure | 68 +++++++++++++++++++++++++------------------ install.sh | 10 +++---- 3 files changed, 62 insertions(+), 45 deletions(-) diff --git a/build-aux/export.make b/build-aux/export.make index 50f49f75..7504231b 100644 --- a/build-aux/export.make +++ b/build-aux/export.make @@ -8,6 +8,19 @@ export top_builddir export config.make export srcdir +export prefix + +export datadir +export docdir + +export bindir +export guile_site_ccache_dir +export guile_site_dir +export infodir +export libdir +export mandir +export moduledir +export sysconfdir ifdef V export V @@ -17,18 +30,6 @@ ifdef DESTDIR export DESTDIR endif -ifdef prefix -export prefix -endif - -ifdef infodir -export infodir -endif - -ifdef mandir -export mandir -endif - ifdef ARCH export ARCH endif @@ -53,6 +54,10 @@ ifdef HEX2 export HEX2 endif +ifdef HELP2MAN +export HELP2MAN +endif + ifdef GUILE export GUILE endif diff --git a/configure b/configure index 48c425d4..def96270 100755 --- a/configure +++ b/configure @@ -212,6 +212,10 @@ exec ${guile} -L . --no-auto-compile -e '(configure)' -s "$0" ${1+"$@"} (host (value #t)) (help (single-char #\h)) (prefix (value #t)) + (bindir (value #t)) + (datadir (value #t)) + (docdir (value #t)) + (libdir (value #t)) (sysconfdir (value #t)) (verbose (single-char #\v)) (with-courage) @@ -267,7 +271,6 @@ Ignored for Debian: --libdir=DIR --libexecdir=DIR --localstatedir=DIR - --mandir=DIR --runstatedir=DIR Some influential environment variables: @@ -285,10 +288,28 @@ Some influential environment variables: " PACKAGE VERSION (getenv "prefix"))) (define (main args) - (let* ((prefix "/usr/local") - (infodir "${prefix}/share/info") - (mandir "${prefix}/share/man") - (sysconfdir "${prefix}/etc") + (let* ((options (parse-opts args)) + (build-type (option-ref options 'build %host-type)) + + (arch (car (string-split build-type #\-))) + (host-type (option-ref options 'host %host-type))(prefix "/usr/local") + + (prefix "/usr/local") + (prefix (option-ref options 'prefix prefix)) + (infodir (option-ref options 'infodir "${prefix}/share/info")) + (mandir (option-ref options 'infodir "${prefix}/share/man")) + (sysconfdir (option-ref options 'sysconfdir "${prefix}/etc")) + + (bindir (option-ref options 'bindir "${prefix}/etc")) + (datadir (option-ref options 'datadir "${prefix}/share")) + (docdir (option-ref options 'docdir "${datadir}/doc/mes-${VERSION}")) + (libdir (option-ref options 'libdir "${prefix}/lib")) + (moduledir "${datadir}/mes/module") + (guile-effective-version (effective-version)) + (guile-site-dir (if (equal? prefix ".") (canonicalize-path ".") + (string-append "${prefix}/share/guile/site/" guile-effective-version))) + (guile-site-ccache-dir (if (equal? prefix ".") (canonicalize-path ".") + (string-append "${prefix}/lib/guile/" guile-effective-version "/site-ccache"))) (srcdir (dirname (car (command-line)))) (abs-top-srcdir (canonicalize-path srcdir)) @@ -298,22 +319,7 @@ Some influential environment variables: (top-builddest (if (equal? srcdir ".") "" (string-append abs-top-builddir "/"))) - (options (parse-opts args)) - (build-type (option-ref options 'build %host-type)) - (arch (car (string-split build-type #\-))) - (host-type (option-ref options 'host %host-type)) - - (prefix (option-ref options 'prefix prefix)) - (infodir (option-ref options 'infodir infodir)) - (sysconfdir (option-ref options 'sysconfdir sysconfdir)) - (datadir (string-append prefix "/share/mes")) - (moduledir (string-append datadir "/module")) - (guile-effective-version (effective-version)) - (guile-site-dir (if (equal? prefix ".") (canonicalize-path ".") - (string-append prefix "/share/guile/site/" guile-effective-version))) - (guile-site-ccache-dir (if (equal? prefix ".") (canonicalize-path ".") - (string-append prefix "/lib/guile/" guile-effective-version "/site-ccache"))) (with-courage? (option-ref options 'with-courage #f)) (disable-silent-rules? (option-ref options 'disable-silent-rules #f)) (vars (filter (cut string-index <> #\=) (option-ref options '() '()))) @@ -325,6 +331,8 @@ Some influential environment variables: (print-help) (exit 0)) (set! %verbose? (option-ref options 'verbose #f)) + (when %verbose? + (stderr "configure args=~s\n" args)) (for-each (lambda (v) (apply setenv (string-split v #\=))) vars) (let* ((mes-seed (or (getenv "MES_SEED") (srcdir-relative "../mes-seed"))) @@ -399,26 +407,30 @@ Some influential environment variables: (stdout "PACKAGE:=~a\n" PACKAGE) (stdout "VERSION:=~a\n" VERSION) + (stdout "ARCH:=~a\n" arch) (stdout "build:=~a\n" build-type) (stdout "host:=~a\n" host-type) - (stdout "srcdir:=~a\n" srcdir) + (stdout "top_builddest:=~a\n" top-builddest) (stdout "top_builddir:=~a\n" top-builddir) (stdout "abs_top_builddir:=~a\n" abs-top-builddir) (stdout "abs_top_srcdir:=~a\n" abs-top-srcdir) + (stdout "srcdir:=~a\n" srcdir) + (stdout "prefix:=~a\n" (gulp-pipe (string-append "echo " prefix))) - (stdout "infodir:=~a\n" infodir) - (stdout "mandir:=~a\n" mandir) (stdout "datadir:=~a\n" datadir) + (stdout "docdir:=~a\n" docdir) + + (stdout "bindir:=~a\n" bindir) + (stdout "guile_site_ccache_dir:=~a\n" guile-site-ccache-dir) + (stdout "guile_site_dir:=~a\n" guile-site-dir) + (stdout "infodir:=~a\n" infodir) + (stdout "libdir:=~a\n" libdir) + (stdout "mandir:=~a\n" mandir) (stdout "moduledir:=~a\n" moduledir) (stdout "sysconfdir:=~a\n" sysconfdir) - (stdout "build:=~a\n" build-type) - (stdout "ARCH:=~a\n" arch) - (stdout "host:=~a\n" %host-type) - (stdout "build:=~a\n" build-type) - (for-each (lambda (o) (stdout "~a:=~a\n" (variable-name o) (or (dependency-file-name o) ""))) deps) diff --git a/install.sh b/install.sh index 5901c19f..af25f4f6 100755 --- a/install.sh +++ b/install.sh @@ -25,11 +25,11 @@ else GUILE_EFFECTIVE_VERSION=${GUILE_EFFECTIVE_VERSION-$(guile -c '(display (effective-version))')} fi bindir=${bindir-$prefix/bin} -datadir=${datadir-$prefix/share/mes} -docdir=${docdir-$prefix/share/doc/mes} -infodir=${infodir-$prefix/share/info} -mandir=${mandir-$prefix/share/man} -moduledir=${moduledir-$datadir/module} +datadir=${datadir-$prefix/share} +docdir=${docdir-$datadir/doc/mes-$VERSION} +infodir=${infodir-$datadir/info} +mandir=${mandir-$datadir/man} +moduledir=${moduledir-$datadir/mes/module} guile_site_dir=${guile_site_dir-$prefix/share/guile/site/$GUILE_EFFECTIVE_VERSION} guile_site_ccache_dir=${guile_site_ccache_dir-$prefix/lib/guile/$GUILE_EFFECTIVE_VERSION/site-ccache}