--- trunk/configure.ac 2010/08/03 13:06:03 202 +++ branches/pure-cfg/configure.ac 2011/05/10 14:08:35 1171 @@ -9,7 +9,7 @@ AC_INIT(diderot,0.1,) AC_PREREQ(2.60) -AC_COPYRIGHT([[COPYRIGHT (c) 2010 The Diderot Project]]) +AC_COPYRIGHT([[COPYRIGHT (c) 2010 The Diderot Project (http://diderot-language.cs.uchicago.edu)]]) AC_CONFIG_SRCDIR(src/dnorm/dnorm.c) AC_CONFIG_AUX_DIR(config) AC_CONFIG_MACRO_DIR(config) @@ -20,7 +20,7 @@ sinclude(config/acx_pthread.m4) sinclude(config/check_smlnj.m4) sinclude(config/check_smlnj_heap_suffix.m4) - +sinclude(config/ax_check_framework.m4) dnl dnl get host information @@ -29,16 +29,74 @@ dnl check for standard programs dnl -AC_PROG_CC_C99 +AC_PROG_CC([clang gcc cc]) AC_PROG_CPP AC_PROG_INSTALL AC_PROG_MAKE_SET +dnl check for c99 support dnl -dnl If we are on Mac OS X, check for the presence of macports and/or fink +AC_PROG_CC_C99 +if test x"$ac_cv_prog_cc_c99" = xno ; then + AC_MSG_ERROR([Diderot requires c99 support]) +fi + +dnl extra C compiler options dnl +CFLAG_M64="-m64" +CFLAGS_BASE="-Wformat -Wreturn-type -Wuninitialized" +AC_SUBST(CFLAG_M64) +AC_SUBST(CFLAGS_BASE) + +dnl +dnl Look for NVIDIA's nvcc compiler +dnl +AC_MSG_NOTICE([checking for CUDA and nvcc]) +AC_PATH_PROG(NVCC, nvcc, no, $PATH) +if test x"$NVCC" = xno ; then + AC_MSG_WARN([nvcc not found]) + CUDA_ENABLED=false + NVCC=":" +else + AC_MSG_RESULT([$NVCC]) + CUDA_ENABLED=true +fi +AC_SUBST(NVCC) +AC_SUBST(CUDA_ENABLED) + +dnl +dnl check for OpenCL support +dnl +OPENCL_LIBS="none" case "$host_os" in darwin*) # On Mac OS X we check for installed frameworks + AX_CHECK_FRAMEWORK([OpenCL], [OPENCL_LIBS="-framework OpenCL"], []) + ;; + *) + AC_CHECK_LIB([OpenCL],[clGetPlatformIDs],[OPENCL_LIBS="-lOpenCL"]) + ;; +esac +if test x"$OPENCL_LIBS" = xnone ; then + AC_MSG_WARN([no OpenCL library found]) + OPENCL_ENABLED=false +else + OPENCL_ENABLED=true + AC_SUBST(OPENCL_LIBS) +fi +AC_SUBST(OPENCL_ENABLED) + +dnl +dnl check for pthreads support +dnl +ACX_PTHREAD() + +dnl +dnl OS-specific linking issues +dnl +LD_NEEDS_RPATH=false; +LIBM="" +case "$host_os" in + darwin*) # On Mac OS X we check for the presence of macports and/or fink if test -x /opt/local/bin/port ; then HAS_MACPORTS=yes else @@ -50,6 +108,10 @@ HAS_FINK=no fi ;; + linux*) # On Linux we include the -rpath option to pick up dynamically-loaded libraries + LD_NEEDS_RPATH=true + LIBM="-lm" + ;; esac if test x"$HAS_MACPORTS" = xyes ; then @@ -60,6 +122,8 @@ LDPATHS="" fi AC_SUBST(LDPATHS) +AC_SUBST(LD_NEEDS_RPATH) +AC_SUBST(LIBM) dnl dnl get the path to the TEEM installation @@ -156,11 +220,21 @@ AC_CONFIG_FILES( dnl dnl ***** Makefiles ***** + Makefile src/dnorm/Makefile src/compiler/Makefile + src/lib/Makefile + src/lib/build/Makefile + src/lib/build/mk/build.gmk:src/lib/build/mk/build_gmk.in + test/MIP/Makefile + test/probe/Makefile +dnl +dnl ***** CM files ***** + src/compiler/codegen/sources.cm:src/compiler/codegen/sources_cm.in dnl dnl ***** SML source files ***** src/compiler/fields/run-dnorm.sml:src/compiler/fields/run-dnorm_sml.in + src/compiler/common/paths.sml:src/compiler/common/paths_sml.in ) dnl @@ -170,4 +244,24 @@ bin/install-sml-wrapper.sh:config/install-sml-wrapper_sh.in ], [chmod +x bin/install-sml-wrapper.sh]) +dnl +dnl generate makefiles for runtime library builds +dnl +dnl usage: MK_BUILD_DIR(, , ) +dnl +AC_DEFUN([MK_BUILD_DIR], [ + if test ! -d src/lib/build/$1 ; then + mkdir src/lib/build/$1 + fi + [sed -e 's,@BUILD_TARGET@,$1,g' \ + -e 's,@TARGET_PLATFORM@,$2,g' \ + -e 's,@BUILD_OPTIONS@,$3,g' \ + src/lib/build/mk/Makefile.in \ + > src/lib/build/$1/Makefile.in] + AC_CONFIG_FILES(src/lib/build/$1/Makefile) + ]) + +MK_BUILD_DIR(rt-c-f, c-target, [float]) +MK_BUILD_DIR(rt-c-f-debug, c-target, [float debug]) + AC_OUTPUT
Click to toggle
does not end with </html> tag
does not end with </body> tag
The output has ended thus: ILD_DIR(rt-c-f, c-target, [float]) +MK_BUILD_DIR(rt-c-f-debug, c-target, [float debug]) + AC_OUTPUT