forked from AreaScout/vice
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathautogen.sh
executable file
·146 lines (117 loc) · 3.08 KB
/
autogen.sh
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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
#! /bin/sh
#
# autogen.sh - generate the auto* files of VICE
#
# Written by
# Spiro Trikaliotis <[email protected]>
# Marco van den Heuvel <[email protected]>
#
# This file is part of VICE, the Versatile Commodore Emulator.
# See README for copyright notice.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
# 02111-1307 USA.
#
generate_configure_in() {
# $1 - major automake version
# $2 - minor automake version
# $3 - build
configure_needs_ac=no
if [ $1 -gt 1 ]; then
configure_needs_ac=yes
else
if [ $2 -gt 12 ]; then
configure_needs_ac=yes
fi
fi
if test x"$configure_needs_ac" = "xyes"; then
sed s/AM_CONFIG_HEADER/AC_CONFIG_HEADERS/g <configure.proto >configure.ac
else
cp configure.proto configure.ac
fi
}
get_automake_version() {
# $1 - "automake"
# $2 - "(GNU"
# $3 - "Automake)"
# $4 - version
automake_version=$4
}
do_command() {
# $1 - command
# $2 - options
echo `pwd`: $1 $2
$1 $2 > .$1.out 2>&1
ret=$?
if [ ! $ret = 0 ] ; then
echo "ERROR: $1 failed in `pwd`"
exit 1
fi
}
do_aclocal() {
do_command aclocal
}
do_autoconf() {
do_command autoconf -f
}
do_autoheader() {
if [ -e configure.in ]; then
if [ ! x"`sed -ne "s/.*AM_CONFIG_HEADER\((.*)\).*/\1/p" configure.in`" = x ]; then
do_command autoheader
fi
else
do_command autoheader
fi
}
do_automake() {
do_command automake "-a -c" # " -f"
}
buildfiles() {
FILES_TO_REMEMBER="INSTALL"
# Save some files which should not be overwritten
for A in $FILES_TO_REMEMBER; do
[ -e $A ] && mv $A $A.backup
done
do_aclocal
do_autoconf
do_autoheader
do_automake
# Restore the files which should not be overwritten
for A in $FILES_TO_REMEMBER; do
[ -e $A ] && mv $A.backup $A
done
}
automake_line=`automake --version`
get_automake_version $automake_line
old_IFS=$IFS
IFS="."
generate_configure_in $automake_version
IFS=$old_IFS
SUBDIRECTORIES=`sed -ne "s/.*AC_CONFIG_SUBDIRS(\(.*\)).*/\1/p" configure.ac`
for A in $SUBDIRECTORIES; do
(
cd $A
buildfiles
)
done
buildfiles
if [ x"$1" = x"--dist" ]; then
./configure
(cd src/monitor/; make mon_lex.c mon_parse.c)
(cd po; make cat-id-tbl.c)
SVN_ADD_FILES="configure src/config.h.in config.guess config.sub src/monitor/mon_parse.c src/monitor/mon_parse.h src/monitor/mon_lex.c src/resid/depcomp src/resid/mkinstalldirs src/resid/missing src/resid/install-sh doc/texinfo.tex po/cat-id-tbl.c"
SVN_ADD_MAKEFILES="`find . -name Makefile.in`"
svn add $SVN_ADD_FILES $SVN_ADD_MAKEFILES
fi