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

Last change on this file since 1114 was 1114, checked in by gah, 14 years ago
File size: 4.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
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=""])
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
71TCL_VERSION="8.4"
72for dir in \
73 ${exec_prefix} \
74 ${exec_prefix}/lib \
75 ${with_rappture} \
76 ${with_rappture}/lib ; do
77  tclconfig="${dir}/tclConfig.sh"
78  if test -f "$tclconfig" ; then
79    . $tclconfig
80    break
81  fi
82done
83TCL_INC_SPEC="$TCL_INCLUDE_SPEC"
84
85if test "x$with_tcllib" != "x" ; then
86   tclconfig="${with_tcllib}/tclConfig.sh"
87   if test -f "$tclconfig" ; then
88    . $tclconfig
89   fi
90   TCL_LIB_SPEC="-L${with_tcllib} -ltcl${TCL_VERSION}"
91fi
92if test "x$with_tclinclude" != "x" ; then
93   TCL_INC_SPEC="-I${with_tclinclude}"
94fi
95
96AC_SUBST(TCL_VERSION)
97AC_SUBST(TCL_INC_SPEC)
98AC_SUBST(TCL_LIB_SPEC)
99
100AC_ARG_WITH(
101    [rappture],
102    [AS_HELP_STRING([--with-rappture[=DIR]],
103        [location of rappture files lib/librappture2.a and include/rappture2/rappture2.h @<:@default=/usr@:>@])],
104    [with_rappture=$withval],
105    [with_rappture=/usr])
106
107RP2_INCL_DIR=""
108RP_DIR=""
109AC_MSG_CHECKING([for rappture])
110if test "x$with_rappture" != "x" ; then
111    if test "x$with_rappture" != "xprefix" ; then
112        if test -f "$with_rappture"
113        then
114            AC_MSG_RESULT([no])
115            AC_MSG_ERROR([please provide --with-rappture with directory])
116        else
117            if test -d "$with_rappture"
118            then
119                if test -r "$with_rappture/include/rappture2/rappture2.h" -a -r "$with_rappture/lib/librappture2.a"
120                then
121                    RP2_INCL_DIR="$with_rappture/include/rappture2"
122                    RP_DIR="$with_rappture"
123                    AC_MSG_RESULT([yes])
124                else
125                    AC_MSG_RESULT([no])
126                    AC_MSG_ERROR([cannot find rappture2.h and librappture2.a, try using --with-rappture])
127                fi
128            else
129                AC_MSG_RESULT([no])
130                AC_MSG_ERROR([cannot find rappture2.h and librappture2.a inside $with_rappture, try using --with-rappture])
131            fi
132        fi
133    else
134        RP2_INCL_DIR="$prefix/include/rappture2"
135        RP_DIR="$prefix"
136        AC_MSG_RESULT([set to prefix])
137    fi
138else
139    AC_CHECK_HEADERS([rappture.h], [],
140           [AC_MSG_ERROR([cannot find rappture.h, try using --with-rappture])])
141
142
143fi
144AC_MSG_RESULT([${RP_DIR}/include])
145AC_SUBST(RP2_INCL_DIR)
146AC_SUBST(RP_DIR)
147
148AC_CHECK_HEADER([GL/glui.h])
149AC_CHECK_HEADER([glui.h])
150AC_CHECK_HEADER([GL/glut.h])
151
152AC_MSG_CHECKING([for DX installation])
153DX_DIR=""
154for dir in \
155 /apps/rappture \
156 /usr/dx \
157 /usr
158do
159  if test -r "${dir}/include/dx/dx.h" ; then
160    DX_DIR="$dir"
161    break
162  fi
163done
164if test "x${DX_DIR}" = "x" ; then
165  AC_MSG_ERROR([can't find OpenDX installation])
166fi
167if test "${DX_DIR}" = "/usr" ; then
168  DX_DIR=""
169fi
170AC_SUBST(DX_DIR)
171AC_MSG_RESULT([${DX_DIR}])
172
173dnl AC_MSG_CHECKING(tcl library version)
174dnl TCL=`AC_TRY_RUN([#include <tcl.h>
175dnl         int main() {printf("tcl%s",TCL_VERSION);return(0);}],,
176dnl         echo "tcl8.4", echo "tcl8.4")`
177dnl AC_MSG_RESULT($TCL)
178dnl AC_MSG_CHECKING(tk library version)
179dnl TK=`AC_TRY_RUN([#include <tk.h>
180dnl         main() {printf("tk%s", TK_VERSION); exit(0);}],,
181dnl         echo "tk8.4", echo "tk8.4")`
182dnl AC_MSG_RESULT($TK)
183
184
185AC_OUTPUT(  Makefile \
186            nanoscale/Makefile \
187            nanovis/Makefile \
188            nanovis/newmat11/Makefile \
189            nanovis/R2/src/Makefile \
190            nanovis/imgLoaders/Makefile \
191            nanovis/transfer-function/Makefile \
192            pymolproxy/Makefile \
193            start_viz.sh    )
Note: See TracBrowser for help on using the repository browser.