source: trunk/packages/vizservers/configure.in @ 1970

Last change on this file since 1970 was 1899, checked in by gah, 12 years ago

re-merge with latest branches/blt4 changes

File size: 7.2 KB
Line 
1AC_INIT(vizservers, 0.1, rappture@nanohub.org)
2AC_CONFIG_HEADER(nanovis/nvconf.h nanoscale/config.h)
3
4VERSION=0.0.1
5AC_SUBST(VERSION)
6
7#------------------------------------------------------------------------
8# Handle the --prefix=... option
9#------------------------------------------------------------------------
10
11if test "${prefix}" = "NONE"; then
12    prefix=/usr/local
13fi
14if test "${exec_prefix}" = "NONE"; then
15    exec_prefix=$prefix
16fi
17
18if test "${libdir}" != "${prefix}/lib"; then
19    LIB_SEARCH_DIRS="-L ${prefix}/lib -L ${libdir}"
20else
21    LIB_SEARCH_DIRS="-L ${libdir}"
22fi
23
24SC_CONFIG_CFLAGS
25
26AC_SUBST(CFLAGS_DEBUG)
27AC_SUBST(CFLAGS_OPTIMIZE)
28AC_SUBST(STLIB_LD)
29AC_SUBST(SHLIB_LD)
30AC_SUBST(SHLIB_CFLAGS)
31AC_SUBST(SHLIB_LDFLAGS)
32AC_SUBST(SHLIB_SUFFIX)
33
34AC_PROG_INSTALL
35AC_PROG_RANLIB
36AC_PROG_LN_S
37AC_PROG_MKDIR_P
38
39dnl find and test the C compiler
40AC_PROG_CC
41AC_PROG_CPP
42AC_PROG_CXXCPP
43AC_PROG_CXX
44AC_LANG_CPLUSPLUS
45
46AC_C_BIGENDIAN
47AC_CHECK_SIZEOF(int, 4)
48AC_CHECK_SIZEOF(long, 4)
49AC_CHECK_SIZEOF(long long, 8)
50AC_CHECK_SIZEOF(void *, 4)
51AC_CHECK_SIZEOF(float, 4)
52
53# Save the values as shell variables so that we can substitute them
54# into bltHash.h for situtations where there's no bltInt.h.
55
56AC_SUBST(SIZEOF_INT, ${ac_cv_sizeof_int})
57AC_SUBST(SIZEOF_LONG, ${ac_cv_sizeof_long})
58AC_SUBST(SIZEOF_LONG_LONG, ${ac_cv_sizeof_long_long})
59AC_SUBST(SIZEOF_VOID_P, ${ac_cv_sizeof_void_p})
60AC_SUBST(SIZEOF_FLOAT, ${ac_cv_sizeof_float})
61
62LD_RPATH="";
63
64SUBDIRS="nanoscale nanovis pymolproxy"
65AC_SUBST(SUBDIRS)
66
67AC_ARG_WITH(
68    [tcllib],
69    [AS_HELP_STRING([--with-tcllib[=DIR]],
70        [location of Tcl binary library libtclstubs.a @<:@default=/usr/lib@:>@])],
71    [with_tcllib=$withval],
72    [with_tcllib=""])
73
74#
75# Need to check for the following dependencies:
76#       Rappture headers and library (done)
77#       Tcl headers and library (done)
78#       GL headers and library
79#       GLuT headers and library
80#       GLui header and library
81#       GLEW header and library
82#       Cg headers and library
83#       CgGL headers and library
84#       pthread library
85#       DX headers and library (done, sort of)
86#       ffmpeg headers and library (started)
87#
88
89TCL_VERSION="8.4"
90for dir in \
91 ${exec_prefix} \
92 ${exec_prefix}/lib \
93 ${with_rappture} \
94 ${with_rappture}/lib ; do
95  tclconfig="${dir}/tclConfig.sh"
96  if test -f "$tclconfig" ; then
97    . $tclconfig
98    break
99  fi
100done
101TCL_INC_SPEC="$TCL_INCLUDE_SPEC"
102
103if test "x$with_tcllib" != "x" ; then
104   tclconfig="${with_tcllib}/tclConfig.sh"
105   if test -f "$tclconfig" ; then
106    . $tclconfig
107   fi
108   TCL_LIB_SPEC="-L${with_tcllib} -ltcl${TCL_VERSION}"
109fi
110if test "x$with_tclinclude" != "x" ; then
111   TCL_INC_SPEC="-I${with_tclinclude}"
112fi
113
114AC_SUBST(TCL_VERSION)
115AC_SUBST(TCL_INC_SPEC)
116AC_SUBST(TCL_LIB_SPEC)
117
118AC_ARG_WITH(
119    [rappture],
120    [AS_HELP_STRING([--with-rappture[=DIR]],
121        [location of rappture files lib/librappture2.a and include/rappture2/rappture2.h @<:@default=/usr@:>@])],
122    [with_rappture=$withval],
123    [with_rappture=/usr])
124
125RP2_INCL_DIR=""
126RP_DIR=""
127AC_MSG_CHECKING([for rappture])
128if test "x$with_rappture" != "x" ; then
129    if test "x$with_rappture" != "xprefix" ; then
130        if test -f "$with_rappture"
131        then
132            AC_MSG_RESULT([no])
133            AC_MSG_ERROR([please provide --with-rappture with directory])
134        else
135            if test -d "$with_rappture"
136            then
137                if test -r "$with_rappture/include/rappture2/rappture2.h" -a -r "$with_rappture/lib/librappture2.a"
138                then
139                    RP2_INCL_DIR="$with_rappture/include/rappture2"
140                    RP_DIR="$with_rappture"
141                    AC_MSG_RESULT([yes])
142                else
143                    AC_MSG_RESULT([no])
144                    AC_MSG_ERROR([cannot find rappture2.h and librappture2.a, try using --with-rappture])
145                fi
146            else
147                AC_MSG_RESULT([no])
148                AC_MSG_ERROR([cannot find rappture2.h and librappture2.a inside $with_rappture, try using --with-rappture])
149            fi
150        fi
151    else
152        RP2_INCL_DIR="$prefix/include/rappture2"
153        RP_DIR="$prefix"
154        AC_MSG_RESULT([set to prefix])
155    fi
156else
157    AC_CHECK_HEADERS([rappture.h], [],
158           [AC_MSG_ERROR([cannot find rappture.h, try using --with-rappture])])
159
160
161fi
162AC_MSG_RESULT([${RP_DIR}/include])
163AC_SUBST(RP2_INCL_DIR)
164AC_SUBST(RP_DIR)
165
166AC_CHECK_HEADER([GL/glui.h])
167AC_CHECK_HEADER([glui.h])
168AC_CHECK_HEADER([GL/glut.h])
169AC_CHECK_HEADER([GL/glew.h])
170AC_CHECK_HEADER([Cg/cgGL.h])
171
172AC_CHECK_HEADERS([stdio.h unistd.h stdlib.h string.h sys/types.h])
173AC_CHECK_HEADERS([sys/socket.h sys/time.h netinet/in.h arpa/inet.h netdb.h])
174
175AC_MSG_CHECKING([for OpenDX headers])
176DX_INC_DIR=""
177for dir in \
178 /apps/rappture/include \
179 /usr/dx/include \
180 /usr/include
181do
182  if test -r "${dir}/dx/dx.h" ; then
183    DX_INC_DIR="$dir"
184    break
185  fi
186done
187if test "x${DX_INC_DIR}" = "x" ; then
188  AC_MSG_ERROR([can't find OpenDX include files])
189fi
190
191if test "${DX_INC_DIR}" = "/usr/include" ; then
192  DX_INC_SPEC=""
193else
194  DX_INC_SPEC="-I{DX_INC_DIR}"
195fi
196AC_SUBST(DX_INC_SPEC)
197AC_MSG_RESULT([${DX_INC_DIR}])
198
199AC_MSG_CHECKING([for OpenDX libraries])
200DX_LIB_DIR=""
201for dir in \
202 /apps/rappture/lib \
203 /usr/lib/dx/lib_linux \
204 /usr/dx/lib_linux \
205 /usr/lib
206do
207  if test -r "${dir}/libDXcallm.a" ; then
208    DX_LIB_DIR="$dir"
209    break
210  fi
211done
212if test "x${DX_LIB_DIR}" = "x" ; then
213  AC_MSG_ERROR([can't find OpenDX libraries])
214fi
215
216if test "${DX_LIB_DIR}" = "/usr" ; then
217  DX_LIB_SPEC=""
218else
219  DX_LIB_SPEC="-L${DX_LIB_DIR}"
220fi
221
222AC_SUBST(DX_LIB_SPEC)
223AC_MSG_RESULT([${DX_LIB_DIR}])
224
225AC_CHECK_HEADERS([ffmpeg/avcodec.h libavcodec/avcodec.h ffmpeg/avformat.h libavformat/avformat.h ffmpeg/avutil.h libavutil/avutil.h],,,[
226#define SIZEOF_LONG ${ac_cv_sizeof_long}
227#if SIZEOF_LONG == 8
228#  define INT64_C(c)  c ## L
229#  define UINT64_C(c) c ## UL
230#else
231#  define INT64_C(c)  c ## LL
232#  define UINT64_C(c) c ## ULL
233#endif
234])
235
236oldLIBS=$LIBS
237LIBS=-lavcodec
238AC_CHECK_FUNCS(img_convert)
239LIBS=-lavformat
240AC_CHECK_FUNCS(avformat_alloc_context)
241LIBS=$oldLIBS
242
243AC_MSG_CHECKING([for nVidia Cg installation])
244CG_DIR=""
245for dir in \
246 /opt/nvidia-cg-toolkit \
247 /usr/cg \
248 /usr
249do
250  if test -r "${dir}/include/Cg/cgGL.h" ; then
251    CG_DIR="$dir"
252    break
253  fi
254done
255if test "x${CG_DIR}" = "x" ; then
256  AC_MSG_ERROR([can't find nVidia Cg installation])
257fi
258
259if test "${CG_DIR}" = "/usr" ; then
260  CG_DIR=""
261else
262  LD_RPATH="$loader_run_path:${CG_DIR}/lib"
263fi
264
265AC_SUBST(CG_DIR)
266AC_MSG_RESULT([${CG_DIR}])
267AC_SUBST(LD_RPATH)
268
269dnl AC_MSG_CHECKING(tcl library version)
270dnl TCL=`AC_TRY_RUN([#include <tcl.h>
271dnl         int main() {printf("tcl%s",TCL_VERSION);return(0);}],,
272dnl         echo "tcl8.4", echo "tcl8.4")`
273dnl AC_MSG_RESULT($TCL)
274dnl AC_MSG_CHECKING(tk library version)
275dnl TK=`AC_TRY_RUN([#include <tk.h>
276dnl         main() {printf("tk%s", TK_VERSION); exit(0);}],,
277dnl         echo "tk8.4", echo "tk8.4")`
278dnl AC_MSG_RESULT($TK)
279
280
281AC_OUTPUT(  Makefile \
282            nanoscale/Makefile \
283            nanovis/Makefile \
284            nanovis/newmat11/Makefile \
285            nanovis/R2/src/Makefile \
286            nanovis/vrutil/Makefile \
287            nanovis/vrmath/Makefile \
288            nanovis/vr3d/Makefile \
289            nanovis/imgLoaders/Makefile \
290            nanovis/transfer-function/Makefile \
291            pymolproxy/Makefile \
292            start_viz.sh    )
Note: See TracBrowser for help on using the repository browser.