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

SCM Repository

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

Diff of /branches/opencl/configure.ac

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

revision 3, Wed Jan 6 04:47:22 2010 UTC revision 1200, Thu May 12 12:53:00 2011 UTC
# Line 9  Line 9 
9  AC_INIT(diderot,0.1,)  AC_INIT(diderot,0.1,)
10    
11  AC_PREREQ(2.60)  AC_PREREQ(2.60)
12  AC_COPYRIGHT([[COPYRIGHT (c) 2010 The Diderot Project]])  AC_COPYRIGHT([[COPYRIGHT (c) 2010 The Diderot Project (http://diderot-language.cs.uchicago.edu)]])
13  AC_CONFIG_SRCDIR(??)  AC_CONFIG_SRCDIR(src/dnorm/dnorm.c)
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 include additional macros  dnl include additional macros
19  dnl  dnl
 dnl sinclude(config/ax_check_gl.m4)  
 dnl sinclude(config/ax_check_glu.m4)  
 dnl sinclude(config/ax_check_glut.m4)  
20  sinclude(config/acx_pthread.m4)  sinclude(config/acx_pthread.m4)
21  sinclude(config/ax_lang_compiler_ms.m4)  sinclude(config/check_smlnj.m4)
22  sinclude(config/ax_check_framework.m4)  sinclude(config/check_smlnj_heap_suffix.m4)
 sinclude(config/ax_check_macports.m4)  
 sinclude(config/ax_check_lib_stdcall.m4)  
23    
24  dnl  dnl
25  dnl get host and target information  dnl get host information
26  dnl  dnl
27  AC_CANONICAL_HOST  AC_CANONICAL_HOST
28    
29  dnl check for standard programs  dnl check for standard programs
30  dnl  dnl
 AC_PROG_CC_C99  
31  AC_PROG_CPP  AC_PROG_CPP
32  AC_PROG_INSTALL  AC_PROG_INSTALL
33  AC_PROG_MAKE_SET  AC_PROG_MAKE_SET
34    
35    dnl check for c99 support
36    dnl
37    AC_PROG_CC_C99
38    if test x"$ac_cv_prog_cc_c99" = xno ; then
39      AC_MSG_ERROR([Diderot requires c99 support])
40    fi
41    
42    dnl extra C compiler options
43    dnl
44    CFLAG_M64="-m64"
45    CFLAGS="$CFLAGS -Wformat -Wreturn-type -Wuninitialized"
46    AC_SUBST(CFLAG_M64)
47    
48    dnl
49    dnl Look for NVIDIA's nvcc compiler
50    dnl
51    AC_MSG_CHECKING([for CUDA and nvcc])
52    AC_PATH_PROG(NVCC, nvcc, ":", $PATH)
53    if test $NVCC = none ; then
54      AC_MSG_WARN([nvcc not found])
55    else
56      AC_MSG_RESULT([$NVCC])
57    fi
58    AC_SUBST(NVCC)
59    
60    dnl
61    dnl check for pthreads support
62    dnl
63    ACX_PTHREAD()
64    
65    dnl
66    dnl OS-specific linking issues
67    dnl
68    LD_NEEDS_RPATH=false;
69    LIBM=""
70    case "$host_os" in
71      darwin*) # On Mac OS X we check for the presence of macports and/or fink
72        if test -x /opt/local/bin/port ; then
73          HAS_MACPORTS=yes
74        else
75          HAS_MACPORTS=no
76        fi
77        if test -x /sw/bin/fink ; then
78          HAS_FINK=yes
79        else
80          HAS_FINK=no
81        fi
82      ;;
83      linux*) # On Linux we include the -rpath option to pick up dynamically-loaded libraries
84        LD_NEEDS_RPATH=true
85        LIBM="-lm"
86      ;;
87    esac
88    
89    if test x"$HAS_MACPORTS" = xyes ; then
90      LDPATHS="-L/opt/local/lib"
91    elif test x"$HAS_FINK" = xyes ; then
92      LDPATHS="-L/sw/lib"
93    else
94      LDPATHS=""
95    fi
96    AC_SUBST(LDPATHS)
97    AC_SUBST(LD_NEEDS_RPATH)
98    AC_SUBST(LIBM)
99    
100    dnl
101    dnl get the path to the TEEM installation
102    dnl
103    AC_ARG_WITH(teem,
104      AC_HELP_STRING([--with-teem=<path>], [specify path to teem installation]),
105      [ac_cv_use_teem=$withval], [ac_cv_use_teem=no])
106    if test x"$ac_cv_use_teem" = xno ; then
107      TEEM_DIR=none
108    else
109      AC_MSG_CHECKING([path to teem ($ac_cv_use_teem)])
110      case $ac_cv_use_teem in
111        /*) ;;
112        *) AC_MSG_ERROR([path to teem must be absolute]) ;;
113      esac
114      if test -x $ac_cv_use_teem ; then
115        TEEM_DIR=$ac_cv_use_teem
116        AC_MSG_RESULT([ okay])
117      else
118        TEEM_DIR=none
119        AC_MSG_RESULT([ invalid])
120      fi
121    fi
122    if test x"$TEEM_DIR" = xnone ; then
123      AC_MSG_ERROR([unable to find teem])
124    fi
125    AC_SUBST(TEEM_DIR)
126    
127    dnl ******************** SML/NJ configuration ********************
128    dnl
129    
130    dnl check that we have a compatible version of SML/NJ
131    dnl
132    CHECK_SMLNJ([AC_MSG_ERROR([unable to find SML/NJ installation; check your PATH or set SMLNJ_CMD])])
133    if test $SMLNJ_MAJOR_VERSION -lt 110 \
134      -o $SMLNJ_MINOR_VERSION -lt 72
135    then
136      AC_MSG_ERROR([installation requires SML/NJ version 110.72+])
137    fi
138    AC_SUBST(SMLNJ_VERSION)
139    
140    dnl determine the heap-image suffix
141    dnl
142    CHECK_SMLNJ_HEAP_SUFFIX([
143      AC_MSG_ERROR([unsupported configuration ${host_cpu}-${host_os}])])
144    
145    dnl look for ml-makedepend
146    dnl
147    AC_MSG_CHECKING([for ml-makedepend])
148    tmpPATH="$SMLNJ_PATH:$PATH"
149    AC_PATH_PROG(ML_MAKEDEPEND, ml-makedepend, ":", $tmpPATH)
150    if test $ML_MAKEDEPEND = none ; then
151      AC_MSG_ERROR([ml-makedepend not found])
152    else
153      AC_MSG_RESULT([$ML_MAKEDEPEND])
154    fi
155    AC_SUBST(ML_MAKEDEPEND)
156    
157    dnl
158    dnl look for ml-build
159    dnl
160    tmpPATH="$SMLNJ_PATH:$PATH"
161    AC_PATH_PROG(ML_BUILD, ml-build, none, $tmpPATH)
162    if test $ML_BUILD = none ; then
163      AC_MSG_ERROR([ml-build not found])
164    fi
165    AC_SUBST(ML_BUILD)
166    
167    dnl ******************** Paths ********************
168    
169    DIDEROT_ROOT=`pwd`
170    DIDEROT_DOCDIR=$DIDEROT_ROOT/doc
171    DIDEROT_SRCDIR=$DIDEROT_ROOT/src
172    DIDEROT_LIBDIR=$DIDEROT_ROOT/lib
173    DIDEROT_BINDIR=$DIDEROT_ROOT/bin
174    DIDEROT_MKDIR=$DIDEROT_ROOT/mk
175    
176    HEAP_IMAGE_DIR=$DIDEROT_BINDIR/.heap
177    INSTALL_SMLNJ_WRAPPER=$DIDEROT_BINDIR/install-sml-wrapper.sh
178    
179    AC_SUBST(DIDEROT_ROOT)
180    AC_SUBST(DIDEROT_DOCDIR)
181    AC_SUBST(DIDEROT_SRCDIR)
182    AC_SUBST(DIDEROT_LIBDIR)
183    AC_SUBST(DIDEROT_BINDIR)
184    AC_SUBST(DIDEROT_MKDIR)
185    AC_SUBST(HEAP_IMAGE_DIR)
186    AC_SUBST(INSTALL_SMLNJ_WRAPPER)
187    
188    dnl
189    dnl ******************** write output ********************
190    dnl
191    
192    AC_CONFIG_FILES(
193    dnl
194    dnl ***** Makefiles *****
195      Makefile
196      src/dnorm/Makefile
197      src/compiler/Makefile
198      src/lib/Makefile
199      src/lib/build/Makefile
200      src/lib/build/mk/build.gmk:src/lib/build/mk/build_gmk.in
201      test/Makefile
202      test/MIP/Makefile
203      test/probe/Makefile
204    dnl
205    dnl ***** SML source files *****
206      src/compiler/fields/run-dnorm.sml:src/compiler/fields/run-dnorm_sml.in
207      src/compiler/common/paths.sml:src/compiler/common/paths_sml.in
208    )
209    
210    dnl
211    dnl shell scripts
212    dnl
213    AC_CONFIG_FILES([
214      bin/install-sml-wrapper.sh:config/install-sml-wrapper_sh.in
215    ], [chmod +x bin/install-sml-wrapper.sh])
216    AC_CONFIG_FILES([
217      rtest/scripts/run-one.sh:rtest/scripts/run-one_sh.in
218    ], [chmod +x rtest/scripts/run-one.sh])
219    AC_CONFIG_FILES([
220      rtest/scripts/run.sh:rtest/scripts/run_sh.in
221    ], [chmod +x rtest/scripts/run.sh])
222    
223    dnl
224    dnl generate makefiles for runtime library builds
225    dnl
226    dnl usage: MK_BUILD_DIR(<build-dir>, <target-platform>, <options>)
227    dnl
228    AC_DEFUN([MK_BUILD_DIR], [
229        if test ! -d src/lib/build/$1 ; then
230          mkdir src/lib/build/$1
231        fi
232        [sed -e 's,@BUILD_TARGET@,$1,g' \
233          -e 's,@TARGET_PLATFORM@,$2,g' \
234          -e 's,@BUILD_OPTIONS@,$3,g' \
235          src/lib/build/mk/Makefile.in \
236            > src/lib/build/$1/Makefile.in]
237        AC_CONFIG_FILES(src/lib/build/$1/Makefile)
238      ])
239    
240    MK_BUILD_DIR(rt-c-f, c-target, [float])
241    MK_BUILD_DIR(rt-c-f-debug, c-target, [float debug])
242    
243  AC_OUTPUT  AC_OUTPUT

Legend:
Removed from v.3  
changed lines
  Added in v.1200

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