|
26 | 26 | EOF |
27 | 27 | } |
28 | 28 |
|
| 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 | + |
29 | 128 | __DIR__=`dirname "$0"` |
30 | 129 |
|
31 | 130 | files=' |
|
73 | 172 | -e s,'@'top_builddir'@',"${top_builddir}",g \ |
74 | 173 | -e s,'@'SHELL'@','/bin/sh',g \ |
75 | 174 | -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 \ |
76 | 219 | > "${file}"; |
77 | 220 | done; |
78 | 221 |
|
|
89 | 232 | cat > "${status_file}" <<EOF |
90 | 233 | #!/bin/sh |
91 | 234 |
|
92 | | -$0 |
| 235 | +$0 $@ |
93 | 236 | EOF |
94 | 237 |
|
95 | 238 | chmod +x "${status_file}" |
|
0 commit comments