Skip to content

Commit 626c609

Browse files
committed
Added sets variables only to the configure script except DESTDIR
1 parent 504f81a commit 626c609

2 files changed

Lines changed: 191 additions & 55 deletions

File tree

bootstrap.mk.in

Lines changed: 47 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -33,23 +33,15 @@ override SHELL = @SHELL@ $(SHELLFLAGS)
3333
#
3434
# Others programs should used via `make` variables so that the user can
3535
# substitute alternatives.
36-
INSTALL = install
37-
INSTALL_PROGRAM = $(INSTALL)
38-
INSTALL_DATA = $(INSTALL) -m 644
36+
INSTALL = @INSTALL@
37+
INSTALL_PROGRAM = @INSTALL_PROGRAM@
38+
INSTALL_DATA = @INSTALL_DATA@
3939

40-
PYTHON = python
41-
PYTHONFLAGS =
42-
43-
# Checks whether the path for python need to be translated into Windows path
44-
# If PYTHON platform is not Windows then set to and simple `echo`
45-
# else use cygpath if it's available
46-
# To use it with python all backslash space must be replaced by a space
47-
CYGPATH_W := cygpath -m 2>/dev/null
48-
CYGPATH_W := $(shell $(PYTHON) -c 'import sys; sys.stdout.write("$(CYGPATH_W)" if sys.platform.startswith("win") else "false")')
49-
CYGPATH_W := $(shell $(CYGPATH_W) --version >/dev/null 2>/dev/null && echo '$(CYGPATH_W)' || echo 'cygpath_w() { echo $$1 | tr \\\\\\\\ / ;}; cygpath_w')
50-
51-
GPG = gpg
40+
PYTHON = @PYTHON@
41+
PYTHONFLAGS = @PYTHONFLAGS@
5242

43+
CYGPATH_W = @CYGPATH_W@
44+
GPG = @GPG@
5345

5446
##
5547
# Directories
@@ -62,51 +54,51 @@ DESTDIR =
6254
# These first two variables set the root for the installation. All the other
6355
# installation directories should be subdirectories of one of these two, and
6456
# nothing should be directly installed into these two directories.
65-
prefix = /usr/local
66-
exec_prefix = $(prefix)
57+
prefix = @prefix@
58+
exec_prefix = @exec_prefix@
6759

6860
# Executable programs are installed in one of the following directories.
69-
bindir = $(exec_prefix)/bin
70-
sbindir = $(exec_prefix)/sbin
71-
libexecdir = $(exec_prefix)/libexec
61+
bindir = @bindir@
62+
sbindir = @sbindir@
63+
libexecdir = @libexecdir@
7264

7365
# Data files used by the program during its execution.
74-
datarootdir = $(prefix)/share
75-
datadir = $(datarootdir)
76-
sysconfdir = $(prefix)/etc
77-
sharedstatedir = $(prefix)/com
78-
localstatedir = $(prefix)/var
79-
runstatedir = $(localstatedir)/run
66+
datarootdir = @datarootdir@
67+
datadir = @datadir@
68+
sysconfdir = @sysconfdir@
69+
sharedstatedir = @sharedstatedir@
70+
localstatedir = @localstatedir@
71+
runstatedir = @runstatedir@
8072

8173
# Directory for installing certain specific types of files.
82-
includedir = $(prefix)/include
83-
oldincludedir =
84-
docdir = $(datarootdir)/doc/$(PACKAGE)
85-
infodir = $(datarootdir)/info
86-
htmldir = $(docdir)
87-
dvidir = $(docdir)
88-
pdfdir = $(docdir)
89-
psdir = $(docdir)
90-
libdir = $(exec_prefix)/lib
91-
lispdir = $(datarootdir)/emacs/site-lisp
92-
localedir = $(datarootdir)/locale
93-
mandir = $(datarootdir)/man
94-
man1dir = $(mandir)/man1
95-
man2dir = $(mandir)/man2
96-
man3dir = $(mandir)/man3
97-
man4dir = $(mandir)/man4
98-
man5dir = $(mandir)/man5
99-
man6dir = $(mandir)/man6
100-
man7dir = $(mandir)/man7
101-
man8dir = $(mandir)/man8
74+
includedir = @includedir@
75+
oldincludedir = @oldincludedir@
76+
docdir = @docdir@
77+
infodir = @infodir@
78+
htmldir = @htmldir@
79+
dvidir = @dvidir@
80+
pdfdir = @pdfdir@
81+
psdir = @psdir@
82+
libdir = @libdir@
83+
lispdir = @lispdir@
84+
localedir = @localedir@
85+
mandir = @mandir@
86+
man1dir = @man1dir@
87+
man2dir = @man2dir@
88+
man3dir = @man3dir@
89+
man4dir = @man4dir@
90+
man5dir = @man5dir@
91+
man6dir = @man6dir@
92+
man7dir = @man7dir@
93+
man8dir = @man8dir@
10294

10395
# Package subdirectory
104-
pkglibexecdir = $(libexecdir)/$(PACKAGE)
105-
pkgdatadir = $(datadir)/$(PACKAGE)
106-
pkgsysconfdir = $(sysconfdir)/$(PACKAGE)
107-
pkglocalstatedir = $(localstatedir)/$(PACKAGE)
108-
pkgincludedir = $(includedir)/$(PACKAGE)
109-
pkglibdir = $(libdir)/$(PACKAGE)
96+
pkglibexecdir = @pkglibexecdir@
97+
pkgdatadir = @pkgdatadir@
98+
pkgsysconfdir = @pkgsysconfdir@
99+
pkglocalstatedir = @pkglocalstatedir@
100+
pkgincludedir = @pkgincludedir@
101+
pkglibdir = @pkglibdir@
110102

111103

112104
##
@@ -280,9 +272,10 @@ distcheck: dist
280272
builddir="`pwd`/_build"; \
281273
mkdir "$$builddir"; \
282274
cd "$$builddir"; \
283-
../configure; \
275+
../configure --prefix="$$installdir"; \
284276
$(MAKE) check; \
285-
$(MAKE) installcheck prefix="$$installdir"; \
277+
$(MAKE) installcheck; \
278+
../configure; \
286279
$(MAKE) install DESTDIR="$$destdir"; \
287280
$(MAKE) dist; \
288281
$(MAKE) distcleancheck;

configure

Lines changed: 144 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,105 @@ $1
2626
EOF
2727
}
2828

29+
expand_args ()
30+
{
31+
while test $# -gt 0; do
32+
if expr "$1" : '[a-zA-Z0-9_-]*=.*' > /dev/null; then
33+
var=`expr "$1" : '-*\(.*\)=.*'`
34+
value=`expr "$1" : '.*=\(.*\)' | sed -e s,'\\\\','\\\\\\\\\\\\\\\\',g`
35+
eval ${var}='${value}'
36+
fi;
37+
shift;
38+
done;
39+
}
40+
41+
# For building and installation should not use any utilities directly except
42+
# these:
43+
#
44+
# awk cat cmp cp diff echo egrep expr false grep install-info ln ls
45+
# mkdir mv printf pwd rm rmdir sed sleep sort tar test touch tr true
46+
#
47+
# Compression programs such as `gzip` can be used in the `dist` rule.
48+
#
49+
# Others programs should used via `make` variables so that the user can
50+
# substitute alternatives.
51+
INSTALL='install'
52+
INSTALL_PROGRAM='$(INSTALL)'
53+
INSTALL_DATA='$(INSTALL) -m 644'
54+
PYTHON='python'
55+
PYTHONFLAGS=''
56+
CYGPATH_W='cygpath -m 2>/dev/null'
57+
GPG='gpg'
58+
59+
# These first two variables set the root for the installation. All the other
60+
# installation directories should be subdirectories of one of these two, and
61+
# nothing should be directly installed into these two directories.
62+
prefix='/usr/local'
63+
exec_prefix='$(prefix)'
64+
65+
# Executable programs are installed in one of the following directories.
66+
bindir='$(exec_prefix)/bin'
67+
sbindir='$(exec_prefix)/sbin'
68+
libexecdir='$(exec_prefix)/libexec'
69+
70+
# Data files used by the program during its execution.
71+
datarootdir='$(prefix)/share'
72+
datadir='$(datarootdir)'
73+
sysconfdir='$(prefix)/etc'
74+
sharedstatedir='$(prefix)/com'
75+
localstatedir='$(prefix)/var'
76+
runstatedir='$(localstatedir)/run'
77+
78+
# Directory for installing certain specific types of files.
79+
includedir='$(prefix)/include'
80+
oldincludedir=''
81+
docdir='$(datarootdir)/doc/$(PACKAGE)'
82+
infodir='$(datarootdir)/info'
83+
htmldir='$(docdir)'
84+
dvidir='$(docdir)'
85+
pdfdir='$(docdir)'
86+
psdir='$(docdir)'
87+
libdir='$(exec_prefix)/lib'
88+
lispdir='$(datarootdir)/emacs/site-lisp'
89+
localedir='$(datarootdir)/locale'
90+
mandir='$(datarootdir)/man'
91+
man1dir='$(mandir)/man1'
92+
man2dir='$(mandir)/man2'
93+
man3dir='$(mandir)/man3'
94+
man4dir='$(mandir)/man4'
95+
man5dir='$(mandir)/man5'
96+
man6dir='$(mandir)/man6'
97+
man7dir='$(mandir)/man7'
98+
man8dir='$(mandir)/man8'
99+
100+
# Package subdirectory
101+
pkglibexecdir='$(libexecdir)/$(PACKAGE)'
102+
pkgdatadir='$(datadir)/$(PACKAGE)'
103+
pkgsysconfdir='$(sysconfdir)/$(PACKAGE)'
104+
pkglocalstatedir='$(localstatedir)/$(PACKAGE)'
105+
pkgincludedir='$(includedir)/$(PACKAGE)'
106+
pkglibdir='$(libdir)/$(PACKAGE)'
107+
108+
109+
expand_args $@
110+
111+
# checks for programs
112+
113+
# Checks whether the path for python need to be translated into Windows path
114+
# If PYTHON platform is not Windows then set to and simple `echo`
115+
# else use cygpath if it's available
116+
# To use it with python all backslash space must be replaced by a space
117+
PYTHON_PLATFORM=`${PYTHON} -c 'import sys; sys.stdout.write(sys.platform)'`
118+
if expr "${PYTHON_PLATFORM}" : 'win.*' > /dev/null; then :; else
119+
CYGPATH_W=false
120+
fi
121+
if `${CYGPATH_W} --version >/dev/null 2>/dev/null`; then :; else
122+
CYGPATH_W='cygpath_w() { echo $$1 | tr \\\\\\\\ / ;}; cygpath_w'
123+
fi
124+
125+
126+
# output
127+
29128
__DIR__=`dirname "$0"`
30129

31130
files='
@@ -73,6 +172,50 @@ EOF
73172
-e s,'@'top_builddir'@',"${top_builddir}",g \
74173
-e s,'@'SHELL'@','/bin/sh',g \
75174
-e s,'@'SHELLFLAGS'@','-e',g \
175+
-e s,'@'INSTALL'@',"${INSTALL}",g \
176+
-e s,'@'INSTALL_PROGRAM'@',"${INSTALL_PROGRAM}",g \
177+
-e s,'@'INSTALL_DATA'@',"${INSTALL_DATA}",g \
178+
-e s,'@'PYTHON'@',"${PYTHON}",g \
179+
-e s,'@'PYTHONFLAGS'@',"${PYTHONFLAGS}",g \
180+
-e s,'@'CYGPATH_W'@',"${CYGPATH_W}",g \
181+
-e s,'@'GPG'@',"${GPG}",g \
182+
-e s,'@'prefix'@',"${prefix}",g \
183+
-e s,'@'exec_prefix'@',"${exec_prefix}",g \
184+
-e s,'@'bindir'@',"${bindir}",g \
185+
-e s,'@'sbindir'@',"${sbindir}",g \
186+
-e s,'@'libexecdir'@',"${libexecdir}",g \
187+
-e s,'@'datarootdir'@',"${datarootdir}",g \
188+
-e s,'@'datadir'@',"${datadir}",g \
189+
-e s,'@'sysconfdir'@',"${sysconfdir}",g \
190+
-e s,'@'sharedstatedir'@',"${sharedstatedir}",g \
191+
-e s,'@'localstatedir'@',"${localstatedir}",g \
192+
-e s,'@'runstatedir'@',"${runstatedir}",g \
193+
-e s,'@'includedir'@',"${includedir}",g \
194+
-e s,'@'oldincludedir'@',"${oldincludedir}",g \
195+
-e s,'@'docdir'@',"${docdir}",g \
196+
-e s,'@'infodir'@',"${infodir}",g \
197+
-e s,'@'htmldir'@',"${htmldir}",g \
198+
-e s,'@'dvidir'@',"${dvidir}",g \
199+
-e s,'@'pdfdir'@',"${pdfdir}",g \
200+
-e s,'@'psdir'@',"${psdir}",g \
201+
-e s,'@'libdir'@',"${libdir}",g \
202+
-e s,'@'lispdir'@',"${lispdir}",g \
203+
-e s,'@'localedir'@',"${localedir}",g \
204+
-e s,'@'mandir'@',"${mandir}",g \
205+
-e s,'@'man1dir'@',"${man1dir}",g \
206+
-e s,'@'man2dir'@',"${man2dir}",g \
207+
-e s,'@'man3dir'@',"${man3dir}",g \
208+
-e s,'@'man4dir'@',"${man4dir}",g \
209+
-e s,'@'man5dir'@',"${man5dir}",g \
210+
-e s,'@'man6dir'@',"${man6dir}",g \
211+
-e s,'@'man7dir'@',"${man7dir}",g \
212+
-e s,'@'man8dir'@',"${man8dir}",g \
213+
-e s,'@'pkglibexecdir'@',"${pkglibexecdir}",g \
214+
-e s,'@'pkgdatadir'@',"${pkgdatadir}",g \
215+
-e s,'@'pkgsysconfdir'@',"${pkgsysconfdir}",g \
216+
-e s,'@'pkglocalstatedir'@',"${pkglocalstatedir}",g \
217+
-e s,'@'pkgincludedir'@',"${pkgincludedir}",g \
218+
-e s,'@'pkglibdir'@',"${pkglibdir}",g \
76219
> "${file}";
77220
done;
78221
@@ -89,7 +232,7 @@ EOF
89232
cat > "${status_file}" <<EOF
90233
#!/bin/sh
91234
92-
$0
235+
$0 $@
93236
EOF
94237
95238
chmod +x "${status_file}"

0 commit comments

Comments
 (0)