-
Notifications
You must be signed in to change notification settings - Fork 7
/
configure.ac
147 lines (132 loc) · 3.94 KB
/
configure.ac
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
147
dnl Autoconf configure script for insight, the GNU debugger GUI.
dnl Copyright (C) 1995-2015 Free Software Foundation, Inc.
dnl
dnl This file is part of GDB.
dnl
dnl This program is free software; you can redistribute it and/or modify
dnl it under the terms of the GNU General Public License as published by
dnl the Free Software Foundation; either version 2 of the License, or
dnl (at your option) any later version.
dnl
dnl This program is distributed in the hope that it will be useful,
dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
dnl GNU General Public License for more details.
dnl
dnl You should have received a copy of the GNU General Public License
dnl along with this program. If not, see <http://www.gnu.org/licenses/>.
dnl Process this file with autoconf to produce a configure script.
AC_PREREQ(2.59) dnl
AC_INIT([insight], [1.0]) dnl
dnl Export original configure arguments for use by sub-configures.
dnl Quote arguments with shell meta charatcers.
CONFARGS=
for ac_arg
do
case "$ac_arg" in
*" "*|*" "*|*[[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\']]*)
ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"`
# if the argument is of the form -foo=baz, quote the baz part only
ac_arg=`echo "'$ac_arg'" | sed "s/^'\([[-a-zA-Z0-9_]]*=\)/\\1'/"` ;;
*) ;;
esac
dnl Add the quoted argument to the list.
CONFARGS="$CONFARGS $ac_arg"
done
if test "$silent" = yes; then
CONFARGS="$CONFARGS --silent"
fi
AC_CONFIG_AUX_DIRS(binutils-gdb) dnl
AC_CANONICAL_SYSTEM dnl
AC_DISABLE_OPTION_CHECKING dnl
AC_CONFIG_SRCDIR([gdbtk/generic/gdbtk.c]) dnl
AC_CONFIG_MACRO_DIR([binutils-gdb/config])
CONFARGS="${CONFARGS} --enable-gdbtk"
dnl Remove the initial space we introduced and, as these will be
dnl expanded by make, quote '$'.
CONFARGS=`echo "x$CONFARGS" |
sed -e 's/^x *//' -e 's,\\$,$$,g'`
dnl Build the bundle directory.
if test -d bundle
then chmod -R u+w bundle
else mkdir bundle
fi
dnl Was "cp -a -T binutils-gdb bundle", but the following tar-based tree copy
dnl is much faster on MinGW.
(cd binutils-gdb; tar cf - *) | (cd bundle; tar xpf - --same-owner)
cp -a gdbtk bundle/gdb/
cp -a testsuite bundle/gdb/
cp -a libgui bundle/
dnl Apply patches
for patchfile in patches/*/*.patch
do patchdir=`basename \`dirname "${patchfile}"\``
test "${patchdir}" = binutils-gdb && patchdir=.
test -d "bundle/${patchdir}" && (
echo "Applying patch ${patchfile}"
cd "bundle/${patchdir}"
patch --no-backup-if-mismatch -p1
) < "${patchfile}"
done
dnl Configure files
for infn in `cd patches; find . -name '*.in'`
do outfn=`echo "${infn}" |
sed -e 's#^\./##' -e 's/\.in$//' -e 's#^binutils-gdb/##'`
if test -d bundle/`dirname "${outfn}"`
then AC_CONFIG_FILES([bundle/${outfn}:patches/${infn}]) dnl
fi
done
dnl Since the binutils-gdb configure files have to be regenerated, we define
dnl the autoconf version to use here.
sed -i -e '[/m4\_define(\[_GCC_AUTOCONF_VERSION\],/s/, \[[a-zA-Z0-9._-]*\]/, m4\_PACKAGE_VERSION)/]' bundle/config/override.m4
dnl Now regenerate the configure files
(
cd bundle
echo "Regenerate `pwd`"
autogen Makefile.def
autoconf --force
)
(
cd bundle/gdb
echo "Regenerate `pwd`"
aclocal -I . -I ../config
autoconf --force
)
(
cd bundle/gdb/gnulib
echo "Regenerate `pwd`"
aclocal -I . -I import/m4 -I ../../config
automake
autoconf --force
)
(
cd bundle/gdb/gdbtk
echo "Regenerate `pwd`"
aclocal -I . -I ../../config
automake
autoconf --force
)
(
cd bundle/gdb/gdbtk/plugins
echo "Regenerate `pwd`"
aclocal -I . -I ../../../config
automake
autoconf --force
)
(
cd bundle/libgui
echo "Regenerate `pwd`"
aclocal -I . -I ../config
# autoheader
automake
autoconf --force
)
(
cd bundle/gdb/testsuite/gdb.gdbtk
echo "Regenerate `pwd`"
aclocal -I . -I ../../../config
autoconf --force
)
dnl Prepare to configure in the bundle directory.
AC_CONFIG_COMMANDS([config_bundle],
[(cd bundle; ./configure ${CONFARGS}; )],[CONFARGS="${CONFARGS}"]) dnl
AC_OUTPUT dnl