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 COPYRIGHT (c) 2012 The Diderot Project |
4 |
dnl All rights reserved. |
dnl All rights reserved. |
5 |
dnl |
dnl |
6 |
|
|
7 |
AC_INIT(diderot,0.1,) |
AC_INIT(diderot,0.1,) |
8 |
|
|
9 |
AC_PREREQ(2.60) |
AC_PREREQ(2.60) |
10 |
AC_COPYRIGHT([[COPYRIGHT (c) 2011 The Diderot Project (http://diderot-language.cs.uchicago.edu)]]) |
AC_COPYRIGHT([[COPYRIGHT (c) 2012 The Diderot Project (http://diderot-language.cs.uchicago.edu)]]) |
11 |
AC_CONFIG_SRCDIR(src/dnorm/dnorm.c) |
AC_CONFIG_SRCDIR(src/dnorm/dnorm.c) |
12 |
AC_CONFIG_AUX_DIR(config) |
AC_CONFIG_AUX_DIR(config) |
13 |
AC_CONFIG_MACRO_DIR(config) |
AC_CONFIG_MACRO_DIR(config) |
32 |
AC_PROG_INSTALL |
AC_PROG_INSTALL |
33 |
AC_PROG_MAKE_SET |
AC_PROG_MAKE_SET |
34 |
|
|
35 |
|
dnl FIXME: this works for now, but we should probably switch to libtool |
36 |
|
dnl |
37 |
|
AC_PATH_PROG(LD, [ld], [none]) |
38 |
|
if test x$LD = xnone ; then |
39 |
|
AC_MSG_ERROR([cannot find ld command]) |
40 |
|
fi |
41 |
|
AC_SUBST(LD) |
42 |
|
|
43 |
dnl check for c99 support |
dnl check for c99 support |
44 |
dnl |
dnl |
45 |
AC_PROG_CC_C99 |
AC_PROG_CC_C99 |
107 |
dnl |
dnl |
108 |
dnl check for OpenCL support |
dnl check for OpenCL support |
109 |
dnl |
dnl |
110 |
CL_LIBS="none" |
LIBS_CL="none" |
111 |
case "$host_os" in |
case "$host_os" in |
112 |
darwin*) # On Mac OS X we check for installed frameworks |
darwin*) # On Mac OS X we check for installed frameworks |
113 |
AX_CHECK_FRAMEWORK([OpenCL], [CL_LIBS="-framework OpenCL"], []) |
AX_CHECK_FRAMEWORK([OpenCL], [LIBS_CL="-framework OpenCL"], []) |
114 |
;; |
;; |
115 |
*) |
*) |
116 |
AC_CHECK_LIB([OpenCL],[clGetPlatformIDs],[CL_LIBS="-lOpenCL"]) |
AC_CHECK_LIB([OpenCL],[clGetPlatformIDs],[LIBS_CL="-lOpenCL"]) |
117 |
;; |
;; |
118 |
esac |
esac |
119 |
if test x"$CL_LIBS" = xnone ; then |
if test x"$LIBS_CL" = xnone ; then |
120 |
AC_MSG_WARN([no OpenCL library found]) |
AC_MSG_WARN([no OpenCL library found]) |
121 |
CL_ENABLED=false |
CL_ENABLED=false |
122 |
CL_VERSION=0 |
CL_VERSION=0 |
123 |
else |
else |
124 |
CL_ENABLED=true |
CL_ENABLED=true |
125 |
AC_CHECK_HEADERS([CL/cl.h OpenCL/cl.h]) |
CPPFLAGS_CL="" |
126 |
|
AC_CHECK_HEADERS([CL/cl.h OpenCL/cl.h], [HAVE_CL_H="yes"; break], [HAVE_CL_H="no"]) |
127 |
|
if test x"$HAVE_CL_H" = xno ; then |
128 |
|
# check for AMD's SDK |
129 |
|
AC_MSG_CHECKING([for cl.h in AMD's SDK]) |
130 |
|
if test -d /opt/AMDAPP/include/CL ; then |
131 |
|
HAVE_CL_H="yes" |
132 |
|
AC_DEFINE([HAVE_CL_CL_H]) |
133 |
|
CPPFLAGS_CL="-I/opt/AMDAPP/include" |
134 |
|
fi |
135 |
|
AC_MSG_RESULT([$HAVE_CL_H]) |
136 |
|
fi |
137 |
|
if test x"$HAVE_CL_H" = xno ; then |
138 |
|
AC_MSG_WARN([no cl.h found]) |
139 |
|
CL_ENABLED=false |
140 |
|
CL_VERSION=0 |
141 |
|
else |
142 |
# check the cl.h header for which version of OpenCL is supported |
# check the cl.h header for which version of OpenCL is supported |
143 |
AC_LANG([C]) |
AC_LANG([C]) |
144 |
|
save_CPPFLAGS=$CPPFLAGS |
145 |
|
CPPFLAGS="$CPPFLAGS_CL $CPPFLAGS" |
146 |
AC_LINK_IFELSE([AC_LANG_PROGRAM([[ |
AC_LINK_IFELSE([AC_LANG_PROGRAM([[ |
147 |
#include <stdio.h> |
#include <stdio.h> |
148 |
# ifdef HAVE_CL_CL_H |
# ifdef HAVE_CL_CL_H |
189 |
[[cl_float4 x; x.s[0] = 0.0;]])], |
[[cl_float4 x; x.s[0] = 0.0;]])], |
190 |
[AC_DEFINE([CL_HOST_VECTORS_ARE_STRUCTS],[1],[host vector types are structs])], |
[AC_DEFINE([CL_HOST_VECTORS_ARE_STRUCTS],[1],[host vector types are structs])], |
191 |
[AC_MSG_ERROR([unable to figure out host types for OpenCL vectors])])]) |
[AC_MSG_ERROR([unable to figure out host types for OpenCL vectors])])]) |
192 |
|
# restore saved CPPFLAGS |
193 |
|
CPPFLAGS=$save_CPPFLAGS |
194 |
# substitutions |
# substitutions |
195 |
AC_SUBST(CL_LIBS) |
AC_SUBST(LIBS_CL) |
196 |
|
AC_SUBST(CPPFLAGS_CL) |
197 |
|
fi |
198 |
fi |
fi |
199 |
AC_SUBST(CL_ENABLED) |
AC_SUBST(CL_ENABLED) |
200 |
AC_SUBST(CL_VERSION) |
AC_SUBST(CL_VERSION) |
483 |
AC_CONFIG_FILES([ |
AC_CONFIG_FILES([ |
484 |
src/compiler/gen/file2str/file2str.sh:src/compiler/gen/file2str/file2str_sh.in |
src/compiler/gen/file2str/file2str.sh:src/compiler/gen/file2str/file2str_sh.in |
485 |
], [chmod +x src/compiler/gen/file2str/file2str.sh]) |
], [chmod +x src/compiler/gen/file2str/file2str.sh]) |
486 |
|
AC_CONFIG_FILES([ |
487 |
|
rtest/scripts/run.sh:rtest/scripts/run_sh.in |
488 |
|
], [chmod +x rtest/scripts/run.sh]) |
489 |
|
AC_CONFIG_FILES([ |
490 |
|
rtest/scripts/run-one.sh:rtest/scripts/run-one_sh.in |
491 |
|
], [chmod +x rtest/scripts/run-one.sh]) |
492 |
|
|
493 |
dnl |
dnl |
494 |
dnl generate makefiles for runtime library builds |
dnl generate makefiles for runtime library builds |