1 |
330 |
jeremybenn |
#!/bin/sh
|
2 |
|
|
#
|
3 |
|
|
# This shell script is a wrapper to the main configure script when
|
4 |
|
|
# configuring GDB for DJGPP. 99% of it can also be used when
|
5 |
|
|
# configuring other GNU programs for DJGPP.
|
6 |
|
|
#
|
7 |
|
|
#=====================================================================
|
8 |
|
|
# Copyright 1997,1999,2000,2001,2002,2003,2005,2007,2008,2009,2010
|
9 |
|
|
# Free Software Foundation, Inc.
|
10 |
|
|
#
|
11 |
|
|
# Originally written by Robert Hoehne, revised by Eli Zaretskii.
|
12 |
|
|
# This file is part of GDB.
|
13 |
|
|
#
|
14 |
|
|
# This program is free software; you can redistribute it and/or modify
|
15 |
|
|
# it under the terms of the GNU General Public License as published by
|
16 |
|
|
# the Free Software Foundation; either version 3 of the License, or
|
17 |
|
|
# (at your option) any later version.
|
18 |
|
|
#
|
19 |
|
|
# This program is distributed in the hope that it will be useful,
|
20 |
|
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
21 |
|
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
22 |
|
|
# GNU General Public License for more details.
|
23 |
|
|
#
|
24 |
|
|
# You should have received a copy of the GNU General Public License
|
25 |
|
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
26 |
|
|
#=====================================================================
|
27 |
|
|
#
|
28 |
|
|
# Call this script like the main configure script with one exception. If you
|
29 |
|
|
# want to pass parameters to configure, you have to pass as the first
|
30 |
|
|
# argument the srcdir, even when it is `.' !!!!!
|
31 |
|
|
#
|
32 |
|
|
# First, undo any CDPATH settings; they will get in our way when we
|
33 |
|
|
# chdir to directories.
|
34 |
|
|
unset CDPATH
|
35 |
|
|
|
36 |
|
|
# Where are the sources? If you are used to having the sources
|
37 |
|
|
# in a separate directory and the objects in another, then set
|
38 |
|
|
# here the full path to the source directory and run this script
|
39 |
|
|
# in the directory where you want to build gdb!!
|
40 |
|
|
# You might give the source directory on commandline, but use
|
41 |
|
|
# then only forward slashes (/) in the directories. It should be
|
42 |
|
|
# an absolute path.
|
43 |
|
|
|
44 |
|
|
if [ x$1 = x ]; then
|
45 |
|
|
srcdir=`pwd`
|
46 |
|
|
else
|
47 |
|
|
srcdir=`cd $1 && pwd`
|
48 |
|
|
shift
|
49 |
|
|
fi
|
50 |
|
|
|
51 |
|
|
# Make sure they don't have some file names mangled by untarring.
|
52 |
|
|
echo -n "Checking the unpacked distribution..."
|
53 |
|
|
if ( ! test -f ${srcdir}/bfd/ChangeLog.0203 || \
|
54 |
|
|
! test -f ${srcdir}/gdb/ChangeLog.002 || \
|
55 |
|
|
! test -f ${srcdir}/opcodes/ChangeLog.0203 || \
|
56 |
|
|
! test -f ${srcdir}/readline/config.h-in ) ; then
|
57 |
|
|
if ( ! test -f ${srcdir}/bfd/ChangeLog.0203 ) ; then
|
58 |
|
|
notfound=${srcdir}/bfd/ChangeLog.0203
|
59 |
|
|
else
|
60 |
|
|
if ( ! test -f ${srcdir}/gdb/ChangeLog.002) ; then
|
61 |
|
|
notfound=${srcdir}/gdb/ChangeLog.002
|
62 |
|
|
else
|
63 |
|
|
if ( ! test -f ${srcdir}/readline/config.h-in ) ; then
|
64 |
|
|
notfound=${srcdir}/readline/config.h-in
|
65 |
|
|
else
|
66 |
|
|
if ( ! test -f ${srcdir}/opcodes/ChangeLog.0203 ) ; then
|
67 |
|
|
notfound=${srcdir}/opcodes/ChangeLog.0203
|
68 |
|
|
fi
|
69 |
|
|
fi
|
70 |
|
|
fi
|
71 |
|
|
fi
|
72 |
|
|
echo " FAILED."
|
73 |
|
|
echo "(File $notfound was not found.)"
|
74 |
|
|
echo ""
|
75 |
|
|
echo "You MUST unpack the sources with the DJTAR command, like this:"
|
76 |
|
|
echo ""
|
77 |
|
|
echo " djtar -x -n fnchange.lst gdb-X.YZ.tar.gz"
|
78 |
|
|
echo ""
|
79 |
|
|
echo "where X.YZ is the GDB version, and fnchange.lst can be found"
|
80 |
|
|
echo "in the gdb/config/djgpp/ directory in the GDB distribution."
|
81 |
|
|
echo ""
|
82 |
|
|
echo "configure FAILED!"
|
83 |
|
|
exit 1
|
84 |
|
|
else
|
85 |
|
|
echo " ok."
|
86 |
|
|
fi
|
87 |
|
|
|
88 |
|
|
# Where is the directory with DJGPP-specific scripts?
|
89 |
|
|
DJGPPDIR=${srcdir}/gdb/config/djgpp
|
90 |
|
|
|
91 |
|
|
echo "Editing configure scripts for DJGPP..."
|
92 |
|
|
TMPFILE="${TMPDIR-.}/cfg.tmp"
|
93 |
|
|
|
94 |
|
|
# We need to skip the build directory if it is a subdirectory of $srcdir,
|
95 |
|
|
# otherwise we will have an infinite recursion on our hands...
|
96 |
|
|
if test "`pwd`" == "${srcdir}" ; then
|
97 |
|
|
SKIPDIR=""
|
98 |
|
|
SKIPFILES=""
|
99 |
|
|
else
|
100 |
|
|
SKIPDIR=`pwd | sed -e "s|${srcdir}|.|"`
|
101 |
|
|
SKIPFILES="${SKIPDIR}/*"
|
102 |
|
|
fi
|
103 |
|
|
|
104 |
|
|
# We use explicit /dev/env/DJDIR/bin/find to avoid catching
|
105 |
|
|
# an incompatible DOS/Windows version that might be on their PATH.
|
106 |
|
|
for fix_dir in \
|
107 |
|
|
`cd $srcdir && /dev/env/DJDIR/bin/find . -type d ! -ipath "${SKIPDIR}" ! -ipath "${SKIPFILES}"`
|
108 |
|
|
do
|
109 |
|
|
if test ! -f ${fix_dir}/configure.orig ; then
|
110 |
|
|
if test -f ${srcdir}/${fix_dir}/configure ; then
|
111 |
|
|
mkdir -p ${fix_dir}
|
112 |
|
|
cp -p ${srcdir}/${fix_dir}/configure ${fix_dir}/configure.orig
|
113 |
|
|
fi
|
114 |
|
|
fi
|
115 |
|
|
if test -f ${fix_dir}/configure.orig ; then
|
116 |
|
|
sed -f ${DJGPPDIR}/config.sed ${fix_dir}/configure.orig > $TMPFILE
|
117 |
|
|
update $TMPFILE ${fix_dir}/configure
|
118 |
|
|
touch ./${fix_dir}/configure -r ${fix_dir}/configure.orig
|
119 |
|
|
rm -f $TMPFILE
|
120 |
|
|
fi
|
121 |
|
|
if test -f ${fix_dir}/INSTALL ; then
|
122 |
|
|
mv ${fix_dir}/INSTALL ${fix_dir}/INSTALL.txt
|
123 |
|
|
fi
|
124 |
|
|
done
|
125 |
|
|
|
126 |
|
|
# Now set the config shell. It is really needed, that the shell
|
127 |
|
|
# points to a shell with full path and also it must conatain the
|
128 |
|
|
# .exe suffix. I assume here, that bash is installed. If not,
|
129 |
|
|
# install it. Additionally, the pathname must not contain a
|
130 |
|
|
# drive letter, so use the /dev/x/foo format supported by versions
|
131 |
|
|
# of Bash 2.03 and later, and by all DJGPP programs compiled with
|
132 |
|
|
# v2.03 (or later) library.
|
133 |
|
|
export CONFIG_SHELL=/dev/env/DJDIR/bin/sh.exe
|
134 |
|
|
|
135 |
|
|
# force to have the ltmain.sh script to be in DOS text format,
|
136 |
|
|
# otherwise the resulting ltconfig script will have mixed
|
137 |
|
|
# (UNIX/DOS) format and is unusable with Bash ports before v2.03.
|
138 |
|
|
utod $srcdir/ltmain.sh
|
139 |
|
|
|
140 |
|
|
# Give the configure script some hints:
|
141 |
|
|
export LD=ld
|
142 |
|
|
export NM=nm
|
143 |
|
|
export CC=gcc
|
144 |
|
|
export CXX=gpp
|
145 |
|
|
export CFLAGS="-O2 -ggdb -g3"
|
146 |
|
|
export RANLIB=ranlib
|
147 |
|
|
export DEFAULT_YACC="bison -y"
|
148 |
|
|
export YACC="bison -y"
|
149 |
|
|
export DEFAULT_LEX=flex
|
150 |
|
|
export PATH_SEPARATOR=';'
|
151 |
|
|
# Define explicitly the .exe extension because on W95 with LFN=y
|
152 |
|
|
# the check might fail
|
153 |
|
|
export am_cv_exeext=.exe
|
154 |
|
|
# ltconfig wants to compute the maximum command-line length, but
|
155 |
|
|
# Bash 2.04 doesn't like that (it doesn't have any limit ;-), and
|
156 |
|
|
# reboots the system. We know our limit in advance, so we don't
|
157 |
|
|
# need all that crap. Assuming that the environment size is less
|
158 |
|
|
# than 4KB, we can afford 12KB of command-line arguments.
|
159 |
|
|
export lt_cv_sys_max_cmd_len=12288
|
160 |
|
|
# Force depcomp to use _deps rather than .deps as the name of the
|
161 |
|
|
# subdirectory where the *.Po dependency files are put. File names
|
162 |
|
|
# with leading dots are invalid on DOS 8+3 filesystems.
|
163 |
|
|
export DEPDIR=${DEPDIR:-_deps}
|
164 |
|
|
|
165 |
|
|
# The configure script needs to see the `install-sh' script, otherwise
|
166 |
|
|
# it decides the source installation is broken. But "make install" will
|
167 |
|
|
# fail on 8+3 filesystems if it finds a file `install-', since there
|
168 |
|
|
# are numerous "install-foo" targets in Makefile's. So we rename the
|
169 |
|
|
# offending file after the configure step is done.
|
170 |
|
|
if test ! -f ${srcdir}/install-sh ; then
|
171 |
|
|
if test -f ${srcdir}/install-.sh ; then
|
172 |
|
|
mv ${srcdir}/install-.sh ${srcdir}/install-sh
|
173 |
|
|
fi
|
174 |
|
|
fi
|
175 |
|
|
|
176 |
|
|
# Now run the configure script while disabling some things like the NLS
|
177 |
|
|
# support, which is nearly impossible to be supported in the current way,
|
178 |
|
|
# since it relies on file names which will never work on DOS.
|
179 |
|
|
echo "Running the configure script..."
|
180 |
|
|
$srcdir/configure --srcdir="$srcdir" --prefix='${DJDIR}' \
|
181 |
|
|
--disable-shared --disable-nls --verbose --enable-build-warnings=\
|
182 |
|
|
-Wimplicit,-Wcomment,-Wformat,-Wparentheses,-Wpointer-arith,-Wuninitialized $*
|
183 |
|
|
|
184 |
|
|
if test -f ${srcdir}/install- ; then
|
185 |
|
|
mv ${srcdir}/install- ${srcdir}/install-.sh
|
186 |
|
|
fi
|