OSDN Git Service

1a36964c34e78286131b79d9bf81f70a790e4a9b
[pf3gnuchains/gcc-fork.git] / libgcc / configure.ac
1 dnl Process this file with autoconf to produce a configure script.
2
3 sinclude(../config/acx.m4)
4 sinclude(../config/no-executables.m4)
5
6 AC_PREREQ(2.59)
7 AC_INIT([GNU C Runtime Library], 1.0,,[libgcc])
8 AC_CONFIG_SRCDIR([static-object.mk])
9
10 AC_ARG_WITH(target-subdir,
11 [  --with-target-subdir=SUBDIR      Configuring in a subdirectory for target])
12 AC_ARG_WITH(cross-host,
13 [  --with-cross-host=HOST           Configuring with a cross compiler])
14 AC_ARG_WITH(ld,
15 [  --with-ld               arrange to use the specified ld (full pathname)])
16
17 if 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
30 else
31   libgcc_topdir="${srcdir}/.."
32 fi
33 AC_SUBST(libgcc_topdir)
34 AC_CONFIG_AUX_DIR($libgcc_topdir)
35
36 AC_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])
53 AC_SUBST(enable_shared)
54
55 AC_ARG_WITH(slibdir,
56 [  --with-slibdir=DIR      shared libraries in DIR [LIBDIR]],
57 slibdir="$with_slibdir",
58 if test "${enable_version_specific_runtime_libs+set}" = set; then
59   slibdir='$(libsubdir)'
60 elif test "$host" != "$target"; then
61   slibdir='$(build_tooldir)/lib'
62 else
63   slibdir='$(libdir)'
64 fi)
65 AC_SUBST(slibdir)
66
67 AC_PROG_INSTALL
68
69 AC_PROG_AWK
70 # We need awk; bail out if it's missing.
71 case ${AWK} in
72   "") AC_MSG_ERROR([can't build without awk, bailing out]) ;;
73 esac
74
75 AC_CANONICAL_HOST
76 ACX_NONCANONICAL_HOST
77
78 dnl These must be called before AM_PROG_LIBTOOL, because it may want
79 dnl to call AC_CHECK_PROG.
80 AC_CHECK_TOOL(AR, ar)
81 AC_CHECK_TOOL(LIPO, lipo, :)
82 AC_CHECK_TOOL(NM, nm)
83 AC_CHECK_TOOL(RANLIB, ranlib, :)
84 AC_CHECK_TOOL(STRIP, strip, :)
85 AC_PROG_LN_S
86
87 GCC_NO_EXECUTABLES
88 AC_PROG_CC
89 AC_PROG_CPP_WERROR
90
91 # Check for decimal float support.
92 AC_CACHE_CHECK([whether decimal floating point is supported], [libgcc_cv_dfp],
93                [AC_COMPILE_IFELSE([_Decimal32 x;], [libgcc_cv_dfp=yes],
94                                   [libgcc_cv_dfp=no])])
95 decimal_float=$libgcc_cv_dfp
96 AC_SUBST(decimal_float)
97
98 # Collect host-machine-specific information.
99 . ${srcdir}/config.host
100
101 # Check for visibility support.  This is after config.host so that
102 # we can check for asm_hidden_op.
103 AC_CACHE_CHECK([for __attribute__((visibility("hidden")))],
104     libgcc_cv_hidden_visibility_attribute, [
105         echo 'int __attribute__ ((visibility ("hidden"))) foo (void) { return 1; }' > conftest.c
106         libgcc_cv_hidden_visibility_attribute=no
107         if AC_TRY_COMMAND(${CC-cc} -Werror -S conftest.c -o conftest.s 1>&AS_MESSAGE_LOG_FD); then
108             if grep "\\$asm_hidden_op.*foo" conftest.s >/dev/null; then
109                 libgcc_cv_hidden_visibility_attribute=yes
110             fi
111         fi
112         rm -f conftest.*
113     ])
114
115 if test $libgcc_cv_hidden_visibility_attribute = yes; then
116     vis_hide='-fvisibility=hidden -DHIDE_EXPORTS'
117 else
118     vis_hide=
119 fi
120 AC_SUBST(vis_hide)
121
122 # Conditionalize the makefile for this target machine.
123 tmake_file_=
124 for f in ${tmake_file}
125 do
126         if test -f ${srcdir}/config/$f
127         then
128                 tmake_file_="${tmake_file_} \$(srcdir)/config/$f"
129         fi
130 done
131 tmake_file="${tmake_file_}"
132 AC_SUBST(tmake_file)
133
134 # Substitute configuration variables
135 AC_SUBST(extra_parts)
136 AC_SUBST(asm_hidden_op)
137
138 # We need multilib support.
139 AC_CONFIG_FILES([Makefile])
140 AC_CONFIG_COMMANDS([default],
141   [[test -z "$CONFIG_HEADERS" || echo timestamp > stamp-h
142 if test -n "$CONFIG_FILES"; then
143   # FIXME: We shouldn't need to set ac_file
144   ac_file=Makefile
145   . ${libgcc_topdir}/config-ml.in
146 fi]],
147 [[srcdir=${srcdir}
148 host=${host}
149 target=${target}
150 with_target_subdir=${with_target_subdir}
151 with_multisubdir=${with_multisubdir}
152 ac_configure_args="--enable-multilib ${ac_configure_args}"
153 CONFIG_SHELL=${CONFIG_SHELL-/bin/sh}
154 libgcc_topdir=${libgcc_topdir}
155 CC="${CC}"
156 ]])
157 AC_OUTPUT