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