Patches from lvaro Lopes <alvieboy@alvie.com> to fix usage
[zpugcc.git] / toolchain / gcc / libgloss / configure.in
blobf79b3210c09cb36ff8b762e3a4f046dc0837963f
1 dnl Process this file with autoconf to produce a configure script.
2 AC_PREREQ(2.7)dnl
3 AC_INIT(README)
5 if test "${enable_shared}" = "yes" ; then
6     echo "Shared libraries not supported for cross compiling, ignored"
7 fi
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}/.."
18 AC_CONFIG_AUX_DIR($libgloss_topdir)
20 AC_PROG_INSTALL
22 AC_CANONICAL_SYSTEM
24 if test -z "${with_multisubdir}" ; then
25   configdirs="doc libnosys"
26 else
27   configdirs="libnosys"
30 case "${target}" in
31   i[[3456]]86-*-elf*|i[[3456]]86-*-coff*)
32         configdirs="${configdirs} i386 testsuite";
33         ;;
34   m32r-*-*)
35         configdirs="${configdirs} m32r testsuite"
36         ;;
37   zpu-*-*)
38         configdirs="zpu testsuite"
39         ;;
40   m68hc11-*-*|m6811-*-*|m68hc12-*-*|m6812-*-*)
41         configdirs="m68hc11 testsuite"
42         ;;
43   m68*-*-*)
44         configdirs="${configdirs} m68k testsuite"
45         ;;
46   hppa*-*-pro*)
47         configdirs="${configdirs} pa testsuite"
48         ;;
49   i960-*-coff)
50         configdirs="${configdirs} i960 testsuite"
51         ;;
52   sparc-*-elf*)
53         configdirs="${configdirs} sparc testsuite"
54         ;;
55   sparc64-*-elf*)
56         configdirs="${configdirs} sparc testsuite"
57         ;;
58   sparc86x-*-*)
59         configdirs="${configdirs} sparc testsuite"
60         ;;
61   sparclite-*-*)
62         configdirs="${configdirs} sparc testsuite"
63         ;;
64   sparclet-*-aout*)
65         configdirs="${configdirs} sparc sparc/libsys testsuite"
66         ;;
67   *arm-wince-pe)
68         configdirs="wince"
69         ;;
70   *arm-*-*)
71         configdirs="${configdirs} arm"
72         ;;
73   sh*-*-pe)
74         configdirs="wince"
75         ;;
76   mips*-*-pe)
77         configdirs="wince"
78         ;;
79   mips*-*-*)
80         configdirs="${configdirs} mips testsuite"
81         ;;
82   powerpc-*-*|powerpcle-*-*)
83         configdirs="${configdirs} rs6000 testsuite"
84         ;;
85   mn10200-*-*)
86         configdirs="${configdirs} mn10200 testsuite"
87         ;;
88   mn10300-*-*)
89         configdirs="${configdirs} mn10300 testsuite"
90         ;;
91   d30v-*-*)
92         configdirs="${configdirs} d30v testsuite"
93         ;;
94   fr30-*-*)
95         configdirs="${configdirs} fr30 testsuite"
96         ;;
97   frv*-*-*)
98         configdirs="${configdirs} frv testsuite"
99         ;;
100   mcore-*-*)
101         configdirs="${configdirs} mcore testsuite"
102         ;;
103   xstormy16-*-*)
104         configdirs="${configdirs} xstormy16 testsuite"
105         ;;
106   strongarm-*-elf | strongarm-*-coff)
107         configdirs="${configdirs} arm testsuite";
108         ;;
109   arm*-*-elf | arm*-*-coff)
110         configdirs="${configdirs} arm testsuite";
111         ;;
112   xscale-*-elf | xscale-*-coff)
113         configdirs="${configdirs} arm testsuite";
114         ;;
116 esac
118 # temporarily strip out testsuite
119 configdirs=`echo $configdirs | sed 's/testsuite//'`
121 AC_CONFIG_SUBDIRS($configdirs)
123 # FIXME: We temporarily define our own version of AC_PROG_CC.  This is
124 # copied from autoconf 2.12, but does not call AC_PROG_CC_WORKS.  We
125 # are probably using a cross compiler, which will not be able to fully
126 # link an executable.  This should really be fixed in autoconf
127 # itself.
129 AC_DEFUN(LIB_AC_PROG_CC,
130 [AC_BEFORE([$0], [AC_PROG_CPP])dnl
131 AC_CHECK_PROG(CC, gcc, gcc)
132 if test -z "$CC"; then
133   AC_CHECK_PROG(CC, cc, cc, , , /usr/ucb/cc)
134   test -z "$CC" && AC_MSG_ERROR([no acceptable cc found in \$PATH])
137 AC_PROG_CC_GNU
139 if test $ac_cv_prog_gcc = yes; then
140   GCC=yes
141 dnl Check whether -g works, even if CFLAGS is set, in case the package
142 dnl plays around with CFLAGS (such as to build both debugging and
143 dnl normal versions of a library), tasteless as that idea is.
144   ac_test_CFLAGS="${CFLAGS+set}"
145   ac_save_CFLAGS="$CFLAGS"
146   CFLAGS=
147   AC_PROG_CC_G
148   if test "$ac_test_CFLAGS" = set; then
149     CFLAGS="$ac_save_CFLAGS"
150   elif test $ac_cv_prog_cc_g = yes; then
151     CFLAGS="-g -O2"
152   else
153     CFLAGS="-O2"
154   fi
155 else
156   GCC=
157   test "${CFLAGS+set}" = set || CFLAGS="-g"
161 LIB_AC_PROG_CC
162 AS=${AS-as}
163 AC_SUBST(AS)
164 AC_CHECK_PROG(AR, ar, ar, :)
165 AR=${AR-ar}
166 AC_SUBST(AR)
167 LD=${LD-ld}
168 AC_SUBST(LD)
169 AC_PROG_RANLIB
171 host_makefile_frag=${srcdir}/config/default.mh
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.
177 host_makefile_frag_path=$host_makefile_frag
178 AC_SUBST(host_makefile_frag_path)
179 AC_SUBST_FILE(host_makefile_frag)
181 # for now, only add multilibs for specific targets
182 AC_OUTPUT(Makefile,
183 . ${libgloss_topdir}/config-ml.in,
184 srcdir=${srcdir}
185 target=${target}
186 with_multisubdir=${with_multisubdir}
187 ac_configure_args="--enable-multilib ${ac_configure_args}"
188 CONFIG_SHELL=${CONFIG_SHELL-/bin/sh}
189 libgloss_topdir=${libgloss_topdir}