source: branches/r9/configure.in @ 4869

Last change on this file since 4869 was 4869, checked in by gah, 6 years ago
File size: 9.4 KB
Line 
1AC_INIT([Rappture],[1.4],[rappture@nanohub.org])
2AC_CONFIG_AUX_DIR(cf)
3
4#------------------------------------------------------------------------
5# Handle the --prefix=... option
6#------------------------------------------------------------------------
7
8if test "${prefix}" = "NONE"; then
9    prefix=/usr/local
10fi
11if test "${exec_prefix}" = "NONE"; then
12    exec_prefix=$prefix
13fi
14
15AC_PROG_INSTALL
16AC_PROG_INSTALL
17AC_PROG_RANLIB
18AC_PROG_LN_S
19AC_PROG_MKDIR_P
20AC_PROG_MAKE_SET
21
22# Check for C, C++, and FORTRAN
23AC_PROG_CC
24AC_PROG_CXX
25# Avoid g95
26AC_PROG_F77([g77 gfortran f77 fort77 f90 xlf xlf90 fl32])
27
28AC_LANG([C])
29
30AC_HEADER_STDC
31AC_CHECK_FUNC(atol,,AC_MSG_ERROR(oops! no atol ?!?))
32
33AC_LANG([C++])
34AC_PATH_X
35
36AC_ARG_WITH(
37    [install],
38    [AS_HELP_STRING([--with-install[=DIR]],
39        [location of installation @<:@default=yes@:>@])],
40    [],
41    [with_install=yes])
42
43if test "$with_install" != "yes"; then
44    INSTALL_PREFIX=$with_install
45else
46    INSTALL_PREFIX=$prefix
47fi
48
49if test "${libdir}" != "${prefix}/lib"; then
50    LIB_SEARCH_DIRS="-L${prefix}/lib -L${libdir}"
51else
52    LIB_SEARCH_DIRS="-L${libdir}"
53fi
54
55AC_ARG_WITH(
56    [statsdir],
57    [AS_HELP_STRING([--with-statsdir=DIR],
58        [Write statistics in DIR])],
59    [STATSDIR=$withval],
60    [STATSDIR="/var/tmp/visservers"])
61
62
63AC_CHECK_FUNCS(sysinfo)
64AC_CHECK_FUNCS(gettimeofday)
65AC_CHECK_FUNC(localtime,,AC_MSG_ERROR(oops! no localtime ?!?))
66AC_CHECK_FUNC(getenv,,AC_MSG_ERROR(oops! no getenv ?!?))
67
68AC_CHECK_HEADERS(sys/sysinfo.h)
69
70AC_CHECK_LIB(ncurses, clrtoeol,,AC_MSG_ERROR([ncurses library missing?]))
71AC_CHECK_HEADERS(ncurses.h,,AC_MSG_WARN(ncurses headers missing ?))
72
73AC_CHECK_LIB(stdc++, main,,AC_MSG_ERROR(librappture requires libstdc++))
74AC_CHECK_HEADERS(algorithm,,AC_MSG_WARN(STL classes missing ?))
75AC_CHECK_HEADERS(cctype,,AC_MSG_WARN(STL classes missing ?))
76AC_CHECK_HEADERS(cfloat,,AC_MSG_WARN(STL classes missing ?))
77AC_CHECK_HEADERS(cmath,,AC_MSG_WARN(STL classes missing ?))
78AC_CHECK_HEADERS(cstdio,,AC_MSG_WARN(STL classes missing ?))
79AC_CHECK_HEADERS(cstdlib,,AC_MSG_WARN(STL classes missing ?))
80AC_CHECK_HEADERS(cstring,,AC_MSG_WARN(STL classes missing ?))
81AC_CHECK_HEADERS(fstream,,AC_MSG_WARN(STL classes missing ?))
82AC_CHECK_HEADERS(list,,AC_MSG_WARN(STL classes missing ?))
83AC_CHECK_HEADERS(iostream,,AC_MSG_WARN(STL classes missing ?))
84AC_CHECK_HEADERS(iterator,,AC_MSG_WARN(STL classes missing ?))
85AC_CHECK_HEADERS(sstream,,AC_MSG_WARN(STL classes missing ?))
86AC_CHECK_HEADERS(stack,,AC_MSG_WARN(STL classes missing ?))
87AC_CHECK_HEADERS(string,,AC_MSG_WARN(STL classes missing ?))
88AC_CHECK_HEADERS(vector,,AC_MSG_WARN(STL classes missing ?))
89
90AC_CHECK_HEADERS(assert.h,,AC_MSG_WARN(C headers missing ?))
91AC_CHECK_HEADERS(ctype.h,,AC_MSG_WARN(C headers missing ?))
92AC_CHECK_HEADERS(errno.h,,AC_MSG_WARN(C headers missing ?))
93AC_CHECK_HEADERS(limits.h,,AC_MSG_WARN(C headers missing ?))
94AC_CHECK_HEADERS(string.h,,AC_MSG_WARN(C headers missing ?))
95AC_CHECK_HEADERS(stdlib.h,,AC_MSG_WARN(C headers missing ?))
96AC_CHECK_HEADERS(stddef.h,,AC_MSG_WARN(C headers missing ?))
97AC_CHECK_HEADERS(float.h,,AC_MSG_WARN(C headers missing ?))
98AC_CHECK_HEADERS(math.h,,AC_MSG_WARN(C headers missing ?))
99dnl AC_CHECK_HEADERS(ieeefp.h,,AC_MSG_WARN(C headers missing ?))
100AC_CHECK_HEADERS(malloc.h,,AC_MSG_WARN(C headers missing ?))
101AC_CHECK_HEADERS(memory.h,,AC_MSG_WARN(C headers missing ?))
102AC_CHECK_HEADERS(unistd.h,,AC_MSG_WARN(C headers missing ?))
103
104AC_CHECK_HEADERS(inttypes.h,,AC_MSG_WARN(C headers missing ?))
105if test "${ac_cv_header_inttypes_h}" = "yes" ; then
106  HAVE_INTTYPES_H=1
107else
108  HAVE_INTTYPES_H=0
109fi
110
111
112SC_CONFIG_CFLAGS
113
114SVN_VERSION=`svnversion $srcdir`
115
116make_command=""
117for m in "$MAKE" make gmake gnumake ; do
118  if test "x${m}" != "x" ; then
119    if  ( sh -c "$m --version" 2>/dev/null | grep GNU >/dev/null ) ; then
120      make_command=$m; break;
121    fi
122  fi
123done
124if test "x${make_command}" = "x" ; then
125  AC_MSG_ERROR([Requires GNU make. You can specify a version with \$MAKE])
126fi
127
128AC_ARG_ENABLE(
129    [lang],
130    [AS_HELP_STRING([--enable-lang], [build language bindings @<:@default=yes@:>@])],
131    [],
132    [enable_lang=yes])
133
134ENABLE_LANG=
135if test "$enable_lang" != "no" ; then
136    ENABLE_LANG="yes"
137fi
138
139AC_ARG_ENABLE(
140    [gui],
141    [AS_HELP_STRING([--enable-gui], [build code related to the graphical user interface @<:@default=yes@:>@])],
142    [],
143    [enable_gui=yes])
144
145ENABLE_GUI=
146if test "$enable_gui" != "no" ; then
147    ENABLE_GUI="yes"
148fi
149
150TCL_VERSION="8.5"
151for dir in \
152 ${exec_prefix} \
153 ${exec_prefix}/lib ; do
154  tclconfig="${dir}/tclConfig.sh"
155  if test -f "$tclconfig" ; then
156    . $tclconfig
157    break
158  fi
159done
160
161AC_ARG_WITH(
162    [ffmpeg],
163    [AS_HELP_STRING([--with-ffmpeg[=DIR]],
164      [location of ffmpeg @<:@default=yes@:>@])],
165    [],
166    [with_ffmpeg=yes])
167
168TCL_INC_SPEC="$TCL_INCLUDE_SPEC"
169
170AC_ARG_WITH(
171    [vtk],
172    [AS_HELP_STRING([--with-vtk[=version]],
173        [VTK library version @<:@default=6.1@:>@])],
174    [],
175    [with_vtk=yes])
176
177AC_MSG_CHECKING([for vtk])
178VTK_VERSION=6.1
179VTK_TCL_DIR=""
180
181ENABLE_VTK=
182if test "$with_vtk" != "no" ; then
183  if test "$with_vtk" != "yes" ; then
184    VTK_VERSION=$with_vtk
185  fi
186  if test "x$with_vtk" != "x" ; then
187    ENABLE_VTK=yes
188    for path in \
189     $libdir/tcltk \
190     $exec_prefix/lib/tcltk \
191     $prefix/lib/tcltk \
192     $libdir \
193     $prefix/lib \
194     $exec_prefix/lib \
195     /usr/lib
196    do
197      if test -d "$path/vtk-$VTK_VERSION" ; then
198        VTK_TCL_DIR="$path/vtk-$VTK_VERSION"
199      fi
200      if test "x${VTK_TCL_DIR}" != "x" ; then
201        break
202      fi
203    done
204  fi
205else
206  if test "${ENABLE_GUI}" = "yes" ; then
207    AC_MSG_WARN([VTK missing: Rappture GUI requires VTK for some features])
208  fi
209fi
210AC_MSG_RESULT([$VTK_TCL_DIR])
211
212AC_ARG_ENABLE(
213    [vtkdicom],
214    [AS_HELP_STRING([--enable-vtkdicom],
215        [Use vtkDICOM package @<:@default=no@:>@])],
216    [],
217    [enable_vtkdicom=no])
218
219AC_MSG_CHECKING([for vtkDICOM])
220ENABLE_VTK_DICOM=
221if test "$enable_vtkdicom" != "no" ; then
222    ENABLE_VTK_DICOM="yes"
223fi
224AC_MSG_RESULT([$enable_vtkdicom])
225
226RP_BASE=`pwd`
227
228SC_ENABLE_SHARED
229
230#--------------------------------------------------------------------
231# This macro figures out what flags to use with the compiler/linker
232# when building shared/static debug/optimized objects.  This information
233# is all taken from the tclConfig.sh file.
234#--------------------------------------------------------------------
235
236if test -f "${exec_prefix}/lib/tclConfig.sh" ; then
237  . ${exec_prefix}/lib/tclConfig.sh
238fi
239if test -f "${exec_prefix}/lib/tkConfig.sh" ; then
240  . ${exec_prefix}/lib/tkConfig.sh
241fi
242
243# -----------------------------------------------------------------------
244#
245# Compiler characteristics:
246#   Check for existence of types of size_t and pid_t
247#
248# -----------------------------------------------------------------------
249
250AC_C_BIGENDIAN
251AC_CHECK_SIZEOF(int)
252AC_CHECK_SIZEOF(long)
253AC_CHECK_SIZEOF(long long)
254AC_CHECK_SIZEOF(void *)
255
256SIZEOF_LONG="${ac_cv_sizeof_long}"
257SIZEOF_LONG_LONG="${ac_cv_sizeof_long_long}"
258SIZEOF_VOID_P="${ac_cv_sizeof_void_p}"
259SIZEOF_INT="${ac_cv_sizeof_int}"
260
261
262#--------------------------------------------------------------------
263# Set the default compiler switches based on the --enable-symbols
264# option.
265#--------------------------------------------------------------------
266
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(TCL_VERSION)
299AC_SUBST(TCL_VERSION)
300AC_SUBST(TK_INC_SPEC)
301AC_SUBST(TK_LIB_SPEC)
302AC_SUBST(TCL_CFLAGS_DEBUG)
303AC_SUBST(TCL_SHLIB_CFLAGS)
304AC_SUBST(TCL_SHLIB_SUFFIX)
305AC_SUBST(TCL_SHLIB_LD)
306AC_SUBST(TCL_SHLIB_LDFLAGS)
307AC_SUBST(TK_XLIBSW)
308AC_SUBST(TK_VERSION)
309AC_SUBST(VTK_TCL_DIR)
310AC_SUBST(VTK_VERSION)
311AC_SUBST(XSUBPP)
312AC_SUBST(STATSDIR)
313AC_SUBST(X_INCLUDES)
314AC_SUBST(X_LIBRARIES)
315AC_SUBST(WORDSIZE)
316
317dnl read Makefile.in and write Makefile
318AC_CONFIG_FILES([
319    Makefile
320    apps/Makefile
321    apps/about
322    apps/copy_rappture_examples
323    apps/encodedata
324    apps/rappture
325    apps/rappture-csh.env
326    apps/rappture.env
327    apps/rappture.use
328    apps/rerun
329    apps/simsim
330    apps/xmldiff
331    builder/Makefile
332    builder/pkgIndex.tcl
333    builder/scripts/Makefile
334    packages/DicomToVtk/Makefile
335    packages/DicomToVtk/pkgIndex.tcl
336    packages/DxToVtk/Makefile
337    packages/DxToVtk/pkgIndex.tcl
338    packages/Makefile
339    packages/PdbToVtk/Makefile
340    packages/PdbToVtk/pkgIndex.tcl
341    packages/diffview/Makefile
342    packages/diffview/pkgIndex.tcl
343    packages/hotspot/Makefile
344    packages/hotspot/pkgIndex.tcl
345    packages/listbox/Makefile
346    packages/listbox/pkgIndex.tcl
347    packages/placard/Makefile
348    packages/placard/pkgIndex.tcl
349    packages/readpoints/Makefile
350    packages/readpoints/pkgIndex.tcl
351    packages/squeezer/Makefile
352    packages/squeezer/pkgIndex.tcl
353    packages/system/Makefile
354    packages/system/pkgIndex.tcl
355    objects/Makefile
356    runner/Makefile
357    runner/pkgIndex.tcl
358    runner/scripts/Makefile
359    tester/Makefile
360    tester/pkgIndex.tcl
361    tester/scripts/Makefile
362])
363AC_OUTPUT
364       
Note: See TracBrowser for help on using the repository browser.