Home My Page Projects Code Snippets Project Openings diderot
Summary Activity Tracker Tasks SCM

SCM Repository

[diderot] Diff of /branches/vis15/configure.ac
ViewVC logotype

Diff of /branches/vis15/configure.ac

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

trunk/configure.ac revision 1116, Thu May 5 04:49:02 2011 UTC branches/vis15/configure.ac revision 4239, Wed Jul 20 18:19:49 2016 UTC
# Line 1  Line 1 
1  dnl Process this file with autoconf to produce a configure script.  dnl Process this file with autoconf to produce a configure script.
2  dnl  dnl
3  dnl COPYRIGHT (c) 2010 The Diderot Project  dnl This code is part of the Diderot Project (http://diderot-language.cs.uchicago.edu)
4    dnl
5    dnl COPYRIGHT (c) 2016 The University of Chicago
6  dnl All rights reserved.  dnl All rights reserved.
7  dnl  dnl
8    
9  dnl NOTE: MANTICORE_DIST_VERSION is an M4 variable defined in config/aclocal.m4  AC_INIT(diderot,1.0,)
 dnl  
 AC_INIT(diderot,0.1,)  
10    
11  AC_PREREQ(2.60)  AC_PREREQ(2.60)
12  AC_COPYRIGHT([[COPYRIGHT (c) 2010 The Diderot Project (http://diderot-language.cs.uchicago.edu)]])  AC_COPYRIGHT([[COPYRIGHT (c) 2016 The University of Chicago]])
13  AC_CONFIG_SRCDIR(src/dnorm/dnorm.c)  AC_CONFIG_SRCDIR(src/compiler/options/ctl.sml)
14  AC_CONFIG_AUX_DIR(config)  AC_CONFIG_AUX_DIR(config)
15  AC_CONFIG_MACRO_DIR(config)  AC_CONFIG_MACRO_DIR(config)
16    
17  dnl  dnl
18    dnl set the following to the name of the branch
19    dnl
20    BRANCH="master"
21    AC_SUBST(BRANCH)
22    
23    dnl
24  dnl include additional macros  dnl include additional macros
25  dnl  dnl
26  sinclude(config/acx_pthread.m4)  sinclude(config/acx_pthread.m4)
27  sinclude(config/check_smlnj.m4)  sinclude(config/check_smlnj.m4)
28  sinclude(config/check_smlnj_heap_suffix.m4)  sinclude(config/check_smlnj_heap_suffix.m4)
29    sinclude(config/ax_check_framework.m4)
30    sinclude(config/ax_cxx_compile_stdcxx.m4)
31    
32  dnl  dnl
33  dnl get host information  dnl get host information
34  dnl  dnl
35  AC_CANONICAL_HOST  AC_CANONICAL_HOST
36    
37    #################### Paths configuration ####################
38    
39    DIDEROT_ROOT=`pwd`
40    DIDEROT_DOCDIR=$DIDEROT_ROOT/doc
41    DIDEROT_SRCDIR=$DIDEROT_ROOT/src
42    DIDEROT_LIBDIR=$DIDEROT_ROOT/lib
43    DIDEROT_BINDIR=$DIDEROT_ROOT/bin
44    DIDEROT_MKDIR=$DIDEROT_ROOT/mk
45    
46    AC_SUBST(DIDEROT_ROOT)
47    AC_SUBST(DIDEROT_DOCDIR)
48    AC_SUBST(DIDEROT_SRCDIR)
49    AC_SUBST(DIDEROT_LIBDIR)
50    AC_SUBST(DIDEROT_BINDIR)
51    AC_SUBST(DIDEROT_MKDIR)
52    
53    #################### end Paths configuration ####################
54    
55  dnl check for standard programs  dnl check for standard programs
56  dnl  dnl
57  AC_PROG_CPP  AC_PROG_CPP
58    AC_PROG_CC([clang gcc cc])
59    AC_PROG_CXX([clang++ g++ c++])
60    AX_CXX_COMPILE_STDCXX(11,[],[mandatory])
61  AC_PROG_INSTALL  AC_PROG_INSTALL
62  AC_PROG_MAKE_SET  AC_PROG_MAKE_SET
63    
64  dnl check for c99 support  dnl FIXME: this works for now, but we should probably switch to libtool
65  dnl  dnl
66  AC_PROG_CC_C99  AC_PATH_PROG(LD, [ld], [none])
67  if test x"$ac_cv_prog_cc_c99" = xno ; then  if test x$LD = xnone ; then
68    AC_MSG_ERROR([Diderot requires c99 support])    AC_MSG_ERROR([cannot find ld command])
69  fi  fi
70    AC_SUBST(LD)
71    
72  dnl extra C compiler options  dnl extra compiler options
73  dnl  dnl
74  CFLAG_M64="-m64"  CXXFLAGS_BASE="-Wreturn-type -Wuninitialized"
75  CFLAGS="$CFLAGS -Wformat -Wreturn-type -Wuninitialized"  
76  AC_SUBST(CFLAG_M64)  AC_ARG_ENABLE([32-bit],
77      AC_HELP_STRING([--enable-32-bit], [configure Diderot to produce 32-bit executables]),
78      [CXXFLAG_Mxx="-m32"],
79      [CXXFLAG_Mxx="-m64"])
80    if test x"$CXX" != "xclang++" ; then
81      CXXFLAGS_BASE="$CXXFLAGS_BASE -fno-implicit-templates"
82    fi
83    
84    CXXFLAGS="$CXXFLAG_Mxx $CXXFLAGS_BASE"
85    AC_SUBST(CXXFLAG_Mxx)
86    AC_SUBST(CXXFLAGS_BASE)
87    
88  dnl  dnl
89  dnl Look for NVIDIA's nvcc compiler  dnl run the compiler tests in 64-bit mode
90  dnl  dnl
91  AC_MSG_CHECKING([for CUDA and nvcc])  save_CFLAGS=$CFLAGS
92  AC_PATH_PROG(NVCC, nvcc, ":", $PATH)  CFLAGS="$CFLAGS $CFLAG_MXX"
93  if test $NVCC = none ; then  
94    AC_MSG_WARN([nvcc not found])  dnl
95    dnl check for gcc builtin atomic operations
96    dnl
97    AC_MSG_CHECKING([for builtin atomic operations])
98    AC_LINK_IFELSE(
99       [AC_LANG_PROGRAM([], [int foo1; int foo2 = __sync_fetch_and_add(&foo1, 1);])],
100       AC_MSG_RESULT(yes)
101       AC_DEFINE(
102        [HAVE_BUILTIN_ATOMIC_OPS], 1,
103        [Define to 1 if gcc compiler provides atomic operations.]),
104       AC_MSG_RESULT(no))
105    
106    AC_C_BIGENDIAN
107    
108    #
109    # determine the sizes of the standard C types
110    AC_CHECK_SIZEOF([int])
111    SIZEOF_C_INT=$ac_cv_sizeof_int
112    AC_CHECK_SIZEOF([long])
113    SIZEOF_C_LONG=$ac_cv_sizeof_long
114    AC_CHECK_SIZEOF([float])
115    SIZEOF_C_FLOAT=$ac_cv_sizeof_float
116    AC_CHECK_SIZEOF([double])
117    SIZEOF_C_DOUBLE=$ac_cv_sizeof_double
118    
119    AC_SUBST(SIZEOF_C_INT)
120    AC_SUBST(SIZEOF_C_LONG)
121    AC_SUBST(SIZEOF_C_FLOAT)
122    AC_SUBST(SIZEOF_C_DOUBLE)
123    
124    dnl
125    dnl restore CFLAGS
126    dnl
127    CFLAGS=$save_CFLAGS
128    
129    dnl
130    dnl check for <stdbool.h>, which we use in the C API
131    dnl
132    AC_HEADER_STDBOOL
133    
134    dnl
135    dnl the C boolean type to use in generated library headers
136    dnl
137    if test x"$ac_cv_header_stdbool_h" = xyes ; then
138      BOOLTY="bool"
139    elif test "x$ac_cv_type__Bool" = xyes; then
140      BOOLTY="_Bool"
141  else  else
142    AC_MSG_RESULT([$NVCC])    BOOLTY="int"
143  fi  fi
144  AC_SUBST(NVCC)  AC_SUBST(BOOLTY)
145    
146  dnl  dnl
147  dnl check for pthreads support  dnl check for pthreads support
148  dnl  dnl
149  ACX_PTHREAD()  ACX_PTHREAD
150    
151    dnl
152    dnl check for various library routines etc.
153    dnl
154    AC_CHECK_FUNCS(posix_memalign)
155    if test x"$ac_cv_func_posix_memalign" != xyes ; then
156      AC_CHECK_FUNCS(memalign)
157      if test x"$ac_cv_func_posix_memalign" != xyes ; then
158        AC_CHECK_FUNCS(valloc)
159      fi
160    fi
161    
162    AC_CHECK_FUNCS(mach_absolute_time)
163    AC_CHECK_TYPES([struct timespec])
164    AC_CHECK_FUNCS(pthread_barrier_init)
165    
166    dnl
167    dnl check for clock_gettime.  On Linux, this requires librt.
168    dnl
169    save_LIBS=$LIBS
170    LIBS="-lrt $LIBS"
171    AC_MSG_CHECKING([for clock_gettime])
172    AC_LINK_IFELSE(
173      [AC_LANG_PROGRAM(
174        [[#include <time.h>]],
175        [[struct timespec t; clock_gettime(CLOCK_REALTIME, &t); ]])],
176      [ ac_cv_func_clock_gettime=yes;
177        AC_DEFINE(HAVE_CLOCK_GETTIME, [1], [is clock_gettime available?])],
178      [ac_cv_func_clock_gettime=no])
179    AC_MSG_RESULT($ac_cv_func_clock_gettime)
180    if test "$ac_cv_func_clock_gettime" = "no" ; then
181      LIBS=$save_LIBS
182    fi
183    
184    AC_CHECK_FUNCS(pthread_getcpuclockid)
185    AC_CHECK_FUNCS(sigtimedwait nanosleep)
186    
187    dnl
188    dnl check for sched_setaffinity
189    dnl
190    AC_CHECK_FUNCS(sched_setaffinity)
191    
192    dnl
193    dnl check for pthread_setaffinity_np
194    dnl
195    save_LIBS=$LIBS
196    save_CFLAGS=$CFLAGS
197    LIBS="$PTHREAD_LIBS $LIBS"
198    CFLAGS="$PTHREAD_CFLAGS $CFLAGS"
199    AC_MSG_CHECKING([for pthread_setaffinity_np])
200    AC_LINK_IFELSE(
201      [AC_LANG_PROGRAM(
202        [[#include <pthread.h>]],
203        [[cpu_set_t s; pthread_setaffinity_np(pthread_self(), sizeof(s), &s); ]])],
204      [ ac_cv_func_pthread_setaffinity_np=yes;
205        AC_DEFINE(HAVE_PTHREAD_SETAFFINITY_NP, [1], [is pthread_setaffinity_np available?])],
206      [ac_cv_func_pthread_setaffinity_np=no])
207    AC_MSG_RESULT($ac_cv_func_pthread_setaffinity_np)
208    LIBS=$save_LIBS
209    CFLAGS=$save_CFLAGS
210    
211    dnl
212    dnl check for Linux NUMA support (libnuma)
213    dnl
214    AC_CHECK_LIB(numa,numa_available)
215    if test "$ac_cv_lib_numa_numa_available" = "yes" ; then
216      PTHREAD_LIBS="$PTHREAD_LIBS -lnuma"
217    fi
218    
219    dnl check for /proc/cpuinfo
220    dnl
221    AC_CHECK_FILES(/proc/cpuinfo)
222    
223  dnl  dnl
224  dnl OS-specific linking issues  dnl OS-specific linking issues
# Line 97  Line 255 
255  AC_SUBST(LD_NEEDS_RPATH)  AC_SUBST(LD_NEEDS_RPATH)
256  AC_SUBST(LIBM)  AC_SUBST(LIBM)
257    
258    #################### CUDA configuration ####################
259    
260    dnl
261    dnl Look for NVIDIA's nvcc compiler
262    dnl
263    AC_MSG_NOTICE([checking for CUDA and nvcc])
264    AC_PATH_PROG(NVCC, nvcc, no, $PATH)
265    if test x"$NVCC" = xno ; then
266      AC_MSG_WARN([nvcc not found])
267      CUDA_ENABLED=false
268      NVCC=":"
269    else
270      AC_MSG_RESULT([$NVCC])
271      CUDA_ENABLED=true
272    fi
273    AC_SUBST(NVCC)
274    AC_SUBST(CUDA_ENABLED)
275    
276    #################### end CUDA configuration ####################
277    
278    #################### OpenCL configuration ####################
279    
280  dnl  dnl
281  dnl get the path to the TEEM installation  dnl check for OpenCL support
282    dnl
283    LIBS_CL="none"
284    case "$host_os" in
285      darwin*) # On Mac OS X we check for installed frameworks
286        AX_CHECK_FRAMEWORK([OpenCL], [LIBS_CL="-framework OpenCL"], [])
287      ;;
288      *)
289        AC_CHECK_LIB([OpenCL],[clGetPlatformIDs],[LIBS_CL="-lOpenCL"])
290      ;;
291    esac
292    if test x"$LIBS_CL" = xnone ; then
293      AC_MSG_WARN([no OpenCL library found])
294      CL_ENABLED=false
295      CL_VERSION=0
296    else
297      CL_ENABLED=true
298      CPPFLAGS_CL=""
299      CL_HEADER=""
300      AC_CHECK_HEADERS([CL/cl.h OpenCL/cl.h], [HAVE_CL_H="yes"; CL_HEADER="$ac_header"; break], [HAVE_CL_H="no"])
301      if test x"$HAVE_CL_H" = xno ; then
302        # check for AMD's SDK
303        AC_MSG_CHECKING([for cl.h in AMD's SDK])
304        if test -d /opt/AMDAPP/include/CL ; then
305          HAVE_CL_H="yes"
306          CL_HEADER="/opt/AMDAPP/include/CL/cl.h"
307          AC_DEFINE([HAVE_CL_CL_H])
308          CPPFLAGS_CL="-I/opt/AMDAPP/include"
309        fi
310        AC_MSG_RESULT([$HAVE_CL_H])
311      fi
312      if test x"$HAVE_CL_H" = xno ; then
313        # check for NVIDIA's SDK
314        AC_MSG_CHECKING([for NVIDIA's SDK cl.h])
315        CUDA_HOME=none
316        for CUDA in cuda cuda-7.0 cuda-6.5 cuda-6.0 ; do
317          if test -d /usr/local/$CUDA/include/CL ; then
318            CUDA_HOME=/usr/local/$CUDA
319            break
320          fi
321        done
322        if test x"$CUDA_HOME" != xnone ; then
323          HAVE_CL_H="yes"
324          CL_HEADER="$CUDA_HOME/include/CL/cl.h"
325          AC_DEFINE([HAVE_CL_CL_H])
326          CPPFLAGS_CL="-I$CUDA_HOME/include"
327        fi
328        AC_MSG_RESULT([$HAVE_CL_H])
329      fi
330      if test x"$HAVE_CL_H" = xno ; then
331        AC_MSG_WARN([no cl.h found])
332        CL_ENABLED=false
333        CL_VERSION=0
334        SIZEOF_CL_INT=0
335        SIZEOF_CL_LONG=0
336        SIZEOF_CL_FLOAT=0
337        SIZEOF_CL_DOUBLE=0
338      else
339        # check the cl.h header for which version of OpenCL is supported
340        AC_LANG([C])
341        save_CPPFLAGS=$CPPFLAGS
342        CPPFLAGS="$CPPFLAGS_CL $CPPFLAGS"
343        AC_LINK_IFELSE([AC_LANG_PROGRAM([[
344    #include <stdio.h>
345    # ifdef HAVE_CL_CL_H
346    #   include <CL/cl.h>
347    # elif defined(HAVE_OPENCL_CL_H)
348    #   include <OpenCL/cl.h>
349    # else
350    #   error no cl.h
351    # endif]],
352    [[#if defined(CL_VERSION_1_2)
353      printf("120\n");
354    #elif defined(CL_VERSION_1_1)
355      printf("110\n");
356    #elif defined(CL_VERSION_1_0)
357      printf("100\n");
358    #else
359      printf("0\n");
360    #endif
361          ]])],
362          [CL_VERSION=`./conftest$EXEEXT`], [CL_VERSION=0])
363    dnl
364    dnl check to see how we access the host-side vector types.  For OpenCL 1.1,
365    dnl the specification specifies the behavior, but it was unspecified in 1.0.
366    dnl
367        AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
368    #include "$CL_HEADER"
369    ]],
370          [[cl_float4 x; x[0] = 0.0;]])],
371          [AC_DEFINE([CL_HOST_VECTORS_ARE_ARRAYS],[1],[host vector types are arrays])],
372    dnl
373    dnl not arrays, so try the OpenCL 1.1 structure representation
374    dnl
375          [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
376    #include "$CL_HEADER"
377    ]],
378          [[cl_float4 x; x.s[0] = 0.0;]])],
379          [AC_DEFINE([CL_HOST_VECTORS_ARE_STRUCTS],[1],[host vector types are structs])],
380          [AC_MSG_ERROR([unable to figure out host types for OpenCL vectors])])])
381      # restore saved CPPFLAGS
382        CPPFLAGS=$save_CPPFLAGS
383      # substitutions
384        AC_SUBST(LIBS_CL)
385        AC_SUBST(CPPFLAGS_CL)
386      #
387      # determine the sizes of the host-side OpenCL types
388      AC_CHECK_SIZEOF([cl_int], [], [#include "$CL_HEADER"])
389      SIZEOF_CL_INT=$ac_cv_sizeof_cl_int
390      AC_CHECK_SIZEOF([cl_long], [], [#include "$CL_HEADER"])
391      SIZEOF_CL_LONG=$ac_cv_sizeof_cl_long
392      AC_CHECK_SIZEOF([cl_float], [], [#include "$CL_HEADER"])
393      SIZEOF_CL_FLOAT=$ac_cv_sizeof_cl_float
394      AC_CHECK_SIZEOF([cl_double], [], [#include "$CL_HEADER"])
395      SIZEOF_CL_DOUBLE=$ac_cv_sizeof_cl_double
396      fi
397    fi
398    AC_SUBST(CL_ENABLED)
399    AC_SUBST(CL_VERSION)
400    AC_DEFINE_UNQUOTED(DIDEROT_CL_VERSION,[$CL_VERSION],[version of OpenCL supported by system])
401    
402    AC_SUBST(SIZEOF_CL_INT)
403    AC_SUBST(SIZEOF_CL_LONG)
404    AC_SUBST(SIZEOF_CL_FLOAT)
405    AC_SUBST(SIZEOF_CL_DOUBLE)
406    
407    #################### end OpenCL configuration ####################
408    
409    #################### Teem configuration ####################
410    
411    dnl
412    dnl get the path to the TEEM installation.  We need this to build the Diderot
413    dnl runtime code and we use the path when searching for teem in the Diderot
414    dnl compiler.
415  dnl  dnl
416  AC_ARG_WITH(teem,  AC_ARG_WITH(teem,
417    AC_HELP_STRING([--with-teem=<path>], [specify path to teem installation]),    AC_HELP_STRING([--with-teem=<path>], [specify path to teem installation]),
418    [ac_cv_use_teem=$withval], [ac_cv_use_teem=no])    [ac_cv_use_teem=$withval], [ac_cv_use_teem=no])
419  if test x"$ac_cv_use_teem" = xno ; then  if test x"$ac_cv_use_teem" = xno ; then
420    TEEM_DIR=none    TEEM_DIR=none
421      AC_MSG_ERROR([unable to find teem; use --with-teem option to specify location])
422  else  else
423    AC_MSG_CHECKING([path to teem ($ac_cv_use_teem)])    AC_MSG_CHECKING([path to teem ($ac_cv_use_teem)])
424    case $ac_cv_use_teem in    case $ac_cv_use_teem in
# Line 113  Line 427 
427    esac    esac
428    if test -x $ac_cv_use_teem ; then    if test -x $ac_cv_use_teem ; then
429      TEEM_DIR=$ac_cv_use_teem      TEEM_DIR=$ac_cv_use_teem
430      AC_MSG_RESULT([ okay])      # check that TEEM_DIR actually points to something that looks like teem
431        if test -f $TEEM_DIR/include/teem/nrrd.h ; then
432          AC_MSG_RESULT([yes])
433        else
434          TEEM_DIR=none
435          AC_MSG_RESULT([invalid path to teem])
436        fi
437    else    else
438      TEEM_DIR=none      TEEM_DIR=none
439      AC_MSG_RESULT([ invalid])      AC_MSG_RESULT([invalid path to teem])
440    fi    fi
441  fi  fi
442  if test x"$TEEM_DIR" = xnone ; then  if test x"$TEEM_DIR" = xnone ; then
443    AC_MSG_ERROR([unable to find teem])    AC_MSG_ERROR([unable to find teem])
444  fi  fi
445    dnl
446    dnl check that unu supports the dnorm command
447    dnl
448    if test x"$TEEM_DIR" != xnone ; then
449      AC_MSG_CHECKING([that \"unu dnorm\" works])
450      if test -x $TEEM_DIR/bin/unu ; then
451        $TEEM_DIR/bin/unu dnorm > /dev/null 2> /dev/null
452        if test $? -eq 0 ; then
453          AC_MSG_RESULT([yes])
454        else
455          AC_MSG_ERROR([\"unu dnorm\" is not supported; please update your teem installation])
456        fi
457      else
458        AC_MSG_ERROR([unable to find unu executable in $TEEM_DIR/bin"])
459      fi
460    fi
461  AC_SUBST(TEEM_DIR)  AC_SUBST(TEEM_DIR)
462    
463  dnl ******************** SML/NJ configuration ********************  #################### end Teem configuration ####################
464    
465    #################### SML configuration ####################
466    
467    dnl
468    dnl We support building with both SML/NJ (the default) or MLton.
469  dnl  dnl
470    
471    dnl first check for --with-mlton=path flag
472    dnl
473    AC_ARG_WITH([mlton],
474      [AS_HELP_STRING([--with-mlton=<path-to-mlton>],
475        [use the MLton Standard ML compiler to build Diderot])],
476      [with_mlton=yes],[with_mlton=no])
477    if test x"$with_mlton" = xyes ; then
478      if test x"$ac_cv_path_with_mlton" = x ; then
479        # look for mlton in the PATH
480        AC_PATH_PROGS(with_mlton, mlton, no)
481        if test x"$MLTON" = xno ; then
482          AC_MSG_ERROR([unable to find mlton executable; please specify the path])
483        fi
484      else
485        with_mlton=$ac_cv_path_with_mlton
486        case $with_mlton in
487          /*) ;;
488          *) AC_MSG_ERROR([please specify absolute path for mlton executable]) ;;
489        esac
490        if test ! -x $with_mlton ; then
491          AC_MSG_ERROR([invalid path for mlton; $with_mlton is not executable])
492        fi
493      fi
494    fi
495    
496    if test x"$with_mlton" = xno ; then
497      # we are using SML/NJ
498      #
499    
500  dnl check that we have a compatible version of SML/NJ  dnl check that we have a compatible version of SML/NJ
501  dnl  dnl
502  CHECK_SMLNJ([AC_MSG_ERROR([unable to find SML/NJ installation; check your PATH or set SMLNJ_CMD])])  CHECK_SMLNJ([AC_MSG_ERROR([unable to find SML/NJ installation; check your PATH or set SMLNJ_CMD])])
503  if test $SMLNJ_MAJOR_VERSION -lt 110 \  if test $SMLNJ_MAJOR_VERSION -lt 110 \
504    -o $SMLNJ_MINOR_VERSION -lt 72      -o $SMLNJ_MINOR_VERSION -lt 79
505  then  then
506    AC_MSG_ERROR([installation requires SML/NJ version 110.72+])      AC_MSG_ERROR([installation requires SML/NJ version 110.79+ (available from smlnj.org)])
507  fi  fi
 AC_SUBST(SMLNJ_VERSION)  
508    
509  dnl determine the heap-image suffix  dnl determine the heap-image suffix
510  dnl  dnl
# Line 163  Line 532 
532    AC_MSG_ERROR([ml-build not found])    AC_MSG_ERROR([ml-build not found])
533  fi  fi
534  AC_SUBST(ML_BUILD)  AC_SUBST(ML_BUILD)
535      SML=smlnj
 dnl ******************** Paths ********************  
   
 DIDEROT_ROOT=`pwd`  
 DIDEROT_DOCDIR=$DIDEROT_ROOT/doc  
 DIDEROT_SRCDIR=$DIDEROT_ROOT/src  
 DIDEROT_LIBDIR=$DIDEROT_ROOT/lib  
 DIDEROT_BINDIR=$DIDEROT_ROOT/bin  
 DIDEROT_MKDIR=$DIDEROT_ROOT/mk  
536    
537  HEAP_IMAGE_DIR=$DIDEROT_BINDIR/.heap  HEAP_IMAGE_DIR=$DIDEROT_BINDIR/.heap
538  INSTALL_SMLNJ_WRAPPER=$DIDEROT_BINDIR/install-sml-wrapper.sh  INSTALL_SMLNJ_WRAPPER=$DIDEROT_BINDIR/install-sml-wrapper.sh
   
 AC_SUBST(DIDEROT_ROOT)  
 AC_SUBST(DIDEROT_DOCDIR)  
 AC_SUBST(DIDEROT_SRCDIR)  
 AC_SUBST(DIDEROT_LIBDIR)  
 AC_SUBST(DIDEROT_BINDIR)  
 AC_SUBST(DIDEROT_MKDIR)  
539  AC_SUBST(HEAP_IMAGE_DIR)  AC_SUBST(HEAP_IMAGE_DIR)
540  AC_SUBST(INSTALL_SMLNJ_WRAPPER)  AC_SUBST(INSTALL_SMLNJ_WRAPPER)
541    
542    else
543    
544      # we are using MLton
545      MLTON=$with_mlton
546      AC_SUBST(MLTON)
547      SML=mlton
548    
549    fi
550    AC_SUBST(SML)
551    
552    #################### SML configuration ####################
553    
554    #################### Documentation tools configuration ####################
555    
556    dnl check for doxygen
557    dnl
558    AC_ARG_WITH([doxygen],
559      [AS_HELP_STRING([--with-doxygen=<path>], [specify location of doxygen executable])],
560      [DOXYGEN=$with_doxygen],
561      [DOXYGEN=none])
562    if test x$DOXYGEN = xnone ; then
563      # see if we can find doxygen in the user's path
564      AC_PATH_PROG(DOXYGEN, [doxygen], [none])
565    fi
566    if test x$with_doxygen = xyes -o x$with_doxygen = xno ; then
567      AC_MSG_ERROR([--with-doxygen option must specify directory argument])
568    elif test x$DOXYGEN != xnone -a ! -x $DOXYGEN ; then
569      AC_MSG_ERROR([doxygen not found at $DOXYGEN])
570    elif test x$DOXYGEN != xnone ; then
571    dnl
572    dnl verify that $DOXYGEN is an absolute path
573  dnl  dnl
574  dnl ******************** write output ********************    case $DOXYGEN in
575        /*) ;;
576        *) AC_MSG_ERROR([--with-doxygen path must be absolute]) ;;
577      esac
578    fi
579    if test $DOXYGEN = xnone ; then
580      DOXYGEN=:
581    fi
582    AC_SUBST(DOXYGEN)
583    
584    dnl check for asciidoc and related tools
585  dnl  dnl
586    AC_PATH_PROGS([ASCIIDOC], [asciidoc], [none])
587    AC_PATH_PROGS([A2X], [a2x], [none])
588    AC_PATH_PROGS([HIGHLIGHTER], [pygmentize], [none])
589    AC_PATH_PROGS([DBLATEX], [dblatex], [none])
590    
591    dnl
592    dnl get the path to the asciidoc cofiguration files
593    dnl
594    if test x"$ASCIIDOC" != xnone ; then
595      AC_MSG_CHECKING([path to asciidoc configuration files])
596      ASCIIDOC_CONF_DIR=`$ASCIIDOC -v /dev/null 2>&1 | head -n 1 | sed 's|.*reading: \(.*\)/asciidoc.conf|\1|'`
597      AC_MSG_RESULT([$ASCIIDOC_CONF_DIR])
598    fi
599    AC_SUBST(ASCIIDOC)
600    AC_SUBST(A2X)
601    AC_SUBST(ASCIIDOC_CONF_DIR)
602    AC_SUBST(HIGHLIGHTER)
603    AC_SUBST(DBLATEX)
604    
605    #################### end Documentation tools configuration ####################
606    
607    #################### config.h ####################
608    
609    AC_DEFINE_UNQUOTED(DIDEROT_INCLUDE_PATH,["$DIDEROT_SRCDIR/lib/include"], [path for Diderot header files])
610    
611    AH_TOP([
612    /*
613     * This code is part of the Diderot Project (http://diderot-language.cs.uchicago.edu)
614     *
615     * COPYRIGHT (c) 2016 The University of Chicago * All rights reserved.
616     */
617    
618    #ifndef _DIDEROT_CONFIG_H_
619    #define _DIDEROT_CONFIG_H_
620    
621    ])
622    AH_BOTTOM([
623    
624    #endif /* !_DIDEROT_CONFIG_H_ */
625    ])
626    
627    #################### end config.h ####################
628    
629    #################### write output ####################
630    
631    dnl The compiler Makefile depends on which SML system we are
632    dnl using.
633    if test x"$SML" = xmlton ; then
634      COMPILER_MAKEFILE_IN=":src/compiler/Makefile_mlton.in"
635    else
636      COMPILER_MAKEFILE_IN=""
637    fi
638    
639  AC_CONFIG_FILES(  AC_CONFIG_FILES(
640  dnl  dnl
641  dnl ***** Makefiles *****  dnl ***** Makefiles *****
642    Makefile    Makefile
643    src/dnorm/Makefile  dnl  doc/Makefile
644    src/compiler/Makefile  dnl  doc/man/Makefile
645    src/lib/Makefile  dnl  src/clinfo/Makefile
646      src/compiler/Makefile"$COMPILER_MAKEFILE_IN"
647    src/lib/build/Makefile    src/lib/build/Makefile
648    src/lib/build/mk/build.gmk:src/lib/build/mk/build_gmk.in    src/lib/build/mk/build.gmk:src/lib/build/mk/build_gmk.in
649    test/Makefile  dnl  test/MIP/Makefile
650    test/MIP/Makefile  dnl  test/probe/Makefile
651    test/probe/Makefile  dnl  test/iso2d-polyline/Makefile
652    dnl  test/vr-lite-cam/Makefile
653    dnl  test/hlic/Makefile
654  dnl  dnl
655  dnl ***** SML source files *****  dnl ***** SML source files *****
656    src/compiler/fields/run-dnorm.sml:src/compiler/fields/run-dnorm_sml.in    src/compiler/nrrd/run-dnorm.sml:src/compiler/nrrd/run-dnorm_sml.in
657    src/compiler/common/paths.sml:src/compiler/common/paths_sml.in    src/compiler/common/paths.sml:src/compiler/common/paths_sml.in
658      src/compiler/common/size-of.sml:src/compiler/common/size-of_sml.in
659      src/compiler/options/version.sml:src/compiler/options/version_sml.in
660  )  )
661    
662    AC_CONFIG_HEADERS(src/lib/include/diderot/config.h:config/config_h.in)
663    
664  dnl  dnl
665  dnl shell scripts  dnl shell scripts
666  dnl  dnl
667  AC_CONFIG_FILES([  AC_CONFIG_FILES([
668    bin/install-sml-wrapper.sh:config/install-sml-wrapper_sh.in    bin/install-sml-wrapper.sh:config/install-sml-wrapper_sh.in
669  ], [chmod +x bin/install-sml-wrapper.sh])  ], [chmod +x bin/install-sml-wrapper.sh])
670    AC_CONFIG_FILES([
671      src/compiler/gen/fragments/mkfrags.sh:src/compiler/gen/fragments/mkfrags_sh.in
672    ], [chmod +x src/compiler/gen/fragments/mkfrags.sh])
673    AC_CONFIG_FILES([
674      src/compiler/gen/fragments/mkmk.sh:src/compiler/gen/fragments/mkmk_sh.in
675    ], [chmod +x src/compiler/gen/fragments/mkmk.sh])
676    AC_CONFIG_FILES([
677      src/tests/rtest/scripts/run.sh:src/tests/rtest/scripts/run_sh.in
678    ], [chmod +x src/tests/rtest/scripts/run.sh])
679    AC_CONFIG_FILES([
680      src/tests/rtest/scripts/run-one.sh:src/tests/rtest/scripts/run-one_sh.in
681    ], [chmod +x src/tests/rtest/scripts/run-one.sh])
682    #
683    # more regression tests; should merge with rtest at some point
684    #
685    # AC_CONFIG_FILES([
686    #   rtest2/scripts/run.sh:rtest2/scripts/run_sh.in
687    # ], [chmod +x rtest2/scripts/run.sh])
688    # AC_CONFIG_FILES([
689    #   rtest2/scripts/run-one.sh:rtest2/scripts/run-one_sh.in
690    # ], [chmod +x rtest2/scripts/run-one.sh])
691    
692  dnl  dnl
693  dnl generate makefiles for runtime library builds  dnl generate makefiles for runtime library builds
694  dnl  dnl
695  dnl usage: MK_BUILD_DIR(<build-dir>, <target-platform>, <options>)  dnl usage: MK_BUILD_DIR(<build-dir>, <target-platform>, <options>)
696  dnl  dnl
697    dnl where the options are taken from [debug, parallel]
698    dnl
699  AC_DEFUN([MK_BUILD_DIR], [  AC_DEFUN([MK_BUILD_DIR], [
700      if test ! -d src/lib/build/$1 ; then      if test ! -d src/lib/build/$1 ; then
701        mkdir src/lib/build/$1        mkdir src/lib/build/$1
# Line 231  Line 708 
708      AC_CONFIG_FILES(src/lib/build/$1/Makefile)      AC_CONFIG_FILES(src/lib/build/$1/Makefile)
709    ])    ])
710    
711  MK_BUILD_DIR(rt-c-f, c-target, [float])  MK_BUILD_DIR(rt-seq, sequential, [])
712  MK_BUILD_DIR(rt-c-f-debug, c-target, [float debug])  MK_BUILD_DIR(rt-seq-debug, sequential, [debug])
713    MK_BUILD_DIR(rt-par, parallel, [parallel])
714    MK_BUILD_DIR(rt-par-debug, parallel, [parallel debug])
715    
716    #if test x"$CL_ENABLED" = xtrue ; then
717    #  MK_BUILD_DIR(rt-cl-f, opencl, [float])
718    #  MK_BUILD_DIR(rt-cl-d, opencl, [double])
719    #  MK_BUILD_DIR(rt-cl-f-debug, opencl, [float debug])
720    #  MK_BUILD_DIR(rt-cl-d-debug, opencl, [double debug])
721    #fi
722    
723  AC_OUTPUT  AC_OUTPUT
724    
725    #################### end write output ####################

Legend:
Removed from v.1116  
changed lines
  Added in v.4239

root@smlnj-gforge.cs.uchicago.edu
ViewVC Help
Powered by ViewVC 1.0.0