source: trunk/vizservers/configure.in @ 944

Last change on this file since 944 was 944, checked in by gah, 15 years ago
File size: 6.4 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_MAKE_SET
27
28dnl find and test the C compiler
29AC_PROG_CC
30AC_LANG_C
31
32AC_PROG_RANLIB
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
49TCL_LIB_DIR=""
50TCL_LIB=""
51TCL_LIB_VERSION=""
52AC_MSG_CHECKING([for tcl binary libraries])
53if test "x$with_tcllib" != "x" ; then
54    if test -f "$with_tcllib"
55    then
56        if test -n `basename $with_tcllib | grep libtcl[0-9]\.[0-9].so`
57        then
58            TCL_LIB_DIR="$with_tcllib"
59        fi
60    else
61        if test -d "$with_tcllib"
62        then
63            if test -x "$with_tcllib/`ls $with_tcllib | grep libtcl[0-9]\.[0-9]\.so$`"
64            then
65                TCL_LIB_DIR="$with_tcllib"
66            else
67                AC_MSG_RESULT([no])
68                AC_MSG_ERROR([cannot find tcl binary libraries, try using --with-tcllib])
69            fi
70        else
71            AC_MSG_RESULT([no])
72            AC_MSG_ERROR([cannot find tcl binary libraries inside $with_tcllib, try using --with-tcllib])
73        fi
74    fi
75else
76    AC_CHECK_HEADERS([tcl.h], [],
77           [AC_MSG_ERROR([cannot find tcl.h, try using --with-tclinclude])])
78fi
79# TCL_LIB=$(ls ${TCL_LIB_DIR} | grep -o libtcl[0-9]\.[0-9])
80# TCL_LIB=`ls ${TCL_LIB_DIR} | awk '/libtcl([0-9]\.?[0-9])?\.so/ { print }'`
81# TCL_LIB=`ls ${TCL_LIB_DIR} | sed -e '/libtcl([0-9]\.?[0-9])?\.so$/ {p}'`
82# TCL_LIB_VERSION=$(echo ${TCL_LIB} | sed -e s/libtcl// -e s/\.so//)
83AC_MSG_RESULT([${TCL_LIB_DIR}/${TCL_LIB}])
84# echo TCL_LIB_DIR = ${TCL_LIB_DIR}
85# echo TCL_LIB = ${TCL_LIB}
86# echo TCL_LIB_VERSION = ${TCL_LIB_VERSION}
87AC_SUBST(TCL_LIB_DIR)
88AC_SUBST(TCL_LIB)
89AC_SUBST(TCL_LIB_VERSION)
90
91AC_ARG_WITH(
92    [tclinclude],
93    [AS_HELP_STRING([--with-tclinclude[=DIR]],
94        [location of tcl.h header file @<:@default=/usr/include@:>@])],
95    [with_tclinclude=$withval],
96    [with_tclinclude=/usr/include])
97
98TCL_INCL_DIR=""
99AC_MSG_CHECKING([for tcl.h])
100if test "x$with_tclinclude" != "x" ; then
101    if test -f "$with_tclinclude"
102    then
103        if test `basename $with_tclinclude` = "tcl.h"
104        then
105            TCL_INCL_DIR="`dirname $with_tclinclude`"
106        fi
107    else
108        if test -d "$with_tclinclude"
109        then
110            if test -r "$with_tclinclude/tcl.h"
111            then
112                TCL_INCL_DIR="$with_tclinclude"
113            else
114                if test -r "$with_tclinclude/tcl${TCL_LIB_VERSION}/tcl.h"
115                then
116                    TCL_INCL_DIR="$with_tclinclude/tcl${TCL_LIB_VERSION}"
117                else
118                    AC_MSG_RESULT([no])
119                    AC_MSG_ERROR([cannot find tcl.h, try using --with-tclinclude])
120                fi
121            fi
122        else
123            AC_MSG_RESULT([no])
124            AC_MSG_ERROR([cannot find tcl.h inside $with_tclinclude, try using --with-tclinclude])
125        fi
126    fi
127else
128    AC_CHECK_HEADERS([tcl.h], [],
129           [AC_MSG_ERROR([cannot find tcl.h, try using --with-tclinclude])])
130fi
131AC_MSG_RESULT([${TCL_INCL_DIR}])
132AC_SUBST(TCL_INCL_DIR)
133
134AC_ARG_WITH(
135    [rappture],
136    [AS_HELP_STRING([--with-rappture[=DIR]],
137        [location of rappture files lib/librappture2.a and include/rappture2/rappture2.h @<:@default=/usr@:>@])],
138    [with_rappture=$withval],
139    [with_rappture=/usr])
140
141RP2_INCL_DIR=""
142RP_DIR=""
143AC_MSG_CHECKING([for rappture])
144if test "x$with_rappture" != "x" ; then
145    if test "x$with_rappture" != "xprefix" ; then
146        if test -f "$with_rappture"
147        then
148            AC_MSG_RESULT([no])
149            AC_MSG_ERROR([please provide --with-rappture with directory])
150        else
151            if test -d "$with_rappture"
152            then
153                if test -r "$with_rappture/include/rappture2/rappture2.h" -a -r "$with_rappture/lib/librappture2.a"
154                then
155                    RP2_INCL_DIR="$with_rappture/include/rappture2"
156                    RP_DIR="$with_rappture"
157                    AC_MSG_RESULT([yes])
158                else
159                    AC_MSG_RESULT([no])
160                    AC_MSG_ERROR([cannot find rappture2.h and librappture2.a, try using --with-rappture])
161                fi
162            else
163                AC_MSG_RESULT([no])
164                AC_MSG_ERROR([cannot find rappture2.h and librappture2.a inside $with_rappture, try using --with-rappture])
165            fi
166        fi
167    else
168        RP2_INCL_DIR="$prefix/include/rappture2"
169        RP_DIR="$prefix"
170        AC_MSG_RESULT([set to prefix])
171    fi
172else
173    AC_CHECK_HEADERS([rappture.h], [],
174           [AC_MSG_ERROR([cannot find rappture.h, try using --with-rappture])])
175
176
177fi
178AC_MSG_RESULT([${RP_DIR}/include])
179AC_SUBST(RP2_INCL_DIR)
180AC_SUBST(RP_DIR)
181
182AC_CHECK_HEADER([GL/glui.h])
183AC_CHECK_HEADER([glui.h])
184AC_CHECK_HEADER([GL/glut.h])
185
186AC_MSG_CHECKING([for DX installation])
187DX_DIR=""
188for dir in \
189 /apps/rappture \
190 /usr/dx \
191 /usr
192do
193  if test -r "${dir}/include/dx/dx.h" ; then
194    DX_DIR="$dir"
195    break
196  fi
197done
198if test "x${DX_DIR}" = "x" ; then
199  AC_MSG_ERROR([can't find OpenDX installation])
200fi
201if test "${DX_DIR}" = "/usr" ; then
202  DX_DIR=""
203fi
204AC_SUBST(DX_DIR)
205AC_MSG_RESULT([${DX_DIR}])
206
207dnl AC_MSG_CHECKING(tcl library version)
208dnl TCL=`AC_TRY_RUN([#include <tcl.h>
209dnl         int main() {printf("tcl%s",TCL_VERSION);return(0);}],,
210dnl         echo "tcl8.4", echo "tcl8.4")`
211dnl AC_MSG_RESULT($TCL)
212dnl AC_MSG_CHECKING(tk library version)
213dnl TK=`AC_TRY_RUN([#include <tk.h>
214dnl         main() {printf("tk%s", TK_VERSION); exit(0);}],,
215dnl         echo "tk8.4", echo "tk8.4")`
216dnl AC_MSG_RESULT($TK)
217
218
219AC_OUTPUT(  Makefile \
220            nanoscale/Makefile \
221            nanovis/Makefile \
222            nanovis/newmat11/Makefile \
223            nanovis/R2/src/Makefile \
224            nanovis/imgLoaders/Makefile \
225            nanovis/transfer-function/Makefile \
226            pymolproxy/Makefile \
227            start_viz.sh    )
Note: See TracBrowser for help on using the repository browser.