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

Last change on this file since 1115 was 1115, checked in by gah, 16 years ago
File size: 5.0 KB
RevLine 
[749]1AC_INIT(vizservers, 0.1, rappture@nanohub.org)
[1115]2AC_CONFIG_HEADER(nanoscale/config.h)
[749]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
[1113]24SC_CONFIG_CFLAGS
[749]25
[1113]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
[749]34AC_PROG_INSTALL
[1111]35AC_PROG_RANLIB
36AC_PROG_LN_S
37AC_PROG_MKDIR_P
[749]38
39dnl find and test the C compiler
40AC_PROG_CC
[1113]41AC_PROG_CPP
42AC_PROG_CXXCPP
[749]43AC_PROG_CXX
44AC_LANG_CPLUSPLUS
45
[940]46AC_C_BIGENDIAN
47
[749]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],
[1114]56    [with_tcllib=""])
[749]57
[948]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
[1114]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
[1113]80    . $tclconfig
81    break
82  fi
83done
[1114]84TCL_INC_SPEC="$TCL_INCLUDE_SPEC"
[1113]85
[749]86if test "x$with_tcllib" != "x" ; then
[1114]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}"
[749]92fi
93if test "x$with_tclinclude" != "x" ; then
[1114]94   TCL_INC_SPEC="-I${with_tclinclude}"
[749]95fi
96
[1114]97AC_SUBST(TCL_VERSION)
98AC_SUBST(TCL_INC_SPEC)
99AC_SUBST(TCL_LIB_SPEC)
100
[749]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
[751]112    if test "x$with_rappture" != "xprefix" ; then
113        if test -f "$with_rappture"
[749]114        then
[751]115            AC_MSG_RESULT([no])
116            AC_MSG_ERROR([please provide --with-rappture with directory])
117        else
118            if test -d "$with_rappture"
[749]119            then
[751]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
[749]129            else
130                AC_MSG_RESULT([no])
[751]131                AC_MSG_ERROR([cannot find rappture2.h and librappture2.a inside $with_rappture, try using --with-rappture])
[749]132            fi
133        fi
[751]134    else
135        RP2_INCL_DIR="$prefix/include/rappture2"
136        RP_DIR="$prefix"
137        AC_MSG_RESULT([set to prefix])
[749]138    fi
139else
140    AC_CHECK_HEADERS([rappture.h], [],
141           [AC_MSG_ERROR([cannot find rappture.h, try using --with-rappture])])
[944]142
143
[749]144fi
145AC_MSG_RESULT([${RP_DIR}/include])
146AC_SUBST(RP2_INCL_DIR)
147AC_SUBST(RP_DIR)
148
[944]149AC_CHECK_HEADER([GL/glui.h])
150AC_CHECK_HEADER([glui.h])
151AC_CHECK_HEADER([GL/glut.h])
152
[1115]153AC_CHECK_HEADERS([stdio.h unistd.h stdlib.h string.h sys/types.h])
154AC_CHECK_HEADERS([sys/socket.h sys/time.h netinet/in.h arpa/inet.h netdb.h])
155
[944]156AC_MSG_CHECKING([for DX installation])
157DX_DIR=""
158for dir in \
159 /apps/rappture \
160 /usr/dx \
161 /usr
162do
163  if test -r "${dir}/include/dx/dx.h" ; then
164    DX_DIR="$dir"
165    break
166  fi
167done
168if test "x${DX_DIR}" = "x" ; then
169  AC_MSG_ERROR([can't find OpenDX installation])
170fi
171if test "${DX_DIR}" = "/usr" ; then
172  DX_DIR=""
173fi
174AC_SUBST(DX_DIR)
175AC_MSG_RESULT([${DX_DIR}])
176
[749]177dnl AC_MSG_CHECKING(tcl library version)
178dnl TCL=`AC_TRY_RUN([#include <tcl.h>
179dnl         int main() {printf("tcl%s",TCL_VERSION);return(0);}],,
180dnl         echo "tcl8.4", echo "tcl8.4")`
181dnl AC_MSG_RESULT($TCL)
182dnl AC_MSG_CHECKING(tk library version)
183dnl TK=`AC_TRY_RUN([#include <tk.h>
184dnl         main() {printf("tk%s", TK_VERSION); exit(0);}],,
185dnl         echo "tk8.4", echo "tk8.4")`
186dnl AC_MSG_RESULT($TK)
187
188
[760]189AC_OUTPUT(  Makefile \
190            nanoscale/Makefile \
191            nanovis/Makefile \
[914]192            nanovis/newmat11/Makefile \
193            nanovis/R2/src/Makefile \
[916]194            nanovis/imgLoaders/Makefile \
[940]195            nanovis/transfer-function/Makefile \
[760]196            pymolproxy/Makefile \
197            start_viz.sh    )
Note: See TracBrowser for help on using the repository browser.