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

Last change on this file since 1508 was 1364, checked in by gah, 15 years ago
File size: 5.9 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
47
48LD_RPATH="";
49
50SUBDIRS="nanoscale nanovis pymolproxy"
51AC_SUBST(SUBDIRS)
52
53AC_ARG_WITH(
54    [tcllib],
55    [AS_HELP_STRING([--with-tcllib[=DIR]],
56        [location of Tcl binary library libtclstubs.a @<:@default=/usr/lib@:>@])],
57    [with_tcllib=$withval],
58    [with_tcllib=""])
59
60#
61# Need to check for the following dependencies:
62#       Rappture headers and library (done)
63#       Tcl headers and library (done)
64#       GL headers and library
65#       GLuT headers and library
66#       GLui header and library
67#       GLEW header and library
68#       Cg headers and library
69#       CgGL headers and library
70#       pthread library
71#       DX headers and library (done, sort of)
72#       ffmpeg headers and library (started)
73#
74
75TCL_VERSION="8.4"
76for dir in \
77 ${exec_prefix} \
78 ${exec_prefix}/lib \
79 ${with_rappture} \
80 ${with_rappture}/lib ; do
81  tclconfig="${dir}/tclConfig.sh"
82  if test -f "$tclconfig" ; then
83    . $tclconfig
84    break
85  fi
86done
87TCL_INC_SPEC="$TCL_INCLUDE_SPEC"
88
89if test "x$with_tcllib" != "x" ; then
90   tclconfig="${with_tcllib}/tclConfig.sh"
91   if test -f "$tclconfig" ; then
92    . $tclconfig
93   fi
94   TCL_LIB_SPEC="-L${with_tcllib} -ltcl${TCL_VERSION}"
95fi
96if test "x$with_tclinclude" != "x" ; then
97   TCL_INC_SPEC="-I${with_tclinclude}"
98fi
99
100AC_SUBST(TCL_VERSION)
101AC_SUBST(TCL_INC_SPEC)
102AC_SUBST(TCL_LIB_SPEC)
103
104AC_ARG_WITH(
105    [rappture],
106    [AS_HELP_STRING([--with-rappture[=DIR]],
107        [location of rappture files lib/librappture2.a and include/rappture2/rappture2.h @<:@default=/usr@:>@])],
108    [with_rappture=$withval],
109    [with_rappture=/usr])
110
111RP2_INCL_DIR=""
112RP_DIR=""
113AC_MSG_CHECKING([for rappture])
114if test "x$with_rappture" != "x" ; then
115    if test "x$with_rappture" != "xprefix" ; then
116        if test -f "$with_rappture"
117        then
118            AC_MSG_RESULT([no])
119            AC_MSG_ERROR([please provide --with-rappture with directory])
120        else
121            if test -d "$with_rappture"
122            then
123                if test -r "$with_rappture/include/rappture2/rappture2.h" -a -r "$with_rappture/lib/librappture2.a"
124                then
125                    RP2_INCL_DIR="$with_rappture/include/rappture2"
126                    RP_DIR="$with_rappture"
127                    AC_MSG_RESULT([yes])
128                else
129                    AC_MSG_RESULT([no])
130                    AC_MSG_ERROR([cannot find rappture2.h and librappture2.a, try using --with-rappture])
131                fi
132            else
133                AC_MSG_RESULT([no])
134                AC_MSG_ERROR([cannot find rappture2.h and librappture2.a inside $with_rappture, try using --with-rappture])
135            fi
136        fi
137    else
138        RP2_INCL_DIR="$prefix/include/rappture2"
139        RP_DIR="$prefix"
140        AC_MSG_RESULT([set to prefix])
141    fi
142else
143    AC_CHECK_HEADERS([rappture.h], [],
144           [AC_MSG_ERROR([cannot find rappture.h, try using --with-rappture])])
145
146
147fi
148AC_MSG_RESULT([${RP_DIR}/include])
149AC_SUBST(RP2_INCL_DIR)
150AC_SUBST(RP_DIR)
151
152AC_CHECK_HEADER([GL/glui.h])
153AC_CHECK_HEADER([glui.h])
154AC_CHECK_HEADER([GL/glut.h])
155AC_CHECK_HEADER([GL/glew.h])
156AC_CHECK_HEADER([Cg/cgGL.h])
157
158AC_CHECK_HEADERS([stdio.h unistd.h stdlib.h string.h sys/types.h])
159AC_CHECK_HEADERS([sys/socket.h sys/time.h netinet/in.h arpa/inet.h netdb.h])
160
161AC_MSG_CHECKING([for DX installation])
162DX_DIR=""
163for dir in \
164 /apps/rappture \
165 /usr/dx \
166 /usr
167do
168  if test -r "${dir}/include/dx/dx.h" ; then
169    DX_DIR="$dir"
170    break
171  fi
172done
173if test "x${DX_DIR}" = "x" ; then
174  AC_MSG_ERROR([can't find OpenDX installation])
175fi
176
177if test "${DX_DIR}" = "/usr" ; then
178  DX_DIR=""
179else
180  LD_RPATH="$loader_run_path:${DX_DIR}/lib"
181fi
182
183AC_SUBST(DX_DIR)
184AC_MSG_RESULT([${DX_DIR}])
185
186AC_CHECK_HEADERS([ffmpeg/avcodec.h libavcodec/avcodec.h ffmpeg/avformat.h libavformat/avformat.h ffmpeg/avutil.h libavutil/avutil.h])
187
188oldLIBS=$LIBS
189LIBS=-lavcodec
190AC_CHECK_FUNCS(img_convert)
191LIBS=-lavformat
192AC_CHECK_FUNCS(avformat_alloc_context)
193LIBS=$oldLIBS
194
195AC_MSG_CHECKING([for nVidia Cg installation])
196CG_DIR=""
197for dir in \
198 /opt/nvidia-cg-toolkit \
199 /usr/cg \
200 /usr
201do
202  if test -r "${dir}/include/Cg/cgGL.h" ; then
203    CG_DIR="$dir"
204    break
205  fi
206done
207if test "x${CG_DIR}" = "x" ; then
208  AC_MSG_ERROR([can't find nVidia Cg installation])
209fi
210
211if test "${CG_DIR}" = "/usr" ; then
212  CG_DIR=""
213else
214  LD_RPATH="$loader_run_path:${CG_DIR}/lib"
215fi
216
217AC_SUBST(CG_DIR)
218AC_MSG_RESULT([${CG_DIR}])
219AC_SUBST(LD_RPATH)
220
221dnl AC_MSG_CHECKING(tcl library version)
222dnl TCL=`AC_TRY_RUN([#include <tcl.h>
223dnl         int main() {printf("tcl%s",TCL_VERSION);return(0);}],,
224dnl         echo "tcl8.4", echo "tcl8.4")`
225dnl AC_MSG_RESULT($TCL)
226dnl AC_MSG_CHECKING(tk library version)
227dnl TK=`AC_TRY_RUN([#include <tk.h>
228dnl         main() {printf("tk%s", TK_VERSION); exit(0);}],,
229dnl         echo "tk8.4", echo "tk8.4")`
230dnl AC_MSG_RESULT($TK)
231
232
233AC_OUTPUT(  Makefile \
234            nanoscale/Makefile \
235            nanovis/Makefile \
236            nanovis/newmat11/Makefile \
237            nanovis/R2/src/Makefile \
238            nanovis/imgLoaders/Makefile \
239            nanovis/transfer-function/Makefile \
240            pymolproxy/Makefile \
241            start_viz.sh    )
Note: See TracBrowser for help on using the repository browser.