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

Last change on this file since 1111 was 1111, checked in by gah, 14 years ago

nanovis/heightmap update

File size: 6.8 KB
Line 
1AC_INIT(vizservers, 0.1, rappture@nanohub.org)
2
3VERSION=0.0.1
4AC_SUBST(VERSION)
5
6#------------------------------------------------------------------------
7# Handle the --prefix=... option
8#------------------------------------------------------------------------
9
10if test "${prefix}" = "NONE"; then
11    prefix=/usr/local
12fi
13if test "${exec_prefix}" = "NONE"; then
14    exec_prefix=$prefix
15fi
16
17if test "${libdir}" != "${prefix}/lib"; then
18    LIB_SEARCH_DIRS="-L ${prefix}/lib -L ${libdir}"
19else
20    LIB_SEARCH_DIRS="-L ${libdir}"
21fi
22
23AC_SUBST(LIB_SEARCH_DIRS)
24
25AC_PROG_INSTALL
26AC_PROG_RANLIB
27AC_PROG_LN_S
28AC_PROG_MKDIR_P
29
30dnl find and test the C compiler
31AC_PROG_CC
32AC_LANG_C
33
34AC_PROG_CXX
35AC_LANG_CPLUSPLUS
36
37AC_C_BIGENDIAN
38
39SUBDIRS="nanoscale nanovis pymolproxy"
40AC_SUBST(SUBDIRS)
41
42AC_ARG_WITH(
43    [tcllib],
44    [AS_HELP_STRING([--with-tcllib[=DIR]],
45        [location of Tcl binary library libtclstubs.a @<:@default=/usr/lib@:>@])],
46    [with_tcllib=$withval],
47    [with_tcllib=/usr/lib])
48
49#
50# Need to check for the following dependencies:
51#       Rappture headers and library (done)
52#       Tcl headers and library (done)
53#       GL headers and library
54#       GLuT headers and library
55#       GLui header and library
56#       GLEW header and library
57#       Cg headers and library
58#       CgGL headers and library
59#       pthread library
60#       DX headers and library (done, sort of)
61#
62
63TCL_LIB_DIR=""
64TCL_LIB=""
65TCL_LIB_VERSION=""
66AC_MSG_CHECKING([for tcl binary libraries])
67if test "x$with_tcllib" != "x" ; then
68    if test -f "$with_tcllib"
69    then
70        if test -n `basename $with_tcllib | grep libtcl[0-9]\.[0-9].so`
71        then
72            TCL_LIB_DIR="$with_tcllib"
73        fi
74    else
75        if test -d "$with_tcllib"
76        then
77            if test -x "$with_tcllib/`ls $with_tcllib | grep libtcl[0-9]\.[0-9]\.so$`"
78            then
79                TCL_LIB_DIR="$with_tcllib"
80            else
81                AC_MSG_RESULT([no])
82                AC_MSG_ERROR([cannot find tcl binary libraries, try using --with-tcllib])
83            fi
84        else
85            AC_MSG_RESULT([no])
86            AC_MSG_ERROR([cannot find tcl binary libraries inside $with_tcllib, try using --with-tcllib])
87        fi
88    fi
89else
90    AC_CHECK_HEADERS([tcl.h], [],
91           [AC_MSG_ERROR([cannot find tcl.h, try using --with-tclinclude])])
92fi
93# TCL_LIB=$(ls ${TCL_LIB_DIR} | grep -o libtcl[0-9]\.[0-9])
94# TCL_LIB=`ls ${TCL_LIB_DIR} | awk '/libtcl([0-9]\.?[0-9])?\.so/ { print }'`
95# TCL_LIB=`ls ${TCL_LIB_DIR} | sed -e '/libtcl([0-9]\.?[0-9])?\.so$/ {p}'`
96# TCL_LIB_VERSION=$(echo ${TCL_LIB} | sed -e s/libtcl// -e s/\.so//)
97AC_MSG_RESULT([${TCL_LIB_DIR}/${TCL_LIB}])
98# echo TCL_LIB_DIR = ${TCL_LIB_DIR}
99# echo TCL_LIB = ${TCL_LIB}
100# echo TCL_LIB_VERSION = ${TCL_LIB_VERSION}
101AC_SUBST(TCL_LIB_DIR)
102AC_SUBST(TCL_LIB)
103AC_SUBST(TCL_LIB_VERSION)
104
105AC_ARG_WITH(
106    [tclinclude],
107    [AS_HELP_STRING([--with-tclinclude[=DIR]],
108        [location of tcl.h header file @<:@default=/usr/include@:>@])],
109    [with_tclinclude=$withval],
110    [with_tclinclude=/usr/include])
111
112TCL_INCL_DIR=""
113AC_MSG_CHECKING([for tcl.h])
114if test "x$with_tclinclude" != "x" ; then
115    if test -f "$with_tclinclude"
116    then
117        if test `basename $with_tclinclude` = "tcl.h"
118        then
119            TCL_INCL_DIR="`dirname $with_tclinclude`"
120        fi
121    else
122        if test -d "$with_tclinclude"
123        then
124            if test -r "$with_tclinclude/tcl.h"
125            then
126                TCL_INCL_DIR="$with_tclinclude"
127            else
128                if test -r "$with_tclinclude/tcl${TCL_LIB_VERSION}/tcl.h"
129                then
130                    TCL_INCL_DIR="$with_tclinclude/tcl${TCL_LIB_VERSION}"
131                else
132                    AC_MSG_RESULT([no])
133                    AC_MSG_ERROR([cannot find tcl.h, try using --with-tclinclude])
134                fi
135            fi
136        else
137            AC_MSG_RESULT([no])
138            AC_MSG_ERROR([cannot find tcl.h inside $with_tclinclude, try using --with-tclinclude])
139        fi
140    fi
141else
142    AC_CHECK_HEADERS([tcl.h], [],
143           [AC_MSG_ERROR([cannot find tcl.h, try using --with-tclinclude])])
144fi
145AC_MSG_RESULT([${TCL_INCL_DIR}])
146AC_SUBST(TCL_INCL_DIR)
147
148AC_ARG_WITH(
149    [rappture],
150    [AS_HELP_STRING([--with-rappture[=DIR]],
151        [location of rappture files lib/librappture2.a and include/rappture2/rappture2.h @<:@default=/usr@:>@])],
152    [with_rappture=$withval],
153    [with_rappture=/usr])
154
155RP2_INCL_DIR=""
156RP_DIR=""
157AC_MSG_CHECKING([for rappture])
158if test "x$with_rappture" != "x" ; then
159    if test "x$with_rappture" != "xprefix" ; then
160        if test -f "$with_rappture"
161        then
162            AC_MSG_RESULT([no])
163            AC_MSG_ERROR([please provide --with-rappture with directory])
164        else
165            if test -d "$with_rappture"
166            then
167                if test -r "$with_rappture/include/rappture2/rappture2.h" -a -r "$with_rappture/lib/librappture2.a"
168                then
169                    RP2_INCL_DIR="$with_rappture/include/rappture2"
170                    RP_DIR="$with_rappture"
171                    AC_MSG_RESULT([yes])
172                else
173                    AC_MSG_RESULT([no])
174                    AC_MSG_ERROR([cannot find rappture2.h and librappture2.a, try using --with-rappture])
175                fi
176            else
177                AC_MSG_RESULT([no])
178                AC_MSG_ERROR([cannot find rappture2.h and librappture2.a inside $with_rappture, try using --with-rappture])
179            fi
180        fi
181    else
182        RP2_INCL_DIR="$prefix/include/rappture2"
183        RP_DIR="$prefix"
184        AC_MSG_RESULT([set to prefix])
185    fi
186else
187    AC_CHECK_HEADERS([rappture.h], [],
188           [AC_MSG_ERROR([cannot find rappture.h, try using --with-rappture])])
189
190
191fi
192AC_MSG_RESULT([${RP_DIR}/include])
193AC_SUBST(RP2_INCL_DIR)
194AC_SUBST(RP_DIR)
195
196AC_CHECK_HEADER([GL/glui.h])
197AC_CHECK_HEADER([glui.h])
198AC_CHECK_HEADER([GL/glut.h])
199
200AC_MSG_CHECKING([for DX installation])
201DX_DIR=""
202for dir in \
203 /apps/rappture \
204 /usr/dx \
205 /usr
206do
207  if test -r "${dir}/include/dx/dx.h" ; then
208    DX_DIR="$dir"
209    break
210  fi
211done
212if test "x${DX_DIR}" = "x" ; then
213  AC_MSG_ERROR([can't find OpenDX installation])
214fi
215if test "${DX_DIR}" = "/usr" ; then
216  DX_DIR=""
217fi
218AC_SUBST(DX_DIR)
219AC_MSG_RESULT([${DX_DIR}])
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.