source: vtkvis/trunk/configure.ac @ 6369

Last change on this file since 6369 was 6192, checked in by ldelgass, 8 years ago

rename configure.in to configure.ac

File size: 3.3 KB
Line 
1AC_PREREQ([2.60])
2AC_INIT([vtkvis], [1.8], [rappture@nanohub.org])
3AC_CONFIG_AUX_DIR(cf)
4
5AC_ARG_WITH(
6    [tcllib],
7    [AS_HELP_STRING([--with-tcllib[=DIR]],
8        [location of Tcl binary library libtclstubs.a @<:@default=/usr/lib@:>@])],
9    [with_tcllib=$withval],
10    [with_tcllib=""])
11
12AC_ARG_WITH(
13    [vtk-includes],
14    [AS_HELP_STRING([--with-vtk-includes=DIR],
15        [location of versioned VTK include dir])],
16    [with_vtk_includes=$withval],
17    [with_vtk_includes=""])
18
19AC_ARG_WITH(
20    [vtk-libs],
21    [AS_HELP_STRING([--with-vtk-libs=DIR],
22        [VTK libraries are in DIR])],
23    [with_vtk_libs=$withval],
24    [with_vtk_libs=""])
25
26AC_ARG_WITH(
27    [vtk],
28    [AS_HELP_STRING([--with-vtk=VERSION],
29        [Version of VTK required @<:@default=6.2@:>@])],
30    [with_vtk=$withval],
31    [with_vtk=""])
32
33AC_ARG_WITH(
34    [statsdir],
35    [AS_HELP_STRING([--with-statsdir=DIR],
36        [Write statistics in DIR])],
37    [STATSDIR=$withval],
38    [STATSDIR="/var/tmp/visservers"])
39
40#------------------------------------------------------------------------
41# Handle the --prefix=... option
42#------------------------------------------------------------------------
43
44if test "${prefix}" = "NONE"; then
45    prefix=/usr/local
46fi
47if test "${exec_prefix}" = "NONE"; then
48    exec_prefix=$prefix
49fi
50
51if test "x${incdir}" == "x"; then
52  incdir=${exec_prefix}/include
53fi
54libdir=${exec_prefix}/lib
55
56if test "${libdir}" != "${prefix}/lib"; then
57    LIB_SEARCH_DIRS="-L ${prefix}/lib -L ${libdir}"
58else
59    LIB_SEARCH_DIRS="-L ${libdir}"
60fi
61
62AC_PROG_INSTALL
63AC_PROG_RANLIB
64AC_PROG_LN_S
65AC_PROG_MKDIR_P
66
67dnl find and test the C compiler
68AC_PROG_CC
69AC_PROG_CPP
70AC_PROG_CXXCPP
71AC_PROG_CXX
72AC_LANG_CPLUSPLUS
73
74#
75# Need to check for the following dependencies:
76#       Tcl headers and library
77#       GL headers and library
78#       pthread library
79#       vtk libraries
80#
81
82TCL_VERSION="8.4"
83for dir in \
84 ${exec_prefix} \
85 ${exec_prefix}/lib ; do
86  tclconfig="${dir}/tclConfig.sh"
87  if test -f "$tclconfig" ; then
88    . $tclconfig
89    break
90  fi
91done
92TCL_INC_SPEC="$TCL_INCLUDE_SPEC"
93
94if test "x$with_tcllib" != "x" ; then
95   tclconfig="${with_tcllib}/tclConfig.sh"
96   if test -f "$tclconfig" ; then
97    . $tclconfig
98   fi
99   TCL_LIB_SPEC="-L${with_tcllib} -ltcl${TCL_VERSION}"
100fi
101if test "x$with_tclinclude" != "x" ; then
102   TCL_INC_SPEC="-I${with_tclinclude}"
103fi
104
105# There can be multiple versions of VTK installed side-by-side
106VTK_VERSION=6.2
107VTK_LIB_DIR=${libdir}
108VTK_INC_DIR=${incdir}
109
110if test "x$with_vtk_includes" != "x"; then
111   VTK_INC_DIR=$with_vtk_includes
112fi
113
114if test "x$with_vtk_libs" != "x"; then
115   VTK_LIB_DIR=$with_vtk_libs
116fi
117
118if test "x$with_vtk" != "x" ; then
119   VTK_VERSION=$with_vtk
120fi
121
122if ! test -d "$VTK_INC_DIR/vtk-${VTK_VERSION}" ; then
123   AC_ERROR([Couldn't find VTK includes])
124else
125   VTK_INC_SPEC="-I${VTK_INC_DIR}/vtk-${VTK_VERSION}"
126fi
127
128save_CPPFLAGS=$CPPFLAGS
129CPPFLAGS=$VTK_INC_SPEC
130AC_CHECK_HEADERS([vtkSmartPointer.h], [], [AC_MSG_WARN([cannot find vtkSmartPointer.h])])
131CPPFLAGS=$save_CPPFLAGS
132
133AC_CHECK_HEADERS([stdio.h unistd.h stdlib.h string.h sys/types.h])
134AC_CHECK_HEADERS([sys/socket.h sys/time.h netinet/in.h arpa/inet.h netdb.h])
135
136AC_CHECK_FUNCS([accept4])
137
138AC_SUBST(STATSDIR)
139AC_SUBST(TCL_INC_SPEC)
140AC_SUBST(TCL_LIB_SPEC)
141AC_SUBST(TCL_VERSION)
142AC_SUBST(VTK_VERSION)
143AC_SUBST(VTK_INC_DIR)
144AC_SUBST(VTK_LIB_DIR)
145
146AC_OUTPUT([
147   Doxyfile \
148   Makefile])
Note: See TracBrowser for help on using the repository browser.