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

Last change on this file since 1120 was 1120, checked in by gah, 14 years ago
File size: 5.1 KB
Line 
1AC_INIT(vizservers, 0.1, rappture@nanohub.org)
2AC_CONFIG_HEADER(nanoscale/config.h)
3
4VERSION=0.0.1
5AC_SUBST(VERSION)
6
7#------------------------------------------------------------------------
8# Handle the --prefix=... option
9#------------------------------------------------------------------------
10
11if test "${prefix}" = "NONE"; then
12    prefix=/usr/local
13fi
14if test "${exec_prefix}" = "NONE"; then
15    exec_prefix=$prefix
16fi
17
18if test "${libdir}" != "${prefix}/lib"; then
19    LIB_SEARCH_DIRS="-L ${prefix}/lib -L ${libdir}"
20else
21    LIB_SEARCH_DIRS="-L ${libdir}"
22fi
23
24SC_CONFIG_CFLAGS
25
26AC_SUBST(CFLAGS_DEBUG)
27AC_SUBST(CFLAGS_OPTIMIZE)
28AC_SUBST(STLIB_LD)
29AC_SUBST(SHLIB_LD)
30AC_SUBST(SHLIB_CFLAGS)
31AC_SUBST(SHLIB_LDFLAGS)
32AC_SUBST(SHLIB_SUFFIX)
33
34AC_PROG_INSTALL
35AC_PROG_RANLIB
36AC_PROG_LN_S
37AC_PROG_MKDIR_P
38
39dnl find and test the C compiler
40AC_PROG_CC
41AC_PROG_CPP
42AC_PROG_CXXCPP
43AC_PROG_CXX
44AC_LANG_CPLUSPLUS
45
46AC_C_BIGENDIAN
47
48SUBDIRS="nanoscale nanovis pymolproxy"
49AC_SUBST(SUBDIRS)
50
51AC_ARG_WITH(
52    [tcllib],
53    [AS_HELP_STRING([--with-tcllib[=DIR]],
54        [location of Tcl binary library libtclstubs.a @<:@default=/usr/lib@:>@])],
55    [with_tcllib=$withval],
56    [with_tcllib=""])
57
58#
59# Need to check for the following dependencies:
60#       Rappture headers and library (done)
61#       Tcl headers and library (done)
62#       GL headers and library
63#       GLuT headers and library
64#       GLui header and library
65#       GLEW header and library
66#       Cg headers and library
67#       CgGL headers and library
68#       pthread library
69#       DX headers and library (done, sort of)
70#
71
72TCL_VERSION="8.4"
73for dir in \
74 ${exec_prefix} \
75 ${exec_prefix}/lib \
76 ${with_rappture} \
77 ${with_rappture}/lib ; do
78  tclconfig="${dir}/tclConfig.sh"
79  if test -f "$tclconfig" ; then
80    . $tclconfig
81    break
82  fi
83done
84TCL_INC_SPEC="$TCL_INCLUDE_SPEC"
85
86if test "x$with_tcllib" != "x" ; then
87   tclconfig="${with_tcllib}/tclConfig.sh"
88   if test -f "$tclconfig" ; then
89    . $tclconfig
90   fi
91   TCL_LIB_SPEC="-L${with_tcllib} -ltcl${TCL_VERSION}"
92fi
93if test "x$with_tclinclude" != "x" ; then
94   TCL_INC_SPEC="-I${with_tclinclude}"
95fi
96
97AC_SUBST(TCL_VERSION)
98AC_SUBST(TCL_INC_SPEC)
99AC_SUBST(TCL_LIB_SPEC)
100
101AC_ARG_WITH(
102    [rappture],
103    [AS_HELP_STRING([--with-rappture[=DIR]],
104        [location of rappture files lib/librappture2.a and include/rappture2/rappture2.h @<:@default=/usr@:>@])],
105    [with_rappture=$withval],
106    [with_rappture=/usr])
107
108RP2_INCL_DIR=""
109RP_DIR=""
110AC_MSG_CHECKING([for rappture])
111if test "x$with_rappture" != "x" ; then
112    if test "x$with_rappture" != "xprefix" ; then
113        if test -f "$with_rappture"
114        then
115            AC_MSG_RESULT([no])
116            AC_MSG_ERROR([please provide --with-rappture with directory])
117        else
118            if test -d "$with_rappture"
119            then
120                if test -r "$with_rappture/include/rappture2/rappture2.h" -a -r "$with_rappture/lib/librappture2.a"
121                then
122                    RP2_INCL_DIR="$with_rappture/include/rappture2"
123                    RP_DIR="$with_rappture"
124                    AC_MSG_RESULT([yes])
125                else
126                    AC_MSG_RESULT([no])
127                    AC_MSG_ERROR([cannot find rappture2.h and librappture2.a, try using --with-rappture])
128                fi
129            else
130                AC_MSG_RESULT([no])
131                AC_MSG_ERROR([cannot find rappture2.h and librappture2.a inside $with_rappture, try using --with-rappture])
132            fi
133        fi
134    else
135        RP2_INCL_DIR="$prefix/include/rappture2"
136        RP_DIR="$prefix"
137        AC_MSG_RESULT([set to prefix])
138    fi
139else
140    AC_CHECK_HEADERS([rappture.h], [],
141           [AC_MSG_ERROR([cannot find rappture.h, try using --with-rappture])])
142
143
144fi
145AC_MSG_RESULT([${RP_DIR}/include])
146AC_SUBST(RP2_INCL_DIR)
147AC_SUBST(RP_DIR)
148
149AC_CHECK_HEADER([GL/glui.h])
150AC_CHECK_HEADER([glui.h])
151AC_CHECK_HEADER([GL/glut.h])
152AC_CHECK_HEADER([GL/glew.h])
153
154AC_CHECK_HEADERS([stdio.h unistd.h stdlib.h string.h sys/types.h])
155AC_CHECK_HEADERS([sys/socket.h sys/time.h netinet/in.h arpa/inet.h netdb.h])
156
157AC_MSG_CHECKING([for DX installation])
158DX_DIR=""
159for dir in \
160 /apps/rappture \
161 /usr/dx \
162 /usr
163do
164  if test -r "${dir}/include/dx/dx.h" ; then
165    DX_DIR="$dir"
166    break
167  fi
168done
169if test "x${DX_DIR}" = "x" ; then
170  AC_MSG_ERROR([can't find OpenDX installation])
171fi
172if test "${DX_DIR}" = "/usr" ; then
173  DX_DIR=""
174fi
175AC_SUBST(DX_DIR)
176AC_MSG_RESULT([${DX_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            nanovis/imgLoaders/Makefile \
196            nanovis/transfer-function/Makefile \
197            pymolproxy/Makefile \
198            start_viz.sh    )
Note: See TracBrowser for help on using the repository browser.