source: trunk/vizservers/configure.in @ 750

Last change on this file since 750 was 749, checked in by dkearney, 17 years ago

moved vizservers directory to top level. added configure/makefiles to nanovis, nanoscale, pymolproxy all controlled by a configure script in
vizservers directory. to build you need to specify where rappture and tcl are installed. the start_viz.sh script was adjusted to copy the voronoi and
rappture libraries over to the tmp directory because these files tend to reside on an nfs mounted drive.

File size: 5.5 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_CXX
33AC_LANG_CPLUSPLUS
34
35SUBDIRS="nanoscale nanovis pymolproxy"
36AC_SUBST(SUBDIRS)
37
38AC_ARG_WITH(
39    [tcllib],
40    [AS_HELP_STRING([--with-tcllib[=DIR]],
41        [location of Tcl binary library libtclstubs.a @<:@default=/usr/lib@:>@])],
42    [with_tcllib=$withval],
43    [with_tcllib=/usr/lib])
44
45TCL_LIB_DIR=""
46TCL_LIB=""
47TCL_LIB_VERSION=""
48AC_MSG_CHECKING([for tcl binary libraries])
49if test "x$with_tcllib" != "x" ; then
50    if test -f "$with_tcllib"
51    then
52        if test -n `basename $with_tcllib | grep libtcl[0-9]\.[0-9].so`
53        then
54            TCL_LIB_DIR="$with_tcllib"
55        fi
56    else
57        if test -d "$with_tcllib"
58        then
59            if test -x "$with_tcllib/`ls $with_tcllib | grep libtcl[0-9]\.[0-9]\.so$`"
60            then
61                TCL_LIB_DIR="$with_tcllib"
62            else
63                AC_MSG_RESULT([no])
64                AC_MSG_ERROR([cannot find tcl binary libraries, try using --with-tcllib])
65            fi
66        else
67            AC_MSG_RESULT([no])
68            AC_MSG_ERROR([cannot find tcl binary libraries inside $with_tcllib, try using --with-tcllib])
69        fi
70    fi
71else
72    AC_CHECK_HEADERS([tcl.h], [],
73           [AC_MSG_ERROR([cannot find tcl.h, try using --with-tclinclude])])
74fi
75# TCL_LIB=$(ls ${TCL_LIB_DIR} | grep -o libtcl[0-9]\.[0-9])
76# TCL_LIB=`ls ${TCL_LIB_DIR} | awk '/libtcl([0-9]\.?[0-9])?\.so/ { print }'`
77# TCL_LIB=`ls ${TCL_LIB_DIR} | sed -e '/libtcl([0-9]\.?[0-9])?\.so$/ {p}'`
78# TCL_LIB_VERSION=$(echo ${TCL_LIB} | sed -e s/libtcl// -e s/\.so//)
79AC_MSG_RESULT([${TCL_LIB_DIR}/${TCL_LIB}])
80# echo TCL_LIB_DIR = ${TCL_LIB_DIR}
81# echo TCL_LIB = ${TCL_LIB}
82# echo TCL_LIB_VERSION = ${TCL_LIB_VERSION}
83AC_SUBST(TCL_LIB_DIR)
84AC_SUBST(TCL_LIB)
85AC_SUBST(TCL_LIB_VERSION)
86
87AC_ARG_WITH(
88    [tclinclude],
89    [AS_HELP_STRING([--with-tclinclude[=DIR]],
90        [location of tcl.h header file @<:@default=/usr/include@:>@])],
91    [with_tclinclude=$withval],
92    [with_tclinclude=/usr/include])
93
94TCL_INCL_DIR=""
95AC_MSG_CHECKING([for tcl.h])
96if test "x$with_tclinclude" != "x" ; then
97    if test -f "$with_tclinclude"
98    then
99        if test `basename $with_tclinclude` = "tcl.h"
100        then
101            TCL_INCL_DIR="`dirname $with_tclinclude`"
102        fi
103    else
104        if test -d "$with_tclinclude"
105        then
106            if test -r "$with_tclinclude/tcl.h"
107            then
108                TCL_INCL_DIR="$with_tclinclude"
109            else
110                if test -r "$with_tclinclude/tcl${TCL_LIB_VERSION}/tcl.h"
111                then
112                    TCL_INCL_DIR="$with_tclinclude/tcl${TCL_LIB_VERSION}"
113                else
114                    AC_MSG_RESULT([no])
115                    AC_MSG_ERROR([cannot find tcl.h, try using --with-tclinclude])
116                fi
117            fi
118        else
119            AC_MSG_RESULT([no])
120            AC_MSG_ERROR([cannot find tcl.h inside $with_tclinclude, try using --with-tclinclude])
121        fi
122    fi
123else
124    AC_CHECK_HEADERS([tcl.h], [],
125           [AC_MSG_ERROR([cannot find tcl.h, try using --with-tclinclude])])
126fi
127AC_MSG_RESULT([${TCL_INCL_DIR}])
128AC_SUBST(TCL_INCL_DIR)
129
130AC_ARG_WITH(
131    [rappture],
132    [AS_HELP_STRING([--with-rappture[=DIR]],
133        [location of rappture files lib/librappture2.a and include/rappture2/rappture2.h @<:@default=/usr@:>@])],
134    [with_rappture=$withval],
135    [with_rappture=/usr])
136
137RP2_INCL_DIR=""
138RP_DIR=""
139AC_MSG_CHECKING([for rappture])
140if test "x$with_rappture" != "x" ; then
141    if test -f "$with_rappture"
142    then
143        AC_MSG_RESULT([no])
144        AC_MSG_ERROR([please provide --with-rappture with directory])
145    else
146        if test -d "$with_rappture"
147        then
148            if test -r "$with_rappture/include/rappture2/rappture2.h" -a -r "$with_rappture/lib/librappture2.a"
149            then
150                RP2_INCL_DIR="$with_rappture/include/rappture2"
151                RP_DIR="$with_rappture"
152            else
153                AC_MSG_RESULT([no])
154                AC_MSG_ERROR([cannot find rappture2.h and librappture2.a, try using --with-rappture])
155            fi
156        else
157            AC_MSG_RESULT([no])
158            AC_MSG_ERROR([cannot find rappture2.h and librappture2.a inside $with_rappture, try using --with-rappture])
159        fi
160    fi
161else
162    AC_CHECK_HEADERS([rappture.h], [],
163           [AC_MSG_ERROR([cannot find rappture.h, try using --with-rappture])])
164fi
165AC_MSG_RESULT([${RP_DIR}/include])
166AC_SUBST(RP2_INCL_DIR)
167AC_SUBST(RP_DIR)
168
169dnl AC_MSG_CHECKING(tcl library version)
170dnl TCL=`AC_TRY_RUN([#include <tcl.h>
171dnl         int main() {printf("tcl%s",TCL_VERSION);return(0);}],,
172dnl         echo "tcl8.4", echo "tcl8.4")`
173dnl AC_MSG_RESULT($TCL)
174dnl AC_MSG_CHECKING(tk library version)
175dnl TK=`AC_TRY_RUN([#include <tk.h>
176dnl         main() {printf("tk%s", TK_VERSION); exit(0);}],,
177dnl         echo "tk8.4", echo "tk8.4")`
178dnl AC_MSG_RESULT($TK)
179
180
181AC_OUTPUT( Makefile nanoscale/Makefile nanovis/Makefile pymolproxy/Makefile start_viz.sh)
Note: See TracBrowser for help on using the repository browser.