]> git.ipfire.org Git - thirdparty/gcc.git/blame - libdecnumber/configure.ac
configure: Implement --enable-host-pie
[thirdparty/gcc.git] / libdecnumber / configure.ac
CommitLineData
c0173136
BE
1# configure.ac for libdecnumber -*- Autoconf -*-
2# Process this file with autoconf to generate a configuration script.
3
7adcbafe 4# Copyright (C) 2005-2022 Free Software Foundation, Inc.
c0173136
BE
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
748086b7 10# Software Foundation; either version 3, or (at your option) any
c0173136
BE
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
748086b7
JJ
19# along with GCC; see the file COPYING3. If not see
20# <http://www.gnu.org/licenses/>.
8fdb0857 21
8fdb0857
BE
22AC_INIT(libdecnumber, [ ], gcc-bugs@gcc.gnu.org, libdecnumber)
23AC_CONFIG_SRCDIR(decNumber.h)
24AC_CONFIG_MACRO_DIR(../config)
309f50b9 25AC_CONFIG_AUX_DIR(..)
8fdb0857
BE
26
27# Checks for programs.
28AC_PROG_MAKE_SET
29AC_PROG_CC
30AC_PROG_RANLIB
731c4ce0 31AC_CHECK_TOOL(AR, ar)
8fdb0857
BE
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 \
aa4f41c1 43 -Wmissing-format-attribute -Wcast-qual])
8fdb0857
BE
44ACX_PROG_CC_WARNING_ALMOST_PEDANTIC([-Wno-long-long])
45
8a1f09e4
JJ
46ACX_PROG_CC_WARNING_OPTS([-fno-lto], [nolto_flags])
47
8fdb0857
BE
48# Only enable with --enable-werror-always until existing warnings are
49# corrected.
50ACX_PROG_CC_WARNINGS_ARE_ERRORS([manual])
51
52# Checks for header files.
53AC_CHECK_HEADERS(ctype.h stddef.h string.h stdio.h)
4c4b3eb0 54GCC_HEADER_STDINT(gstdint.h)
8fdb0857
BE
55
56# Checks for typedefs, structures, and compiler characteristics.
57AC_C_CONST
58AC_TYPE_OFF_T
59AC_CHECK_SIZEOF(int)
60AC_CHECK_SIZEOF(long)
61
62# Checks for library functions.
63AC_HEADER_STDC
64
65AC_ARG_ENABLE(maintainer-mode,
66[ --enable-maintainer-mode enable rules only needed by maintainers],,
67enable_maintainer_mode=no)
68
69if test "x$enable_maintainer_mode" = xno; then
70 MAINT='#'
71else
72 MAINT=
73fi
74AC_SUBST(MAINT)
75
f808a484
MM
76AC_CANONICAL_TARGET
77
79b87c74
MM
78# Default decimal format
79# If you change the defaults here, be sure to change them in the GCC directory also
80AC_MSG_CHECKING([for decimal floating point])
3c39bca6
AK
81
82GCC_AC_ENABLE_DECIMAL_FLOAT([$target])
79b87c74 83
cc0ae0ca
L
84# Use default_decimal_float for dependency.
85enable_decimal_float=$default_decimal_float
86
b1237e13
TJB
87# If BID is being used, additional objects should be linked in.
88if test x$enable_decimal_float = xbid; then
89 ADDITIONAL_OBJS="$ADDITIONAL_OBJS \$(bid_OBJS)"
90else
91 ADDITIONAL_OBJS=
92fi
93
79b87c74
MM
94AC_MSG_RESULT($enable_decimal_float)
95AC_SUBST(enable_decimal_float)
b1237e13 96AC_SUBST(ADDITIONAL_OBJS)
79b87c74
MM
97
98AC_C_BIGENDIAN
99
459260ec
DM
100# Enable --enable-host-shared.
101AC_ARG_ENABLE(host-shared,
102[AS_HELP_STRING([--enable-host-shared],
251c72a6
MP
103 [build host code as shared libraries])])
104AC_SUBST(enable_host_shared)
105
106# Enable --enable-host-pie.
107AC_ARG_ENABLE(host-pie,
108[AS_HELP_STRING([--enable-host-pie],
109 [build host code as PIE])])
110AC_SUBST(enable_host_pie)
111
112if test x$enable_host_shared = xyes; then
113 PICFLAG=-fPIC
114elif test x$enable_host_pie = xyes; then
115 PICFLAG=-fPIE
116else
117 PICFLAG=
118fi
119
459260ec
DM
120AC_SUBST(PICFLAG)
121
b3d16040
L
122# Enable Intel CET on Intel CET enabled host if jit is enabled.
123GCC_CET_HOST_FLAGS(CET_HOST_FLAGS)
124case x$enable_languages in
125*jit*)
126 ;;
127*)
128 CET_HOST_FLAGS=
129 ;;
130esac
131AC_SUBST(CET_HOST_FLAGS)
132
133
8fdb0857
BE
134# Output.
135
136AC_CONFIG_HEADERS(config.h:config.in, [echo timestamp > stamp-h1])
137AC_CONFIG_FILES(Makefile)
138AC_OUTPUT