File: makesubst

package info (click to toggle)
leafnode 1.11.7.rc1-10~lenny0
  • links: PTS
  • area: main
  • in suites: lenny
  • size: 2,436 kB
  • ctags: 577
  • sloc: ansic: 10,637; sh: 4,107; xml: 650; makefile: 281; perl: 84; sed: 4
file content (68 lines) | stat: -rwxr-xr-x 1,645 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
#! /bin/sh

# (c) Andreas Barth <aba@muenchen.pro-bahn.de> 1999
# Dieses Programm ermglicht "von Hand" die configure-nderungen zu machen
# und steht unter der GPL
#
# taken from unix-connect-0.94 and hacked up for leafnode
# by  Ralf Wildenhues <ralf.wildenhues@gmx.de> 2002
# and Matthias Andree <matthias.andree@gmx.de> 2002
#
# This is subject to the GPL (as stated above in german) and does the
# substitutions done by configure (actually, recent autoconf versions do not
# replace everything until build time;  the built script does build time
# replacement.  DO NOT reorder the SUBSTNAMES unless you know what you are
# doing!
#
# Tries to extract some configure substitutions from $CONFIGURE_AC and
# is not very intelligent about its syntax.  Maybe better use autoconf -t ..

if test $# -ne 1
then
	echo >&2 "usage: $0 configure.ac"
	exit 1
fi

CONFIGURE_AC="$1"
SUBSTNAMES="VERSION
CPPFLAGS
DEFS
LIBS
prefix
exec_prefix
datarootdir
program_transform_name
bindir
sbindir
libexecdir
datadir
sysconfdir
sharedstatedir
localstatedir
libdir
includedir
oldincludedir
infodir
mandir
CC
RANLIB
AWK
"

AUTOSUBSTNAMES=`egrep '^[ ]*AC_SUBST|^[ ]*AC_CHECK_PROGS|^[ ]*AC_PATH_PROG(S)?' $CONFIGURE_AC | \
		sed 's/^[ 	]*\(AC_.*([^,]*\),.*/\1)/; s/^[ ]*AC_.*(\(.*\))/\1/; s/^\[\(.*\)\]/\1/; s/^[ 	]*\(.*\)[ 	]*/\1/;'`

echo "#! /bin/sh"
echo "# generated automatically by makesubst -- do not edit"
echo
echo "configure_input=\"DO NOT EDIT -- generated automatically by subst\""
for n in $SUBSTNAMES $AUTOSUBSTNAMES
do
	echo "$n=\"@$n@\""
done
echo sed \"
for n in configure_input $SUBSTNAMES $AUTOSUBSTNAMES
do
	echo "s%[@]$n@%\$$n%g;"
done
echo \"