source: branches/r9/configure.in @ 4914

Last change on this file since 4914 was 4914, checked in by gah, 7 years ago
File size: 9.3 KB
Line 
1define(Major_Version, [1])
2define(Minor_Version, [5])
3define(Release_Serial, [0])
4
5define(Version, [Major_Version].[Minor_Version])
6AC_INIT([Rappture],[Version],[rappture@nanohub.org])
7AC_CONFIG_AUX_DIR(cf)
8AC_CONFIG_HEADER(lib/rappture/config.h)
9
10RAPPTURE_MAJOR_VERSION=Major_Version
11RAPPTURE_MINOR_VERSION=Minor_Version
12RAPPTURE_RELEASE_SERIAL=Release_Serial
13RAPPTURE_VERSION=Version
14
15WITH_R=yes
16WITH_JAVA=yes
17WITH_MATLAB=yes
18WITH_MKOCTFILE2=yes
19WITH_MKOCTFILE3=yes
20WITH_OCTAVE=yes
21WITH_PERL=yes
22WITH_PYTHON=yes
23WITH_RUBY=yes
24WITH_RUBY_SITELIBDIR=yes
25WITH_TCL=yes
26
27AC_ARG_WITH(
28    [R],
29    [AS_HELP_STRING([--with-R[=DIR]],
30        [location of R interpreter @<:@default=yes@:>@])],
31    [WITH_R=${with_val}],
32    [WITH_R=yes])
33
34AC_ARG_WITH(
35    [java],
36    [AS_HELP_STRING([--with-java[=DIR]],
37        [location of java @<:@default=yes@:>@])],
38    [WITH_JAVA=${with_val}],
39    [WITH_JAVA=yes])
40
41AC_ARG_WITH(
42    [matlab],
43    [AS_HELP_STRING([--with-matlab[=DIR]],
44        [location of matlab and mex compiler @<:@default=yes@:>@])],
45    [WITH_MATLAB=${with_val}],
46    [WITH_MATLAB=yes])
47
48AC_ARG_WITH(
49    [mkoctfile2],
50    [AS_HELP_STRING([--with-mkoctfile2[=DIR]],
51        [path of octave compiler `mkoctfile' @<:@default=no@:>@])],
52    [WITH_MKOCTFILE2=${with_val}],
53    [WITH_MKOCTFILE2=no])
54
55AC_ARG_WITH(
56    [mkoctfile3],
57    [AS_HELP_STRING([--with-mkoctfile3[=DIR]],
58        [path of octave compiler `mkoctfile' @<:@default=no@:>@])],
59    [WITH_MKOCTFILE3=${with_val}],
60    [WITH_MKOCTFILE3=no])
61
62AC_ARG_WITH(
63    [octave],
64    [AS_HELP_STRING([--with-octave[=DIR]],
65        [path of default octave compiler `mkoctfile' @<:@default=yes@:>@])],
66    [WITH_OCTAVE=${with_val}],
67    [with_octave=yes])
68
69AC_ARG_WITH(
70    [perl],
71    [AS_HELP_STRING([--with-perl[=DIR]],
72        [location of perl library @<:@default=yes@:>@])],
73    [WITH_PERL=${with_val}],
74    [WITH_PERL=yes])
75
76AC_ARG_WITH(
77    [python],
78    [AS_HELP_STRING([--with-python[=DIR]],
79        [location of python library @<:@default=yes@:>@])],
80    [WITH_PYTHON=${with_val}],
81    [WITH_PYTHON=yes])
82
83AC_ARG_WITH(
84    [ruby],
85    AC_HELP_STRING(
86     --with-ruby=PATH,
87     [ path to the ruby interpreter [[ruby]] ]),
88    [WITH_RUBY=${with_val}],
89    [WITH_RUBY=yes])
90
91AC_ARG_WITH(
92    [ruby_sitelibdir],
93    AC_HELP_STRING(
94     --with-ruby-sitelibdir=PATH,
95     [ path to install ruby scripts [[auto-detect]] ]),
96    [WITH_RUBY_SITELIBDIR=${with_val}],
97    [WITH_RUBY_SITELIBDIR=NONE ])
98
99AC_ARG_WITH(
100    [tcl],
101    [AS_HELP_STRING([--with-tcl[=DIR]],
102        [location of tcl library @<:@default=yes@:>@])],
103    [WITH_TCL=${with_val}],
104    [WITH_TCL=yes])
105
106AC_ARG_WITH(
107    [install],
108    [AS_HELP_STRING([--with-install[=DIR]],
109        [location of installation @<:@default=yes@:>@])],
110    [WITH_INSTALL=${withval}],
111    [WITH_INSTALL=yes])
112
113AC_ARG_WITH(
114    [vtk],
115    [AS_HELP_STRING([--with-vtk],
116        [Build VTK for rappture])],
117    [WITH_VTK=${withval}],
118    [WITH_VTK=no])
119
120AC_ARG_ENABLE(
121    [vtkdicom],
122    [AS_HELP_STRING([--enable-vtkdicom],
123        [Use vtkDICOM package @<:@default=no@:>@])],
124    [],
125    [enable_vtkdicom=no])
126
127#------------------------------------------------------------------------
128# Handle the --prefix=... option
129#------------------------------------------------------------------------
130
131if test "${prefix}" = "NONE"; then
132    prefix=/usr/local
133fi
134if test "${exec_prefix}" = "NONE"; then
135    exec_prefix=$prefix
136fi
137
138AC_PROG_INSTALL
139AC_PROG_RANLIB
140AC_PROG_LN_S
141AC_PROG_MKDIR_P
142AC_PROG_MAKE_SET
143
144# Check for C, C++, and FORTRAN
145AC_PROG_CC
146AC_PROG_CXX
147# Avoid g95
148AC_PROG_F77([g77 gfortran f77 fort77 f90 xlf xlf90 fl32])
149
150AC_LANG([C])
151
152AC_HEADER_STDC
153AC_CHECK_FUNC(atol,,AC_MSG_ERROR(oops! no atol ?!?))
154
155AC_LANG([C++])
156AC_PATH_X
157
158# -----------------------------------------------------------------------
159#
160# Compiler characteristics:
161#   Check for existence of types of size_t and pid_t
162#
163# -----------------------------------------------------------------------
164
165AC_C_BIGENDIAN
166AC_CHECK_SIZEOF(int)
167AC_CHECK_SIZEOF(long)
168AC_CHECK_SIZEOF(long long)
169AC_CHECK_SIZEOF(void *)
170
171SIZEOF_LONG="${ac_cv_sizeof_long}"
172SIZEOF_LONG_LONG="${ac_cv_sizeof_long_long}"
173SIZEOF_VOID_P="${ac_cv_sizeof_void_p}"
174SIZEOF_INT="${ac_cv_sizeof_int}"
175
176
177AC_CHECK_FUNCS(sysinfo)
178AC_CHECK_FUNCS(gettimeofday)
179AC_CHECK_FUNC(localtime,,AC_MSG_ERROR(oops! no localtime ?!?))
180AC_CHECK_FUNC(getenv,,AC_MSG_ERROR(oops! no getenv ?!?))
181
182AC_CHECK_HEADERS(sys/sysinfo.h)
183
184AC_CHECK_LIB(ncurses, clrtoeol,,AC_MSG_ERROR([ncurses library missing?]))
185AC_CHECK_HEADERS(ncurses.h,,AC_MSG_WARN(ncurses headers missing ?))
186
187AC_CHECK_LIB(stdc++, main,,AC_MSG_ERROR(librappture requires libstdc++))
188AC_CHECK_HEADERS(algorithm,,AC_MSG_WARN(STL classes missing ?))
189AC_CHECK_HEADERS(cctype,,AC_MSG_WARN(STL classes missing ?))
190AC_CHECK_HEADERS(cfloat,,AC_MSG_WARN(STL classes missing ?))
191AC_CHECK_HEADERS(cmath,,AC_MSG_WARN(STL classes missing ?))
192AC_CHECK_HEADERS(cstdio,,AC_MSG_WARN(STL classes missing ?))
193AC_CHECK_HEADERS(cstdlib,,AC_MSG_WARN(STL classes missing ?))
194AC_CHECK_HEADERS(cstring,,AC_MSG_WARN(STL classes missing ?))
195AC_CHECK_HEADERS(fstream,,AC_MSG_WARN(STL classes missing ?))
196AC_CHECK_HEADERS(list,,AC_MSG_WARN(STL classes missing ?))
197AC_CHECK_HEADERS(iostream,,AC_MSG_WARN(STL classes missing ?))
198AC_CHECK_HEADERS(iterator,,AC_MSG_WARN(STL classes missing ?))
199AC_CHECK_HEADERS(sstream,,AC_MSG_WARN(STL classes missing ?))
200AC_CHECK_HEADERS(stack,,AC_MSG_WARN(STL classes missing ?))
201AC_CHECK_HEADERS(string,,AC_MSG_WARN(STL classes missing ?))
202AC_CHECK_HEADERS(vector,,AC_MSG_WARN(STL classes missing ?))
203
204AC_CHECK_HEADERS(assert.h,,AC_MSG_WARN(C headers missing ?))
205AC_CHECK_HEADERS(ctype.h,,AC_MSG_WARN(C headers missing ?))
206AC_CHECK_HEADERS(errno.h,,AC_MSG_WARN(C headers missing ?))
207AC_CHECK_HEADERS(limits.h,,AC_MSG_WARN(C headers missing ?))
208AC_CHECK_HEADERS(string.h,,AC_MSG_WARN(C headers missing ?))
209AC_CHECK_HEADERS(stdlib.h,,AC_MSG_WARN(C headers missing ?))
210AC_CHECK_HEADERS(stddef.h,,AC_MSG_WARN(C headers missing ?))
211AC_CHECK_HEADERS(float.h,,AC_MSG_WARN(C headers missing ?))
212AC_CHECK_HEADERS(math.h,,AC_MSG_WARN(C headers missing ?))
213dnl AC_CHECK_HEADERS(ieeefp.h,,AC_MSG_WARN(C headers missing ?))
214AC_CHECK_HEADERS(malloc.h,,AC_MSG_WARN(C headers missing ?))
215AC_CHECK_HEADERS(memory.h,,AC_MSG_WARN(C headers missing ?))
216AC_CHECK_HEADERS(unistd.h,,AC_MSG_WARN(C headers missing ?))
217
218AC_CHECK_HEADERS(inttypes.h,,AC_MSG_WARN(C headers missing ?))
219if test "${ac_cv_header_inttypes_h}" = "yes" ; then
220  HAVE_INTTYPES_H=1
221else
222  HAVE_INTTYPES_H=0
223fi
224
225
226if test "$with_install" != "yes"; then
227    INSTALL_PREFIX=$with_install
228else
229    INSTALL_PREFIX=$prefix
230fi
231
232if test "${libdir}" != "${prefix}/lib"; then
233    LIB_SEARCH_DIRS="-L${prefix}/lib -L${libdir}"
234else
235    LIB_SEARCH_DIRS="-L${libdir}"
236fi
237
238SVN_VERSION=`svnversion $srcdir`
239
240make_command=""
241for m in "$MAKE" make gmake gnumake ; do
242  if test "x${m}" != "x" ; then
243    if  ( sh -c "$m --version" 2>/dev/null | grep GNU >/dev/null ) ; then
244      make_command=$m; break;
245    fi
246  fi
247done
248if test "x${make_command}" = "x" ; then
249  AC_MSG_ERROR([Requires GNU make. You can specify a version with \$MAKE])
250fi
251
252AC_MSG_CHECKING([for vtkDICOM])
253ENABLE_VTK_DICOM=
254if test "$enable_vtkdicom" != "no" ; then
255    ENABLE_VTK_DICOM="yes"
256fi
257AC_MSG_RESULT([$enable_vtkdicom])
258
259RP_BASE=`pwd`
260
261#--------------------------------------------------------------------
262# Set the default compiler switches based on the --enable-symbols
263# option.
264#--------------------------------------------------------------------
265
266SC_CONFIG_CFLAGS
267SC_ENABLE_SYMBOLS
268
269AC_SUBST(CFLAGS_DEBUG)
270AC_SUBST(CFLAGS_OPTIMIZE)
271AC_SUBST(ENABLE_LANG)
272AC_SUBST(ENABLE_GUI)
273AC_SUBST(ENABLE_VTK)
274AC_SUBST(ENABLE_VTK_DICOM)
275AC_SUBST(HAVE_INTTYPES_H)
276AC_SUBST(INSTALL_PREFIX)
277AC_SUBST(LIB_SEARCH_DIRS)
278AC_SUBST(MAKE, ${make_command})
279AC_SUBST(SVN_VERSION)
280AC_SUBST(RP_BASE)
281AC_SUBST(SHLIB_CFLAGS)
282AC_SUBST(SHLIB_LD)
283AC_SUBST(SHLIB_LDFLAGS)
284AC_SUBST(SHLIB_SUFFIX)
285AC_SUBST(SIZEOF_INT)
286AC_SUBST(SIZEOF_LONG)
287AC_SUBST(SIZEOF_LONG_LONG)
288AC_SUBST(SIZEOF_VOID_P)
289AC_SUBST(STLIB_LD)
290AC_SUBST(TCL_INC_SPEC)
291AC_SUBST(TCL_LIB_SPEC)
292AC_SUBST(TCL_CFLAGS_DEBUG)
293AC_SUBST(TCL_CFLAGS_OPTIMIZE)
294AC_SUBST(TCL_SHLIB_CFLAGS)
295AC_SUBST(TCL_SHLIB_LD)
296AC_SUBST(TCL_SHLIB_LDFLAGS)
297AC_SUBST(TCL_SHLIB_SUFFIX)
298AC_SUBST(TK_INC_SPEC)
299AC_SUBST(TK_LIB_SPEC)
300AC_SUBST(TCL_CFLAGS_DEBUG)
301AC_SUBST(TCL_SHLIB_CFLAGS)
302AC_SUBST(TCL_SHLIB_SUFFIX)
303AC_SUBST(TCL_SHLIB_LD)
304AC_SUBST(TCL_SHLIB_LDFLAGS)
305AC_SUBST(TK_XLIBSW)
306AC_SUBST(TK_VERSION)
307AC_SUBST(VTK_TCL_DIR)
308AC_SUBST(VTK_VERSION)
309AC_SUBST(XSUBPP)
310AC_SUBST(STATSDIR)
311AC_SUBST(X_INCLUDES)
312AC_SUBST(X_LIBRARIES)
313AC_SUBST(WORDSIZE)
314AC_SUBST(RAPPTURE_MAJOR_VERSION)
315AC_SUBST(RAPPTURE_MINOR_VERSION)
316AC_SUBST(RAPPTURE_RELEASE_SERIAL)
317AC_SUBST(RAPPTURE_VERSION)
318AC_SUBST(WITH_VTK)
319AC_SUBST(WITH_R)
320AC_SUBST(WITH_JAVA)
321AC_SUBST(WITH_MATLAB)
322AC_SUBST(WITH_MKOCTFILE2)
323AC_SUBST(WITH_MKOCTFILE3)
324AC_SUBST(WITH_OCTAVE)
325AC_SUBST(WITH_PERL)
326AC_SUBST(WITH_PYTHON)
327AC_SUBST(WITH_RUBY)
328AC_SUBST(WITH_RUBY_SITELIBDIR)
329AC_SUBST(WITH_TCL)
330AC_SUBST(WITH_VTK)
331
332dnl read Makefile.in and write Makefile
333AC_CONFIG_FILES([
334    Makefile
335    fixrunpaths.tcl
336    apps/Makefile
337    apps/about
338    apps/copy_rappture_examples
339    apps/encodedata
340    apps/rappture
341    apps/rappture-csh.env
342    apps/rappture.env
343    apps/rappture.use
344    apps/rerun
345    apps/simsim
346    apps/xmldiff
347    lib/Makefile
348    lib/objects/Makefile
349    lib/objects/RpHash.h
350    lib/rappture/Makefile
351    lib/rappture2/Makefile
352    lib/rapptureConfig.sh
353])
354AC_OUTPUT
355       
Note: See TracBrowser for help on using the repository browser.