configure.in 2.6 KB

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