extend.texi: Mark builtin arguments with @var{...}
[official-gcc.git] / libcody / configure.ac
blob14e8dd4a2260700146d41ea0589bbd85a037f77a
1 # CODYlib  -*- mode:autoconf -*-
2 # Copyright (C) 2020 Nathan Sidwell, nathan@acm.org
3 # License: Apache v2.0
5 AC_INIT([codylib],[0.0],[github.com/urnathan/libcody])
6 AC_CONFIG_SRCDIR(cody.hh)
7 m4_include(config.m4)
9 AC_CONFIG_AUX_DIR(..)
10 AC_SUBST(PACKAGE_VERSION)
12 AC_CANONICAL_HOST
14 NMS_MAINTAINER_MODE
15 NMS_CXX_COMPILER
16 AC_LANG(C++)
17 AC_PROG_CXX
18 NMS_CXX_11
19 NMS_LINK_OPT([-Wl,--no-undefined])
21 # Enable expensive internal checks
22 is_release=
23 if test -d $srcdir/../gcc \
24    && test -f $srcdir/../gcc/DEV-PHASE \
25    && test x"`cat $srcdir/../gcc/DEV-PHASE`" != xexperimental; then
26   is_release=yes
29 dnl NMS_ENABLE_CHECKING
30 dnl cloned from ../libcpp/configure.ac
31 AC_ARG_ENABLE(checking,
32 [AS_HELP_STRING([[--enable-checking[=LIST]]],
33                 [enable expensive run-time checks.  With LIST,
34                  enable only specific categories of checks.
35                  Categories are: yes,no,all,none,release.
36                  Flags are: misc,valgrind or other strings])],
37 [ac_checking_flags="${enableval}"],[
38 # Determine the default checks.
39 if test x$is_release = x ; then
40   ac_checking_flags=yes
41 else
42   ac_checking_flags=release
43 fi])
44 IFS="${IFS=     }"; ac_save_IFS="$IFS"; IFS="$IFS,"
45 for check in release $ac_checking_flags
47         case $check in
48         yes|all|misc) ac_checking=1 ;;
49         no|none|release) ac_checking= ;;
50         # accept
51         *) ;;
52         esac
53 done
54 IFS="$ac_save_IFS"
55                 
56 if test x$ac_checking != x ; then
57   AC_DEFINE(NMS_CHECKING, 1,
58 [Define to 1 if you want more run-time sanity checks.])
59 else
60   AC_DEFINE(NMS_CHECKING, 0)
63 # Enable --enable-host-shared.
64 AC_ARG_ENABLE(host-shared,
65 [AS_HELP_STRING([--enable-host-shared],
66                 [build host code as shared libraries])])
67 AC_SUBST(enable_host_shared)
69 # Enable --enable-host-pie.
70 AC_ARG_ENABLE(host-pie,
71 [AS_HELP_STRING([--enable-host-pie],
72                 [build host code as PIE])])
73 AC_SUBST(enable_host_pie)
75 if test x$enable_host_shared = xyes; then
76   PICFLAG=-fPIC
77 elif test x$enable_host_pie = xyes; then
78   PICFLAG=-fPIE
79 else
80   PICFLAG=
83 if test x$enable_host_pie = xyes; then
84   LD_PICFLAG=-pie
85 else
86   LD_PICFLAG=
89 AC_SUBST(PICFLAG)
90 AC_SUBST(LD_PICFLAG)
92 NMS_ENABLE_EXCEPTIONS
94 AC_PROG_RANLIB
95 AC_CHECK_TOOL([AR],[ar])
96 AH_VERBATIM([_GNU_SOURCE],[#define _GNU_SOURCE 1])
97 AH_VERBATIM([_FORTIFY_SOURCE],[#undef _FORTIFY_SOURCE])
98 AC_CONFIG_HEADERS([config.h])
100 AC_CONFIG_FILES([Makefile])
101 AC_SUBST(configure_args,[$ac_configure_args])
103 AC_OUTPUT