configure.in 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  1. # Process this file with autoconf to produce a configure script.
  2. AC_INIT()
  3. AC_CONFIG_HEADER(Source/cmConfigure.h)
  4. CMAKE_CONFIG_DIR=`pwd`
  5. AC_SUBST(CMAKE_CONFIG_DIR)
  6. #
  7. # check for some programs we use
  8. #
  9. AC_PROG_CC
  10. AC_PROG_CXX
  11. AC_PROG_INSTALL
  12. fullSrcDir=`cd $srcdir; pwd`
  13. CMAKE_ROOT_DIR=$fullSrcDir
  14. AC_SUBST(CMAKE_ROOT_DIR)
  15. CMAKE_ANSI_CFLAGS=""
  16. # on hp use -Aa for ansi
  17. if test $ac_cv_prog_gxx = no; then
  18. case $system in
  19. HP-UX-*.08.*|HP-UX-*.09.*|HP-UX-*.10.*)
  20. echo $ac_n "checking whether ${CC} accepts -Aa""... $ac_c" 1>&6
  21. echo 'void f(){}' > conftest.c
  22. if test -z "`${CC} -Aa -c conftest.c 2>&1`"; then
  23. echo "$ac_t""yes" 1>&6
  24. CMAKE_ANSI_CFLAGS="-Aa"
  25. else
  26. echo "$ac_t""no" 1>&6
  27. fi
  28. rm -f conftest*
  29. ;;
  30. esac
  31. fi
  32. AC_SUBST(CMAKE_ANSI_CFLAGS)
  33. # if we are not running g++ then we might need some other flags
  34. # to get the templates compiled correctly
  35. CMAKE_TEMPLATE_FLAGS=""
  36. if test $ac_cv_prog_gxx = no; then
  37. echo $ac_n "checking whether ${CXX} accepts -ptused -no_prelink""... $ac_c" 1>&6
  38. echo 'void f(){}' > conftest.cc
  39. if test -z "`${CXX} -ptused -no_prelink -c conftest.cc 2>&1`"; then
  40. echo "$ac_t""yes" 1>&6
  41. CMAKE_TEMPLATE_FLAGS="-ptused -no_prelink"
  42. else
  43. echo "$ac_t""no" 1>&6
  44. fi
  45. rm -f conftest*
  46. echo $ac_n "checking whether ${CXX} accepts -instances=semiexplicit""... $ac_c" 1>&6
  47. echo 'void f(){}' > conftest.cc
  48. if test -z "`${CXX} -instances=static -c conftest.cc 2>&1`"; then
  49. echo "$ac_t""yes" 1>&6
  50. CMAKE_TEMPLATE_FLAGS="-instances=static"
  51. else
  52. echo "$ac_t""no" 1>&6
  53. fi
  54. fi
  55. AC_SUBST(CMAKE_TEMPLATE_FLAGS)
  56. # check no g++ compilers to see if they have the standard
  57. # ansi stream files (without the .h)
  58. if test $ac_cv_prog_gxx = no; then
  59. AC_MSG_CHECKING( ansi standard C++ stream headers )
  60. rm -rf conftest.*
  61. cat > conftest.cc <<!
  62. #include <iostream>
  63. !
  64. if test -z "`${CXX} $CXXFLAGS $CPPFLAGS -c conftest.cc 2>&1`"; then
  65. echo "$ac_t""yes" 1>&6
  66. else
  67. AC_DEFINE(CMAKE_NO_ANSI_STREAM_HEADERS)
  68. echo "$ac_t""no" 1>&6
  69. fi
  70. fi
  71. # check to see if stl is in the std namespace
  72. if test $ac_cv_prog_gxx = no; then
  73. AC_MSG_CHECKING( ansi standard namespace support )
  74. rm -rf conftest.*
  75. cat > conftest.cc <<!
  76. #include <list>
  77. void foo() { std::list<int> l; }
  78. !
  79. if test -z "`${CXX} $CXXFLAGS $CPPFLAGS -c conftest.cc 2>&1`"; then
  80. echo "$ac_t""yes" 1>&6
  81. else
  82. AC_DEFINE(CMAKE_NO_STD_NAMESPACE)
  83. echo "$ac_t""no" 1>&6
  84. fi
  85. fi
  86. AC_OUTPUT(Makefile Source/Makefile)