1 | AC_PREREQ([2.60]) |
---|
2 | AC_INIT([vtkvis], [1.7], [rappture@nanohub.org]) |
---|
3 | AC_CONFIG_AUX_DIR(cf) |
---|
4 | |
---|
5 | AC_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 | |
---|
12 | AC_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 | |
---|
19 | AC_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 | |
---|
26 | AC_ARG_WITH( |
---|
27 | [vtk], |
---|
28 | [AS_HELP_STRING([--with-vtk=VERSION], |
---|
29 | [Version of VTK required @<:@default=6.1@:>@])], |
---|
30 | [with_vtk=$withval], |
---|
31 | [with_vtk=""]) |
---|
32 | |
---|
33 | AC_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 | |
---|
44 | if test "${prefix}" = "NONE"; then |
---|
45 | prefix=/usr/local |
---|
46 | fi |
---|
47 | if test "${exec_prefix}" = "NONE"; then |
---|
48 | exec_prefix=$prefix |
---|
49 | fi |
---|
50 | |
---|
51 | if test "x${incdir}" == "x"; then |
---|
52 | incdir=${exec_prefix}/include |
---|
53 | fi |
---|
54 | libdir=${exec_prefix}/lib |
---|
55 | |
---|
56 | if test "${libdir}" != "${prefix}/lib"; then |
---|
57 | LIB_SEARCH_DIRS="-L ${prefix}/lib -L ${libdir}" |
---|
58 | else |
---|
59 | LIB_SEARCH_DIRS="-L ${libdir}" |
---|
60 | fi |
---|
61 | |
---|
62 | AC_PROG_INSTALL |
---|
63 | AC_PROG_RANLIB |
---|
64 | AC_PROG_LN_S |
---|
65 | AC_PROG_MKDIR_P |
---|
66 | |
---|
67 | dnl find and test the C compiler |
---|
68 | AC_PROG_CC |
---|
69 | AC_PROG_CPP |
---|
70 | AC_PROG_CXXCPP |
---|
71 | AC_PROG_CXX |
---|
72 | AC_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 | |
---|
82 | TCL_VERSION="8.4" |
---|
83 | for 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 |
---|
91 | done |
---|
92 | TCL_INC_SPEC="$TCL_INCLUDE_SPEC" |
---|
93 | |
---|
94 | if 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}" |
---|
100 | fi |
---|
101 | if test "x$with_tclinclude" != "x" ; then |
---|
102 | TCL_INC_SPEC="-I${with_tclinclude}" |
---|
103 | fi |
---|
104 | |
---|
105 | # We are assuming that we're using VTK 6.0 |
---|
106 | VTK_VERSION=6.0 |
---|
107 | VTK_LIB_DIR=${libdir} |
---|
108 | VTK_INC_DIR=${incdir} |
---|
109 | |
---|
110 | if test "x$with_vtk_includes" != "x"; then |
---|
111 | VTK_INC_DIR=$with_vtk_includes |
---|
112 | fi |
---|
113 | |
---|
114 | if test "x$with_vtk_libs" != "x"; then |
---|
115 | VTK_LIB_DIR=$with_vtk_libs |
---|
116 | fi |
---|
117 | |
---|
118 | dnl Prefer our VTK installation over systems. --with-vtk overrides. |
---|
119 | if test "x$with_vtk" != "x" ; then |
---|
120 | VTK_VERSION=$with_vtk |
---|
121 | fi |
---|
122 | |
---|
123 | if ! test -d "$VTK_INC_DIR/vtk-${VTK_VERSION}" ; then |
---|
124 | AC_ERROR([Couldn't find VTK includes]) |
---|
125 | else |
---|
126 | VTK_INC_SPEC="-I${VTK_INC_DIR}/vtk-${VTK_VERSION}" |
---|
127 | fi |
---|
128 | |
---|
129 | save_CPPFLAGS=$CPPFLAGS |
---|
130 | CPPFLAGS=$VTK_INC_SPEC |
---|
131 | AC_CHECK_HEADERS([vtkSmartPointer.h], [], [AC_MSG_WARN([cannot find vtkSmartPointer.h])]) |
---|
132 | CPPFLAGS=$save_CPPFLAGS |
---|
133 | |
---|
134 | AC_CHECK_HEADERS([stdio.h unistd.h stdlib.h string.h sys/types.h]) |
---|
135 | AC_CHECK_HEADERS([sys/socket.h sys/time.h netinet/in.h arpa/inet.h netdb.h]) |
---|
136 | |
---|
137 | AC_CHECK_FUNCS([accept4]) |
---|
138 | |
---|
139 | AC_SUBST(STATSDIR) |
---|
140 | AC_SUBST(TCL_INC_SPEC) |
---|
141 | AC_SUBST(TCL_LIB_SPEC) |
---|
142 | AC_SUBST(TCL_VERSION) |
---|
143 | AC_SUBST(VTK_VERSION) |
---|
144 | AC_SUBST(VTK_INC_DIR) |
---|
145 | AC_SUBST(VTK_LIB_DIR) |
---|
146 | |
---|
147 | AC_OUTPUT([ |
---|
148 | Doxyfile \ |
---|
149 | Makefile]) |
---|