diff --git a/bootstrap.mk.in b/bootstrap.mk.in index 4a35341..288ad77 100644 --- a/bootstrap.mk.in +++ b/bootstrap.mk.in @@ -33,23 +33,15 @@ override SHELL = @SHELL@ $(SHELLFLAGS) # # Others programs should used via `make` variables so that the user can # substitute alternatives. -INSTALL = install -INSTALL_PROGRAM = $(INSTALL) -INSTALL_DATA = $(INSTALL) -m 644 +INSTALL = @INSTALL@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_DATA = @INSTALL_DATA@ -PYTHON = python -PYTHONFLAGS = - -# Checks whether the path for python need to be translated into Windows path -# If PYTHON platform is not Windows then set to and simple `echo` -# else use cygpath if it's available -# To use it with python all backslash space must be replaced by a space -CYGPATH_W := cygpath -m 2>/dev/null -CYGPATH_W := $(shell $(PYTHON) -c 'import sys; sys.stdout.write("$(CYGPATH_W)" if sys.platform.startswith("win") else "false")') -CYGPATH_W := $(shell $(CYGPATH_W) --version >/dev/null 2>/dev/null && echo '$(CYGPATH_W)' || echo 'cygpath_w() { echo $$1 | tr \\\\\\\\ / ;}; cygpath_w') - -GPG = gpg +PYTHON = @PYTHON@ +PYTHONFLAGS = @PYTHONFLAGS@ +CYGPATH_W = @CYGPATH_W@ +GPG = @GPG@ ## # Directories @@ -62,51 +54,51 @@ DESTDIR = # These first two variables set the root for the installation. All the other # installation directories should be subdirectories of one of these two, and # nothing should be directly installed into these two directories. -prefix = /usr/local -exec_prefix = $(prefix) +prefix = @prefix@ +exec_prefix = @exec_prefix@ # Executable programs are installed in one of the following directories. -bindir = $(exec_prefix)/bin -sbindir = $(exec_prefix)/sbin -libexecdir = $(exec_prefix)/libexec +bindir = @bindir@ +sbindir = @sbindir@ +libexecdir = @libexecdir@ # Data files used by the program during its execution. -datarootdir = $(prefix)/share -datadir = $(datarootdir) -sysconfdir = $(prefix)/etc -sharedstatedir = $(prefix)/com -localstatedir = $(prefix)/var -runstatedir = $(localstatedir)/run +datarootdir = @datarootdir@ +datadir = @datadir@ +sysconfdir = @sysconfdir@ +sharedstatedir = @sharedstatedir@ +localstatedir = @localstatedir@ +runstatedir = @runstatedir@ # Directory for installing certain specific types of files. -includedir = $(prefix)/include -oldincludedir = -docdir = $(datarootdir)/doc/$(PACKAGE) -infodir = $(datarootdir)/info -htmldir = $(docdir) -dvidir = $(docdir) -pdfdir = $(docdir) -psdir = $(docdir) -libdir = $(exec_prefix)/lib -lispdir = $(datarootdir)/emacs/site-lisp -localedir = $(datarootdir)/locale -mandir = $(datarootdir)/man -man1dir = $(mandir)/man1 -man2dir = $(mandir)/man2 -man3dir = $(mandir)/man3 -man4dir = $(mandir)/man4 -man5dir = $(mandir)/man5 -man6dir = $(mandir)/man6 -man7dir = $(mandir)/man7 -man8dir = $(mandir)/man8 +includedir = @includedir@ +oldincludedir = @oldincludedir@ +docdir = @docdir@ +infodir = @infodir@ +htmldir = @htmldir@ +dvidir = @dvidir@ +pdfdir = @pdfdir@ +psdir = @psdir@ +libdir = @libdir@ +lispdir = @lispdir@ +localedir = @localedir@ +mandir = @mandir@ +man1dir = @man1dir@ +man2dir = @man2dir@ +man3dir = @man3dir@ +man4dir = @man4dir@ +man5dir = @man5dir@ +man6dir = @man6dir@ +man7dir = @man7dir@ +man8dir = @man8dir@ # Package subdirectory -pkglibexecdir = $(libexecdir)/$(PACKAGE) -pkgdatadir = $(datadir)/$(PACKAGE) -pkgsysconfdir = $(sysconfdir)/$(PACKAGE) -pkglocalstatedir = $(localstatedir)/$(PACKAGE) -pkgincludedir = $(includedir)/$(PACKAGE) -pkglibdir = $(libdir)/$(PACKAGE) +pkglibexecdir = @pkglibexecdir@ +pkgdatadir = @pkgdatadir@ +pkgsysconfdir = @pkgsysconfdir@ +pkglocalstatedir = @pkglocalstatedir@ +pkgincludedir = @pkgincludedir@ +pkglibdir = @pkglibdir@ ## @@ -280,9 +272,10 @@ distcheck: dist builddir="`pwd`/_build"; \ mkdir "$$builddir"; \ cd "$$builddir"; \ - ../configure; \ + ../configure --prefix="$$installdir"; \ $(MAKE) check; \ - $(MAKE) installcheck prefix="$$installdir"; \ + $(MAKE) installcheck; \ + ../configure; \ $(MAKE) install DESTDIR="$$destdir"; \ $(MAKE) dist; \ $(MAKE) distcleancheck; diff --git a/configure b/configure index 1c098e4..7da6a37 100755 --- a/configure +++ b/configure @@ -26,6 +26,105 @@ $1 EOF } +expand_args () +{ + while test $# -gt 0; do + if expr "$1" : '[a-zA-Z0-9_-]*=.*' > /dev/null; then + var=`expr "$1" : '-*\(.*\)=.*'` + value=`expr "$1" : '.*=\(.*\)' | sed -e s,'\\\\','\\\\\\\\\\\\\\\\',g` + eval ${var}='${value}' + fi; + shift; + done; +} + +# For building and installation should not use any utilities directly except +# these: +# +# awk cat cmp cp diff echo egrep expr false grep install-info ln ls +# mkdir mv printf pwd rm rmdir sed sleep sort tar test touch tr true +# +# Compression programs such as `gzip` can be used in the `dist` rule. +# +# Others programs should used via `make` variables so that the user can +# substitute alternatives. +INSTALL='install' +INSTALL_PROGRAM='$(INSTALL)' +INSTALL_DATA='$(INSTALL) -m 644' +PYTHON='python' +PYTHONFLAGS='' +CYGPATH_W='cygpath -m 2>/dev/null' +GPG='gpg' + +# These first two variables set the root for the installation. All the other +# installation directories should be subdirectories of one of these two, and +# nothing should be directly installed into these two directories. +prefix='/usr/local' +exec_prefix='$(prefix)' + +# Executable programs are installed in one of the following directories. +bindir='$(exec_prefix)/bin' +sbindir='$(exec_prefix)/sbin' +libexecdir='$(exec_prefix)/libexec' + +# Data files used by the program during its execution. +datarootdir='$(prefix)/share' +datadir='$(datarootdir)' +sysconfdir='$(prefix)/etc' +sharedstatedir='$(prefix)/com' +localstatedir='$(prefix)/var' +runstatedir='$(localstatedir)/run' + +# Directory for installing certain specific types of files. +includedir='$(prefix)/include' +oldincludedir='' +docdir='$(datarootdir)/doc/$(PACKAGE)' +infodir='$(datarootdir)/info' +htmldir='$(docdir)' +dvidir='$(docdir)' +pdfdir='$(docdir)' +psdir='$(docdir)' +libdir='$(exec_prefix)/lib' +lispdir='$(datarootdir)/emacs/site-lisp' +localedir='$(datarootdir)/locale' +mandir='$(datarootdir)/man' +man1dir='$(mandir)/man1' +man2dir='$(mandir)/man2' +man3dir='$(mandir)/man3' +man4dir='$(mandir)/man4' +man5dir='$(mandir)/man5' +man6dir='$(mandir)/man6' +man7dir='$(mandir)/man7' +man8dir='$(mandir)/man8' + +# Package subdirectory +pkglibexecdir='$(libexecdir)/$(PACKAGE)' +pkgdatadir='$(datadir)/$(PACKAGE)' +pkgsysconfdir='$(sysconfdir)/$(PACKAGE)' +pkglocalstatedir='$(localstatedir)/$(PACKAGE)' +pkgincludedir='$(includedir)/$(PACKAGE)' +pkglibdir='$(libdir)/$(PACKAGE)' + + +expand_args $@ + +# checks for programs + +# Checks whether the path for python need to be translated into Windows path +# If PYTHON platform is not Windows then set to and simple `echo` +# else use cygpath if it's available +# To use it with python all backslash space must be replaced by a space +PYTHON_PLATFORM=`${PYTHON} -c 'import sys; sys.stdout.write(sys.platform)'` +if expr "${PYTHON_PLATFORM}" : 'win.*' > /dev/null; then :; else + CYGPATH_W=false +fi +if `${CYGPATH_W} --version >/dev/null 2>/dev/null`; then :; else + CYGPATH_W='cygpath_w() { echo $$1 | tr \\\\\\\\ / ;}; cygpath_w' +fi + + +# output + __DIR__=`dirname "$0"` files=' @@ -73,6 +172,50 @@ EOF -e s,'@'top_builddir'@',"${top_builddir}",g \ -e s,'@'SHELL'@','/bin/sh',g \ -e s,'@'SHELLFLAGS'@','-e',g \ + -e s,'@'INSTALL'@',"${INSTALL}",g \ + -e s,'@'INSTALL_PROGRAM'@',"${INSTALL_PROGRAM}",g \ + -e s,'@'INSTALL_DATA'@',"${INSTALL_DATA}",g \ + -e s,'@'PYTHON'@',"${PYTHON}",g \ + -e s,'@'PYTHONFLAGS'@',"${PYTHONFLAGS}",g \ + -e s,'@'CYGPATH_W'@',"${CYGPATH_W}",g \ + -e s,'@'GPG'@',"${GPG}",g \ + -e s,'@'prefix'@',"${prefix}",g \ + -e s,'@'exec_prefix'@',"${exec_prefix}",g \ + -e s,'@'bindir'@',"${bindir}",g \ + -e s,'@'sbindir'@',"${sbindir}",g \ + -e s,'@'libexecdir'@',"${libexecdir}",g \ + -e s,'@'datarootdir'@',"${datarootdir}",g \ + -e s,'@'datadir'@',"${datadir}",g \ + -e s,'@'sysconfdir'@',"${sysconfdir}",g \ + -e s,'@'sharedstatedir'@',"${sharedstatedir}",g \ + -e s,'@'localstatedir'@',"${localstatedir}",g \ + -e s,'@'runstatedir'@',"${runstatedir}",g \ + -e s,'@'includedir'@',"${includedir}",g \ + -e s,'@'oldincludedir'@',"${oldincludedir}",g \ + -e s,'@'docdir'@',"${docdir}",g \ + -e s,'@'infodir'@',"${infodir}",g \ + -e s,'@'htmldir'@',"${htmldir}",g \ + -e s,'@'dvidir'@',"${dvidir}",g \ + -e s,'@'pdfdir'@',"${pdfdir}",g \ + -e s,'@'psdir'@',"${psdir}",g \ + -e s,'@'libdir'@',"${libdir}",g \ + -e s,'@'lispdir'@',"${lispdir}",g \ + -e s,'@'localedir'@',"${localedir}",g \ + -e s,'@'mandir'@',"${mandir}",g \ + -e s,'@'man1dir'@',"${man1dir}",g \ + -e s,'@'man2dir'@',"${man2dir}",g \ + -e s,'@'man3dir'@',"${man3dir}",g \ + -e s,'@'man4dir'@',"${man4dir}",g \ + -e s,'@'man5dir'@',"${man5dir}",g \ + -e s,'@'man6dir'@',"${man6dir}",g \ + -e s,'@'man7dir'@',"${man7dir}",g \ + -e s,'@'man8dir'@',"${man8dir}",g \ + -e s,'@'pkglibexecdir'@',"${pkglibexecdir}",g \ + -e s,'@'pkgdatadir'@',"${pkgdatadir}",g \ + -e s,'@'pkgsysconfdir'@',"${pkgsysconfdir}",g \ + -e s,'@'pkglocalstatedir'@',"${pkglocalstatedir}",g \ + -e s,'@'pkgincludedir'@',"${pkgincludedir}",g \ + -e s,'@'pkglibdir'@',"${pkglibdir}",g \ > "${file}"; done; @@ -89,7 +232,7 @@ EOF cat > "${status_file}" <