source: branches/1.3/packages/vizservers/configure.in @ 4467

Last change on this file since 4467 was 4467, checked in by ldelgass, 7 years ago

Separate configure for nanovis

File size: 5.6 KB
Line 
1AC_PREREQ([2.60])
2AC_INIT(vizservers, 0.1, rappture@nanohub.org)
3AC_CONFIG_AUX_DIR(cf)
4AC_CONFIG_HEADERS([nanovis/nvconf.h nanoscale/config.h])
5
6AC_ARG_WITH(
7    [tcllib],
8    [AS_HELP_STRING([--with-tcllib[=DIR]],
9        [location of Tcl binary library libtclstubs.a @<:@default=/usr/lib@:>@])],
10    [with_tcllib=$withval],
11    [with_tcllib=""])
12
13AC_ARG_WITH(
14    [rappture],
15    [AS_HELP_STRING([--with-rappture[=DIR]],
16        [location of rappture files lib/librappture.a and include/rappture.h @<:@default=/usr@:>@])],
17    [with_rappture=$withval],
18    [with_rappture=yes])
19
20AC_ARG_WITH(
21    [vtk-includes],
22    [AS_HELP_STRING([--with-vtk-includes=DIR],
23        [VTK include files are in DIR])],
24    [with_vtk_includes=$withval],
25    [with_vtk_includes=""])
26
27AC_ARG_WITH(
28    [vtk-libs],
29    [AS_HELP_STRING([--with-vtk-libs=DIR],
30        [VTK libraries are in DIR])],
31    [with_vtk_libs=$withval],
32    [with_vtk_libs=""])
33
34AC_ARG_WITH(
35    [vtk],
36    [AS_HELP_STRING([--with-vtk=VERSION],
37        [Version of VTK required])],
38    [with_vtk=$withval],
39    [with_vtk=yes])
40
41RP_LANG_PYTHON
42
43AC_ARG_WITH(
44    [statsdir],
45    [AS_HELP_STRING([--with-statsdir=DIR],
46        [Write statics in DIR])],
47    [STATSDIR=$withval],
48    [STATSDIR="/var/tmp/visservers"])
49
50VERSION=0.0.1
51
52#------------------------------------------------------------------------
53# Handle the --prefix=... option
54#------------------------------------------------------------------------
55
56if test "${prefix}" = "NONE"; then
57    prefix=/usr/local
58fi
59if test "${exec_prefix}" = "NONE"; then
60    exec_prefix=$prefix
61fi
62
63if test "x${incdir}" == "x"; then
64  incdir=${exec_prefix}/include
65fi
66libdir=${exec_prefix}/lib
67
68if test "${libdir}" != "${prefix}/lib"; then
69    LIB_SEARCH_DIRS="-L ${prefix}/lib -L ${libdir}"
70else
71    LIB_SEARCH_DIRS="-L ${libdir}"
72fi
73
74SC_CONFIG_CFLAGS
75
76
77AC_PATH_X
78
79AC_PROG_INSTALL
80AC_PROG_RANLIB
81AC_PROG_LN_S
82AC_PROG_MKDIR_P
83
84dnl find and test the C compiler
85AC_PROG_CC
86AC_PROG_CPP
87AC_PROG_CXXCPP
88AC_PROG_CXX
89AC_LANG_CPLUSPLUS
90
91AC_C_BIGENDIAN
92AC_CHECK_SIZEOF(int, 4)
93AC_CHECK_SIZEOF(long, 4)
94AC_CHECK_SIZEOF(long long, 8)
95AC_CHECK_SIZEOF(void *, 4)
96AC_CHECK_SIZEOF(float, 4)
97
98# Save the values as shell variables so that we can substitute them
99# into bltHash.h for situtations where there's no bltInt.h.
100
101
102LD_RPATH="";
103
104#
105# Need to check for the following dependencies:
106#       Rappture headers and library (done)
107#       Tcl headers and library (done)
108#       GL headers and library
109#       GLEW header and library
110#       pthread library
111#       ffmpeg headers and library (started)
112#
113
114TCL_VERSION="8.4"
115for dir in \
116 ${exec_prefix} \
117 ${exec_prefix}/lib \
118 ${with_rappture} \
119 ${with_rappture}/lib ; do
120  tclconfig="${dir}/tclConfig.sh"
121  if test -f "$tclconfig" ; then
122    . $tclconfig
123    break
124  fi
125done
126TCL_INC_SPEC="$TCL_INCLUDE_SPEC"
127
128if test "x$with_tcllib" != "x" ; then
129   tclconfig="${with_tcllib}/tclConfig.sh"
130   if test -f "$tclconfig" ; then
131    . $tclconfig
132   fi
133   TCL_LIB_SPEC="-L${with_tcllib} -ltcl${TCL_VERSION}"
134fi
135if test "x$with_tclinclude" != "x" ; then
136   TCL_INC_SPEC="-I${with_tclinclude}"
137fi
138
139RP_DIR=""
140AC_MSG_CHECKING([for rappture])
141if test "$with_rappture" == "yes" ; then
142  for dir in "$exec_prefix" "/usr" ; do
143    if test -r "$dir/include/rappture2/rappture2.h" -a \
144     -r "$dir/lib/librappture.a"; then
145      RP_DIR="$dir"
146      RP_INC_SPEC="-I$dir/include -I$dir/include/rappture2"
147      RP_LIB_DIR="$dir/lib"
148      AC_MSG_RESULT([$dir])
149      break
150    fi
151  done
152else
153  if test ! -d "$with_rappture" ; then
154    AC_MSG_ERROR([--with-rappture: no such directory $with_rappture])
155  fi
156  RP_DIR=$with_rappture
157  RP_INC_SPEC="-I$with_rappture/include -I$with_rappture/include/rappture2"
158  RP_LIB_DIR="$with_rappture/lib"
159fi
160if test "x${RP_DIR}" = "x" ; then
161  AC_MSG_ERROR([cannot find rappture.h and librappture2.a, try using --with-rappture])
162else
163  AC_MSG_RESULT([$with_rappture])
164fi
165
166# This could be temporary. We are assuming that we're using VTK 6+.
167# Since VTK 6 hasn't been released, we will look it only in the
168# Rappture build directories.
169VTK_LIB_DIR=${libdir}
170dnl Prefer our VTK installation over systems. --with-vtk overrides.
171if test "$with_vtk" != "no" ; then
172  if test "$with_vtk" = "yes" ; then
173    for dir in vtk-6.{10,9,8,7,6,5,4,3,2,1,0} ; do
174      if test -d "${incdir}/$dir"; then
175        VTK_INC_SPEC="-I${incdir}/$dir"
176        break
177      fi
178    done
179  fi
180fi
181
182if test "x$with_vtk_includes" != "x"; then
183   VTK_INC_SPEC=-I$with_vtk_includes
184fi
185
186if test "x$with_vtk_libs" != "x"; then
187   VTK_LIB_DIR=$with_vtk_libs
188   VTK_LIB_SPEC="-L$with_vtk_libs"
189fi
190
191save_CPPFLAGS=$CPPFLAGS
192CPPFLAGS=$VTK_INC_SPEC
193AC_CHECK_HEADERS([vtkSmartPointer.h], [], [AC_MSG_WARN([cannot find vtkSmartPointer.h])])
194CPPFLAGS=$save_CPPFLAGS
195
196AC_CHECK_HEADER([GL/glew.h])
197
198AC_CHECK_HEADERS([stdio.h unistd.h stdlib.h string.h sys/types.h])
199AC_CHECK_HEADERS([sys/socket.h sys/time.h netinet/in.h arpa/inet.h netdb.h])
200
201AC_CHECK_FUNCS([accept4])
202
203save_CPPFLAGS=$CPPFLAGS
204
205SUBDIRS="nanoscale pymolproxy vtkvis"
206
207AC_SUBST(CFLAGS_DEBUG)
208AC_SUBST(CFLAGS_OPTIMIZE)
209AC_SUBST(LD_RPATH)
210AC_SUBST(RP_DIR)
211AC_SUBST(RP_INC_SPEC)
212AC_SUBST(RP_LIB_DIR)
213AC_SUBST(SHLIB_CFLAGS)
214AC_SUBST(SHLIB_LD)
215AC_SUBST(SHLIB_LDFLAGS)
216AC_SUBST(SHLIB_SUFFIX)
217AC_SUBST(SIZEOF_FLOAT)
218AC_SUBST(SIZEOF_INT)
219AC_SUBST(SIZEOF_LONG)
220AC_SUBST(SIZEOF_LONG_LONG)
221AC_SUBST(SIZEOF_VOID_P)
222AC_SUBST(STATSDIR)
223AC_SUBST(STLIB_LD)
224AC_SUBST(SUBDIRS)
225AC_SUBST(PYTHON)
226AC_SUBST(TCL_INC_SPEC)
227AC_SUBST(TCL_LIB_SPEC)
228AC_SUBST(TCL_VERSION)
229AC_SUBST(VERSION)
230AC_SUBST(VTK_INC_SPEC)
231AC_SUBST(VTK_LIB_DIR)
232
233AC_OUTPUT([
234   Makefile \
235   nanoscale/Makefile \
236   nanoscale/renderservers.tcl \
237   pymolproxy/Makefile \
238   vtkvis/Doxyfile \
239   vtkvis/Makefile \
240   start_viz.sh \
241   start_nanoscale.sh])
Note: See TracBrowser for help on using the repository browser.