CMake/configure.in

154 lines
4.2 KiB
Plaintext
Raw Normal View History

2001-05-21 17:33:35 +04:00
# Process this file with autoconf to produce a configure script.
AC_INIT()
AC_CONFIG_HEADER(Source/cmConfigure.h)
CMAKE_CONFIG_DIR=`pwd`
AC_SUBST(CMAKE_CONFIG_DIR)
#
# check for some programs we use
#
AC_PROG_CC
AC_PROG_CXX
fullSrcDir=`cd $srcdir; pwd`
CMAKE_ROOT_DIR=$fullSrcDir
AC_SUBST(CMAKE_ROOT_DIR)
2001-08-25 01:00:40 +04:00
# Step 1: set the variable "system" to hold the name and version number
# for the system. This can usually be done via the "uname" command, but
# there are a few systems, like Next, where this doesn't work.
AC_MSG_CHECKING([system version (for dynamic loading)])
if test -f /usr/lib/NextStep/software_version; then
system=NEXTSTEP-`awk '/3/,/3/' /usr/lib/NextStep/software_version`
else
system=`uname -s`-`uname -r`
if test "$?" -ne 0 ; then
AC_MSG_RESULT([unknown (can't find uname command)])
system=unknown
else
# Special check for weird MP-RAS system (uname returns weird
# results, and the version is kept in special file).
if test -r /etc/.relid -a "X`uname -n`" = "X`uname -s`" ; then
system=MP-RAS-`awk '{print $3}' /etc/.relid'`
fi
AC_MSG_RESULT($system)
fi
fi
2001-05-21 17:33:35 +04:00
CMAKE_ANSI_CFLAGS=""
# on hp use -Aa for ansi
if test $ac_cv_prog_gxx = no; then
case $system in
HP-UX-*.08.*|HP-UX-*.09.*|HP-UX-*.10.*)
echo $ac_n "checking whether ${CC} accepts -Aa""... $ac_c" 1>&6
echo 'void f(){}' > conftest.c
if test -z "`${CC} -Aa -c conftest.c 2>&1`"; then
echo "$ac_t""yes" 1>&6
CMAKE_ANSI_CFLAGS="-Aa"
else
echo "$ac_t""no" 1>&6
fi
rm -f conftest*
2001-08-24 23:45:46 +04:00
;;
2001-08-25 00:51:10 +04:00
IRIX-5* | IRIX-6* | IRIX64-6* | IRIX-64-6*)
2001-08-24 23:45:46 +04:00
echo $ac_n "checking whether ${CC} accepts -LANG:std""... $ac_c" 1>&6
echo 'void f(){}' > conftest.c
if test -z "`${CC} -LANG:std -c conftest.c 2>&1`"; then
echo "$ac_t""yes" 1>&6
CMAKE_ANSI_CFLAGS="-LANG:std"
else
echo "$ac_t""no" 1>&6
fi
rm -f conftest*
;;
2001-05-21 17:33:35 +04:00
esac
fi
AC_SUBST(CMAKE_ANSI_CFLAGS)
# if we are not running g++ then we might need some other flags
# to get the templates compiled correctly
CMAKE_TEMPLATE_FLAGS=""
if test $ac_cv_prog_gxx = no; then
echo $ac_n "checking whether ${CXX} accepts -ptused -no_prelink""... $ac_c" 1>&6
echo 'void f(){}' > conftest.cc
if test -z "`${CXX} -ptused -no_prelink -c conftest.cc 2>&1`"; then
echo "$ac_t""yes" 1>&6
CMAKE_TEMPLATE_FLAGS="-ptused -no_prelink"
else
echo "$ac_t""no" 1>&6
fi
rm -f conftest*
echo $ac_n "checking whether ${CXX} accepts -instances=semiexplicit""... $ac_c" 1>&6
echo 'void f(){}' > conftest.cc
if test -z "`${CXX} -instances=static -c conftest.cc 2>&1`"; then
echo "$ac_t""yes" 1>&6
CMAKE_TEMPLATE_FLAGS="-instances=static"
else
echo "$ac_t""no" 1>&6
fi
fi
AC_SUBST(CMAKE_TEMPLATE_FLAGS)
# check no g++ compilers to see if they have the standard
# ansi stream files (without the .h)
if test $ac_cv_prog_gxx = no; then
AC_MSG_CHECKING( ansi standard C++ stream headers )
rm -rf conftest.*
cat > conftest.cc <<!
#include <iostream>
!
2001-08-25 01:15:12 +04:00
if test -z "`${CXX} $CMAKE_ANSI_CFLAGS $CXXFLAGS $CPPFLAGS -c conftest.cc 2>&1`"; then
2001-05-21 17:33:35 +04:00
echo "$ac_t""yes" 1>&6
else
2001-05-21 22:01:30 +04:00
AC_DEFINE(CMAKE_NO_ANSI_STREAM_HEADERS)
2001-05-21 17:33:35 +04:00
echo "$ac_t""no" 1>&6
fi
fi
# check to see if stl is in the std namespace
if test $ac_cv_prog_gxx = no; then
AC_MSG_CHECKING( ansi standard namespace support )
rm -rf conftest.*
cat > conftest.cc <<!
#include <list>
void foo() { std::list<int> l; }
!
2001-08-25 01:15:12 +04:00
if test -z "`${CXX} $CMAKE_ANSI_CFLAGS $CXXFLAGS $CPPFLAGS -c conftest.cc 2>&1`"; then
2001-05-21 17:33:35 +04:00
echo "$ac_t""yes" 1>&6
else
2001-05-21 22:01:30 +04:00
AC_DEFINE(CMAKE_NO_STD_NAMESPACE)
2001-05-21 17:33:35 +04:00
echo "$ac_t""no" 1>&6
fi
fi
# check to see if for scoping is supported
if test $ac_cv_prog_gxx = no; then
AC_MSG_CHECKING( ansi for scope support )
rm -rf conftest.*
cat > conftest.cc <<!
void foo() { for(int i;;); for(int i;;); }
!
2001-08-25 01:15:12 +04:00
if test -z "`${CXX} $CMAKE_ANSI_CFLAGS $CXXFLAGS $CPPFLAGS -c conftest.cc 2>&1`"; then
echo "$ac_t""yes" 1>&6
else
AC_DEFINE(CMAKE_NO_ANSI_FOR_SCOPE)
echo "$ac_t""no" 1>&6
fi
fi
# find make to use to build cmake, prefer gmake
AC_PATH_PROGS(RUNMAKE, gmake make)
2001-05-21 17:33:35 +04:00
AC_OUTPUT(Makefile Source/Makefile)
2001-07-06 22:11:59 +04:00
# build cmake
$RUNMAKE
2001-07-06 22:11:59 +04:00
# run cmake
./Source/cmake $fullSrcDir
2001-07-06 22:11:59 +04:00
# run cmake depends
$RUNMAKE depend