configure.ac 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. # CODYlib -*- mode:autoconf -*-
  2. # Copyright (C) 2020 Nathan Sidwell, nathan@acm.org
  3. # License: Apache v2.0
  4. AC_INIT([codylib],[0.0],[github.com/urnathan/libcody])
  5. AC_CONFIG_SRCDIR(cody.hh)
  6. m4_include(config.m4)
  7. AC_CONFIG_AUX_DIR(..)
  8. AC_SUBST(PACKAGE_VERSION)
  9. AC_CANONICAL_HOST
  10. NMS_MAINTAINER_MODE
  11. NMS_CXX_COMPILER
  12. AC_LANG(C++)
  13. AC_PROG_CXX
  14. NMS_CXX_11
  15. NMS_LINK_OPT([-Wl,--no-undefined])
  16. # Enable expensive internal checks
  17. is_release=
  18. if test -d $srcdir/../gcc \
  19. && test -f $srcdir/../gcc/DEV-PHASE \
  20. && test x"`cat $srcdir/../gcc/DEV-PHASE`" != xexperimental; then
  21. is_release=yes
  22. fi
  23. dnl NMS_ENABLE_CHECKING
  24. dnl cloned from ../libcpp/configure.ac
  25. AC_ARG_ENABLE(checking,
  26. [AS_HELP_STRING([[--enable-checking[=LIST]]],
  27. [enable expensive run-time checks. With LIST,
  28. enable only specific categories of checks.
  29. Categories are: yes,no,all,none,release.
  30. Flags are: misc,valgrind or other strings])],
  31. [ac_checking_flags="${enableval}"],[
  32. # Determine the default checks.
  33. if test x$is_release = x ; then
  34. ac_checking_flags=yes
  35. else
  36. ac_checking_flags=release
  37. fi])
  38. IFS="${IFS= }"; ac_save_IFS="$IFS"; IFS="$IFS,"
  39. for check in release $ac_checking_flags
  40. do
  41. case $check in
  42. yes|all|misc) ac_checking=1 ;;
  43. no|none|release) ac_checking= ;;
  44. # accept
  45. *) ;;
  46. esac
  47. done
  48. IFS="$ac_save_IFS"
  49. if test x$ac_checking != x ; then
  50. AC_DEFINE(NMS_CHECKING, 1,
  51. [Define to 1 if you want more run-time sanity checks.])
  52. else
  53. AC_DEFINE(NMS_CHECKING, 0)
  54. fi
  55. # Enable --enable-host-shared.
  56. AC_ARG_ENABLE(host-shared,
  57. [AS_HELP_STRING([--enable-host-shared],
  58. [build host code as shared libraries])],
  59. [PICFLAG=-fPIC], [PICFLAG=])
  60. AC_SUBST(PICFLAG)
  61. NMS_ENABLE_EXCEPTIONS
  62. AC_PROG_RANLIB
  63. AC_CHECK_TOOL([AR],[ar])
  64. AH_VERBATIM([_GNU_SOURCE],[#define _GNU_SOURCE 1])
  65. AH_VERBATIM([_FORTIFY_SOURCE],[#undef _FORTIFY_SOURCE])
  66. AC_CONFIG_HEADERS([config.h])
  67. AC_CONFIG_FILES([Makefile])
  68. AC_SUBST(configure_args,[$ac_configure_args])
  69. AC_OUTPUT