aboutsummaryrefslogtreecommitdiff
path: root/binutils/configure.in
blob: 878aa289673145130d80b913b115543f0e78494f (plain)
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
# This file is a shell script that supplies the information necessary
# to tailor a template configure script into the configure script
# appropriate for this directory.  For more information, check any
# existing configure script.

srctrigger=ar.c
srcname="Binutils"

# per-host:

. ${srcdir}/../bfd/configure.host

# per-target:

# Canonicalize the secondary target names.
if [ -n "$enable_targets" ]; then
    for targ in `echo $enable_targets | sed 's/,/ /g'`
    do
	result=`$configsub $targ 2>/dev/null`
	if [ -n "$result" ]; then
	    canon_targets="$canon_targets $result"
	else
	    # Allow targets that config.sub doesn't recognize, like "all".
	    canon_targets="$canon_targets $targ"
	fi
    done
else
# If our target is rs6000 _and nothing else_ then we build only nm!
    case $target in
	rs6000-*-lynx*) target_makefile_frag=config/rslynx ;;
    esac
fi

all_targets=false
build_nlmconv=false
nlmconv_defs=
build_srconv=false
build_dlltool=false
dlltool_defs=

for targ in $target $canon_targets
do
    if [ "x$targ" = "xall" ]; then
        all_targets=true
	build_nlmconv=true
	build_srconv=true
	nlmconv_defs="-DNLMCONV_I386 -DNLMCONV_ALPHA -DNLMCONV_POWERPC -DNLMCONV_SPARC"
    else
	case $targ in
	i[345]86*-*-netware*) 
	  build_nlmconv=true 
	  nlmconv_defs="$nlmconv_defs -DNLMCONV_I386"
	  ;;
	alpha*-*-netware*)
	  build_nlmconv=true
	  nlmconv_defs="$nlmconv_defs -DNLMCONV_ALPHA"
	  ;;
	powerpc*-*-netware*)
	  build_nlmconv=true
	  nlmconv_defs="$nlmconv_defs -DNLMCONV_POWERPC"
	  ;;
	sparc*-*-netware*)
	  build_nlmconv=true
	  nlmconv_defs="$nlmconv_defs -DNLMCONV_SPARC"
	  ;;
	esac
	case $targ in
	*-*-hms*) build_srconv=true ;;
	esac
	case $targ in
	arm-*pe*)
  	  build_dlltool=true;
	  dlltool_defs="$dlltool_defs -DDLLTOOL_ARM"
	 ;;
	i[3-6]86-*pe* | i[3-6]86-*-win32)
  	  build_dlltool=true;
	  dlltool_defs="$dlltool_defs -DDLLTOOL_I386"
	 ;;
	esac
    fi
done

# We don't do any links based on the target system, just makefile config.

# post-target:

rm -f Makefile.tmp Makefile.2
mv Makefile Makefile.tmp

if [ "x${build_nlmconv}" = "xtrue" ]; then
    echo 'BUILD_NLMCONV = $(NLMCONV_PROG)' >> Makefile.2
    echo "NLMCONV_DEFS = ${nlmconv_defs}" >> Makefile.2
fi

if [ "x${build_srconv}" = "xtrue" ]; then
    echo 'BUILD_SRCONV = $(SRCONV_PROG)' >> Makefile.2
fi

if [ "x${build_dlltool}" = "xtrue" ]; then
    echo 'BUILD_DLLTOOL = $(DLLTOOL_PROG)' >> Makefile.2
    echo "DLLTOOL_DEFS = ${dlltool_defs}" >> Makefile.2
fi

targ=$target
. $srcdir/../bfd/config.bfd
if test "x$targ_underscore" = "xyes"; then
    underscore=1
else
    underscore=0
fi
echo "UNDERSCORE = ${underscore}" >> Makefile.2

test -z "$CC" && CC=`egrep '^CC *=' ../Makefile | tail -1 | sed 's/^CC *= *//'`
test -z "$CC" && CC=cc
test -z "$CFLAGS" && CFLAGS=-g
sed -e "s%@CC@%${CC}%" \
    -e "s%@CFLAGS@%${CFLAGS}%" \
    -e "s%@HDEFINES@%${HDEFINES}%" \
    -e "s%@LDFLAGS@%${LDFLAGS}%" < Makefile.tmp >> Makefile.2

rm -f Makefile.tmp
mv Makefile.2 Makefile