source: branches/r9/configure.in @ 4872

Last change on this file since 4872 was 4872, checked in by gah, 7 years ago
File size: 8.7 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
59HAVE_VTK=""
60AC_ARG_WITH(
61    [vtk],
62    [AS_HELP_STRING([--with-vtk],
63        [Build VTK for rappture])],
64    [HAVE_VTK=$withval],
65    [HAVE_VTK=""])
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
116SVN_VERSION=`svnversion $srcdir`
117
118make_command=""
119for m in "$MAKE" make gmake gnumake ; do
120  if test "x${m}" != "x" ; then
121    if  ( sh -c "$m --version" 2>/dev/null | grep GNU >/dev/null ) ; then
122      make_command=$m; break;
123    fi
124  fi
125done
126if test "x${make_command}" = "x" ; then
127  AC_MSG_ERROR([Requires GNU make. You can specify a version with \$MAKE])
128fi
129
130AC_ARG_ENABLE(
131    [lang],
132    [AS_HELP_STRING([--enable-lang], [build language bindings @<:@default=yes@:>@])],
133    [],
134    [enable_lang=yes])
135
136ENABLE_LANG=
137if test "$enable_lang" != "no" ; then
138    ENABLE_LANG="yes"
139fi
140
141AC_ARG_ENABLE(
142    [gui],
143    [AS_HELP_STRING([--enable-gui], [build code related to the graphical user interface @<:@default=yes@:>@])],
144    [],
145    [enable_gui=yes])
146
147ENABLE_GUI=
148if test "$enable_gui" != "no" ; then
149    ENABLE_GUI="yes"
150fi
151
152TCL_VERSION="8.5"
153TK_VERSION="8.5"
154
155for dir in \
156 ${exec_prefix} \
157 ${exec_prefix}/lib ; do
158  tclconfig="${dir}/tclConfig.sh"
159  if test -f "$tclconfig" ; then
160    . $tclconfig
161    break
162  fi
163done
164
165AC_ARG_WITH(
166    [ffmpeg],
167    [AS_HELP_STRING([--with-ffmpeg[=DIR]],
168      [location of ffmpeg @<:@default=yes@:>@])],
169    [],
170    [with_ffmpeg=yes])
171
172TCL_INC_SPEC="$TCL_INCLUDE_SPEC"
173
174AC_ARG_WITH(
175    [vtk],
176    [AS_HELP_STRING([--with-vtk[=version]],
177        [VTK library version @<:@default=6.1@:>@])],
178    [],
179    [with_vtk=yes])
180
181AC_MSG_CHECKING([for vtk])
182VTK_VERSION=6.1
183VTK_TCL_DIR=""
184
185ENABLE_VTK=
186if test "$with_vtk" != "no" ; then
187  if test "$with_vtk" != "yes" ; then
188    VTK_VERSION=$with_vtk
189  fi
190  if test "x$with_vtk" != "x" ; then
191    ENABLE_VTK=yes
192    for path in \
193     $libdir/tcltk \
194     $exec_prefix/lib/tcltk \
195     $prefix/lib/tcltk \
196     $libdir \
197     $prefix/lib \
198     $exec_prefix/lib \
199     /usr/lib
200    do
201      if test -d "$path/vtk-$VTK_VERSION" ; then
202        VTK_TCL_DIR="$path/vtk-$VTK_VERSION"
203      fi
204      if test "x${VTK_TCL_DIR}" != "x" ; then
205        break
206      fi
207    done
208  fi
209else
210  if test "${ENABLE_GUI}" = "yes" ; then
211    AC_MSG_WARN([VTK missing: Rappture GUI requires VTK for some features])
212  fi
213fi
214AC_MSG_RESULT([$VTK_TCL_DIR])
215
216AC_ARG_ENABLE(
217    [vtkdicom],
218    [AS_HELP_STRING([--enable-vtkdicom],
219        [Use vtkDICOM package @<:@default=no@:>@])],
220    [],
221    [enable_vtkdicom=no])
222
223AC_MSG_CHECKING([for vtkDICOM])
224ENABLE_VTK_DICOM=
225if test "$enable_vtkdicom" != "no" ; then
226    ENABLE_VTK_DICOM="yes"
227fi
228AC_MSG_RESULT([$enable_vtkdicom])
229
230RP_BASE=`pwd`
231
232#--------------------------------------------------------------------
233# This macro figures out what flags to use with the compiler/linker
234# when building shared/static debug/optimized objects.  This information
235# is all taken from the tclConfig.sh file.
236#--------------------------------------------------------------------
237
238if test -f "${exec_prefix}/lib/tclConfig.sh" ; then
239  . ${exec_prefix}/lib/tclConfig.sh
240fi
241if test -f "${exec_prefix}/lib/tkConfig.sh" ; then
242  . ${exec_prefix}/lib/tkConfig.sh
243fi
244
245# -----------------------------------------------------------------------
246#
247# Compiler characteristics:
248#   Check for existence of types of size_t and pid_t
249#
250# -----------------------------------------------------------------------
251
252AC_C_BIGENDIAN
253AC_CHECK_SIZEOF(int)
254AC_CHECK_SIZEOF(long)
255AC_CHECK_SIZEOF(long long)
256AC_CHECK_SIZEOF(void *)
257
258SIZEOF_LONG="${ac_cv_sizeof_long}"
259SIZEOF_LONG_LONG="${ac_cv_sizeof_long_long}"
260SIZEOF_VOID_P="${ac_cv_sizeof_void_p}"
261SIZEOF_INT="${ac_cv_sizeof_int}"
262
263
264#--------------------------------------------------------------------
265# Set the default compiler switches based on the --enable-symbols
266# option.
267#--------------------------------------------------------------------
268
269SC_ENABLE_SYMBOLS
270
271AC_SUBST(CFLAGS_DEBUG)
272AC_SUBST(CFLAGS_OPTIMIZE)
273AC_SUBST(ENABLE_LANG)
274AC_SUBST(ENABLE_GUI)
275AC_SUBST(ENABLE_VTK)
276AC_SUBST(ENABLE_VTK_DICOM)
277AC_SUBST(HAVE_INTTYPES_H)
278AC_SUBST(INSTALL_PREFIX)
279AC_SUBST(LIB_SEARCH_DIRS)
280AC_SUBST(MAKE, ${make_command})
281AC_SUBST(SVN_VERSION)
282AC_SUBST(RP_BASE)
283AC_SUBST(SHLIB_CFLAGS)
284AC_SUBST(SHLIB_LD)
285AC_SUBST(SHLIB_LDFLAGS)
286AC_SUBST(SHLIB_SUFFIX)
287AC_SUBST(SIZEOF_INT)
288AC_SUBST(SIZEOF_LONG)
289AC_SUBST(SIZEOF_LONG_LONG)
290AC_SUBST(SIZEOF_VOID_P)
291AC_SUBST(STLIB_LD)
292AC_SUBST(TCL_INC_SPEC)
293AC_SUBST(TCL_LIB_SPEC)
294AC_SUBST(TCL_CFLAGS_DEBUG)
295AC_SUBST(TCL_CFLAGS_OPTIMIZE)
296AC_SUBST(TCL_SHLIB_CFLAGS)
297AC_SUBST(TCL_SHLIB_LD)
298AC_SUBST(TCL_SHLIB_LDFLAGS)
299AC_SUBST(TCL_SHLIB_SUFFIX)
300AC_SUBST(TCL_VERSION)
301AC_SUBST(TCL_VERSION)
302AC_SUBST(TK_INC_SPEC)
303AC_SUBST(TK_LIB_SPEC)
304AC_SUBST(TCL_CFLAGS_DEBUG)
305AC_SUBST(TCL_SHLIB_CFLAGS)
306AC_SUBST(TCL_SHLIB_SUFFIX)
307AC_SUBST(TCL_SHLIB_LD)
308AC_SUBST(TCL_SHLIB_LDFLAGS)
309AC_SUBST(TK_XLIBSW)
310AC_SUBST(TK_VERSION)
311AC_SUBST(VTK_TCL_DIR)
312AC_SUBST(VTK_VERSION)
313AC_SUBST(XSUBPP)
314AC_SUBST(STATSDIR)
315AC_SUBST(X_INCLUDES)
316AC_SUBST(X_LIBRARIES)
317AC_SUBST(WORDSIZE)
318AC_SUBST(RAPPTURE_MAJOR_VERSION)
319AC_SUBST(RAPPTURE_MINOR_VERSION)
320AC_SUBST(RAPPTURE_RELEASE_SERIAL)
321AC_SUBST(HAVE_VTK)
322
323dnl read Makefile.in and write Makefile
324AC_CONFIG_FILES([
325    Makefile
326    fixrunpaths.tcl
327    apps/Makefile
328    apps/about
329    apps/copy_rappture_examples
330    apps/encodedata
331    apps/rappture
332    apps/rappture-csh.env
333    apps/rappture.env
334    apps/rappture.use
335    apps/rerun
336    apps/simsim
337    apps/xmldiff
338])
339AC_OUTPUT
340       
Note: See TracBrowser for help on using the repository browser.