OSDN Git Service

2011-12-15 Konrad Eisele <konrad@gaisler.com>
[pf3gnuchains/pf3gnuchains4x.git] / libgloss / configure.in
1 dnl Process this file with autoconf to produce a configure script.
2 AC_PREREQ(2.59)
3 AC_INIT([libgloss],[LIBGLOSS_VERSION])
4 AC_CONFIG_SRCDIR([libnosys])
5
6 if test "${enable_shared}" = "yes" ; then
7     echo "Shared libraries not supported for cross compiling, ignored"
8 fi
9
10 if test "${srcdir}" = "." ; then
11   if test "${with_target_subdir}" != "." ; then
12     libgloss_topdir="${srcdir}/${with_multisrctop}../.."
13   else
14     libgloss_topdir="${srcdir}/${with_multisrctop}.."
15   fi
16 else
17   libgloss_topdir="${srcdir}/.."
18 fi
19 AC_CONFIG_AUX_DIR($libgloss_topdir)
20
21 AC_PROG_INSTALL
22
23 AC_CANONICAL_SYSTEM
24 AM_INIT_AUTOMAKE([cygnus no-define 1.9.5])
25
26 if test -z "${with_multisubdir}" ; then
27   AC_CONFIG_SUBDIRS([doc])
28 fi
29
30 dnl indicates whether to run configure within the testsuite subdirectory
31 config_testsuite=true
32
33 dnl indicates whether to run configure within the libnosys subdirectory
34 config_libnosys=true
35
36 case "${target}" in
37   i[[3456]]86-*-elf* | i[[3456]]86-*-coff*)
38         AC_CONFIG_SUBDIRS([i386])
39         ;;
40   m32r-*-*)
41         AC_CONFIG_SUBDIRS([m32r])
42         ;;
43   m68hc11-*-* | m6811-*-* | m68hc12-*-* | m6812-*-*)
44         AC_CONFIG_SUBDIRS([m68hc11])
45         ;;
46   fido-*-* | m68*-*-*)
47         AC_CONFIG_SUBDIRS([m68k])
48         ;;
49   hppa*-*-pro*)
50         AC_CONFIG_SUBDIRS([pa])
51         ;;
52   i960-*-coff)
53         AC_CONFIG_SUBDIRS([i960])
54         ;;
55   sparc-*leon*-elf* | sparc-*leon*-none*)
56         AC_CONFIG_SUBDIRS([sparc_leon])
57         ;; 
58   sparclet-*-aout* | sparc-*-elf* | sparc64-*-elf* | sparc86x-*-* | sparclite-*-*)
59         AC_CONFIG_SUBDIRS([sparc])
60         ;;
61   sh*-*-pe | mips*-*-pe | *arm-wince-pe)
62         AC_CONFIG_SUBDIRS([wince])
63         ;;
64   mips*-*-*)
65         AC_CONFIG_SUBDIRS([mips])
66         ;;
67   powerpc-*-*|powerpcle-*-*)
68         AC_CONFIG_SUBDIRS([rs6000])
69         ;;
70   mn10200-*-*)
71         AC_CONFIG_SUBDIRS([mn10200])
72         ;;
73   mn10300-*-*)
74         AC_CONFIG_SUBDIRS([mn10300])
75         ;;
76   bfin-*-*)
77         AC_CONFIG_SUBDIRS([bfin])
78         ;;
79   cr16-*-*)
80         AC_CONFIG_SUBDIRS([cr16])
81         ;;
82   cris-*-* | crisv32-*-*)
83         AC_CONFIG_SUBDIRS([cris])
84         ;;
85   crx-*-*)
86         AC_CONFIG_SUBDIRS([crx])
87         ;;
88   d30v-*-*)
89         AC_CONFIG_SUBDIRS([d30v])
90         ;;
91   fr30-*-*)
92         AC_CONFIG_SUBDIRS([fr30])
93         ;;
94   frv*-*-*)
95         AC_CONFIG_SUBDIRS([frv])
96         ;;
97   lm32*-*-*)
98         AC_CONFIG_SUBDIRS([lm32])
99         ;;
100   mcore-*-*)
101         AC_CONFIG_SUBDIRS([mcore])
102         ;;
103   mep-*-*)
104         AC_CONFIG_SUBDIRS([mep])
105         ;;
106   moxie-*-*)
107         AC_CONFIG_SUBDIRS([moxie])
108         ;;
109   microblaze-*-*)
110         AC_CONFIG_SUBDIRS([microblaze])
111         ;;
112   mt-*-*)
113         AC_CONFIG_SUBDIRS([mt])
114         ;;
115   v850*-*-*)
116         AC_CONFIG_SUBDIRS([v850])
117         ;;
118   xc16x-*-*)
119         AC_CONFIG_SUBDIRS([xc16x])
120         ;;
121   xstormy16-*-*)
122         AC_CONFIG_SUBDIRS([xstormy16])
123         ;;
124   m32c-*-*)
125         AC_CONFIG_SUBDIRS([m32c])
126         ;;
127   rl78*-*-elf)
128         AC_CONFIG_SUBDIRS([rl78])
129         ;;
130   rx*-*-elf)
131         AC_CONFIG_SUBDIRS([rx])
132         ;;
133   arm*-*-elf | arm*-*-coff | arm-*-*)
134         AC_CONFIG_SUBDIRS([arm])
135         ;;
136   spu-*-elf)
137         AC_CONFIG_SUBDIRS([spu])
138         config_testsuite=false
139         config_libnosys=false
140         ;;
141   tic6x-*-*)
142         AC_CONFIG_SUBDIRS(tic6x)
143         config_testsuite=false
144         ;;
145   iq2000-*-*)
146         AC_CONFIG_SUBDIRS([iq2000])
147         ;;
148 esac
149
150 dnl For now, don't bother configuring testsuite
151 dnl
152 dnl if test "${config_testsuite}" = "true";
153 dnl   then AC_CONFIG_SUBDIRS([testsuite])
154 dnl fi
155
156 if test "${config_libnosys}" = "true"; then
157   AC_CONFIG_SUBDIRS([libnosys])
158 fi
159
160 LIB_AC_PROG_CC
161 AS=${AS-as}
162 AC_SUBST(AS)
163 AC_CHECK_PROG(AR, ar, ar, :)
164 AR=${AR-ar}
165 AC_SUBST(AR)
166 LD=${LD-ld}
167 AC_SUBST(LD)
168 AC_PROG_RANLIB
169 LIB_AM_PROG_AS
170
171 host_makefile_frag=${srcdir}/config/default.mh
172
173 dnl We have to assign the same value to other variables because autoconf
174 dnl doesn't provide a mechanism to substitute a replacement keyword with
175 dnl arbitrary data or pathnames.
176 dnl
177 host_makefile_frag_path=$host_makefile_frag
178 AC_SUBST(host_makefile_frag_path)
179 AC_SUBST_FILE(host_makefile_frag)
180
181 if test "${multilib}" = "yes"; then
182   multilib_arg="--enable-multilib"
183 else
184   multilib_arg=
185 fi
186
187 # for now, only add multilibs for specific targets
188 AC_CONFIG_FILES([Makefile],
189 [if test -n "$CONFIG_FILES"; then
190   unset ac_file
191   . ${libgloss_topdir}/config-ml.in
192 fi],
193 srcdir=${srcdir}
194 target=${target}
195 with_multisubdir=${with_multisubdir}
196 ac_configure_args="--enable-multilib ${ac_configure_args}"
197 CONFIG_SHELL=${CONFIG_SHELL-/bin/sh}
198 libgloss_topdir=${libgloss_topdir}
199 CC="${CC}"
200 LDFLAGS=${LDFLAGS}
201 )
202 AC_OUTPUT
203
204