(REGISTER_TYPES): Adjust for h8/300h.
[deliverable/binutils-gdb.git] / gdb / munch
CommitLineData
dd3b648e
RP
1#!/bin/sh
2
3# create an initialization procedure from a list of .o files
4
5echo '/* Do not modify this file. It is created automatically by "munch". */'
6echo 'void initialize_all_files () {'
7
faaaea3c
SG
8NMOPT=""
9case $1 in
44f0c5db
JG
10MUNCH_NM=*)
11 MUNCH_NM=`echo $1 | sed 's/MUNCH_NM=//'`; shift ;;
12-*)
13 NMOPT=$1; shift ;;
faaaea3c
SG
14esac
15
dd3b648e 16# make it easy to use a different nm, e.g. for cross-developing
faaaea3c 17
44f0c5db 18MUNCH_NM="${MUNCH_NM-nm} $NMOPT"
cb17dfb1
FF
19if test "`$MUNCH_NM main.o | egrep main | egrep FUNC | egrep GLOB`" != "" ; then
20 # System V Release 4 style nm
b9b6dbc2 21 $MUNCH_NM $* | egrep '\|__?initialize_' | egrep FUNC | \
2ce124df
JG
22 sed -e \
23 's/^.*\(_initialize_[a-zA-Z0-9_]*\).*$/ {extern void \1 (); \1 ();}/'\
24 | sort -u
91912864 25elif test "`$MUNCH_NM main.o | egrep '[TD] *_?main$'`" = "" ; then
04c6a64f 26 if test "`$MUNCH_NM main.o | egrep 'Type Subspace'`" != "" ; then
7da1e27d
SG
27 # HP PA RISC compilers don't prepend underscores
28 shift;
29 $MUNCH_NM $* | egrep '_initialize_.*' | \
30 sed -e \
31 's/^.*\(_initialize_[a-zA-Z0-9_]*\).*/ {extern void \1 (); \1 ();}/' \
32 | sort -u
33 else
34 # System V style nm
35 shift;
36 $MUNCH_NM $* | egrep '_initialize_.*' | egrep '\.text'|\
37 sed -e \
38 's/^.*\(_initialize_[a-zA-Z0-9_]*\).*/ {extern void \1 (); \1 ();}/' \
39 | sort -u
40 fi
dd3b648e
RP
41else
42 # BSD style nm
44f0c5db 43 # We now accept either text or data symbols, since the RT/PC uses data.
818de002 44 $MUNCH_NM -p $* | egrep '[TD] *_?[_.]initialize_' | \
2ce124df
JG
45 sed -e 's/^.*\(initialize_.*\)/ {extern void _\1 (); _\1 ();}/' \
46 | sort -u
dd3b648e
RP
47fi
48
49echo '}'
This page took 0.106553 seconds and 4 git commands to generate.