| 1 |
271 |
jeremybenn |
# configure.ac for libdecnumber -*- Autoconf -*-
|
| 2 |
|
|
# Process this file with autoconf to generate a configuration script.
|
| 3 |
|
|
|
| 4 |
|
|
# Copyright 2005, 2006, 2009 Free Software Foundation, Inc.
|
| 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 3, 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 COPYING3. If not see
|
| 20 |
|
|
# .
|
| 21 |
|
|
|
| 22 |
|
|
AC_PREREQ(2.64)
|
| 23 |
|
|
AC_INIT(libdecnumber, [ ], gcc-bugs@gcc.gnu.org, libdecnumber)
|
| 24 |
|
|
AC_CONFIG_SRCDIR(decNumber.h)
|
| 25 |
|
|
AC_CONFIG_MACRO_DIR(../config)
|
| 26 |
|
|
|
| 27 |
|
|
# Checks for programs.
|
| 28 |
|
|
AC_PROG_MAKE_SET
|
| 29 |
|
|
AC_PROG_CC
|
| 30 |
|
|
AC_PROG_RANLIB
|
| 31 |
|
|
|
| 32 |
|
|
MISSING=`cd $ac_aux_dir && ${PWDCMD-pwd}`/missing
|
| 33 |
|
|
AC_CHECK_PROGS([ACLOCAL], [aclocal], [$MISSING aclocal])
|
| 34 |
|
|
AC_CHECK_PROGS([AUTOCONF], [autoconf], [$MISSING autoconf])
|
| 35 |
|
|
AC_CHECK_PROGS([AUTOHEADER], [autoheader], [$MISSING autoheader])
|
| 36 |
|
|
|
| 37 |
|
|
# Figure out what compiler warnings we can enable.
|
| 38 |
|
|
# See config/warnings.m4 for details.
|
| 39 |
|
|
|
| 40 |
|
|
ACX_PROG_CC_WARNING_OPTS([-W -Wall -Wwrite-strings -Wstrict-prototypes \
|
| 41 |
|
|
-Wmissing-prototypes -Wold-style-definition \
|
| 42 |
|
|
-Wmissing-format-attribute -Wcast-qual])
|
| 43 |
|
|
ACX_PROG_CC_WARNING_ALMOST_PEDANTIC([-Wno-long-long])
|
| 44 |
|
|
|
| 45 |
|
|
# Only enable with --enable-werror-always until existing warnings are
|
| 46 |
|
|
# corrected.
|
| 47 |
|
|
ACX_PROG_CC_WARNINGS_ARE_ERRORS([manual])
|
| 48 |
|
|
|
| 49 |
|
|
# Checks for header files.
|
| 50 |
|
|
AC_CHECK_HEADERS(ctype.h stddef.h string.h stdio.h)
|
| 51 |
|
|
GCC_HEADER_STDINT(gstdint.h)
|
| 52 |
|
|
|
| 53 |
|
|
# Checks for typedefs, structures, and compiler characteristics.
|
| 54 |
|
|
AC_C_CONST
|
| 55 |
|
|
AC_TYPE_OFF_T
|
| 56 |
|
|
AC_CHECK_SIZEOF(int)
|
| 57 |
|
|
AC_CHECK_SIZEOF(long)
|
| 58 |
|
|
|
| 59 |
|
|
# Checks for library functions.
|
| 60 |
|
|
AC_HEADER_STDC
|
| 61 |
|
|
|
| 62 |
|
|
AC_ARG_ENABLE(maintainer-mode,
|
| 63 |
|
|
[ --enable-maintainer-mode enable rules only needed by maintainers],,
|
| 64 |
|
|
enable_maintainer_mode=no)
|
| 65 |
|
|
|
| 66 |
|
|
if test "x$enable_maintainer_mode" = xno; then
|
| 67 |
|
|
MAINT='#'
|
| 68 |
|
|
else
|
| 69 |
|
|
MAINT=
|
| 70 |
|
|
fi
|
| 71 |
|
|
AC_SUBST(MAINT)
|
| 72 |
|
|
|
| 73 |
|
|
AC_CANONICAL_TARGET
|
| 74 |
|
|
|
| 75 |
|
|
# Default decimal format
|
| 76 |
|
|
# If you change the defaults here, be sure to change them in the GCC directory also
|
| 77 |
|
|
AC_MSG_CHECKING([for decimal floating point])
|
| 78 |
|
|
AC_ARG_ENABLE(decimal-float,
|
| 79 |
|
|
[ --enable-decimal-float={no,yes,bid,dpd}
|
| 80 |
|
|
enable decimal float extension to C. Selecting 'bid'
|
| 81 |
|
|
or 'dpd' choses which decimal floating point format
|
| 82 |
|
|
to use],
|
| 83 |
|
|
[
|
| 84 |
|
|
case $enable_decimal_float in
|
| 85 |
|
|
yes | no | bid | dpd) ;;
|
| 86 |
|
|
*) AC_MSG_ERROR(['$enable_decimal_float' is an invalid value for --enable-decimal-float.
|
| 87 |
|
|
Valid choices are 'yes', 'bid', 'dpd', and 'no'.]) ;;
|
| 88 |
|
|
esac
|
| 89 |
|
|
],
|
| 90 |
|
|
[
|
| 91 |
|
|
case $target in
|
| 92 |
|
|
powerpc*-*-linux* | i?86*-*-linux* | x86_64*-*-linux*)
|
| 93 |
|
|
enable_decimal_float=yes
|
| 94 |
|
|
;;
|
| 95 |
|
|
*)
|
| 96 |
|
|
enable_decimal_float=no
|
| 97 |
|
|
;;
|
| 98 |
|
|
esac
|
| 99 |
|
|
])
|
| 100 |
|
|
|
| 101 |
|
|
# x86's use BID format instead of DPD
|
| 102 |
|
|
# In theory --enable-decimal-float=no should not compile anything
|
| 103 |
|
|
# For the sake of simplicity, just use the default format in this directory
|
| 104 |
|
|
if test x$enable_decimal_float = xyes -o x$enable_decimal_float = xno; then
|
| 105 |
|
|
case $target in
|
| 106 |
|
|
i?86*-*-linux* | x86_64*-*-linux*)
|
| 107 |
|
|
enable_decimal_float=bid
|
| 108 |
|
|
;;
|
| 109 |
|
|
*)
|
| 110 |
|
|
enable_decimal_float=dpd
|
| 111 |
|
|
;;
|
| 112 |
|
|
esac
|
| 113 |
|
|
fi
|
| 114 |
|
|
|
| 115 |
|
|
# If BID is being used, additional objects should be linked in.
|
| 116 |
|
|
if test x$enable_decimal_float = xbid; then
|
| 117 |
|
|
ADDITIONAL_OBJS="$ADDITIONAL_OBJS \$(bid_OBJS)"
|
| 118 |
|
|
else
|
| 119 |
|
|
ADDITIONAL_OBJS=
|
| 120 |
|
|
fi
|
| 121 |
|
|
|
| 122 |
|
|
AC_MSG_RESULT($enable_decimal_float)
|
| 123 |
|
|
AC_SUBST(enable_decimal_float)
|
| 124 |
|
|
AC_SUBST(ADDITIONAL_OBJS)
|
| 125 |
|
|
|
| 126 |
|
|
AC_C_BIGENDIAN
|
| 127 |
|
|
|
| 128 |
|
|
# Output.
|
| 129 |
|
|
|
| 130 |
|
|
AC_CONFIG_HEADERS(config.h:config.in, [echo timestamp > stamp-h1])
|
| 131 |
|
|
AC_CONFIG_FILES(Makefile)
|
| 132 |
|
|
AC_OUTPUT
|