1 | AC_PREREQ([2.60]) |
---|
2 | AC_INIT(geovis, 0.4, rappture@nanohub.org) |
---|
3 | AC_CONFIG_AUX_DIR(cf) |
---|
4 | |
---|
5 | AC_ARG_WITH( |
---|
6 | [tcllib], |
---|
7 | [AS_HELP_STRING([--with-tcllib[=DIR]], |
---|
8 | [location of Tcl binary library libtclstubs.a @<:@default=/usr/lib@:>@])], |
---|
9 | [with_tcllib=$withval], |
---|
10 | [with_tcllib=""]) |
---|
11 | |
---|
12 | AC_ARG_WITH( |
---|
13 | [osg-includes], |
---|
14 | [AS_HELP_STRING([--with-osg-includes=DIR], |
---|
15 | [OSG include files are in DIR])], |
---|
16 | [with_osg_includes=$withval], |
---|
17 | [with_osg_includes=""]) |
---|
18 | |
---|
19 | AC_ARG_WITH( |
---|
20 | [osg-libs], |
---|
21 | [AS_HELP_STRING([--with-osg-libs=DIR], |
---|
22 | [OSG libraries are in DIR])], |
---|
23 | [with_osg_libs=$withval], |
---|
24 | [with_osg_libs=""]) |
---|
25 | |
---|
26 | AC_ARG_WITH( |
---|
27 | [statsdir], |
---|
28 | [AS_HELP_STRING([--with-statsdir=DIR], |
---|
29 | [Write statistics in DIR])], |
---|
30 | [STATSDIR=$withval], |
---|
31 | [STATSDIR="/var/tmp/visservers"]) |
---|
32 | |
---|
33 | #------------------------------------------------------------------------ |
---|
34 | # Handle the --prefix=... option |
---|
35 | #------------------------------------------------------------------------ |
---|
36 | |
---|
37 | if test "${prefix}" = "NONE"; then |
---|
38 | prefix=/usr/local |
---|
39 | fi |
---|
40 | if test "${exec_prefix}" = "NONE"; then |
---|
41 | exec_prefix=$prefix |
---|
42 | fi |
---|
43 | |
---|
44 | if test "x${incdir}" == "x"; then |
---|
45 | incdir=${exec_prefix}/include |
---|
46 | fi |
---|
47 | libdir=${exec_prefix}/lib |
---|
48 | |
---|
49 | if test "${libdir}" != "${prefix}/lib"; then |
---|
50 | LIB_SEARCH_DIRS="-L ${prefix}/lib -L ${libdir}" |
---|
51 | else |
---|
52 | LIB_SEARCH_DIRS="-L ${libdir}" |
---|
53 | fi |
---|
54 | |
---|
55 | AC_PROG_INSTALL |
---|
56 | AC_PROG_RANLIB |
---|
57 | AC_PROG_LN_S |
---|
58 | AC_PROG_MKDIR_P |
---|
59 | |
---|
60 | dnl find and test the C compiler |
---|
61 | AC_PROG_CC |
---|
62 | AC_PROG_CPP |
---|
63 | AC_PROG_CXXCPP |
---|
64 | AC_PROG_CXX |
---|
65 | AC_LANG_CPLUSPLUS |
---|
66 | |
---|
67 | # |
---|
68 | # Need to check for the following dependencies: |
---|
69 | # Tcl headers and library |
---|
70 | # GL headers and library |
---|
71 | # pthread library |
---|
72 | # OpenSceneGraph libraries |
---|
73 | # osgEarth libraries |
---|
74 | # |
---|
75 | |
---|
76 | TCL_VERSION="8.4" |
---|
77 | for dir in \ |
---|
78 | ${exec_prefix} \ |
---|
79 | ${exec_prefix}/lib ; do |
---|
80 | tclconfig="${dir}/tclConfig.sh" |
---|
81 | if test -f "$tclconfig" ; then |
---|
82 | . $tclconfig |
---|
83 | break |
---|
84 | fi |
---|
85 | done |
---|
86 | TCL_INC_SPEC="$TCL_INCLUDE_SPEC" |
---|
87 | |
---|
88 | if test "x$with_tcllib" != "x" ; then |
---|
89 | tclconfig="${with_tcllib}/tclConfig.sh" |
---|
90 | if test -f "$tclconfig" ; then |
---|
91 | . $tclconfig |
---|
92 | fi |
---|
93 | TCL_LIB_SPEC="-L${with_tcllib} -ltcl${TCL_VERSION}" |
---|
94 | fi |
---|
95 | if test "x$with_tclinclude" != "x" ; then |
---|
96 | TCL_INC_SPEC="-I${with_tclinclude}" |
---|
97 | fi |
---|
98 | |
---|
99 | OSG_INC_SPEC=-I${incdir} |
---|
100 | OSG_LIB_DIR=${libdir} |
---|
101 | OSG_LIB_SPEC="-L${libdir}" |
---|
102 | |
---|
103 | if test "x$with_osg_includes" != "x"; then |
---|
104 | OSG_INC_SPEC=-I$with_osg_includes |
---|
105 | fi |
---|
106 | |
---|
107 | if test "x$with_osg_libs" != "x"; then |
---|
108 | OSG_LIB_DIR=$with_osg_libs |
---|
109 | OSG_LIB_SPEC="-L$with_osg_libs" |
---|
110 | fi |
---|
111 | |
---|
112 | AC_CHECK_HEADERS([stdio.h unistd.h stdlib.h string.h sys/types.h]) |
---|
113 | AC_CHECK_HEADERS([sys/socket.h sys/time.h netinet/in.h arpa/inet.h netdb.h]) |
---|
114 | |
---|
115 | AC_CHECK_FUNCS([accept4]) |
---|
116 | |
---|
117 | AC_SUBST(STATSDIR) |
---|
118 | AC_SUBST(TCL_INC_SPEC) |
---|
119 | AC_SUBST(TCL_LIB_SPEC) |
---|
120 | AC_SUBST(TCL_VERSION) |
---|
121 | AC_SUBST(OSG_INC_SPEC) |
---|
122 | AC_SUBST(OSG_LIB_DIR) |
---|
123 | AC_SUBST(OSG_LIB_SPEC) |
---|
124 | |
---|
125 | AC_OUTPUT([Makefile]) |
---|