Skip to content

Commit

Permalink
Added sets variables only to the configure script except DESTDIR
Browse files Browse the repository at this point in the history
  • Loading branch information
alquerci committed Oct 6, 2014
1 parent 9cc2312 commit d6187da
Show file tree
Hide file tree
Showing 2 changed files with 215 additions and 80 deletions.
150 changes: 71 additions & 79 deletions bootstrap.mk.in
Original file line number Diff line number Diff line change
Expand Up @@ -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
override INSTALL = @INSTALL@
override INSTALL_PROGRAM = @INSTALL_PROGRAM@
override 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
override PYTHON = @PYTHON@
override PYTHONFLAGS = @PYTHONFLAGS@

override CYGPATH_W = @CYGPATH_W@
override GPG = @GPG@

##
# Directories
Expand All @@ -62,76 +54,76 @@ 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)
override prefix = @prefix@
override 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
override bindir = @bindir@
override sbindir = @sbindir@
override 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
override datarootdir = @datarootdir@
override datadir = @datadir@
override sysconfdir = @sysconfdir@
override sharedstatedir = @sharedstatedir@
override localstatedir = @localstatedir@
override 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
override includedir = @includedir@
override oldincludedir = @oldincludedir@
override docdir = @docdir@
override infodir = @infodir@
override htmldir = @htmldir@
override dvidir = @dvidir@
override pdfdir = @pdfdir@
override psdir = @psdir@
override libdir = @libdir@
override lispdir = @lispdir@
override localedir = @localedir@
override mandir = @mandir@
override man1dir = @man1dir@
override man2dir = @man2dir@
override man3dir = @man3dir@
override man4dir = @man4dir@
override man5dir = @man5dir@
override man6dir = @man6dir@
override man7dir = @man7dir@
override man8dir = @man8dir@

# Package subdirectory
pkglibexecdir = $(libexecdir)/$(PACKAGE)
pkgdatadir = $(datadir)/$(PACKAGE)
pkgsysconfdir = $(sysconfdir)/$(PACKAGE)
pkglocalstatedir = $(localstatedir)/$(PACKAGE)
pkgincludedir = $(includedir)/$(PACKAGE)
pkglibdir = $(libdir)/$(PACKAGE)
override pkglibexecdir = @pkglibexecdir@
override pkgdatadir = @pkgdatadir@
override pkgsysconfdir = @pkgsysconfdir@
override pkglocalstatedir = @pkglocalstatedir@
override pkgincludedir = @pkgincludedir@
override pkglibdir = @pkglibdir@


##
# Extensions file.
##
manext = .1
man1ext = $(manext)
man2ext = .2
man3ext = .3
man4ext = .4
man5ext = .5
man6ext = .6
man7ext = .7
man8ext = .8
override manext = .1
override man1ext = $(manext)
override man2ext = .2
override man3ext = .3
override man4ext = .4
override man5ext = .5
override man6ext = .6
override man7ext = .7
override man8ext = .8

tarext = .tar
override tarext = .tar


##
# Package configuration
##
PACKAGE = cyg-apt
override PACKAGE = cyg-apt

VERSION_FILE = $(top_srcdir)/VERSION-FILE~
VERSION = 1.1.0rc1
override VERSION_FILE = $(top_srcdir)/VERSION-FILE~
override VERSION = 1.1.0rc1
$(VERSION_FILE): FORCE
@cd $(top_srcdir) \
&& export VERSION='$(VERSION)' \
Expand All @@ -141,20 +133,20 @@ $(VERSION_FILE): FORCE
-include $(VERSION_FILE)

distdir = $(PACKAGE)-$(VERSION)
DIST_ARCHIVE = $(builddir)/$(subst /,-,$(distdir))$(tarext)
SUB_DIST_ARCHIVES = $(shell $(fn_get_sub_dist_archives))
DIST_ARCHIVES = $(DIST_ARCHIVE)
override DIST_ARCHIVE = $(builddir)/$(subst /,-,$(distdir))$(tarext)
override SUB_DIST_ARCHIVES = $(shell $(fn_get_sub_dist_archives))
override DIST_ARCHIVES = $(DIST_ARCHIVE)

MOSTLYCLEAN_FILES =
CLEAN_FILES = $(MOSTLYCLEAN_FILES)
DISTCLEAN_FILES = $(CLEAN_FILES) \
override MOSTLYCLEAN_FILES =
override CLEAN_FILES = $(MOSTLYCLEAN_FILES)
override DISTCLEAN_FILES = $(CLEAN_FILES) \
$(TOP_DISTCLEAN_FILES) \
$(builddir)/Makefile
TOP_DISTCLEAN_FILES = $(top_builddir)/bootstrap.mk \
$(DIST_ARCHIVES) \
$(top_builddir)/config.status \
$(VERSION_FILE)
MAINTAINER_CLEAN_FILES = $(DISTCLEAN_FILES)
override MAINTAINER_CLEAN_FILES = $(DISTCLEAN_FILES)

##
# Standard targets for users.
Expand Down Expand Up @@ -208,14 +200,14 @@ fn_top_pre_dist = \
exit 1; \
} >&2

fn_pre_dist = \
override fn_pre_dist = \
@$(fn_top_pre_dist); \
echo 'rm -f $(DIST_ARCHIVE)'; \
rm -f '$(DIST_ARCHIVE)'

fn_append_files_to_dist_archive = tar -C $$dir -rf '$(DIST_ARCHIVE)' --transform s,'^','$(distdir)/',
override fn_append_files_to_dist_archive = tar -C $$dir -rf '$(DIST_ARCHIVE)' --transform s,'^','$(distdir)/',

fn_post_dist = \
override fn_post_dist = \
@echo 'dir="$(srcdir)" && $(fn_append_files_to_dist_archive)'; \
echo ' Makefile.in'; \
dir='$(srcdir)' && $(fn_append_files_to_dist_archive) \
Expand Down Expand Up @@ -253,12 +245,12 @@ fn_finalize_top_dist_archive = \
done; \
} | $(fn_titlelize)

fn_get_sub_dist_archives = \
override fn_get_sub_dist_archives = \
for subdir in $(subdirs); do \
echo $$subdir/$(subst /,-,$(distdir))-$$subdir$(tarext); \
done

fn_titlelize = { sed -e 1h -e 1s/./=/g -e 1p -e 1x -e '$$p' -e '$$x'; }
override fn_titlelize = { sed -e 1h -e 1s/./=/g -e 1p -e 1x -e '$$p' -e '$$x'; }

%-recursive: FORCE
@target='$(subst -recursive,,$@)'; \
Expand All @@ -280,9 +272,9 @@ distcheck: dist
builddir="`pwd`/_build"; \
mkdir "$$builddir"; \
cd "$$builddir"; \
../configure; \
../configure --prefix="$$installdir"; \
$(MAKE) check; \
$(MAKE) installcheck prefix="$$installdir"; \
$(MAKE) installcheck; \
$(MAKE) install DESTDIR="$$destdir"; \
$(MAKE) dist; \
$(MAKE) distcleancheck;
Expand Down
145 changes: 144 additions & 1 deletion configure
Original file line number Diff line number Diff line change
Expand Up @@ -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='
Expand Down Expand Up @@ -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;
Expand All @@ -89,7 +232,7 @@ EOF
cat > "${status_file}" <<EOF
#!/bin/sh
$0
$0 $@
EOF
chmod +x "${status_file}"
Expand Down

0 comments on commit d6187da

Please sign in to comment.