configure.in.sample 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633
  1. # Process this file with autoconf to produce a configure script.
  2. AC_INIT()
  3. CMAKE_CONFIG_DIR=`pwd`
  4. AC_SUBST(CMAKE_CONFIG_DIR)
  5. #
  6. # check for some programs we use
  7. #
  8. AC_PROG_CC
  9. AC_PROG_CXX
  10. AC_PROG_RANLIB
  11. AC_PROG_INSTALL
  12. AC_PATH_XTRA
  13. # get byte swapping info
  14. AC_C_BIGENDIAN
  15. if test $ac_cv_c_bigendian = yes; then
  16. AC_DEFINE(CMAKE_WORDS_BIGENDIAN)
  17. fi
  18. # some stuff Tcl uses
  19. #
  20. AC_CHECK_HEADER(limits.h, HAVE_LIMITS_H=-DHAVE_LIMITS_H,HAVE_LIMITS_H="")
  21. AC_SUBST(HAVE_LIMITS_H)
  22. AC_HAVE_HEADERS(unistd.h, HAVE_UNISTD_H=-DHAVE_UNISTD_H,HAVE_UNISTD_H="")
  23. AC_SUBST(HAVE_UNISTD_H)
  24. # Step 1: set the variable "system" to hold the name and version number
  25. # for the system. This can usually be done via the "uname" command, but
  26. # there are a few systems, like Next, where this doesn't work.
  27. AC_MSG_CHECKING([system version (for dynamic loading)])
  28. if test -f /usr/lib/NextStep/software_version; then
  29. system=NEXTSTEP-`awk '/3/,/3/' /usr/lib/NextStep/software_version`
  30. else
  31. system=`uname -s`-`uname -r`
  32. if test "$?" -ne 0 ; then
  33. AC_MSG_RESULT([unknown (can't find uname command)])
  34. system=unknown
  35. else
  36. # Special check for weird MP-RAS system (uname returns weird
  37. # results, and the version is kept in special file).
  38. if test -r /etc/.relid -a "X`uname -n`" = "X`uname -s`" ; then
  39. system=MP-RAS-`awk '{print $3}' /etc/.relid'`
  40. fi
  41. AC_MSG_RESULT($system)
  42. fi
  43. fi
  44. #
  45. # use shared libs
  46. #
  47. AC_ARG_WITH(shared,
  48. [ --with-shared create shared libraries],
  49. [CMAKE_shared_ok=$withval], [CMAKE_shared_ok=no])
  50. INSTALL_TARGET="install"
  51. AC_SUBST(INSTALL_TARGET)
  52. BUILD_TOOLKITS=""
  53. CLEAN_TOOLKITS=""
  54. DEPEND_TOOLKITS=""
  55. INSTALL_TOOLKITS=""
  56. # --with-kits goes here
  57. AC_SUBST(BUILD_TOOLKITS)
  58. AC_SUBST(INSTALL_TOOLKITS)
  59. AC_SUBST(DEPEND_TOOLKITS)
  60. AC_SUBST(CLEAN_TOOLKITS)
  61. # option for handling BSD style makefile includes
  62. #
  63. AC_ARG_WITH(bsdmake,
  64. [ --with-bsdmake uses bsd style makefile includes],
  65. if test "$withval" = yes; then
  66. MAKEINCLUDE=".include"
  67. MAKEQUOTE='"'
  68. fi,
  69. MAKEINCLUDE="include"
  70. MAKEQUOTE='')
  71. AC_SUBST(MAKEINCLUDE)
  72. AC_SUBST(MAKEQUOTE)
  73. # the following is an excerpt from the tcl7.5b2 configure.in
  74. #--------------------------------------------------------------------
  75. # The statements below define a collection of symbols related to
  76. # dynamic loading and shared libraries:
  77. #
  78. # SHLIB_CFLAGS - Flags to pass to cc when compiling the components
  79. # of a shared library (may request position-independent
  80. # code, among other things).
  81. # SHLIB_LD_LIBS - Dependent libraries for the linker to scan when
  82. # creating shared libraries. This symbol typically
  83. # goes at the end of the "ld" commands that build
  84. # shared libraries. The value of the symbol if
  85. # "${LIBS}" if all of the dependent libraries should
  86. # be specified when creating a shared library. If
  87. # dependent libraries should not be specified (as on
  88. # SunOS 4.x, where they cause the link to fail, or in
  89. # general if Tcl and Tk aren't themselves shared
  90. # libraries), then this symbol has an empty string
  91. # as its value.
  92. # SHLIB_SUFFIX - Suffix to use for the name of the shared library. An
  93. # empty string means we don't know how to use shared
  94. # libraries on this platform.
  95. # CMAKE_SHLIB_BUILD_FLAGS -
  96. # Flags to use when building a shared library.
  97. # CMAKE_SHLIB_LINK_FLAGS -
  98. # Flags to pass to the compiler when linking object
  99. # files into an executable application binary such
  100. # as tclsh.
  101. #--------------------------------------------------------------------
  102. # Step 2: check for existence of -ldl library. This is needed because
  103. # Linux can use either -ldl or -ldld for dynamic loading.
  104. AC_CHECK_LIB(dl, dlopen, have_dl=yes, have_dl=no)
  105. # Step 4: set configuration options based on system name and version.
  106. fullSrcDir=`cd $srcdir; pwd`
  107. AC_SUBST(fullSrcDir)
  108. case $system in
  109. AIX-*)
  110. # AIX: can't link shared library extensions unless Tcl and Tk are
  111. # also shared libraries.
  112. SHLIB_CFLAGS=""
  113. SHLIB_LD_LIBS='${LIBS}'
  114. SHLIB_SUFFIX="..o"
  115. DL_LIBS=""
  116. AC_CHECK_LIB(ld,printf, DL_LIBS="-lld")
  117. CMAKE_SHLIB_LINK_FLAGS=""
  118. ;;
  119. HP-UX-*.08.*|HP-UX-*.09.*|HP-UX-*.10.*)
  120. SHLIB_CFLAGS="+z"
  121. SHLIB_LD_LIBS=""
  122. SHLIB_SUFFIX=".sl"
  123. DL_LIBS="-ldld"
  124. CMAKE_SHLIB_BUILD_FLAGS='+Z -Wl,-E -Wl,-b'
  125. CMAKE_SHLIB_LINK_FLAGS='-Wl,+s -Wl,+b,${LIB_RUNTIME_DIR}'
  126. if test "$CC" = "gcc" -o `$CC -v 2>&1 | grep -c gcc` != "0" ; then
  127. CMAKE_SHLIB_BUILD_FLAGS='-shared -Wl,-E -Wl,-b'
  128. CMAKE_SHLIB_LINK_FLAGS='-Wl,+s -Wl,+b,${LIB_RUNTIME_DIR}'
  129. fi
  130. ;;
  131. IRIX-5.*)
  132. SHLIB_CFLAGS=""
  133. SHLIB_LD_LIBS=""
  134. SHLIB_SUFFIX=".so"
  135. DL_LIBS=""
  136. CMAKE_SHLIB_BUILD_FLAGS="-shared -rdata_shared"
  137. ;;
  138. IRIX-6* | IRIX64-6* | IRIX-64-6*)
  139. SHLIB_CFLAGS=""
  140. SHLIB_LD_LIBS=""
  141. SHLIB_SUFFIX=".so"
  142. DL_LIBS=""
  143. CMAKE_SHLIB_BUILD_FLAGS="-shared -rdata_shared"
  144. ;;
  145. Linux*)
  146. SHLIB_CFLAGS="-fPIC"
  147. SHLIB_LD_LIBS=""
  148. SHLIB_SUFFIX=".so"
  149. CMAKE_SHLIB_BUILD_FLAGS="-shared"
  150. if test "$have_dl" = yes; then
  151. DL_LIBS="-ldl"
  152. CMAKE_SHLIB_LINK_FLAGS="-rdynamic"
  153. else
  154. AC_CHECK_HEADER(dld.h, [
  155. DL_LIBS="-ldld"
  156. CMAKE_SHLIB_LINK_FLAGS=""])
  157. fi
  158. ;;
  159. CYGWIN_NT*)
  160. SHLIB_CFLAGS=""
  161. DL_LIBS="-lgdi32"
  162. SHLIB_SUFFIX=".dll"
  163. CMAKE_SHLIB_LINK_FLAGS="-shared"
  164. ;;
  165. MP-RAS-02*)
  166. SHLIB_CFLAGS="-K PIC"
  167. SHLIB_LD_LIBS=""
  168. SHLIB_SUFFIX=".so"
  169. DL_LIBS="-ldl"
  170. CMAKE_SHLIB_LINK_FLAGS=""
  171. ;;
  172. MP-RAS-*)
  173. SHLIB_CFLAGS="-K PIC"
  174. SHLIB_LD_LIBS=""
  175. SHLIB_SUFFIX=".so"
  176. DL_LIBS="-ldl"
  177. CMAKE_SHLIB_LINK_FLAGS="-Wl,-Bexport"
  178. ;;
  179. NetBSD-*|FreeBSD-*)
  180. # Not available on all versions: check for include file.
  181. if test -f /usr/include/dlfcn.h; then
  182. SHLIB_CFLAGS="-fpic"
  183. SHLIB_LD_LIBS=""
  184. SHLIB_SUFFIX=".so"
  185. DL_LIBS=""
  186. CMAKE_SHLIB_LINK_FLAGS="-shared"
  187. else
  188. SHLIB_CFLAGS=""
  189. SHLIB_LD_LIBS=""
  190. SHLIB_SUFFIX="..o"
  191. DL_LIBS=""
  192. CMAKE_SHLIB_LINK_FLAGS=""
  193. fi
  194. ;;
  195. NEXTSTEP-*)
  196. SHLIB_CFLAGS=""
  197. SHLIB_LD_LIBS=""
  198. SHLIB_SUFFIX=".so"
  199. DL_LIBS=""
  200. CMAKE_SHLIB_LINK_FLAGS=""
  201. ;;
  202. OSF1-1.[012])
  203. # OSF/1 1.[012] from OSF, and derivatives, including Paragon OSF/1
  204. SHLIB_CFLAGS=""
  205. # Hack: make package name same as library name
  206. SHLIB_LD_LIBS=""
  207. SHLIB_SUFFIX=".so"
  208. DL_LIBS=""
  209. CMAKE_SHLIB_LINK_FLAGS=""
  210. ;;
  211. OSF1-1.*)
  212. # OSF/1 1.3 from OSF using ELF, and derivatives, including AD2
  213. SHLIB_CFLAGS="-fpic"
  214. SHLIB_LD_LIBS=""
  215. SHLIB_SUFFIX=".so"
  216. DL_LIBS=""
  217. CMAKE_SHLIB_LINK_FLAGS=""
  218. ;;
  219. OSF1-V*)
  220. # Digital OSF/1
  221. SHLIB_CFLAGS=""
  222. SHLIB_LD_LIBS=""
  223. SHLIB_SUFFIX=".so"
  224. DL_LIBS=""
  225. CMAKE_SHLIB_BUILD_FLAGS='-shared -Wl,-expect_unresolved,"*"'
  226. CMAKE_SHLIB_LINK_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}'
  227. ;;
  228. RISCos-*)
  229. SHLIB_CFLAGS="-G 0"
  230. SHLIB_LD_LIBS=""
  231. SHLIB_SUFFIX="..o"
  232. DL_LIBS=""
  233. CMAKE_SHLIB_LINK_FLAGS="-Wl,-D,08000000"
  234. ;;
  235. SCO_SV-3.2*)
  236. # Note, dlopen is available only on SCO 3.2.5 and greater. However,
  237. # this test works, since "uname -s" was non-standard in 3.2.4 and
  238. # below.
  239. SHLIB_CFLAGS="-Kpic -belf"
  240. SHLIB_LD_LIBS=""
  241. SHLIB_SUFFIX=".so"
  242. DL_LIBS=""
  243. CMAKE_SHLIB_LINK_FLAGS="-belf -Wl,-Bexport"
  244. ;;
  245. SINIX*5.4*)
  246. SHLIB_CFLAGS="-K PIC"
  247. SHLIB_LD_LIBS=""
  248. SHLIB_SUFFIX=".so"
  249. DL_LIBS="-ldl"
  250. CMAKE_SHLIB_LINK_FLAGS=""
  251. ;;
  252. SunOS-4*)
  253. SHLIB_CFLAGS="-PIC"
  254. SHLIB_LD_LIBS=""
  255. SHLIB_SUFFIX=".so"
  256. DL_LIBS="-ldl"
  257. CMAKE_SHLIB_BUILD_FLAGS='-shared -Wl,-r -nostdlib'
  258. CMAKE_SHLIB_LINK_FLAGS='-Wl,-L${LIB_RUNTIME_DIR}'
  259. ;;
  260. SunOS-5*)
  261. SHLIB_CFLAGS="-KPIC"
  262. SHLIB_LD_LIBS='${LIBS}'
  263. SHLIB_SUFFIX=".so"
  264. DL_LIBS="-ldl"
  265. CMAKE_SHLIB_BUILD_FLAGS='-G'
  266. CMAKE_SHLIB_LINK_FLAGS='-R ${LIB_RUNTIME_DIR}'
  267. if test "$CC" = "gcc" -o `$CC -v 2>&1 | grep -c gcc` != "0" ; then
  268. CMAKE_SHLIB_BUILD_FLAGS='-Wl,-G'
  269. CMAKE_SHLIB_LINK_FLAGS='-Wl,-R,${LIB_RUNTIME_DIR}'
  270. fi
  271. ;;
  272. ULTRIX-4.*)
  273. SHLIB_CFLAGS="-G 0"
  274. SHLIB_SUFFIX="..o"
  275. SHLIB_LD_LIBS=""
  276. DL_LIBS=""
  277. CMAKE_SHLIB_LINK_FLAGS="-Wl,-D,08000000"
  278. ;;
  279. UNIX_SV*)
  280. SHLIB_CFLAGS="-K PIC"
  281. SHLIB_LD_LIBS=""
  282. SHLIB_SUFFIX=".so"
  283. DL_LIBS="-ldl"
  284. CMAKE_SHLIB_LINK_FLAGS="-Wl,-Bexport"
  285. ;;
  286. esac
  287. export SHLIB_SUFFIX
  288. # If we're running gcc, then change the C flags for compiling shared
  289. # libraries to the right flags for gcc, instead of those for the
  290. # standard manufacturer compiler.
  291. if test "$CC" = "gcc" -o `$CC -v 2>&1 | grep -c gcc` != "0" ; then
  292. SHLIB_CFLAGS="-fPIC"
  293. fi
  294. # if running on cygwin remove -fPIC flag
  295. case $system in
  296. CYGWIN_NT*)
  297. SHLIB_CFLAGS=""
  298. ;;
  299. esac
  300. if test "$CMAKE_shared_ok" = "yes"; then
  301. CMAKE_SHLIB_CFLAGS="${SHLIB_CFLAGS}"
  302. CMAKE_LD_SEARCH_FLAGS="${LD_SEARCH_FLAGS}"
  303. CMAKE_TCL_SHLIB_TARGET="CMAKEtcl"
  304. RANLIB=":"
  305. TOOLKIT_DEPENDS=""
  306. CMAKE_LIB_EXT="${SHLIB_SUFFIX}"
  307. else
  308. CMAKE_LIB_EXT=".a"
  309. SHLIB_LD_LIBS=""
  310. CMAKE_SHLIB_CFLAGS=""
  311. CMAKE_LD_SEARCH_FLAGS=""
  312. fi
  313. export CMAKE_LIB_EXT
  314. AC_SUBST(CMAKE_TCL_SHLIB_TARGET)
  315. AC_SUBST(TOOLKIT_DEPENDS)
  316. AC_SUBST(CMAKE_SHLIB_LINK_FLAGS)
  317. AC_SUBST(CMAKE_SHLIB_BUILD_FLAGS)
  318. AC_SUBST(CMAKE_SHLIB_CFLAGS)
  319. AC_SUBST(CMAKE_LIB_EXT)
  320. AC_SUBST(DL_LIBS)
  321. AC_SUBST(SHLIB_LD_LIBS)
  322. AC_SUBST(SHLIB_SUFFIX)
  323. #--------------------------------------------------------------------
  324. # Include sys/select.h if it exists and if it supplies things
  325. # that appear to be useful and aren't already in sys/types.h.
  326. # This appears to be true only on the RS/6000 under AIX. Some
  327. # systems like OSF/1 have a sys/select.h that's of no use, and
  328. # other systems like SCO UNIX have a sys/select.h that's
  329. # pernicious. If "fd_set" isn't defined anywhere then set a
  330. # special flag.
  331. #--------------------------------------------------------------------
  332. AC_MSG_CHECKING([fd_set and sys/select])
  333. AC_TRY_COMPILE([#include <sys/types.h>],
  334. [fd_set readMask, writeMask;], tk_ok=yes, tk_ok=no)
  335. if test $tk_ok = no; then
  336. AC_HEADER_EGREP(fd_mask, sys/select.h, tk_ok=yes)
  337. if test $tk_ok = yes; then
  338. AC_DEFINE(HAVE_SYS_SELECT_H)
  339. fi
  340. fi
  341. AC_MSG_RESULT($tk_ok)
  342. if test $tk_ok = no; then
  343. AC_DEFINE(NO_FD_SET)
  344. fi
  345. ##########################
  346. ## ##
  347. ## Check thread support ##
  348. ## ##
  349. ##########################
  350. # initialize thread vars
  351. THREAD_LIBS=""
  352. THREAD_FLAGS=""
  353. use_sproc=no
  354. CMAKE_USE_SPROC=0
  355. CMAKE_USE_PTHREADS=0
  356. CMAKE_HP_PTHREADS=0
  357. ##########################
  358. ## ##
  359. ## sproc ##
  360. ## ##
  361. ##########################
  362. # check for sproc
  363. force_sproc=no
  364. AC_ARG_WITH(sproc,
  365. [ --with-sproc use sproc instead of pthreads if possible],
  366. if test "$withval" = yes; then
  367. force_sproc=yes
  368. fi,)
  369. AC_CHECK_HEADERS(sys/prctl.h, [use_sproc=yes])
  370. if test "$use_sproc" = "yes"; then
  371. case $system in
  372. Linux* | IRIX64-6.5 | IRIX-6.5)
  373. if test "$force_sproc" = "yes"; then
  374. CMAKE_USE_SPROC=1
  375. else
  376. use_sproc=no
  377. fi
  378. ;;
  379. IRIX*)
  380. CMAKE_USE_SPROC=1
  381. ;;
  382. esac
  383. fi
  384. use_pthreads=no
  385. AC_CHECK_HEADERS(pthread.h, [use_pthreads=yes])
  386. if test "$use_pthreads" = "yes"; then
  387. if test "$use_sproc" = "no"; then
  388. AC_CHECK_LIB(pthreads, pthread_create, THREAD_LIBS="-lpthreads")
  389. AC_CHECK_LIB(pthread, pthread_create, THREAD_LIBS="-lpthread")
  390. # Work around Solaris 5.6 and 5.7 bug:
  391. if test "`uname -s -r`" = "SunOS 5.6"; then
  392. AC_CHECK_LIB(thread, thr_create, THREAD_LIBS="$THREAD_LIBS -lthread")
  393. fi
  394. if test "`uname -s -r`" = "SunOS 5.7"; then
  395. AC_CHECK_LIB(thread, thr_create, THREAD_LIBS="$THREAD_LIBS -lthread")
  396. fi
  397. CMAKE_USE_PTHREADS=1
  398. fi
  399. fi
  400. # on an HP with pthread we need to use -lcma
  401. # on dec alphas we have had problems as well
  402. if test "$use_pthreads" = "yes"; then
  403. case $system in
  404. HP-UX-*.10.*)
  405. THREAD_LIBS="-lcma"
  406. CMAKE_USE_PTHREADS=1
  407. CMAKE_HP_PTHREADS=1
  408. ;;
  409. OSF1-V*)
  410. CMAKE_USE_PTHREADS=0
  411. THREAD_LIBS=""
  412. ;;
  413. FreeBSD*)
  414. CMAKE_USE_PTHREADS=0
  415. THREAD_LIBS=""
  416. ;;
  417. esac
  418. fi
  419. if test $CMAKE_USE_SPROC = 1; then
  420. AC_DEFINE(CMAKE_USE_SPROC)
  421. fi
  422. if test $CMAKE_USE_PTHREADS = 1; then
  423. AC_DEFINE(CMAKE_USE_PTHREADS)
  424. fi
  425. if test $CMAKE_HP_PTHREADS = 1; then
  426. AC_DEFINE(CMAKE_HP_PTHREADS)
  427. fi
  428. AC_SUBST(THREAD_LIBS)
  429. # on hp use -Aa for ansi
  430. if test $ac_cv_prog_gxx = no; then
  431. case $system in
  432. HP-UX-*.08.*|HP-UX-*.09.*|HP-UX-*.10.*)
  433. echo $ac_n "checking whether ${CC} accepts -Aa""... $ac_c" 1>&6
  434. echo 'void f(){}' > conftest.c
  435. if test -z "`${CC} -Aa -c conftest.c 2>&1`"; then
  436. echo "$ac_t""yes" 1>&6
  437. ANSI_CFLAGS="-Aa"
  438. else
  439. echo "$ac_t""no" 1>&6
  440. fi
  441. rm -f conftest*
  442. ;;
  443. esac
  444. fi
  445. AC_SUBST(ANSI_CFLAGS)
  446. # if we are not running g++ then we might need some other flags
  447. # to get the templates compiled correctly
  448. CMAKE_TEMPLATE_FLAGS=""
  449. if test $ac_cv_prog_gxx = no; then
  450. echo $ac_n "checking whether ${CXX} accepts -ptused -no_prelink""... $ac_c" 1>&6
  451. echo 'void f(){}' > conftest.cc
  452. if test -z "`${CXX} -ptused -no_prelink -c conftest.cc 2>&1`"; then
  453. echo "$ac_t""yes" 1>&6
  454. CMAKE_TEMPLATE_FLAGS="-ptused -no_prelink"
  455. else
  456. echo "$ac_t""no" 1>&6
  457. fi
  458. rm -f conftest*
  459. echo $ac_n "checking whether ${CXX} accepts -instances=semiexplicit""... $ac_c" 1>&6
  460. echo 'void f(){}' > conftest.cc
  461. if test -z "`${CXX} -instances=static -c conftest.cc 2>&1`"; then
  462. echo "$ac_t""yes" 1>&6
  463. CMAKE_TEMPLATE_FLAGS="-instances=static"
  464. else
  465. echo "$ac_t""no" 1>&6
  466. fi
  467. fi
  468. AC_SUBST(CMAKE_TEMPLATE_FLAGS)
  469. # check no g++ compilers to see if they have the standard
  470. # ansi stream files (without the .h)
  471. if test $ac_cv_prog_gxx = no; then
  472. AC_MSG_CHECKING( ansi standard C++ stream headers )
  473. echo "******"
  474. rm -rf conftest.*
  475. cat > conftest.cc <<!
  476. #include <iostream>
  477. !
  478. if test -z "`${CXX} -c conftest.cc 2>&1`"; then
  479. echo "$ac_t""yes" 1>&6
  480. else
  481. AC_DEFINE(CMAKE_NO_STD_NAMESPACE)
  482. echo "$ac_t""no" 1>&6
  483. fi
  484. fi
  485. # check to see if stl is in the std namespace
  486. if test $ac_cv_prog_gxx = no; then
  487. echo "******"
  488. AC_MSG_CHECKING( ansi standard namespace support )
  489. rm -rf conftest.*
  490. cat > conftest.cc <<!
  491. #include <list>
  492. void foo() { std::list<int> l; }
  493. !
  494. if test -z "`${CXX} -c conftest.cc 2>&1`"; then
  495. echo "$ac_t""yes" 1>&6
  496. else
  497. AC_DEFINE(CMAKE_NO_ANSI_STREAM_HEADERS)
  498. echo "$ac_t""no" 1>&6
  499. fi
  500. fi
  501. if test "$CC" = "gcc" -o `$CC -v 2>&1 | grep -c gcc` != "0" ; then
  502. SHLIB_CFLAGS="-fPIC"
  503. fi
  504. if test -f $CMAKE_CONFIG_DIR/CMakeLocal.make.in; then
  505. echo "create CMakeLocal.make from $CMAKE_CONFIG_DIR/CMakeLocal.make.in"
  506. rm -f local.make
  507. cp $CMAKE_CONFIG_DIR/local.make.in local.make
  508. else
  509. echo "no $CMAKE_CONFIG_DIR/CMakeLocal.make.in creating an empty CMakeLocal.make file"
  510. rm -f CMakeLocal.make
  511. touch CMakeLocal.make
  512. fi
  513. AC_SUBST(EXTRA_GCC_FLAG)
  514. # output to the top level Makefile, which must be present
  515. # create the toplevel CMakeTargets.make file
  516. # Create all the make file fragments in CMake
  517. # Create the Makefile in CMake/Source
  518. # Testing system configuration
  519. AC_PATH_PROGS(MAKECOMMAND, gmake make)
  520. AC_PATH_PROGS(CVSCOMMAND, cvs )
  521. AC_PATH_PROGS(GREPCOMMAND, grep )
  522. AC_PATH_PROGS(COMPRESSIONCOMMAND, gzip compress zip )
  523. AC_PATH_PROGS(TCLSHCOMMAND, cygtclsh80 tclsh tclsh82 tclsh8.2 tclsh80 tclsh8.2 )
  524. AC_PATH_PROGS(GUNZIPCOMMAND, gunzip )
  525. AC_SUBST(MAKECOMMAND)
  526. AC_SUBST(CVSCOMMAND)
  527. AC_SUBST(GREPCOMMAND)
  528. AC_SUBST(GUNZIPCOMMAND)
  529. AC_SUBST(COMPRESSIONCOMMAND)
  530. AC_SUBST(TCLSHCOMMAND)
  531. # Make java optional
  532. AC_PATH_PROGS(JAVACOMMAND, java, jre )
  533. AC_SUBST(JAVACOMMAND)
  534. # AC_PROG_JAVA
  535. # AC_PROG_JAVAC
  536. # AC_PROG_JAR
  537. # generate output files.
  538. # create mkdir files just to make some of the directories
  539. AC_OUTPUT(
  540. Makefile:CMake/CMakeTopMakefileTemplate.in
  541. CMakeTargets.make:CMake/CMakeTargets.make.in
  542. CMake/CMakeSimpleRules.make
  543. CMake/CMakeMaster.make
  544. CMake/CMakeVariables.make
  545. CMake/CMakeRules.make
  546. CMake/Source/CMakeTargets.make:CMake/dummy.in
  547. CMake/Source/Makefile
  548. )
  549. # build the CMakeBuildTargets program
  550. (cd CMake/Source; $MAKECOMMAND CMakeBuildTargets)
  551. # if there is no cache file then create one
  552. if test ! -f $CMAKE_CONFIG_DIR/CMakeCache.txt; then
  553. echo CMake/Source/CMakeBuildTargets ${fullSrcDir}/CMakeLists.txt -MakeCache -S${fullSrcDir} -O${CMAKE_CONFIG_DIR} -H${fullSrcDir} -B${CMAKE_CONFIG_DIR}
  554. CMake/Source/CMakeBuildTargets ${fullSrcDir}/CMakeLists.txt -MakeCache -S${fullSrcDir} -O${CMAKE_CONFIG_DIR} -H${fullSrcDir} -B${CMAKE_CONFIG_DIR}
  555. fi
  556. echo CMakeCache.txt location: ${CMAKE_CONFIG_DIR}/CMakeCache.txt
  557. # force a rebuild of CMakeBuildTargets which will rebuild CMakeTargets.make
  558. # this has to be done because configure generates empty CMakeTargets.make files
  559. # and make programs other than gnu do not like to include make file fragments
  560. # that do not exist, even if they know how to create them.
  561. rm -f CMake/Source/CMakeBuildTargets
  562. rm -f CMake/Source/CMakeBuildTargets.exe