* configure.in (host_makefile_frag): Don't set. Substitute for
[binutils-gdb.git] / binutils / configure.in
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
7 srcname="Binutils"
8
9 # per-host:
10
11 . ${srcdir}/../bfd/configure.host
12
13 # per-target:
14
15 # Canonicalize the secondary target names.
16 if [ -n "$enable_targets" ]; then
17 for targ in `echo $enable_targets | sed 's/,/ /g'`
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
36 nlmconv_defs=
37 build_srconv=false
38 build_dlltool=false
39 dlltool_defs=
40
41 for targ in $target $canon_targets
42 do
43 if [ "x$targ" = "xall" ]; then
44 all_targets=true
45 build_nlmconv=true
46 build_srconv=true
47 nlmconv_defs="-DNLMCONV_I386 -DNLMCONV_ALPHA -DNLMCONV_POWERPC -DNLMCONV_SPARC"
48 else
49 case $targ in
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 ;;
66 esac
67 case $targ in
68 *-*-hms*) build_srconv=true ;;
69 esac
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
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
92 echo "NLMCONV_DEFS = ${nlmconv_defs}" >> Makefile.2
93 fi
94
95 if [ "x${build_srconv}" = "xtrue" ]; then
96 echo 'BUILD_SRCONV = $(SRCONV_PROG)' >> Makefile.2
97 fi
98
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
104 targ=$target
105 . $srcdir/../bfd/config.bfd
106 if test "x$targ_underscore" = "xyes"; then
107 underscore=1
108 else
109 underscore=0
110 fi
111 echo "UNDERSCORE = ${underscore}" >> Makefile.2
112
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
121 rm -f Makefile.tmp
122 mv Makefile.2 Makefile