8sa1-binutils-gdb/gdb/config.gdb

332 lines
7.3 KiB
Plaintext
Raw Normal View History

1988-09-03 03:00:00 -04:00
#!/bin/sh
#
1989-09-29 20:00:00 -04:00
# Shell script to do machine-dependent things in
1988-09-03 03:00:00 -04:00
# preparation for compiling gdb.
#
1989-01-31 12:56:40 -05:00
# Usage: config.gdb machine [operating-system]
1988-09-03 03:00:00 -04:00
#
# If config.gdb succeeds, it leaves its status in config.status.
# If config.gdb fails after disturbing the status quo,
# config.status is removed.
#
1989-09-29 20:00:00 -04:00
# Note: if making something gives errors like "unable to make target
# 1-dep.c", this means that the compiler has put in a builtin define
# and there is a "-U" missing from makedefine in this file.
#
1988-09-03 03:00:00 -04:00
progname=$0
1989-01-31 12:56:40 -05:00
case $# in
1988-09-03 03:00:00 -04:00
1)
machine=$1
1989-09-29 20:00:00 -04:00
os=""
1989-01-31 12:56:40 -05:00
;;
2)
machine=$1
os=$2
;;
*)
echo "Usage: $progname machine [operating-system]"
echo "Available machine types:"
echo m-*.h | sed 's/m-//g' | sed 's/\.h//g'
if [ -r config.status ]
then
cat config.status
fi
exit 1
;;
esac
1988-09-03 03:00:00 -04:00
1989-09-29 20:00:00 -04:00
# cannonicalize the machine name.
case $machine in
news)
case $os in
os3|newsos3)
$machine=newsos3
$os=""
;;
esac
;;
sun2)
case $os in
os4|sunos4)
$machine=sun2os4
$os=""
;;
os2|sunos2)
$machine=sun2os2
$os=""
;;
esac
;;
sun3)
case $os in
os4|sunos4)
$machine=sun3os4
$os=""
;;
os3|sunos3)
$machine=sun3os3
$os=""
;;
esac
;;
sparc|sun4)
case $os in
os4|sunos4)
$machine=sun4os4
$os=""
;;
esac
;;
esac
paramfile=m-${machine}${os}.h
pinsnfile=${machine}${os}-pinsn.c
opcodefile=${machine}${os}-opcode.h
# Set up a define for purposes of editing the makefile.
makedefine=
if [ -r ${machine}${os}-dep.c ]
1989-01-31 12:56:40 -05:00
then
1989-09-29 20:00:00 -04:00
depfile=${machine}${os}-dep.c
1989-01-31 12:56:40 -05:00
else
depfile=default-dep.c
fi
#
# Special cases.
1989-09-29 20:00:00 -04:00
# If a file is not needed, set the file name to something.
# It must be linked to something, or else make will try to make it.
# /dev/null will not work because on systems without symbolic links,
# it will complain that /dev/null is on a different file system.
1989-01-31 12:56:40 -05:00
#
case $machine in
1989-09-29 20:00:00 -04:00
altos)
makedefine="-DM_REGEX=regex.o -DM_SYSV -DM_BSD_NM"
pinsnfile=m68k-pinsn.c
opcodefile=m68k-opcode.h
;;
altosgas)
echo "Use of the coff encapsulation features require the GNU binutils utilities"
echo "To be ahead of their System V counterparts in your path."
makedefine="-DM_REGEX=regex.o -DM_SYSV -DM_BSD_NM"
1989-01-31 12:56:40 -05:00
pinsnfile=m68k-pinsn.c
1989-09-29 20:00:00 -04:00
depfile=altos-dep.c
1989-01-31 12:56:40 -05:00
opcodefile=m68k-opcode.h
;;
vax)
1989-09-29 20:00:00 -04:00
echo
echo "/bin/cc has been known to fail on readline.c on VAXen running BSD4.3"
echo "If this occurs, use gcc "
echo " (but see comments in Makefile.dist about compiling with gcc)."
echo
1989-01-31 12:56:40 -05:00
pinsnfile=vax-pinsn.c
opcodefile=vax-opcode.h
;;
hp9k320)
1989-09-29 20:00:00 -04:00
# The headers in the directory hp-include override system headers
# and tell GDB to use BSD executable file format (hence -Ihp-include)
makedefine="-DM_SYSV -DM_BSD_NM -DM_REGEX=regex.o
-DM_ALLOCA=alloca.o -DM_CFLAGS=-Ihp-include"
# The following is true because gcc uses a different .o file format
# than the native HPUX compiler
echo
echo "If you compile GDB with GCC on HPUX, you must make sure"
echo "that the \`nm' used in \`munch' is GNU nm"
echo
pinsnfile=m68k-pinsn.c
opcodefile=m68k-opcode.h
;;
hp300bsd)
# Not sure what makefile editing (if any) is necessary for this machine.
1989-01-31 12:56:40 -05:00
pinsnfile=m68k-pinsn.c
opcodefile=m68k-opcode.h
;;
isi)
1989-09-29 20:00:00 -04:00
# ISI running bsd4.2
1989-01-31 12:56:40 -05:00
pinsnfile=m68k-pinsn.c
opcodefile=m68k-opcode.h
;;
i386)
1989-09-29 20:00:00 -04:00
makedefine="-DM_CLIBS=-lPW -DM_SYSV -DM_REGEX=regex.o"
# The following is a lie, but a necessary one. See comment at beginning
# of this file about unneeded files.
opcodefile=m-i386.h
1989-01-31 12:56:40 -05:00
;;
i386gas)
1989-09-29 20:00:00 -04:00
makedefine="-DM_CLIBS=-lPW -DM_SYSV -DM_REGEX=regex.o"
echo
echo "Use of the coff encapsulation features requires the GNU binary utilities"
1989-01-31 12:56:40 -05:00
echo "to be ahead of their System V counterparts in your path."
1989-09-29 20:00:00 -04:00
echo
1989-01-31 12:56:40 -05:00
pinsnfile=i386-pinsn.c
depfile=i386-dep.c
1989-09-29 20:00:00 -04:00
# The following is a lie, but a necessary one. See comment at beginning
# of this file about unneeded files.
opcodefile=m-i386.h
;;
i386-sysv3.2)
makedefine="-DM_CLIBS=-lPW -DM_SYSV -DM_REGEX=regex.o"
pinsnfile=i386-pinsn.c
depfile=i386-dep.c
opcodefile=/dev/null
;;
i386gas-sysv3.2)
makedefine="-DM_CLIBS=-lPW -DM_SYSV -DM_REGEX=regex.o"
echo
echo "Use of the coff encapsulation features requires the GNU binary utilities"
echo "to be ahead of their System V counterparts in your path."
echo
pinsnfile=i386-pinsn.c
depfile=i386-dep.c
opcodefile=/dev/null
1989-01-31 12:56:40 -05:00
;;
merlin)
pinsnfile=ns32k-pinsn.c
opcodefile=ns32k-opcode.h
;;
news)
pinsnfile=m68k-pinsn.c
opcodefile=m68k-opcode.h
;;
1989-09-29 20:00:00 -04:00
newsos3)
pinsnfile=m68k-pinsn.c
opcodefile=m68k-opcode.h
depfile=news-dep.c
;;
1989-01-31 12:56:40 -05:00
npl)
pinsnfile=gld-pinsn.c
;;
pn)
pinsnfile=gld-pinsn.c
;;
sun2)
1989-09-29 20:00:00 -04:00
depfile=sun3-dep.c
1989-01-31 12:56:40 -05:00
pinsnfile=m68k-pinsn.c
opcodefile=m68k-opcode.h
;;
1989-09-29 20:00:00 -04:00
sun2os2|sun2-os2)
depfile=default-dep.c
paramfile=m-sun2.h
1989-01-31 12:56:40 -05:00
pinsnfile=m68k-pinsn.c
opcodefile=m68k-opcode.h
;;
1989-09-29 20:00:00 -04:00
sun2os4|sun2-os4)
# Compile GDB without shared libraries so that it can be run on itself.
makedefine=-DM_CFLAGS=-Bstatic
echo
echo "Make sure to compile any program on which you want to run gdb"
echo " without shared libraries (cc -Bstatic)"
echo
paramfile=m-sun2os4.h
depfile=sun3-dep.c
1989-01-31 12:56:40 -05:00
pinsnfile=m68k-pinsn.c
opcodefile=m68k-opcode.h
;;
1989-09-29 20:00:00 -04:00
sun3os3)
paramfile=m-sun3.h
depfile=sun3-dep.c
1989-01-31 12:56:40 -05:00
pinsnfile=m68k-pinsn.c
opcodefile=m68k-opcode.h
;;
1989-09-29 20:00:00 -04:00
sun3os4|sun3-os4)
# Compile GDB without shared libraries so that it can be run on itself.
makedefine=-DM_CFLAGS=-Bstatic
echo
echo "Make sure to compile any program on which you want to run gdb"
echo " without shared libraries (cc -Bstatic)"
echo
paramfile=m-sun3os4.h
1989-01-31 12:56:40 -05:00
pinsnfile=m68k-pinsn.c
opcodefile=m68k-opcode.h
depfile=sun3-dep.c
;;
1989-09-29 20:00:00 -04:00
sun4os4|sun4-os4)
# Compile GDB without shared libraries so that it can be run on itself.
# Undefine sparc to avoid changing sparc-dep.c to 1-dep.c
makedefine="-DM_CFLAGS=-Bstatic -Usparc"
echo
echo "Make sure to compile any program on which you want to run gdb"
echo " without shared libraries (cc -Bstatic)"
echo
paramfile=m-sun4os4.h
1989-01-31 12:56:40 -05:00
pinsnfile=sparc-pinsn.c
opcodefile=sparc-opcode.h
depfile=sparc-dep.c
;;
1989-09-29 20:00:00 -04:00
symmetry)
pinsnfile=i386-pinsn.c
# Need *some* opcode file to keep make from trying to make opcode.h
opcodefile=/dev/null
;;
1989-01-31 12:56:40 -05:00
umax)
pinsnfile=ns32k-pinsn.c
opcodefile=ns32k-opcode.h
;;
1989-09-29 20:00:00 -04:00
sparc|sun4|sun4os3|sun4-os3)
paramfile=m-sparc.h
# Undefine sparc to avoid changing sparc-dep.c to 1-dep.c
makedefine=-Usparc
1989-01-31 12:56:40 -05:00
pinsnfile=sparc-pinsn.c
opcodefile=sparc-opcode.h
depfile=sparc-dep.c
1989-09-29 20:00:00 -04:00
;;
convex)
1989-01-31 12:56:40 -05:00
;;
test)
paramfile=one
pinsnfile=three
opcodefile=four
;;
*)
echo "Unknown machine type: \`$machine'"
echo "Available types:"
echo m-*.h | sed 's/m-//g' | sed 's/\.h//g'
exit 1
1989-09-29 20:00:00 -04:00
;;
1989-01-31 12:56:40 -05:00
esac
1988-09-03 03:00:00 -04:00
1989-01-31 12:56:40 -05:00
files="$paramfile $pinsnfile $opcodefile $depfile"
links="param.h pinsn.c opcode.h dep.c"
1988-09-03 03:00:00 -04:00
1989-09-29 20:00:00 -04:00
rm -f config.status
1989-01-31 12:56:40 -05:00
while [ -n "$files" ]
do
# set file to car of files, files to cdr of files
set $files; file=$1; shift; files=$*
set $links; link=$1; shift; links=$*
1988-09-03 03:00:00 -04:00
1989-01-31 12:56:40 -05:00
if [ "$file" != skip ]
then
1988-09-03 03:00:00 -04:00
if [ ! -r $file ]
then
echo "$progname: cannot create a link \`$link',"
echo "since the file \`$file' does not exist."
exit 1
fi
1989-09-29 20:00:00 -04:00
echo "Linking \`$link' to \`$file'."
rm -f $link
1988-09-03 03:00:00 -04:00
# Make a symlink if possible, otherwise try a hard link
ln -s $file $link 2>/dev/null || ln $file $link
if [ ! -r $link ]
then
echo "$progname: unable to link \`$link' to \`$file'."
exit 1
fi
fi
1989-01-31 12:56:40 -05:00
done
1989-09-29 20:00:00 -04:00
# edit the makefile
echo "Editing Makefile"
cp Makefile.dist tmp.c
cc -E >Makefile tmp.c $makedefine -DM_MAKEDEFINE="$makedefine"
rm -f tmp.c
echo "GDB is now set up for use with a $machine." \
1989-01-31 12:56:40 -05:00
| tee config.status
exit 0
1988-09-03 03:00:00 -04:00