source: trunk/vizservers/configure.in @ 914

Last change on this file since 914 was 914, checked in by gah, 16 years ago

fixes to configure.in

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