Ignore:
Timestamp:
Apr 8, 2011, 10:47:03 AM (13 years ago)
Author:
gah
Message:

fixes for vizservers build on render servers

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/packages/vizservers/configure.in

    r2111 r2198  
    22AC_INIT(vizservers, 0.1, rappture@nanohub.org)
    33AC_CONFIG_HEADER(nanovis/nvconf.h nanoscale/config.h)
     4
     5with_vtk="yes"
     6with_vtk_libs=""
     7with_vtk_includes=""
     8with_rappture=""
     9with_tcllib=""
     10with_rappture="yes"
    411
    512AC_ARG_WITH(
     
    1320    [rappture],
    1421    [AS_HELP_STRING([--with-rappture[=DIR]],
    15         [location of rappture files lib/librappture2.a and include/rappture2/rappture2.h @<:@default=/usr@:>@])],
     22        [location of rappture files lib/librappture.a and include/rappture.h @<:@default=/usr@:>@])],
    1623    [with_rappture=$withval],
    17     [with_rappture=/usr])
     24    [with_rappture=yes])
    1825
    1926AC_ARG_WITH(
     
    3138    [with_vtk_libs=/usr/lib/vtk-5.6])
    3239
     40AC_ARG_WITH(
     41    [vtk],
     42    [AS_HELP_STRING([--with-vtk=VERSION],
     43        [Version of VTK required])],
     44    [with_vtk=$withval],
     45    [with_vtk=yes])
     46
    3347VERSION=0.0.1
    34 AC_SUBST(VERSION)
    3548
    3649#------------------------------------------------------------------------
     
    4457    exec_prefix=$prefix
    4558fi
     59
     60if test "x${incdir}" == "x"; then
     61  incdir=${exec_prefix}/include
     62fi
     63libdir=${exec_prefix}/lib
    4664
    4765if test "${libdir}" != "${prefix}/lib"; then
     
    5371SC_CONFIG_CFLAGS
    5472
    55 AC_SUBST(CFLAGS_DEBUG)
    56 AC_SUBST(CFLAGS_OPTIMIZE)
    57 AC_SUBST(STLIB_LD)
    58 AC_SUBST(SHLIB_LD)
    59 AC_SUBST(SHLIB_CFLAGS)
    60 AC_SUBST(SHLIB_LDFLAGS)
    61 AC_SUBST(SHLIB_SUFFIX)
    6273
    6374AC_PATH_X
     
    8596# into bltHash.h for situtations where there's no bltInt.h.
    8697
    87 AC_SUBST(SIZEOF_INT, ${ac_cv_sizeof_int})
    88 AC_SUBST(SIZEOF_LONG, ${ac_cv_sizeof_long})
    89 AC_SUBST(SIZEOF_LONG_LONG, ${ac_cv_sizeof_long_long})
    90 AC_SUBST(SIZEOF_VOID_P, ${ac_cv_sizeof_void_p})
    91 AC_SUBST(SIZEOF_FLOAT, ${ac_cv_sizeof_float})
    9298
    9399LD_RPATH="";
    94 
    95 SUBDIRS="nanoscale nanovis pymolproxy vtkvis"
    96 AC_SUBST(SUBDIRS)
    97100
    98101#
     
    136139fi
    137140
    138 AC_SUBST(TCL_VERSION)
    139 AC_SUBST(TCL_INC_SPEC)
    140 AC_SUBST(TCL_LIB_SPEC)
    141 
    142141RP2_INCL_DIR=""
    143142RP_DIR=""
    144143AC_MSG_CHECKING([for rappture])
    145 if test "x$with_rappture" != "x" ; then
    146     if test "x$with_rappture" != "xprefix" ; then
    147         if test -f "$with_rappture"
    148         then
    149             AC_MSG_RESULT([no])
    150             AC_MSG_ERROR([please provide --with-rappture with directory])
    151         else
    152             if test -d "$with_rappture"
    153             then
    154                 if test -r "$with_rappture/include/rappture2/rappture2.h" -a -r "$with_rappture/lib/librappture2.a"
    155                 then
    156                     RP2_INCL_DIR="$with_rappture/include/rappture2"
    157                     RP_DIR="$with_rappture"
    158                     AC_MSG_RESULT([yes])
    159                 else
    160                     AC_MSG_RESULT([no])
    161                     AC_MSG_ERROR([cannot find rappture2.h and librappture2.a, try using --with-rappture])
    162                 fi
    163             else
    164                 AC_MSG_RESULT([no])
    165                 AC_MSG_ERROR([cannot find rappture2.h and librappture2.a inside $with_rappture, try using --with-rappture])
    166             fi
    167         fi
    168     else
    169         RP2_INCL_DIR="$prefix/include/rappture2"
    170         RP_DIR="$prefix"
    171         AC_MSG_RESULT([set to prefix])
     144if test "$with_rappture" == "yes" ; then
     145  for dir in "$exec_prefix" "/usr" ; do
     146    if test -r "$dir/include/rappture2/rappture2.h" -a \
     147     -r "$dir/lib/librappture.a"; then
     148      RP_INCL_SPEC="-I$dir/include"
     149      RP_DIR="$dir"
     150      RP_LIB_DIR="$dir/lib"
     151      AC_MSG_RESULT([$dir])
     152      break
    172153    fi
     154  done
    173155else
    174     AC_CHECK_HEADERS([rappture.h], [],
    175            [AC_MSG_ERROR([cannot find rappture.h, try using --with-rappture])])
    176 
    177 
    178 fi
    179 AC_MSG_RESULT([${RP_DIR}/include])
    180 AC_SUBST(RP2_INCL_DIR)
    181 AC_SUBST(RP_DIR)
     156  if test -d "$with_rappture" ; then
     157    AC_MSG_ERROR([--with-rappture: no such directory $with_rappture])
     158  fi
     159  RP_LIB=$with_rappture
     160  RP_INCL_SPEC="-I$with_rappture/include"
     161  RP_LIB_DIR="$with_rappture/lib"
     162fi
     163if test "x${RP_DIR}" = "x" ; then
     164  AC_MSG_ERROR([cannot find rappture.h and librappture2.a, try using --with-rappture])
     165else
     166  AC_MSG_RESULT([$with_rappture])
     167fi
     168
     169dnl Prefer our VTK installation over systems. --with-vtk overrides.
     170if test "$with_vtk" != "no" ; then
     171  if test "$with_vtk" = "yes" ; then
     172    for dir in vtk-5.{9,8,7,6,5,4,3,2,1} ; do
     173      if test -d "${libdir}/$dir" -a -d "${incdir}/$dir"; then
     174        VTK_LIB_SPEC="-L${libdir}/$dir"
     175        VTK_LIB_DIR="${libdir}/$dir"
     176        VTK_INC_SPEC="-I${incdir}/$dir"
     177        break
     178      fi
     179      if test -d "/usr/lib/$dir" -a -d "/usr/include/$dir"; then
     180        VTK_LIB_SPEC=-L/usr/lib/$dir
     181        VTK_LIB_DIR=/usr/lib/$dir
     182        VTK_INC_SPEC=-I/usr/include/$dir
     183        break
     184      fi
     185    done
     186  fi
     187fi
    182188
    183189if test "x$with_vtk_includes" != "x"; then
    184190   VTK_INC_SPEC=-I$with_vtk_includes
     191fi
     192
     193if test "x$with_vtk_libs" != "x"; then
     194   VTK_LIB_DIR=$with_vtk_libs
    185195fi
    186196
     
    190200CPPFLAGS=$save_CPPFLAGS
    191201
    192 if test "x$with_vtk_libs" != "x"; then
    193    VTK_LIB_DIR=$with_vtk_libs
    194 fi
    195 
    196 AC_SUBST(VTK_INC_SPEC)
    197 AC_SUBST(VTK_LIB_DIR)
    198 
    199202AC_CHECK_HEADER([GL/glui.h])
    200203AC_CHECK_HEADER([glui.h])
    201204AC_CHECK_HEADER([GL/glut.h])
    202205AC_CHECK_HEADER([GL/glew.h])
    203 AC_CHECK_HEADER([Cg/cgGL.h])
    204206
    205207AC_CHECK_HEADERS([stdio.h unistd.h stdlib.h string.h sys/types.h])
     
    219221done
    220222if test "x${DX_INC_DIR}" = "x" ; then
    221   AC_MSG_ERROR([can't find OpenDX include files])
     223  AC_MSG_ERROR([cannot find OpenDX include files])
    222224fi
    223225
     
    227229  DX_INC_SPEC="-I{DX_INC_DIR}"
    228230fi
    229 AC_SUBST(DX_INC_SPEC)
    230231AC_MSG_RESULT([${DX_INC_DIR}])
    231232
     
    251252done
    252253if test "x{$DX_LIB_DIR}" = "x" ; then
    253   AC_MSG_ERROR([cant find OpenDX libraries])
     254  AC_MSG_ERROR([cannot find OpenDX libraries])
    254255fi
    255256
     
    261262fi
    262263AC_MSG_RESULT([$DX_LIB_SPEC])
    263 AC_SUBST(DX_LIB_SPEC)
    264264
    265265AC_CHECK_HEADERS([opencv/cv.h opencv/highgui.h])
     
    272272  FF_INC_SPEC="-I/usr/include/ffmpeg"
    273273fi
    274 AC_SUBST(FF_INC_SPEC)
    275274
    276275AC_CHECK_HEADERS([ffmpeg/avcodec.h libavcodec/avcodec.h ffmpeg/avformat.h libavformat/avformat.h ffmpeg/avutil.h libavutil/avutil.h],,,[
     
    294293AC_CHECK_FUNCS([img_convert])
    295294
     295
    296296AC_MSG_CHECKING([for nVidia Cg installation])
    297297CG_DIR=""
     
    301301 /usr
    302302do
    303   if test -r "${dir}/include/Cg/cgGL.h" ; then
    304     CG_DIR="$dir"
     303  if test -r "$dir/include" ; then
     304    CG_DIR=$dir
    305305    break
    306306  fi
    307307done
    308 if test "x${CG_DIR}" = "x" ; then
    309   AC_MSG_ERROR([can't find nVidia Cg installation])
    310 fi
    311 
    312 if test "${CG_DIR}" = "/usr" ; then
     308AC_MSG_RESULT([${CG_DIR}])
     309
     310CG_INC_DIR="$dir/include"
     311CG_LIB_DIR="$dir/lib"
     312
     313echo CGDIR=$CG_DIR
     314save_CPPFLAGS=$CPPFLAGS
     315CPPFLAGS="-I${CG_INC_DIR} $CPPFLAGS"
     316AC_CHECK_HEADERS([Cg/cgGL.h], [], AC_MSG_ERROR([cannot find nVidia Cg headers]))
     317CPPFLAGS=$save_CPPFLAGS
     318
     319 if test "${CG_DIR}" = "/usr" ; then
    313320  CG_DIR=""
    314321else
    315   LD_RPATH="$loader_run_path:${CG_DIR}/lib"
    316 fi
    317 
     322  LD_RPATH="$loader_run_path:${CG_LIB_DIR}"
     323fi
     324
     325SUBDIRS="nanoscale nanovis pymolproxy vtkvis"
     326
     327AC_SUBST(CFLAGS_DEBUG)
     328AC_SUBST(CFLAGS_OPTIMIZE)
    318329AC_SUBST(CG_DIR)
    319 AC_MSG_RESULT([${CG_DIR}])
     330AC_SUBST(CG_INC_DIR)
     331AC_SUBST(CG_LIB_DIR)
     332AC_SUBST(DX_INC_SPEC)
     333AC_SUBST(DX_LIB_SPEC)
     334AC_SUBST(FF_INC_SPEC)
    320335AC_SUBST(LD_RPATH)
    321 
    322 dnl AC_MSG_CHECKING(tcl library version)
    323 dnl TCL=`AC_TRY_RUN([#include <tcl.h>
    324 dnl         int main() {printf("tcl%s",TCL_VERSION);return(0);}],,
    325 dnl         echo "tcl8.4", echo "tcl8.4")`
    326 dnl AC_MSG_RESULT($TCL)
    327 dnl AC_MSG_CHECKING(tk library version)
    328 dnl TK=`AC_TRY_RUN([#include <tk.h>
    329 dnl         main() {printf("tk%s", TK_VERSION); exit(0);}],,
    330 dnl         echo "tk8.4", echo "tk8.4")`
    331 dnl AC_MSG_RESULT($TK)
    332 
    333 
    334 AC_OUTPUT(  Makefile \
    335             nanoscale/Makefile \
    336             nanovis/Makefile \
    337             nanovis/newmat11/Makefile \
    338             nanovis/R2/src/Makefile \
    339             nanovis/vrutil/Makefile \
    340             nanovis/vrmath/Makefile \
    341             nanovis/vr3d/Makefile \
    342             nanovis/imgLoaders/Makefile \
    343             nanovis/transfer-function/Makefile \
    344             pymolproxy/Makefile \
    345             vtkvis/Doxyfile \
    346             vtkvis/Makefile \
    347             start_viz.sh    )
     336AC_SUBST(RP_DIR)
     337AC_SUBST(RP_INC_SPEC)
     338AC_SUBST(RP_LIB_DIR)
     339AC_SUBST(SHLIB_CFLAGS)
     340AC_SUBST(SHLIB_LD)
     341AC_SUBST(SHLIB_LDFLAGS)
     342AC_SUBST(SHLIB_SUFFIX)
     343AC_SUBST(SIZEOF_FLOAT)
     344AC_SUBST(SIZEOF_INT)
     345AC_SUBST(SIZEOF_LONG)
     346AC_SUBST(SIZEOF_LONG_LONG)
     347AC_SUBST(SIZEOF_VOID_P)
     348AC_SUBST(STLIB_LD)
     349AC_SUBST(SUBDIRS)
     350AC_SUBST(TCL_INC_SPEC)
     351AC_SUBST(TCL_LIB_SPEC)
     352AC_SUBST(TCL_VERSION)
     353AC_SUBST(VERSION)
     354AC_SUBST(VTK_INC_SPEC)
     355AC_SUBST(VTK_LIB_DIR)
     356
     357AC_OUTPUT([
     358  Makefile \
     359   nanoscale/Makefile \
     360   nanovis/Makefile \
     361   nanovis/newmat11/Makefile \
     362   nanovis/R2/src/Makefile \
     363   nanovis/vrutil/Makefile \
     364   nanovis/vrmath/Makefile \
     365   nanovis/vr3d/Makefile \
     366   nanovis/imgLoaders/Makefile \
     367   nanovis/transfer-function/Makefile \
     368   pymolproxy/Makefile \
     369   vtkvis/Doxyfile \
     370   vtkvis/Makefile \
     371   start_viz.sh])
     372 
Note: See TracChangeset for help on using the changeset viewer.