Commit | Line | Data |
---|---|---|
db19f828 RP |
1 | # This file is a shell script that supplies the information necessary |
2 | # to tailor a template configure script into the configure script | |
3 | # appropriate for this directory. For more information, check any | |
4 | # existing configure script. | |
5 | ||
6 | srctrigger=ar.c | |
a8cd562d | 7 | srcname="Binutils" |
db19f828 | 8 | |
0019b190 | 9 | # per-host: |
db19f828 | 10 | |
b5775df3 DHW |
11 | . ${srcdir}/../bfd/configure.host |
12 | ||
a8cd562d | 13 | # per-target: |
b5775df3 DHW |
14 | |
15 | # Canonicalize the secondary target names. | |
99ac7754 JM |
16 | if [ -n "$enable_targets" ]; then |
17 | for targ in `echo $enable_targets | sed 's/,/ /g'` | |
b5775df3 DHW |
18 | do |
19 | result=`$configsub $targ 2>/dev/null` | |
20 | if [ -n "$result" ]; then | |
21 | canon_targets="$canon_targets $result" | |
22 | else | |
23 | # Allow targets that config.sub doesn't recognize, like "all". | |
24 | canon_targets="$canon_targets $targ" | |
25 | fi | |
26 | done | |
27 | else | |
28 | # If our target is rs6000 _and nothing else_ then we build only nm! | |
29 | case $target in | |
30 | rs6000-*-lynx*) target_makefile_frag=config/rslynx ;; | |
31 | esac | |
32 | fi | |
33 | ||
34 | all_targets=false | |
35 | build_nlmconv=false | |
99ac7754 | 36 | nlmconv_defs= |
b5775df3 | 37 | build_srconv=false |
99ac7754 JM |
38 | build_dlltool=false |
39 | dlltool_defs= | |
b5775df3 DHW |
40 | |
41 | for targ in $target $canon_targets | |
42 | do | |
fe48a154 | 43 | if [ "x$targ" = "xall" ]; then |
b5775df3 DHW |
44 | all_targets=true |
45 | build_nlmconv=true | |
46 | build_srconv=true | |
99ac7754 | 47 | nlmconv_defs="-DNLMCONV_I386 -DNLMCONV_ALPHA -DNLMCONV_POWERPC -DNLMCONV_SPARC" |
b5775df3 DHW |
48 | else |
49 | case $targ in | |
99ac7754 JM |
50 | i[345]86*-*-netware*) |
51 | build_nlmconv=true | |
52 | nlmconv_defs="$nlmconv_defs -DNLMCONV_I386" | |
53 | ;; | |
54 | alpha*-*-netware*) | |
55 | build_nlmconv=true | |
56 | nlmconv_defs="$nlmconv_defs -DNLMCONV_ALPHA" | |
57 | ;; | |
58 | powerpc*-*-netware*) | |
59 | build_nlmconv=true | |
60 | nlmconv_defs="$nlmconv_defs -DNLMCONV_POWERPC" | |
61 | ;; | |
62 | sparc*-*-netware*) | |
63 | build_nlmconv=true | |
64 | nlmconv_defs="$nlmconv_defs -DNLMCONV_SPARC" | |
65 | ;; | |
b5775df3 | 66 | esac |
b5775df3 DHW |
67 | case $targ in |
68 | *-*-hms*) build_srconv=true ;; | |
69 | esac | |
99ac7754 JM |
70 | case $targ in |
71 | arm-*pe*) | |
72 | build_dlltool=true; | |
73 | dlltool_defs="$dlltool_defs -DDLLTOOL_ARM" | |
74 | ;; | |
75 | i[3-6]86-*pe* | i[3-6]86-*-win32) | |
76 | build_dlltool=true; | |
77 | dlltool_defs="$dlltool_defs -DDLLTOOL_I386" | |
78 | ;; | |
79 | esac | |
b5775df3 DHW |
80 | fi |
81 | done | |
82 | ||
83 | # We don't do any links based on the target system, just makefile config. | |
84 | ||
85 | # post-target: | |
86 | ||
87 | rm -f Makefile.tmp Makefile.2 | |
88 | mv Makefile Makefile.tmp | |
89 | ||
90 | if [ "x${build_nlmconv}" = "xtrue" ]; then | |
91 | echo 'BUILD_NLMCONV = $(NLMCONV_PROG)' >> Makefile.2 | |
99ac7754 | 92 | echo "NLMCONV_DEFS = ${nlmconv_defs}" >> Makefile.2 |
b5775df3 DHW |
93 | fi |
94 | ||
95 | if [ "x${build_srconv}" = "xtrue" ]; then | |
96 | echo 'BUILD_SRCONV = $(SRCONV_PROG)' >> Makefile.2 | |
97 | fi | |
98 | ||
99ac7754 JM |
99 | if [ "x${build_dlltool}" = "xtrue" ]; then |
100 | echo 'BUILD_DLLTOOL = $(DLLTOOL_PROG)' >> Makefile.2 | |
101 | echo "DLLTOOL_DEFS = ${dlltool_defs}" >> Makefile.2 | |
102 | fi | |
103 | ||
fe48a154 ILT |
104 | targ=$target |
105 | . $srcdir/../bfd/config.bfd | |
106 | if test "x$targ_underscore" = "xyes"; then | |
6f88f031 ILT |
107 | underscore=1 |
108 | else | |
109 | underscore=0 | |
110 | fi | |
111 | echo "UNDERSCORE = ${underscore}" >> Makefile.2 | |
112 | ||
109eb06c ILT |
113 | test -z "$CC" && CC=`egrep '^CC *=' ../Makefile | tail -1 | sed 's/^CC *= *//'` |
114 | test -z "$CC" && CC=cc | |
115 | test -z "$CFLAGS" && CFLAGS=-g | |
116 | sed -e "s%@CC@%${CC}%" \ | |
117 | -e "s%@CFLAGS@%${CFLAGS}%" \ | |
118 | -e "s%@HDEFINES@%${HDEFINES}%" \ | |
119 | -e "s%@LDFLAGS@%${LDFLAGS}%" < Makefile.tmp >> Makefile.2 | |
120 | ||
b5775df3 DHW |
121 | rm -f Makefile.tmp |
122 | mv Makefile.2 Makefile |