source: branches/r9/configure.in @ 4870

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