]> git.ipfire.org Git - thirdparty/gcc.git/blame - libdecnumber/configure.ac
2007-10-31 Thiago Jung Bauermann <bauerman@br.ibm.com>
[thirdparty/gcc.git] / libdecnumber / configure.ac
CommitLineData
84d7eab9 1# configure.ac for libdecnumber -*- Autoconf -*-
2# Process this file with autoconf to generate a configuration script.
3
56c15991 4# Copyright 2005, 2006 Free Software Foundation, Inc.
84d7eab9 5
6# This file is part of GCC.
7
8# GCC is free software; you can redistribute it and/or modify it under
9# the terms of the GNU General Public License as published by the Free
10# Software Foundation; either version 2, or (at your option) any
11# later #version.
12
13# GCC is distributed in the hope that it will be useful, but WITHOUT
14# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
15# or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
16# License #for more details.
17
18# You should have received a copy of the GNU General Public License
19# along with GCC; see the file COPYING. If not, write to the Free
20# Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA
21# 02110-1301, USA.
b1075c1b 22
23AC_PREREQ(2.59)
24AC_INIT(libdecnumber, [ ], gcc-bugs@gcc.gnu.org, libdecnumber)
25AC_CONFIG_SRCDIR(decNumber.h)
26AC_CONFIG_MACRO_DIR(../config)
27
28# Checks for programs.
29AC_PROG_MAKE_SET
30AC_PROG_CC
31AC_PROG_RANLIB
32
33MISSING=`cd $ac_aux_dir && ${PWDCMD-pwd}`/missing
34AC_CHECK_PROGS([ACLOCAL], [aclocal], [$MISSING aclocal])
35AC_CHECK_PROGS([AUTOCONF], [autoconf], [$MISSING autoconf])
36AC_CHECK_PROGS([AUTOHEADER], [autoheader], [$MISSING autoheader])
37
38# Figure out what compiler warnings we can enable.
39# See config/warnings.m4 for details.
40
41ACX_PROG_CC_WARNING_OPTS([-W -Wall -Wwrite-strings -Wstrict-prototypes \
42 -Wmissing-prototypes -Wold-style-definition \
d22a76db 43 -Wmissing-format-attribute -Wcast-qual])
b1075c1b 44ACX_PROG_CC_WARNING_ALMOST_PEDANTIC([-Wno-long-long])
45
46# Only enable with --enable-werror-always until existing warnings are
47# corrected.
48ACX_PROG_CC_WARNINGS_ARE_ERRORS([manual])
49
50# Checks for header files.
51AC_CHECK_HEADERS(ctype.h stddef.h string.h stdio.h)
56c15991 52GCC_HEADER_STDINT(gstdint.h)
b1075c1b 53
54# Checks for typedefs, structures, and compiler characteristics.
55AC_C_CONST
56AC_TYPE_OFF_T
57AC_CHECK_SIZEOF(int)
58AC_CHECK_SIZEOF(long)
59
60# Checks for library functions.
61AC_HEADER_STDC
62
63AC_ARG_ENABLE(maintainer-mode,
64[ --enable-maintainer-mode enable rules only needed by maintainers],,
65enable_maintainer_mode=no)
66
67if test "x$enable_maintainer_mode" = xno; then
68 MAINT='#'
69else
70 MAINT=
71fi
72AC_SUBST(MAINT)
73
8da7bb5d 74AC_CANONICAL_TARGET
75
10de71e1 76# Default decimal format
77# If you change the defaults here, be sure to change them in the GCC directory also
78AC_MSG_CHECKING([for decimal floating point])
79AC_ARG_ENABLE(decimal-float,
80[ --enable-decimal-float={no,yes,bid,dpd}
81 enable decimal float extension to C. Selecting 'bid'
82 or 'dpd' choses which decimal floating point format
83 to use],
84[
85 case $enable_decimal_float in
86 yes | no | bid | dpd) ;;
87 *) AC_MSG_ERROR(['$enable_decimal_float' is an invalid value for --enable-decimal-float.
88Valid choices are 'yes', 'bid', 'dpd', and 'no'.]) ;;
89 esac
90],
91[
92 case $target in
93 powerpc*-*-linux* | i?86*-*-linux* | x86_64*-*-linux*)
94 enable_decimal_float=yes
95 ;;
96 *)
97 enable_decimal_float=no
98 ;;
99 esac
100])
101
102# x86's use BID format instead of DPD
103# In theory --enable-decimal-float=no should not compile anything
104# For the sake of simplicity, just use the default format in this directory
105if test x$enable_decimal_float = xyes -o x$enable_decimal_float = xno; then
106 case $target in
107 i?86*-*-linux* | x86_64*-*-linux*)
108 enable_decimal_float=bid
109 ;;
110 *)
111 enable_decimal_float=dpd
112 ;;
113 esac
114fi
115
36fb5685 116# If BID is being used, additional objects should be linked in.
117if test x$enable_decimal_float = xbid; then
118 ADDITIONAL_OBJS="$ADDITIONAL_OBJS \$(bid_OBJS)"
119else
120 ADDITIONAL_OBJS=
121fi
122
10de71e1 123AC_MSG_RESULT($enable_decimal_float)
124AC_SUBST(enable_decimal_float)
36fb5685 125AC_SUBST(ADDITIONAL_OBJS)
10de71e1 126
127AC_C_BIGENDIAN
128
b1075c1b 129# Output.
130
131AC_CONFIG_HEADERS(config.h:config.in, [echo timestamp > stamp-h1])
132AC_CONFIG_FILES(Makefile)
133AC_OUTPUT