You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

176 lines
6.1 KiB

  1. # -*- Autoconf -*-
  2. # Process this file with autoconf to produce a configure script.
  3. AC_PREREQ([2.69])
  4. AC_INIT([cudd], [3.0.0], [Fabio@Colorado.EDU])
  5. AC_CONFIG_AUX_DIR([build-aux])
  6. AC_CONFIG_MACRO_DIR([m4])
  7. AC_CANONICAL_HOST
  8. AM_INIT_AUTOMAKE(
  9. [1.14 -Wall -Werror foreign subdir-objects color-tests silent-rules]
  10. )
  11. AC_REQUIRE_AUX_FILE([tap-driver.sh])
  12. AC_ARG_ENABLE([dddmp],
  13. [AS_HELP_STRING([--enable-dddmp],[include libdddmp in libcudd])])
  14. AM_CONDITIONAL([DDDMP], [test x$enable_dddmp = xyes])
  15. AC_ARG_ENABLE([obj],
  16. [AS_HELP_STRING([--enable-obj],[include libobj in libcudd])])
  17. AM_CONDITIONAL([OBJ], [test x$enable_obj = xyes])
  18. AC_ARG_WITH([system-qsort],
  19. [AS_HELP_STRING([--with-system-qsort],
  20. [use system qsort instead of portable one])],
  21. [],[with_system_qsort=no])
  22. if test x$with_system_qsort != xno ; then
  23. AC_DEFINE([USE_SYSTEM_QSORT], [1], [Define to 1 to use system qsort])
  24. fi
  25. # Set our own default (instead of "-g -O2") unless CFLAGS is already defined.
  26. : ${CFLAGS="-Wall -Wextra -g -O3"}
  27. : ${CXXFLAGS="-Wall -Wextra -std=c++0x -g -O3"}
  28. AC_PROG_CC
  29. AC_PROG_CXX
  30. AM_PROG_AR
  31. LT_PREREQ([2.4])
  32. LT_INIT([win32-dll disable-shared])
  33. AC_CONFIG_SRCDIR([st/st.c])
  34. AC_CONFIG_HEADERS([config.h])
  35. # Checks for programs.
  36. AC_C_BIGENDIAN
  37. AM_CONDITIONAL([CROSS_COMPILING],[test x$cross_compiling = xyes])
  38. # Building documentation requires doxygen, pdflatex, and makeindex.
  39. AC_CHECK_PROGS([DOXYGEN], [doxygen])
  40. if test -z "$DOXYGEN"; then
  41. AC_MSG_WARN([Doxygen not found - continuing without Doxygen support])
  42. fi
  43. AM_CONDITIONAL([HAVE_DOXYGEN],[test -n "$DOXYGEN"])
  44. AM_COND_IF([HAVE_DOXYGEN], [AC_CONFIG_FILES([Doxyfile])])
  45. AC_CHECK_PROGS([PDFLATEX], [pdflatex])
  46. if test -z "$PDFLATEX"; then
  47. AC_MSG_WARN([pdflatex not found - unable to compile manual to PDF])
  48. fi
  49. AC_CHECK_PROGS([MAKEINDEX], [makeindex])
  50. if test -z "$MAKEINDEX"; then
  51. AC_MSG_WARN([makeindex not found - unable to compile manual to PDF])
  52. fi
  53. AM_CONDITIONAL([HAVE_PDFLATEX],[test -n "$PDFLATEX" && test -n "$MAKEINDEX"])
  54. AM_COND_IF([HAVE_PDFLATEX], [AC_CONFIG_FILES([doc/cudd.tex])])
  55. # Checks for libraries.
  56. #AC_CHECK_LIB([m],[pow])
  57. AC_SEARCH_LIBS([pow],[m])
  58. AC_CHECK_LIB([pthread],[pthread_create],[have_pthreads=yes],[have_pthreads=no])
  59. AM_CONDITIONAL([HAVE_PTHREADS],[test x$have_pthreads = xyes])
  60. # Check for Windows API functions.
  61. AC_SEARCH_LIBS([WSAStartup],[ws2_32])
  62. AC_SEARCH_LIBS([GetProcessMemoryInfo],[psapi])
  63. # Checks for header files.
  64. # First check for mandatory headers...
  65. AC_CHECK_HEADERS([float.h inttypes.h limits.h stddef.h stdlib.h string.h assert.h math.h], [], [have_mandatory_headers=no])
  66. if test "x${have_mandatory_headers}" = xno; then
  67. AC_MSG_ERROR([One or more mandatory headers missing. Check 'config.log'.])
  68. fi
  69. # ...then check for optional C headers.
  70. AC_CHECK_HEADERS([unistd.h sys/time.h sys/times.h sys/resource.h sys/wait.h])
  71. # Finally, check C++ optional headers.
  72. AC_MSG_CHECKING([for working C++ thread header])
  73. AC_LANG_PUSH([C++])
  74. AC_COMPILE_IFELSE(
  75. [AC_LANG_PROGRAM([#include <thread>], [[ std::thread([] {}).join()]])],
  76. [have_working_thread=yes],[have_working_thread=no])
  77. AC_LANG_POP([C++])
  78. if test x$have_working_thread = xyes ; then
  79. AC_MSG_RESULT(yes)
  80. AC_DEFINE([HAVE_WORKING_THREAD], [1], [Define to 1 if C++ thread header is usable])
  81. else
  82. AC_MSG_RESULT(no)
  83. fi
  84. # Checks for typedefs, structures, and compiler characteristics.
  85. AC_CHECK_HEADER_STDBOOL
  86. AC_C_INLINE
  87. AC_TYPE_SIZE_T
  88. AC_TYPE_UINT16_T
  89. AC_TYPE_UINT32_T
  90. AC_CHECK_TYPES([ptrdiff_t])
  91. AC_CHECK_SIZEOF([int])
  92. AC_CHECK_SIZEOF([long])
  93. AC_CHECK_SIZEOF([void *])
  94. AC_CHECK_SIZEOF([long double])
  95. MINGW_AC_WIN32_NATIVE_HOST
  96. AM_CONDITIONAL([MINGW64], [test x$mingw_cv_win32_host = xyes])
  97. if test x$mingw_cv_win32_host = xyes ; then
  98. AC_DEFINE([__USE_MINGW_ANSI_STDIO], [1], [Define to 1 to enable C99-compliant printf on MinGW-w64])
  99. fi
  100. MODERN_CXX
  101. if test x$ac_cv_have_modern_cxx = xyes ; then
  102. AC_DEFINE([HAVE_MODERN_CXX], [1], [Define to 1 if your compiler supports enough C++11])
  103. fi
  104. # Checks for library functions.
  105. # First the mandatory functions...
  106. AC_CHECK_FUNCS([pow sqrt strchr strstr],
  107. [], [have_mandatory_functions=no])
  108. if test "x${have_mandatory_functions}" = xno; then
  109. AC_MSG_ERROR([One or more mandatory functions missing. Check 'config.log'.])
  110. fi
  111. # ...then check for optional functions.
  112. AC_CHECK_FUNCS([powl gethostname getrlimit getrusage sysconf])
  113. # Check for a working implementation of IEEE 754 floating point
  114. # Specifically, check for correct treatment of +Infinity
  115. AC_MSG_CHECKING([for +Infinity (IEEE 754 floating point)])
  116. AC_CACHE_VAL(ac_cv_have_ieee_754,
  117. [ AC_TRY_RUN([
  118. #include <math.h>
  119. main(void)
  120. {
  121. if (HUGE_VAL != HUGE_VAL * 3 || HUGE_VAL != HUGE_VAL / 3) return 1;
  122. return 0;
  123. }
  124. ],ac_cv_have_ieee_754=yes,ac_cv_have_ieee_754=no,ac_cv_have_ieee_754=maybe)])
  125. if test x$ac_cv_have_ieee_754 = xmaybe ; then
  126. AC_COMPILE_IFELSE(
  127. [AC_LANG_PROGRAM([#include <math.h>], [ double x = INFINITY])],
  128. [ac_cv_have_ieee_754=yes],[ac_cv_have_ieee_754=no])
  129. fi
  130. if test x$ac_cv_have_ieee_754 = xyes ; then
  131. AC_MSG_RESULT(yes)
  132. AC_DEFINE([HAVE_IEEE_754], [1], [Define to 1 if you have working floating-point infinities])
  133. else
  134. AC_MSG_RESULT(no)
  135. fi
  136. AC_CONFIG_FILES([Makefile])
  137. AC_CONFIG_FILES([dddmp/exp/test1.sh], [chmod +x dddmp/exp/test1.sh])
  138. AC_CONFIG_FILES([dddmp/exp/test2.sh], [chmod +x dddmp/exp/test2.sh])
  139. AC_CONFIG_FILES([dddmp/exp/test3.sh], [chmod +x dddmp/exp/test3.sh])
  140. AC_CONFIG_FILES([dddmp/exp/test4.sh], [chmod +x dddmp/exp/test4.sh])
  141. AC_CONFIG_FILES([dddmp/exp/test5.sh], [chmod +x dddmp/exp/test5.sh])
  142. AC_CONFIG_FILES([dddmp/exp/test6.sh], [chmod +x dddmp/exp/test6.sh])
  143. AC_CONFIG_FILES([dddmp/exp/test7.sh], [chmod +x dddmp/exp/test7.sh])
  144. AC_OUTPUT
  145. echo \
  146. "--------------------------------------------------
  147. Configuration summary for ${PACKAGE_NAME} ${PACKAGE_VERSION}
  148. Build system : ${build}
  149. Host system : ${host}
  150. Prefix : '${prefix}'
  151. Compilers : '${CC} ${AM_CPPFLAGS} ${CPPFLAGS} ${AM_CFLAGS} ${CFLAGS}'
  152. : '${CXX} ${AM_CPPFLAGS} ${CPPFLAGS} ${AM_CXXFLAGS} ${CXXFLAGS}'
  153. Shared library : ${enable_shared}
  154. dddmp enabled : ${enable_dddmp:-no}
  155. obj enabled : ${enable_obj:-no}
  156. --------------------------------------------------"