1 | |
---|
2 | AC_INIT([RapptureGUI],[1.3],[rappture@nanohub.org]) |
---|
3 | AC_CONFIG_AUX_DIR(cf) |
---|
4 | #------------------------------------------------------------------------ |
---|
5 | # Handle the --prefix=... option |
---|
6 | #------------------------------------------------------------------------ |
---|
7 | |
---|
8 | if test "${prefix}" = "NONE"; then |
---|
9 | prefix=/usr/local |
---|
10 | fi |
---|
11 | if test "${exec_prefix}" = "NONE"; then |
---|
12 | exec_prefix=$prefix |
---|
13 | fi |
---|
14 | |
---|
15 | if test "${libdir}" != "${prefix}/lib"; then |
---|
16 | LIB_SEARCH_DIRS="-L${prefix}/lib -L${libdir}" |
---|
17 | else |
---|
18 | LIB_SEARCH_DIRS="-L${libdir}" |
---|
19 | fi |
---|
20 | AC_CANONICAL_TARGET |
---|
21 | AC_SUBST(LIB_SEARCH_DIRS) |
---|
22 | |
---|
23 | AC_PROG_INSTALL |
---|
24 | AC_PROG_INSTALL |
---|
25 | AC_PROG_RANLIB |
---|
26 | AC_PROG_LN_S |
---|
27 | AC_PROG_MKDIR_P |
---|
28 | AC_PROG_MAKE_SET |
---|
29 | AC_PROG_CC |
---|
30 | |
---|
31 | #SC_CONFIG_CFLAGS |
---|
32 | #SC_ENABLE_SHARED |
---|
33 | |
---|
34 | gui_with_tcl="" |
---|
35 | |
---|
36 | make_command="" |
---|
37 | for m in "$MAKE" make gmake gnumake ; do |
---|
38 | if test "x${m}" != "x" ; then |
---|
39 | if ( sh -c "$m --version" 2>/dev/null | grep GNU >/dev/null ) ; then |
---|
40 | make_command=$m; break; |
---|
41 | fi |
---|
42 | fi |
---|
43 | done |
---|
44 | if test "x${make_command}" = "x" ; then |
---|
45 | AC_MSG_ERROR([Requires GNU make. You can specify a version with \$MAKE]) |
---|
46 | fi |
---|
47 | AC_SUBST(MAKE, ${make_command}) |
---|
48 | |
---|
49 | AC_ARG_ENABLE( |
---|
50 | [gui], |
---|
51 | [AS_HELP_STRING([--enable-gui], [build code related to the graphical user interface @<:@default=yes@:>@])], |
---|
52 | [], |
---|
53 | [enable_gui=yes]) |
---|
54 | |
---|
55 | ENABLE_GUI= |
---|
56 | if test "$enable_gui" != "no" ; then |
---|
57 | ENABLE_GUI="yes" |
---|
58 | fi |
---|
59 | AC_SUBST(ENABLE_GUI) |
---|
60 | |
---|
61 | with_tclsh="yes" |
---|
62 | AC_ARG_WITH( |
---|
63 | [tclsh], |
---|
64 | [AS_HELP_STRING([--with-tclsh[=DIR]], |
---|
65 | [location of tclsh @<:@default=yes@:>@])], |
---|
66 | [], |
---|
67 | [with_tclsh=yes]) |
---|
68 | |
---|
69 | TCLSH= |
---|
70 | # ----------------------------------------------------------------------- |
---|
71 | # |
---|
72 | # Find the Tcl build configuration file "tclConfig.sh" |
---|
73 | # |
---|
74 | # ----------------------------------------------------------------------- |
---|
75 | |
---|
76 | AC_MSG_CHECKING([for tclConfig.sh]) |
---|
77 | tcl_config_sh="" |
---|
78 | if test "x$gui_with_tcl" != "x" ; then |
---|
79 | |
---|
80 | # Verify that a tclConfig.sh file exists in the directory specified |
---|
81 | # by --with-tcl. |
---|
82 | |
---|
83 | for dir in \ |
---|
84 | $gui_with_tcl |
---|
85 | do |
---|
86 | if test -r "$dir/tclConfig.sh" ; then |
---|
87 | tcl_config_sh="$dir/tclConfig.sh" |
---|
88 | break |
---|
89 | elif test -r "$dir/lib/tclConfig.sh" ; then |
---|
90 | tcl_config_sh="$dir/lib/tclConfig.sh" |
---|
91 | break |
---|
92 | fi |
---|
93 | done |
---|
94 | else |
---|
95 | |
---|
96 | # Otherwise, search for Tcl configuration file. |
---|
97 | |
---|
98 | # 1. Search previously named locations. |
---|
99 | |
---|
100 | for dir in \ |
---|
101 | $prefix \ |
---|
102 | $exec_prefix \ |
---|
103 | $gui_cv_tcl_lib |
---|
104 | do |
---|
105 | if test -r "$dir/tclConfig.sh" ; then |
---|
106 | tcl_config_sh="$dir/tclConfig.sh" |
---|
107 | break |
---|
108 | elif test -r "$dir/lib/tclConfig.sh" ; then |
---|
109 | tcl_config_sh="$dir/lib/tclConfig.sh" |
---|
110 | break |
---|
111 | fi |
---|
112 | done |
---|
113 | fi |
---|
114 | |
---|
115 | AC_MSG_RESULT([${tcl_config_sh}]) |
---|
116 | |
---|
117 | if test "x$tcl_config_sh" = "x" ; then |
---|
118 | echo "can't find Tcl configuration script \"tclConfig.sh\"" |
---|
119 | exit 1 |
---|
120 | fi |
---|
121 | . ${tcl_config_sh} |
---|
122 | TCL_INC_SPEC="$TCL_INCLUDE_SPEC" |
---|
123 | |
---|
124 | case $target in |
---|
125 | *-*-cygwin*|*-*-mingw*) |
---|
126 | gui_platform="win" |
---|
127 | TCLSH=${TCL_PREFIX}/bin/tclsh${TCL_MAJOR_VERSION}${TCL_MINOR_VERSION} |
---|
128 | ;; |
---|
129 | *-*-darwin*) |
---|
130 | gui_platform="macosx" |
---|
131 | TCLSH=${TCL_PREFIX}/bin/tclsh${TCL_MAJOR_VERSION}.${TCL_MINOR_VERSION} |
---|
132 | ;; |
---|
133 | *) |
---|
134 | blt_platform="unix" |
---|
135 | TCLSH=${TCL_PREFIX}/bin/tclsh${TCL_MAJOR_VERSION}.${TCL_MINOR_VERSION} |
---|
136 | ;; |
---|
137 | esac |
---|
138 | |
---|
139 | AC_MSG_RESULT([${TCLSH}]) |
---|
140 | AC_SUBST(TCLSH) |
---|
141 | |
---|
142 | if test -f "${exec_prefix}/lib/tclConfig.sh" ; then |
---|
143 | . ${exec_prefix}/lib/tclConfig.sh |
---|
144 | fi |
---|
145 | if test -f "${exec_prefix}/lib/tkConfig.sh" ; then |
---|
146 | . ${exec_prefix}/lib/tkConfig.sh |
---|
147 | fi |
---|
148 | AC_SUBST(TCL_INC_SPEC) |
---|
149 | AC_SUBST(TCL_LIB_SPEC) |
---|
150 | AC_SUBST(TCL_VERSION) |
---|
151 | AC_SUBST(TK_INC_SPEC) |
---|
152 | AC_SUBST(TK_LIB_SPEC) |
---|
153 | AC_SUBST(TK_XLIBSW) |
---|
154 | AC_SUBST(TK_VERSION) |
---|
155 | AC_SUBST(TCL_CFLAGS_DEBUG) |
---|
156 | AC_SUBST(TCL_CFLAGS_OPTIMIZE) |
---|
157 | AC_SUBST(TCL_STLIB_LD) |
---|
158 | AC_SUBST(TCL_SHLIB_LD) |
---|
159 | AC_SUBST(TCL_SHLIB_CFLAGS) |
---|
160 | AC_SUBST(TCL_SHLIB_LDFLAGS) |
---|
161 | AC_SUBST(TCL_SHLIB_SUFFIX) |
---|
162 | |
---|
163 | |
---|
164 | AC_CONFIG_FILES([ |
---|
165 | Makefile |
---|
166 | pkgIndex.tcl |
---|
167 | apps/Makefile |
---|
168 | apps/about |
---|
169 | apps/encodedata |
---|
170 | apps/rappture |
---|
171 | apps/rappture-csh.env |
---|
172 | apps/rappture.env |
---|
173 | apps/rappture.use |
---|
174 | apps/rerun |
---|
175 | apps/simsim |
---|
176 | apps/xmldiff |
---|
177 | scripts/Makefile |
---|
178 | src/Makefile |
---|
179 | ]) |
---|
180 | AC_OUTPUT |
---|