SCM Repository
Annotation of /examples/configure.ac
Parent Directory
|
Revision Log
Revision 2064 - (view) (download)
1 : | jhr | 1881 | dnl Process this file with autoconf to produce a configure script. |
2 : | dnl | ||
3 : | dnl COPYRIGHT (c) 2012 The Diderot Project | ||
4 : | dnl All rights reserved. | ||
5 : | dnl | ||
6 : | |||
7 : | AC_INIT(diderot-examples,0.1,) | ||
8 : | |||
9 : | AC_PREREQ(2.60) | ||
10 : | AC_COPYRIGHT([[COPYRIGHT (c) 2012 The Diderot Project (http://diderot-language.cs.uchicago.edu)]]) | ||
11 : | AC_CONFIG_SRCDIR(iso2d-demo/iso2d.diderot) | ||
12 : | AC_CONFIG_AUX_DIR(config) | ||
13 : | AC_CONFIG_MACRO_DIR(config) | ||
14 : | |||
15 : | dnl | ||
16 : | jhr | 1882 | dnl include additional macros |
17 : | dnl | ||
18 : | sinclude(config/pkg.m4) | ||
19 : | |||
20 : | dnl | ||
21 : | jhr | 1881 | dnl get host information |
22 : | dnl | ||
23 : | AC_CANONICAL_HOST | ||
24 : | |||
25 : | dnl check for standard programs | ||
26 : | dnl | ||
27 : | AC_PROG_CC([clang gcc cc]) | ||
28 : | AC_PROG_CPP | ||
29 : | AC_PROG_INSTALL | ||
30 : | AC_PROG_MAKE_SET | ||
31 : | |||
32 : | dnl check for c99 support | ||
33 : | dnl | ||
34 : | AC_PROG_CC_C99 | ||
35 : | if test x"$ac_cv_prog_cc_c99" = xno ; then | ||
36 : | AC_MSG_ERROR([Diderot requires c99 support]) | ||
37 : | fi | ||
38 : | |||
39 : | dnl extra C compiler options | ||
40 : | dnl | ||
41 : | CFLAGS="" | ||
42 : | CFLAG_M64="-m64" | ||
43 : | CFLAGS_BASE="-Wformat -Wreturn-type -Wuninitialized" | ||
44 : | AC_SUBST(CFLAG_M64) | ||
45 : | AC_SUBST(CFLAGS_BASE) | ||
46 : | |||
47 : | dnl | ||
48 : | dnl OS-specific linking issues | ||
49 : | dnl | ||
50 : | LD_NEEDS_RPATH=false; | ||
51 : | LIBM="" | ||
52 : | case "$host_os" in | ||
53 : | darwin*) # On Mac OS X we check for the presence of macports and/or fink | ||
54 : | if test -x /opt/local/bin/port ; then | ||
55 : | HAS_MACPORTS=yes | ||
56 : | else | ||
57 : | HAS_MACPORTS=no | ||
58 : | fi | ||
59 : | if test -x /sw/bin/fink ; then | ||
60 : | HAS_FINK=yes | ||
61 : | else | ||
62 : | HAS_FINK=no | ||
63 : | fi | ||
64 : | ;; | ||
65 : | linux*) # On Linux we include the -rpath option to pick up dynamically-loaded libraries | ||
66 : | LD_NEEDS_RPATH=true | ||
67 : | LIBM="-lm" | ||
68 : | ;; | ||
69 : | esac | ||
70 : | |||
71 : | if test x"$HAS_MACPORTS" = xyes ; then | ||
72 : | LDPATHS="-L/opt/local/lib" | ||
73 : | jhr | 1882 | CPPFLAGS="-I/opt/local/include" |
74 : | jhr | 1881 | elif test x"$HAS_FINK" = xyes ; then |
75 : | LDPATHS="-L/sw/lib" | ||
76 : | jhr | 1882 | CPPFLAGS="-I/sw/include" |
77 : | jhr | 1881 | else |
78 : | LDPATHS="" | ||
79 : | fi | ||
80 : | AC_SUBST(LDPATHS) | ||
81 : | AC_SUBST(LD_NEEDS_RPATH) | ||
82 : | AC_SUBST(LIBM) | ||
83 : | |||
84 : | dnl | ||
85 : | dnl get the path to the TEEM installation | ||
86 : | dnl | ||
87 : | AC_ARG_WITH(teem, | ||
88 : | AC_HELP_STRING([--with-teem=<path>], [specify path to teem installation]), | ||
89 : | [ac_cv_use_teem=$withval], [ac_cv_use_teem=no]) | ||
90 : | if test x"$ac_cv_use_teem" = xno ; then | ||
91 : | TEEM_DIR=none | ||
92 : | else | ||
93 : | AC_MSG_CHECKING([path to teem ($ac_cv_use_teem)]) | ||
94 : | case $ac_cv_use_teem in | ||
95 : | /*) ;; | ||
96 : | *) AC_MSG_ERROR([path to teem must be absolute]) ;; | ||
97 : | esac | ||
98 : | if test -x $ac_cv_use_teem ; then | ||
99 : | TEEM_DIR=$ac_cv_use_teem | ||
100 : | # check that TEEM_DIR actually points to something that looks like teem | ||
101 : | if test -f $TEEM_DIR/include/teem/nrrd.h ; then | ||
102 : | AC_MSG_RESULT([ okay]) | ||
103 : | else | ||
104 : | TEEM_DIR=none | ||
105 : | AC_MSG_RESULT([ invalid]) | ||
106 : | fi | ||
107 : | else | ||
108 : | TEEM_DIR=none | ||
109 : | AC_MSG_RESULT([ invalid]) | ||
110 : | fi | ||
111 : | fi | ||
112 : | if test x"$TEEM_DIR" = xnone ; then | ||
113 : | AC_MSG_ERROR([unable to find teem]) | ||
114 : | fi | ||
115 : | jhr | 1882 | TEEM_CPPFLAGS="-I$TEEM_DIR/include" |
116 : | TEEM_LDFLAGS="-L$TEEM_DIR/lib -lteem" | ||
117 : | AC_SUBST(TEEM_CPPFLAGS) | ||
118 : | AC_SUBST(TEEM_LDFLAGS) | ||
119 : | jhr | 1881 | |
120 : | jhr | 1882 | dnl ******************** Graphics configuration ******************** |
121 : | dnl | ||
122 : | |||
123 : | export PKG_CONFIG_PATH | ||
124 : | PKG_CONFIG_PATH=/lib/pkgconfig:/usr/lib/pkgconfig/:/usr/local/lib/pkgconfig | ||
125 : | if test x"$HAS_MACPORTS" = xyes ; then | ||
126 : | PKG_CONFIG_PATH=$PKG_CONFIG_PATH:/opt/local/lib/pkgconfig | ||
127 : | fi | ||
128 : | if test x"$HAS_FINK" = xyes ; then | ||
129 : | PKG_CONFIG_PATH=$PKG_CONFIG_PATH:/sw/lib/pkgconfig | ||
130 : | fi | ||
131 : | |||
132 : | PKG_CHECK_MODULES([GLFW], [libglfw]) | ||
133 : | AC_SUBST([GLFW_CFLAGS]) | ||
134 : | AC_SUBST([GLFW_LIBS]) | ||
135 : | |||
136 : | AC_ARG_WITH(ant-tweak-bar, | ||
137 : | AC_HELP_STRING([--with-ant-tweak-bar=<path>], [specify prefix for ant-tweak-bar lib and include dirs]), | ||
138 : | [ac_cv_use_atb=$withval], [ac_cv_use_atb=no]) | ||
139 : | if test x"$ac_cv_use_atb" != xno ; then | ||
140 : | AC_MSG_CHECKING([path to AntTweakBar ($ac_cv_use_atb)]) | ||
141 : | case $ac_cv_use_atb in | ||
142 : | /*) ;; | ||
143 : | *) AC_MSG_ERROR([path to AntTweakBar must be absolute]) ;; | ||
144 : | esac | ||
145 : | if test -d $ac_cv_use_atb ; then | ||
146 : | # check that ac_cv_use_atb points to something that looks right | ||
147 : | if test -f $ac_cv_use_atb/include/AntTweakBar.h -a -d $ac_cv_use_atb/lib ; then | ||
148 : | ATB_CPPFLAGS="-I$ac_cv_use_atb/include" | ||
149 : | ATB_LDFLAGS="-L$ac_cv_use_atb/lib -lAntTweakBar" | ||
150 : | AC_SUBST([ATB_CPPFLAGS]) | ||
151 : | AC_SUBST([ATB_LDFLAGS]) | ||
152 : | AC_MSG_RESULT([ okay]) | ||
153 : | else | ||
154 : | AC_MSG_RESULT([ invalid]) | ||
155 : | fi | ||
156 : | else | ||
157 : | AC_MSG_RESULT([ invalid]) | ||
158 : | fi | ||
159 : | jhr | 1915 | else |
160 : | # check to see if AntTweakBar is installed in a standard place | ||
161 : | AC_CHECK_HEADERS([AntTweakBar.h]) | ||
162 : | if test x"$ac_cv_header_AntTweakBar_h" = xyes ; then | ||
163 : | ATB_CPPFLAGS="" | ||
164 : | ATB_LDFLAGS="-lAntTweakBar" | ||
165 : | AC_SUBST([ATB_CPPFLAGS]) | ||
166 : | AC_SUBST([ATB_LDFLAGS]) | ||
167 : | fi | ||
168 : | jhr | 1882 | fi |
169 : | |||
170 : | jhr | 1881 | dnl ******************** Diderot configuration ******************** |
171 : | dnl | ||
172 : | |||
173 : | dnl | ||
174 : | dnl get the path to the diderot executable | ||
175 : | dnl | ||
176 : | AC_ARG_WITH(diderotc, | ||
177 : | AC_HELP_STRING([--with-diderotc=<path>], [specify path to Diderot compiler]), | ||
178 : | [ac_cv_use_diderotc=$withval], [ac_cv_use_diderotc=no]) | ||
179 : | if test x"$ac_cv_use_diderotc" = xno ; then | ||
180 : | DIDEROTC=none | ||
181 : | else | ||
182 : | AC_MSG_CHECKING([path to diderotc ($ac_cv_use_diderotc)]) | ||
183 : | case $ac_cv_use_diderotc in | ||
184 : | /*) DIDEROTC=$ac_cv_use_diderotc ;; | ||
185 : | *) DIDEROTC=$BMARKS_ROOT$ac_cv_use_diderotc ;; | ||
186 : | esac | ||
187 : | # check that diderotc exists and is executable | ||
188 : | if test -x $DIDEROTC ; then | ||
189 : | AC_MSG_RESULT([ okay]) | ||
190 : | else | ||
191 : | DIDEROTC=none | ||
192 : | AC_MSG_RESULT([ invalid]) | ||
193 : | fi | ||
194 : | fi | ||
195 : | if test x"$DIDEROTC" = xnone ; then | ||
196 : | AC_MSG_ERROR([unable to find diderotc]) | ||
197 : | fi | ||
198 : | AC_SUBST(DIDEROTC) | ||
199 : | |||
200 : | dnl | ||
201 : | dnl ******************** C compiler properties ******************** | ||
202 : | dnl | ||
203 : | |||
204 : | dnl | ||
205 : | dnl run the compiler tests in 64-bit mode | ||
206 : | dnl | ||
207 : | save_CFLAGS=$CFLAGS | ||
208 : | CFLAGS="$CFLAGS $CFLAG_M64" | ||
209 : | |||
210 : | AC_C_BIGENDIAN | ||
211 : | |||
212 : | dnl | ||
213 : | dnl restore CFLAGS | ||
214 : | dnl | ||
215 : | CFLAGS=$save_CFLAGS | ||
216 : | |||
217 : | dnl | ||
218 : | dnl ******************** write output ******************** | ||
219 : | dnl | ||
220 : | |||
221 : | AC_CONFIG_FILES( | ||
222 : | dnl | ||
223 : | dnl ***** Makefiles ***** | ||
224 : | iso2d-demo/Makefile | ||
225 : | jhr | 2064 | vr-demo/Makefile |
226 : | jhr | 1881 | ) |
227 : | |||
228 : | AC_OUTPUT |
root@smlnj-gforge.cs.uchicago.edu | ViewVC Help |
Powered by ViewVC 1.0.0 |