]>
Commit | Line | Data |
---|---|---|
03261851 RK |
1 | dnl Process this file with autoconf to produce a configure script. |
2 | AC_PREREQ(2.7)dnl | |
3 | AC_INIT(README) | |
4 | ||
5 | if test "${enable_shared}" = "yes" ; then | |
6 | echo "Shared libraries not supported for cross compiling, ignored" | |
7 | fi | |
8 | ||
9 | if test "${srcdir}" = "." ; then | |
10 | if test "${with_target_subdir}" != "." ; then | |
11 | libgloss_topdir="${srcdir}/${with_multisrctop}../.." | |
12 | else | |
13 | libgloss_topdir="${srcdir}/${with_multisrctop}.." | |
14 | fi | |
15 | else | |
16 | libgloss_topdir="${srcdir}/.." | |
17 | fi | |
18 | AC_CONFIG_AUX_DIR($libgloss_topdir) | |
19 | ||
20 | AC_PROG_INSTALL | |
21 | ||
22 | AC_CANONICAL_SYSTEM | |
23 | ||
24 | if test -z "${with_multisubdir}" ; then | |
25 | configdirs="doc libnosys" | |
26 | else | |
27 | configdirs="libnosys" | |
28 | fi | |
29 | ||
30 | case "${target}" in | |
9e60b9a9 | 31 | i[[3456]]86-*-elf*|i[[3456]]86-*-coff*) |
03261851 RK |
32 | configdirs="${configdirs} i386 testsuite"; |
33 | ;; | |
34 | m32r-*-*) | |
35 | configdirs="${configdirs} m32r testsuite" | |
36 | ;; | |
63a93e9d JJ |
37 | m68hc11-*-*|m6811-*-*|m68hc12-*-*|m6812-*-*) |
38 | configdirs="m68hc11 testsuite" | |
39 | ;; | |
03261851 RK |
40 | m68*-*-*) |
41 | configdirs="${configdirs} m68k testsuite" | |
42 | ;; | |
43 | hppa*-*-pro*) | |
44 | configdirs="${configdirs} pa testsuite" | |
45 | ;; | |
46 | i960-*-coff) | |
47 | configdirs="${configdirs} i960 testsuite" | |
48 | ;; | |
49 | sparc-*-elf*) | |
50 | configdirs="${configdirs} sparc testsuite" | |
51 | ;; | |
52 | sparc64-*-elf*) | |
53 | configdirs="${configdirs} sparc testsuite" | |
54 | ;; | |
55 | sparc86x-*-*) | |
56 | configdirs="${configdirs} sparc testsuite" | |
57 | ;; | |
58 | sparclite-*-*) | |
59 | configdirs="${configdirs} sparc testsuite" | |
60 | ;; | |
61 | sparclet-*-aout*) | |
62 | configdirs="${configdirs} sparc sparc/libsys testsuite" | |
63 | ;; | |
64 | *arm-wince-pe) | |
65 | configdirs="wince" | |
66 | ;; | |
9e60b9a9 JJ |
67 | *arm-*-*) |
68 | configdirs="${configdirs} arm" | |
69 | ;; | |
03261851 RK |
70 | sh*-*-pe) |
71 | configdirs="wince" | |
72 | ;; | |
73 | mips*-*-pe) | |
74 | configdirs="wince" | |
75 | ;; | |
76 | mips*-*-*) | |
77 | configdirs="${configdirs} mips testsuite" | |
78 | ;; | |
79 | powerpc-*-*|powerpcle-*-*) | |
80 | configdirs="${configdirs} rs6000 testsuite" | |
81 | ;; | |
82 | mn10200-*-*) | |
83 | configdirs="${configdirs} mn10200 testsuite" | |
84 | ;; | |
85 | mn10300-*-*) | |
86 | configdirs="${configdirs} mn10300 testsuite" | |
87 | ;; | |
49a8b8f0 JJ |
88 | crx-*-*) |
89 | configdirs="${configdirs} crx" | |
90 | ;; | |
03261851 RK |
91 | d30v-*-*) |
92 | configdirs="${configdirs} d30v testsuite" | |
93 | ;; | |
94 | fr30-*-*) | |
95 | configdirs="${configdirs} fr30 testsuite" | |
96 | ;; | |
c2b0dec2 | 97 | frv*-*-*) |
fb921031 DB |
98 | configdirs="${configdirs} frv testsuite" |
99 | ;; | |
03261851 RK |
100 | mcore-*-*) |
101 | configdirs="${configdirs} mcore testsuite" | |
102 | ;; | |
f6eff1c0 GK |
103 | xstormy16-*-*) |
104 | configdirs="${configdirs} xstormy16 testsuite" | |
105 | ;; | |
9e60b9a9 | 106 | strongarm-*-elf | strongarm-*-coff) |
62a25ce1 MS |
107 | configdirs="${configdirs} arm testsuite"; |
108 | ;; | |
9e60b9a9 | 109 | arm*-*-elf | arm*-*-coff) |
62a25ce1 MS |
110 | configdirs="${configdirs} arm testsuite"; |
111 | ;; | |
a7364ade JJ |
112 | ep9312-*-elf | ep9312-*-coff) |
113 | configdirs="${configdirs} arm testsuite"; | |
114 | ;; | |
9e60b9a9 | 115 | xscale-*-elf | xscale-*-coff) |
62a25ce1 MS |
116 | configdirs="${configdirs} arm testsuite"; |
117 | ;; | |
7be5e72f NC |
118 | iq2000-*-*) |
119 | configdirs="${configdirs} iq2000 testsuite";; | |
62a25ce1 | 120 | |
03261851 RK |
121 | esac |
122 | ||
123 | # temporarily strip out testsuite | |
124 | configdirs=`echo $configdirs | sed 's/testsuite//'` | |
125 | ||
126 | AC_CONFIG_SUBDIRS($configdirs) | |
127 | ||
128 | # FIXME: We temporarily define our own version of AC_PROG_CC. This is | |
129 | # copied from autoconf 2.12, but does not call AC_PROG_CC_WORKS. We | |
130 | # are probably using a cross compiler, which will not be able to fully | |
131 | # link an executable. This should really be fixed in autoconf | |
132 | # itself. | |
133 | ||
134 | AC_DEFUN(LIB_AC_PROG_CC, | |
135 | [AC_BEFORE([$0], [AC_PROG_CPP])dnl | |
136 | AC_CHECK_PROG(CC, gcc, gcc) | |
137 | if test -z "$CC"; then | |
138 | AC_CHECK_PROG(CC, cc, cc, , , /usr/ucb/cc) | |
139 | test -z "$CC" && AC_MSG_ERROR([no acceptable cc found in \$PATH]) | |
140 | fi | |
141 | ||
142 | AC_PROG_CC_GNU | |
143 | ||
144 | if test $ac_cv_prog_gcc = yes; then | |
145 | GCC=yes | |
146 | dnl Check whether -g works, even if CFLAGS is set, in case the package | |
147 | dnl plays around with CFLAGS (such as to build both debugging and | |
148 | dnl normal versions of a library), tasteless as that idea is. | |
149 | ac_test_CFLAGS="${CFLAGS+set}" | |
150 | ac_save_CFLAGS="$CFLAGS" | |
151 | CFLAGS= | |
152 | AC_PROG_CC_G | |
153 | if test "$ac_test_CFLAGS" = set; then | |
154 | CFLAGS="$ac_save_CFLAGS" | |
155 | elif test $ac_cv_prog_cc_g = yes; then | |
156 | CFLAGS="-g -O2" | |
157 | else | |
158 | CFLAGS="-O2" | |
159 | fi | |
160 | else | |
161 | GCC= | |
162 | test "${CFLAGS+set}" = set || CFLAGS="-g" | |
163 | fi | |
164 | ]) | |
165 | ||
166 | LIB_AC_PROG_CC | |
167 | AS=${AS-as} | |
168 | AC_SUBST(AS) | |
169 | AC_CHECK_PROG(AR, ar, ar, :) | |
170 | AR=${AR-ar} | |
171 | AC_SUBST(AR) | |
172 | LD=${LD-ld} | |
173 | AC_SUBST(LD) | |
174 | AC_PROG_RANLIB | |
175 | ||
176 | host_makefile_frag=${srcdir}/config/default.mh | |
177 | ||
178 | dnl We have to assign the same value to other variables because autoconf | |
179 | dnl doesn't provide a mechanism to substitute a replacement keyword with | |
180 | dnl arbitrary data or pathnames. | |
181 | dnl | |
182 | host_makefile_frag_path=$host_makefile_frag | |
183 | AC_SUBST(host_makefile_frag_path) | |
184 | AC_SUBST_FILE(host_makefile_frag) | |
185 | ||
186 | # for now, only add multilibs for specific targets | |
187 | AC_OUTPUT(Makefile, | |
188 | . ${libgloss_topdir}/config-ml.in, | |
189 | srcdir=${srcdir} | |
190 | target=${target} | |
191 | with_multisubdir=${with_multisubdir} | |
192 | ac_configure_args="--enable-multilib ${ac_configure_args}" | |
193 | CONFIG_SHELL=${CONFIG_SHELL-/bin/sh} | |
194 | libgloss_topdir=${libgloss_topdir} | |
195 | ) | |
196 | ||
197 | ||
198 |