configure.ac 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151
  1. #
  2. # /*
  3. # * This program is free software: you can redistribute it and/or modify
  4. # * it under the terms of the GNU General Public License as published by
  5. # * the Free Software Foundation, either version 3 of the License, or
  6. # * (at your option) any later version.
  7. # *
  8. # * This program is distributed in the hope that it will be useful,
  9. # * but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. # * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  11. # * GNU General Public License for more details.
  12. # *
  13. # * You should have received a copy of the GNU General Public License
  14. # * along with this program. If not, see <http://www.gnu.org/licenses/>.
  15. # *
  16. # * SPDX-License-Identifier: GPL-3.0+
  17. # * License-Filename: LICENSE
  18. # *
  19. # */
  20. #
  21. # -*- Autoconf -*-
  22. # Process this file with autoconf to produce a configure script.
  23. # Macro: AC_INIT (package, version, [bug-report], [tarname], [url])
  24. # minor version number is increased at important feature change
  25. # Process with autogen.sh or manual:
  26. # aclocal
  27. # autoheader
  28. # autoconf
  29. # libtoolize --force --automake
  30. # automake -a --gnu --include-deps
  31. # or do this all using autoreconf -fvim
  32. #
  33. # -*- Autoconf -*-
  34. # Process this file with autoconf to produce a configure script.
  35. AC_PREREQ([2.69])
  36. AC_INIT([miptgraph], [2.0], [mooigraph@gmail.com], [miptgraph.tar.gz], [https://notabug.org/mooigraph/miptgraph])
  37. AC_CONFIG_SRCDIR([src/Layout/LEdge.h])
  38. AC_CONFIG_HEADERS([config.h])
  39. AC_CONFIG_MACRO_DIRS([m4])
  40. AM_INIT_AUTOMAKE([-Wall])
  41. AM_SILENT_RULES([no])
  42. # Checks for header files.
  43. AC_CHECK_HEADERS([stdlib.h])
  44. # add here compile flags
  45. #CFLAGS="$CFLAGS -fplugin=$HOME/scallgraph_plugin.so.0.0.0"
  46. CFLAGS="$CFLAGS -Wall -Wextra"
  47. AC_SUBST(CFLAGS)
  48. # Checks for programs.
  49. AC_PROG_CXX
  50. AC_PROG_CC
  51. AC_PROG_MAKE_SET
  52. AM_PROG_AR
  53. AC_PROG_LIBTOOL
  54. AM_PROG_LIBTOOL
  55. LT_INIT
  56. # Checks for typedefs, structures, and compiler characteristics.
  57. AC_CHECK_HEADER_STDBOOL
  58. AC_TYPE_SIZE_T
  59. # compilation date in config.h
  60. # CONFIG_DATE=`date +"%a %x %Y"`
  61. # CONFIG_DATE=`date +"%a %d %b %Y"`
  62. # unix timestamp
  63. # date +%s
  64. # utc time
  65. CONFIG_DATE=`date -u `
  66. AC_SUBST(CONFIG_DATE)
  67. AC_DEFINE_UNQUOTED(COMPILE_DATE, ["$CONFIG_DATE"], [Year, month and day this program is compiled.])
  68. # short system name in config.h
  69. CONFIG_UNAME=`uname -s`
  70. AC_SUBST(CONFIG_UNAME)
  71. AC_DEFINE_UNQUOTED(COMPILE_UNAME, ["$CONFIG_UNAME"], [System where this is compiled.])
  72. AC_COPYRIGHT([
  73. # /*
  74. # * This program is free software: you can redistribute it and/or modify
  75. # * it under the terms of the GNU General Public License as published by
  76. # * the Free Software Foundation, either version 3 of the License, or
  77. # * (at your option) any later version.
  78. # *
  79. # * This program is distributed in the hope that it will be useful,
  80. # * but WITHOUT ANY WARRANTY; without even the implied warranty of
  81. # * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  82. # * GNU General Public License for more details.
  83. # *
  84. # * You should have received a copy of the GNU General Public License
  85. # * along with this program. If not, see <http://www.gnu.org/licenses/>.
  86. # *
  87. # * SPDX-License-Identifier: GPL-3.0+
  88. # * License-Filename: LICENSE
  89. # *
  90. # */
  91. ])
  92. AC_CONFIG_FILES([Makefile src/Makefile src/Layout/Makefile src/test1/Makefile])
  93. # set here cflags
  94. CFLAGS="$CFLAGS \
  95. -Wall \
  96. -Wextra \
  97. -pedantic"
  98. # option here to use asan instead of valgrind
  99. # https://github.com/google/sanitizers/wiki/AddressSanitizer
  100. CFLAGSASAN="$CFLAGS \
  101. -fsanitize=address \
  102. -fsanitize=undefined \
  103. -fsanitize-recover=address \
  104. -fsanitize=bounds \
  105. -fsanitize=vptr \
  106. -fsanitize=enum \
  107. -fsanitize=signed-integer-overflow \
  108. -fsanitize=null \
  109. -fsanitize=return \
  110. -fsanitize=integer-divide-by-zero \
  111. -fsanitize=unreachable \
  112. -fsanitize=alignment"
  113. AC_OUTPUT
  114. AC_MSG_NOTICE([
  115. Configuration:
  116. Source code location ${srcdir}
  117. Build code location ${builddir}
  118. Destination prefix ${prefix}
  119. CXX-Compiler ${CXX}
  120. Config warning flags "${WARNING_CFLAGS}"
  121. Config CFLAGS "${CFLAGS}"
  122. Config LIBS "${LIBS}"
  123. Config PACKAGE_CFLAGS "$PACKAGE_CFLAGS"
  124. ])