1 # CODYlib -*- mode:autoconf -*-
2 # Copyright (C) 2020 Nathan Sidwell, nathan@acm.org
5 AC_INIT([codylib],[0.0],[github.com/urnathan/libcody])
6 AC_CONFIG_SRCDIR(cody.hh)
10 AC_SUBST(PACKAGE_VERSION)
19 NMS_LINK_OPT([-Wl,--no-undefined])
21 # Enable expensive internal checks
23 if test -d $srcdir/../gcc \
24 && test -f $srcdir/../gcc/DEV-PHASE \
25 && test x"`cat $srcdir/../gcc/DEV-PHASE`" != xexperimental; then
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
42 ac_checking_flags=release
44 IFS="${IFS= }"; ac_save_IFS="$IFS"; IFS="$IFS,"
45 for check in release $ac_checking_flags
48 yes|all|misc) ac_checking=1 ;;
49 no|none|release) ac_checking= ;;
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.])
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
77 elif test x$enable_host_pie = xyes; then
83 if test x$enable_host_pie = xyes; then
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])