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.
7 #=====================================================================
8 # Copyright 1997, 1999, 2000, 2001 Free Software Foundation, Inc.
10 # Originally written by Robert Hoehne, revised by Eli Zaretskii.
11 # This file is part of GDB.
13 # This program is free software; you can redistribute it and/or modify
14 # it under the terms of the GNU General Public License as published by
15 # the Free Software Foundation; either version 2 of the License, or
16 # (at your option) any later version.
18 # This program is distributed in the hope that it will be useful,
19 # but WITHOUT ANY WARRANTY; without even the implied warranty of
20 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 # GNU General Public License for more details.
23 # You should have received a copy of the GNU General Public License
24 # along with this program; if not, write to the Free Software
25 # Foundation, Inc., 59 Temple Place - Suite 330,
26 # Boston, MA 02111-1307, USA. */
27 #=====================================================================
29 # Call this script like the main configure script with one exception. If you
30 # want to pass parameters to configure, you have to pass as the first
31 # argument the srcdir, even when it is `.' !!!!!
33 # Where are the sources? If you are used to having the sources
34 # in a separate directory and the objects in another, then set
35 # here the full path to the source directory and run this script
36 # in the directory where you want to build gdb!!
37 # You might give the source directory on commandline, but use
38 # then only forward slashes (/) in the directories. It should be
48 # Make sure they don't have some file names mangled by untarring.
49 echo -n "Checking the unpacked distribution..."
50 if ( ! test -f ${srcdir}/intl/po2tblsed.in || \
51 ! test -d ${srcdir}/gdb/testsuite/gdb.cxx || \
52 ! test -f ${srcdir}/readline/config.h-in ) ; then
55 echo "You MUST unpack the sources with the DJTAR command, like this:"
57 echo " djtar -x -n fnchange.lst gdb-X.YZ.tar.gz"
59 echo "where X.YZ is the GDB version, and fnchange.lst can be found"
60 echo "in the gdb/config/djgpp/ directory in the GDB distribution."
61 echo "configure FAILED!"
67 # Where is the directory with DJGPP-specific scripts?
68 DJGPPDIR=${srcdir}/gdb/config/djgpp
70 echo "Editing configure scripts for DJGPP..."
71 TMPFILE="${TMPDIR-.}/cfg.tmp"
73 # We need to skip the build directory if it is a subdirectory of $srcdir,
74 # otherwise we will have an infinite recursion on our hands...
75 if test "`pwd`" == "${srcdir}" ; then
79 SKIPDIR=`pwd | sed -e "s|${srcdir}|.|"`
80 SKIPFILES="${SKIPDIR}/*"
83 # We use explicit /dev/env/DJDIR/bin/find to avoid catching
84 # an incompatible DOS/Windows version that might be on their PATH.
86 `cd $srcdir && /dev/env/DJDIR/bin/find . -type d ! -ipath "${SKIPDIR}" ! -ipath "${SKIPFILES}"`
88 if test ! -f ${fix_dir}/configure.orig ; then
89 if test -f ${srcdir}/${fix_dir}/configure ; then
91 cp -p ${srcdir}/${fix_dir}/configure ${fix_dir}/configure.orig
94 if test -f ${fix_dir}/configure.orig ; then
95 sed -f ${DJGPPDIR}/config.sed ${fix_dir}/configure.orig > $TMPFILE
96 update $TMPFILE ${fix_dir}/configure
97 touch ./${fix_dir}/configure -r ${fix_dir}/configure.orig
100 if test -f ${fix_dir}/INSTALL ; then
101 mv ${fix_dir}/INSTALL ${fix_dir}/INSTALL.txt
105 # Now set the config shell. It is really needed, that the shell
106 # points to a shell with full path and also it must conatain the
107 # .exe suffix. I assume here, that bash is installed. If not,
108 # install it. Additionally, the pathname must not contain a
109 # drive letter, so use the /dev/x/foo format supported by versions
110 # of Bash 2.03 and later, and by all DJGPP programs compiled with
111 # v2.03 (or later) library.
112 export CONFIG_SHELL=/dev/env/DJDIR/bin/sh.exe
114 # force to have the ltmain.sh script to be in DOS text format,
115 # otherwise the resulting ltconfig script will have mixed
116 # (UNIX/DOS) format and is unusable with Bash ports before v2.03.
117 utod $srcdir/ltmain.sh
119 # Give the configure script some hints:
123 export DEFAULT_YACC="bison -y"
124 export YACC="bison -y"
125 export DEFAULT_LEX=flex
126 # Define explicitly the .exe extension because on W95 with LFN=y
127 # the check might fail
128 export am_cv_exeext=.exe
130 # The configure script needs to see the `install-sh' script, otherwise
131 # it decides the source installation is broken. But "make install" will
132 # fail on 8+3 filesystems if it finds a file `install-', since there
133 # are numerous "install-foo" targets in Makefile's. So we rename the
134 # offending file after the configure step is done.
135 if test ! -f ${srcdir}/install-sh ; then
136 if test -f ${srcdir}/install-.sh ; then
137 mv ${srcdir}/install-.sh ${srcdir}/install-sh
141 # Now run the configure script while disabling some things like the NLS
142 # support, which is nearly impossible to be supported in the current way,
143 # since it relies on file names which will never work on DOS.
144 echo "Running the configure script..."
145 $srcdir/configure --srcdir="$srcdir" --prefix='${DJDIR}' \
146 --disable-shared --disable-nls --verbose --enable-build-warnings=\
147 -Wimplicit,-Wcomment,-Wformat,-Wparentheses,-Wpointer-arith $*
149 if test -f ${srcdir}/install- ; then
150 mv ${srcdir}/install- ${srcdir}/install-.sh