]> git.ipfire.org Git - thirdparty/gcc.git/blame - libgcc/configure.ac
Add BID decimal support
[thirdparty/gcc.git] / libgcc / configure.ac
CommitLineData
fa958513
DJ
1dnl Process this file with autoconf to produce a configure script.
2
3sinclude(../config/acx.m4)
4sinclude(../config/no-executables.m4)
5
6AC_PREREQ(2.59)
7AC_INIT([GNU C Runtime Library], 1.0,,[libgcc])
8AC_CONFIG_SRCDIR([static-object.mk])
9
10AC_ARG_WITH(target-subdir,
11[ --with-target-subdir=SUBDIR Configuring in a subdirectory for target])
12AC_ARG_WITH(cross-host,
13[ --with-cross-host=HOST Configuring with a cross compiler])
14AC_ARG_WITH(ld,
15[ --with-ld arrange to use the specified ld (full pathname)])
16
17if test "${srcdir}" = "."; then
18 if test -n "${with_build_subdir}"; then
19 libgcc_topdir="${srcdir}/../.."
20 with_target_subdir=
21 elif test -z "${with_target_subdir}"; then
22 libgcc_topdir="${srcdir}/.."
23 else
24 if test "${with_target_subdir}" != "."; then
25 libgcc_topdir="${srcdir}/${with_multisrctop}../.."
26 else
27 libgcc_topdir="${srcdir}/${with_multisrctop}.."
28 fi
29 fi
30else
31 libgcc_topdir="${srcdir}/.."
32fi
33AC_SUBST(libgcc_topdir)
34AC_CONFIG_AUX_DIR($libgcc_topdir)
35
36AC_ARG_ENABLE(shared,
37[ --disable-shared don't provide a shared libgcc],
38[
39 case $enable_shared in
40 yes | no) ;;
41 *)
42 enable_shared=no
43 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
44 for pkg in $enableval; do
45 if test "X$pkg" = "Xgcc" || test "X$pkg" = "Xlibgcc"; then
46 enable_shared=yes
47 fi
48 done
49 IFS="$ac_save_ifs"
50 ;;
51 esac
52], [enable_shared=yes])
53AC_SUBST(enable_shared)
54
d6efbf5a
DJ
55AC_MSG_CHECKING([for --enable-version-specific-runtime-libs])
56AC_ARG_ENABLE(version-specific-runtime-libs,
57[ --enable-version-specific-runtime-libs Specify that runtime libraries should be installed in a compiler-specific directory ],
58[case "$enableval" in
59 yes) version_specific_libs=yes ;;
60 no) version_specific_libs=no ;;
61 *) AC_MSG_ERROR([Unknown argument to enable/disable version-specific libs]);;
62 esac],
63[version_specific_libs=no])
64AC_MSG_RESULT($version_specific_libs)
65
fa958513
DJ
66AC_ARG_WITH(slibdir,
67[ --with-slibdir=DIR shared libraries in DIR [LIBDIR]],
68slibdir="$with_slibdir",
d6efbf5a 69if test "${version_specific_libs}" = yes; then
fa958513 70 slibdir='$(libsubdir)'
d6efbf5a
DJ
71elif test -n "$with_cross_host" && test x"$with_cross_host" != x"no"; then
72 slibdir='$(exec_prefix)/$(host_noncanonical)/lib'
fa958513
DJ
73else
74 slibdir='$(libdir)'
75fi)
76AC_SUBST(slibdir)
77
78AC_PROG_INSTALL
79
80AC_PROG_AWK
81# We need awk; bail out if it's missing.
82case ${AWK} in
83 "") AC_MSG_ERROR([can't build without awk, bailing out]) ;;
84esac
85
86AC_CANONICAL_HOST
87ACX_NONCANONICAL_HOST
14e8fc8b 88GCC_TOPLEV_SUBDIRS
fa958513
DJ
89
90dnl These must be called before AM_PROG_LIBTOOL, because it may want
91dnl to call AC_CHECK_PROG.
92AC_CHECK_TOOL(AR, ar)
93AC_CHECK_TOOL(LIPO, lipo, :)
94AC_CHECK_TOOL(NM, nm)
95AC_CHECK_TOOL(RANLIB, ranlib, :)
96AC_CHECK_TOOL(STRIP, strip, :)
97AC_PROG_LN_S
98
99GCC_NO_EXECUTABLES
100AC_PROG_CC
101AC_PROG_CPP_WERROR
102
103# Check for decimal float support.
104AC_CACHE_CHECK([whether decimal floating point is supported], [libgcc_cv_dfp],
105 [AC_COMPILE_IFELSE([_Decimal32 x;], [libgcc_cv_dfp=yes],
106 [libgcc_cv_dfp=no])])
107decimal_float=$libgcc_cv_dfp
108AC_SUBST(decimal_float)
109
79b87c74
MM
110AC_ARG_ENABLE(decimal-float,
111[ --enable-decimal-float={no,yes,bid,dpd}
112 enable decimal float extension to C. Selecting 'bid'
113 or 'dpd' choses which decimal floating point format
114 to use],
115[
116 case $enable_decimal_float in
117 yes | no | bid | dpd) ;;
118 *) AC_MSG_ERROR(['$enable_decimal_float' is an invalid value for --enable-decimal-float.
119Valid choices are 'yes', 'bid', 'dpd', and 'no'.]) ;;
120 esac
121],
122[
123 case $target in
124 powerpc*-*-linux* | i?86*-*-linux* | x86_64*-*-linux*)
125 enable_decimal_float=yes
126 ;;
127 *)
128 enable_decimal_float=no
129 ;;
130 esac
131])
132
133# x86's use BID format instead of DPD
134if test x$enable_decimal_float = xyes; then
135 case $target in
136 i?86*-*-linux* | x86_64*-*-linux*)
137 enable_decimal_float=bid
138 ;;
139 *)
140 enable_decimal_float=dpd
141 ;;
142 esac
143fi
144AC_SUBST(enable_decimal_float)
145
fa958513
DJ
146# Collect host-machine-specific information.
147. ${srcdir}/config.host
148
149# Check for visibility support. This is after config.host so that
150# we can check for asm_hidden_op.
151AC_CACHE_CHECK([for __attribute__((visibility("hidden")))],
152 libgcc_cv_hidden_visibility_attribute, [
153 echo 'int __attribute__ ((visibility ("hidden"))) foo (void) { return 1; }' > conftest.c
154 libgcc_cv_hidden_visibility_attribute=no
155 if AC_TRY_COMMAND(${CC-cc} -Werror -S conftest.c -o conftest.s 1>&AS_MESSAGE_LOG_FD); then
156 if grep "\\$asm_hidden_op.*foo" conftest.s >/dev/null; then
157 libgcc_cv_hidden_visibility_attribute=yes
158 fi
159 fi
160 rm -f conftest.*
161 ])
162
163if test $libgcc_cv_hidden_visibility_attribute = yes; then
164 vis_hide='-fvisibility=hidden -DHIDE_EXPORTS'
165else
166 vis_hide=
167fi
168AC_SUBST(vis_hide)
169
170# Conditionalize the makefile for this target machine.
171tmake_file_=
172for f in ${tmake_file}
173do
174 if test -f ${srcdir}/config/$f
175 then
176 tmake_file_="${tmake_file_} \$(srcdir)/config/$f"
177 fi
178done
179tmake_file="${tmake_file_}"
180AC_SUBST(tmake_file)
181
182# Substitute configuration variables
183AC_SUBST(extra_parts)
184AC_SUBST(asm_hidden_op)
185
186# We need multilib support.
187AC_CONFIG_FILES([Makefile])
188AC_CONFIG_COMMANDS([default],
189 [[test -z "$CONFIG_HEADERS" || echo timestamp > stamp-h
190if test -n "$CONFIG_FILES"; then
191 # FIXME: We shouldn't need to set ac_file
192 ac_file=Makefile
193 . ${libgcc_topdir}/config-ml.in
194fi]],
195[[srcdir=${srcdir}
196host=${host}
197target=${target}
198with_target_subdir=${with_target_subdir}
199with_multisubdir=${with_multisubdir}
200ac_configure_args="--enable-multilib ${ac_configure_args}"
201CONFIG_SHELL=${CONFIG_SHELL-/bin/sh}
202libgcc_topdir=${libgcc_topdir}
203CC="${CC}"
204]])
205AC_OUTPUT