[go: up one dir, main page]

Menu

[r19]: / trunk / configure.in  Maximize  Restore  History

Download this file

104 lines (87 with data), 2.9 kB

# This file is part of mdcore.
# Coypright (c) 2010 Pedro Gonnet (gonnet@maths.ox.ac.uk)
# 
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
# 
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
# 
# You should have received a copy of the GNU General Public License
# along with this program.  If not, see <http://www.gnu.org/licenses/>.

# init the project
AC_INIT(src/engine.c)
VERSION="0.0.1"
AC_SUBST(VERSION)
AM_INIT_AUTOMAKE(mdcore,VERSION)
AC_PROG_LIBTOOL

# generate header file
AM_CONFIG_HEADER(config.h)

# compiler settings
CFLAGS="-Wall -g $CFLAGS"

# find and test the compiler
AC_PROG_CC
AC_LANG_C
AX_CC_MAXOPT
AX_FUNC_POSIX_MEMALIGN
AX_GCC_ARCHFLAG([no])
AX_EXT

# autoconf stuff
AC_PROG_INSTALL
AC_PROG_MAKE_SET
AC_HEADER_STDC

# check for the libraries we will need
AC_CHECK_LIB(m,sqrt,,AC_MSG_ERROR(something is wrong with the math library!))


# Check for pthreads
ACX_PTHREAD([LIBS="$PTHREAD_LIBS $LIBS" CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
    CC="$PTHREAD_CC" LDFLAGS="$PTHREAD_LIBS $LIBS"],
    AC_MSG_ERROR([Could not find a working version of
    the pthread library. Make sure you have the library and header files installed
    or use CPPFLAGS and LDFLAGS if the library is installed in a
    non-standard location.]))
    
# Check for CUDA
AC_ARG_WITH([cuda],
    [  --with-cuda=PATH        prefix where cuda is installed [default=auto]])
if test -n "$with_cuda"
then
    CUDA_CFLAGS="-I$with_cuda/include"
    CUDA_LIBS="-L$with_cuda/lib -lcuda -lcudart"
    NVCC="$with_cuda/bin/nvcc"
else
    AC_CHECK_PROG([NVCC],nvcc)
    if test -n "$NVCC"
    then
        CUDA_CFLAGS="-I/usr/local/cuda/include"
        CUDA_LIBS="-L/usr/local/cuda/lib -lcuda -lcudart"
    fi
fi
if test -n "$NVCC"; then
    AC_DEFINE([HAVE_CUDA],[true],[The cuda compiler is installed.])
fi
AC_SUBST(CUDA_CFLAGS)
AC_SUBST(CUDA_LIBS)
AC_SUBST(NVCC)


# Check for CELL
AC_ARG_WITH([cell],
    [  --with-cell=PATH        prefix where the IBM Cell-SDK is installed [default=auto]])
if test -n "$with_cell"
then
    PPUGCC="$with_cell/toolchain/bin/ppu-gcc"
    SPUGCC="$with_cell/toolchain/bin/spu-gcc"
else
    AC_CHECK_PROG([PPUGCC],ppu-gcc)
    AC_CHECK_PROG([SPUGCC],spu-gcc)
fi
if test -n "$PPUGCC"; then
    AC_DEFINE([HAVE_CELL],[true],[The Cell/BE Toolchain appears to be present.])
fi
AC_SUBST(PPUGCC)
AC_SUBST(SPUGCC)


# make the documentation
DX_INIT_DOXYGEN(mdcore,doc/Doxyfile,doc/)

# generate the Makefiles
AC_OUTPUT(Makefile src/Makefile examples/Makefile doc/Makefile)