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

Last change on this file since 1113 was 1113, checked in by gah, 16 years ago
File size: 7.2 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
23SC_CONFIG_CFLAGS
24
25AC_SUBST(CFLAGS_DEBUG)
26AC_SUBST(CFLAGS_OPTIMIZE)
27AC_SUBST(STLIB_LD)
28AC_SUBST(SHLIB_LD)
29AC_SUBST(SHLIB_CFLAGS)
30AC_SUBST(SHLIB_LDFLAGS)
31AC_SUBST(SHLIB_SUFFIX)
32
33AC_PROG_INSTALL
34AC_PROG_RANLIB
35AC_PROG_LN_S
36AC_PROG_MKDIR_P
37
38dnl find and test the C compiler
39AC_PROG_CC
40AC_PROG_CPP
41AC_PROG_CXXCPP
42AC_PROG_CXX
43AC_LANG_CPLUSPLUS
44
45AC_C_BIGENDIAN
46
47SUBDIRS="nanoscale nanovis pymolproxy"
48AC_SUBST(SUBDIRS)
49
50AC_ARG_WITH(
51    [tcllib],
52    [AS_HELP_STRING([--with-tcllib[=DIR]],
53        [location of Tcl binary library libtclstubs.a @<:@default=/usr/lib@:>@])],
54    [with_tcllib=$withval],
55    [with_tcllib=/usr/lib])
56
57#
58# Need to check for the following dependencies:
59#       Rappture headers and library (done)
60#       Tcl headers and library (done)
61#       GL headers and library
62#       GLuT headers and library
63#       GLui header and library
64#       GLEW header and library
65#       Cg headers and library
66#       CgGL headers and library
67#       pthread library
68#       DX headers and library (done, sort of)
69#
70
71for dir in ${exec_prefix} ${with_rappture} ; do
72  tclconfig="${dir}/lib/tclConfig.sh"
73  if test -x "$tclconfig" ; then
74    . $tclconfig
75    break
76  fi
77done
78
79AC_SUBST(TCL_VERSION)
80TCL_LIB_DIR=""
81TCL_LIB=""
82TCL_LIB_VERSION="$TCL_VERSION"
83AC_MSG_CHECKING([for tcl binary libraries])
84if test "x$with_tcllib" != "x" ; then
85    if test -f "$with_tcllib"
86    then
87        if test -n `basename $with_tcllib | grep libtcl[0-9]\.[0-9].so`
88        then
89            TCL_LIB_DIR="$with_tcllib"
90        fi
91    else
92        if test -d "$with_tcllib"
93        then
94            if test -x "$with_tcllib/`ls $with_tcllib | grep libtcl[0-9]\.[0-9]\.so$`"
95            then
96                TCL_LIB_DIR="$with_tcllib"
97            else
98                AC_MSG_RESULT([no])
99                AC_MSG_ERROR([cannot find tcl binary libraries, try using --with-tcllib])
100            fi
101        else
102            AC_MSG_RESULT([no])
103            AC_MSG_ERROR([cannot find tcl binary libraries inside $with_tcllib, try using --with-tcllib])
104        fi
105    fi
106else
107    AC_CHECK_HEADERS([tcl.h], [],
108           [AC_MSG_ERROR([cannot find tcl.h, try using --with-tclinclude])])
109fi
110# TCL_LIB=$(ls ${TCL_LIB_DIR} | grep -o libtcl[0-9]\.[0-9])
111# TCL_LIB=`ls ${TCL_LIB_DIR} | awk '/libtcl([0-9]\.?[0-9])?\.so/ { print }'`
112# TCL_LIB=`ls ${TCL_LIB_DIR} | sed -e '/libtcl([0-9]\.?[0-9])?\.so$/ {p}'`
113# TCL_LIB_VERSION=$(echo ${TCL_LIB} | sed -e s/libtcl// -e s/\.so//)
114AC_MSG_RESULT([${TCL_LIB_DIR}/${TCL_LIB}])
115# echo TCL_LIB_DIR = ${TCL_LIB_DIR}
116# echo TCL_LIB = ${TCL_LIB}
117# echo TCL_LIB_VERSION = ${TCL_LIB_VERSION}
118AC_SUBST(TCL_LIB_DIR)
119AC_SUBST(TCL_LIB)
120AC_SUBST(TCL_LIB_VERSION)
121
122AC_ARG_WITH(
123    [tclinclude],
124    [AS_HELP_STRING([--with-tclinclude[=DIR]],
125        [location of tcl.h header file @<:@default=/usr/include@:>@])],
126    [with_tclinclude=$withval],
127    [with_tclinclude=/usr/include])
128
129TCL_INCL_DIR=""
130AC_MSG_CHECKING([for tcl.h])
131if test "x$with_tclinclude" != "x" ; then
132    if test -f "$with_tclinclude"
133    then
134        if test `basename $with_tclinclude` = "tcl.h"
135        then
136            TCL_INCL_DIR="`dirname $with_tclinclude`"
137        fi
138    else
139        if test -d "$with_tclinclude"
140        then
141            if test -r "$with_tclinclude/tcl.h"
142            then
143                TCL_INCL_DIR="$with_tclinclude"
144            else
145                if test -r "$with_tclinclude/tcl${TCL_LIB_VERSION}/tcl.h"
146                then
147                    TCL_INCL_DIR="$with_tclinclude/tcl${TCL_LIB_VERSION}"
148                else
149                    AC_MSG_RESULT([no])
150                    AC_MSG_ERROR([cannot find tcl.h, try using --with-tclinclude])
151                fi
152            fi
153        else
154            AC_MSG_RESULT([no])
155            AC_MSG_ERROR([cannot find tcl.h inside $with_tclinclude, try using --with-tclinclude])
156        fi
157    fi
158else
159    AC_CHECK_HEADERS([tcl.h], [],
160           [AC_MSG_ERROR([cannot find tcl.h, try using --with-tclinclude])])
161fi
162AC_MSG_RESULT([${TCL_INCL_DIR}])
163AC_SUBST(TCL_INCL_DIR)
164
165AC_ARG_WITH(
166    [rappture],
167    [AS_HELP_STRING([--with-rappture[=DIR]],
168        [location of rappture files lib/librappture2.a and include/rappture2/rappture2.h @<:@default=/usr@:>@])],
169    [with_rappture=$withval],
170    [with_rappture=/usr])
171
172RP2_INCL_DIR=""
173RP_DIR=""
174AC_MSG_CHECKING([for rappture])
175if test "x$with_rappture" != "x" ; then
176    if test "x$with_rappture" != "xprefix" ; then
177        if test -f "$with_rappture"
178        then
179            AC_MSG_RESULT([no])
180            AC_MSG_ERROR([please provide --with-rappture with directory])
181        else
182            if test -d "$with_rappture"
183            then
184                if test -r "$with_rappture/include/rappture2/rappture2.h" -a -r "$with_rappture/lib/librappture2.a"
185                then
186                    RP2_INCL_DIR="$with_rappture/include/rappture2"
187                    RP_DIR="$with_rappture"
188                    AC_MSG_RESULT([yes])
189                else
190                    AC_MSG_RESULT([no])
191                    AC_MSG_ERROR([cannot find rappture2.h and librappture2.a, try using --with-rappture])
192                fi
193            else
194                AC_MSG_RESULT([no])
195                AC_MSG_ERROR([cannot find rappture2.h and librappture2.a inside $with_rappture, try using --with-rappture])
196            fi
197        fi
198    else
199        RP2_INCL_DIR="$prefix/include/rappture2"
200        RP_DIR="$prefix"
201        AC_MSG_RESULT([set to prefix])
202    fi
203else
204    AC_CHECK_HEADERS([rappture.h], [],
205           [AC_MSG_ERROR([cannot find rappture.h, try using --with-rappture])])
206
207
208fi
209AC_MSG_RESULT([${RP_DIR}/include])
210AC_SUBST(RP2_INCL_DIR)
211AC_SUBST(RP_DIR)
212
213AC_CHECK_HEADER([GL/glui.h])
214AC_CHECK_HEADER([glui.h])
215AC_CHECK_HEADER([GL/glut.h])
216
217AC_MSG_CHECKING([for DX installation])
218DX_DIR=""
219for dir in \
220 /apps/rappture \
221 /usr/dx \
222 /usr
223do
224  if test -r "${dir}/include/dx/dx.h" ; then
225    DX_DIR="$dir"
226    break
227  fi
228done
229if test "x${DX_DIR}" = "x" ; then
230  AC_MSG_ERROR([can't find OpenDX installation])
231fi
232if test "${DX_DIR}" = "/usr" ; then
233  DX_DIR=""
234fi
235AC_SUBST(DX_DIR)
236AC_MSG_RESULT([${DX_DIR}])
237
238dnl AC_MSG_CHECKING(tcl library version)
239dnl TCL=`AC_TRY_RUN([#include <tcl.h>
240dnl         int main() {printf("tcl%s",TCL_VERSION);return(0);}],,
241dnl         echo "tcl8.4", echo "tcl8.4")`
242dnl AC_MSG_RESULT($TCL)
243dnl AC_MSG_CHECKING(tk library version)
244dnl TK=`AC_TRY_RUN([#include <tk.h>
245dnl         main() {printf("tk%s", TK_VERSION); exit(0);}],,
246dnl         echo "tk8.4", echo "tk8.4")`
247dnl AC_MSG_RESULT($TK)
248
249
250AC_OUTPUT(  Makefile \
251            nanoscale/Makefile \
252            nanovis/Makefile \
253            nanovis/newmat11/Makefile \
254            nanovis/R2/src/Makefile \
255            nanovis/imgLoaders/Makefile \
256            nanovis/transfer-function/Makefile \
257            pymolproxy/Makefile \
258            start_viz.sh    )
Note: See TracBrowser for help on using the repository browser.