1 | #-------------------------------------------------------------------- |
---|
2 | # Sample configure.in for Tcl Extensions. The only places you should |
---|
3 | # need to modify this file are marked by the string __CHANGE__ |
---|
4 | #-------------------------------------------------------------------- |
---|
5 | |
---|
6 | #-------------------------------------------------------------------- |
---|
7 | # __CHANGE__ |
---|
8 | # This very first macro is used to verify that the configure script can |
---|
9 | # find the sources. The argument to AC_INIT should be a unique filename |
---|
10 | # for this package, and can be a relative path, such as: |
---|
11 | # |
---|
12 | # AC_INIT(../generic/tcl.h) |
---|
13 | #-------------------------------------------------------------------- |
---|
14 | |
---|
15 | AC_INIT(src/RpLibraryTclInterface.cc) |
---|
16 | AC_CONFIG_AUX_DIR(cf) |
---|
17 | |
---|
18 | #-------------------------------------------------------------------- |
---|
19 | # __CHANGE__ |
---|
20 | # Set your package name and version numbers here. The NODOT_VERSION is |
---|
21 | # required for constructing the library name on systems that don't like |
---|
22 | # dots in library names (Windows). The VERSION variable is used on the |
---|
23 | # other systems. |
---|
24 | #-------------------------------------------------------------------- |
---|
25 | |
---|
26 | PACKAGE=Rappture |
---|
27 | |
---|
28 | MAJOR_VERSION=1 |
---|
29 | MINOR_VERSION=1 |
---|
30 | VERSION=${MAJOR_VERSION}.${MINOR_VERSION} |
---|
31 | |
---|
32 | #-------------------------------------------------------------------- |
---|
33 | # Extra build options |
---|
34 | #-------------------------------------------------------------------- |
---|
35 | #AC_ARG_WITH(blt, [ --with-blt=DIR Find bltInt.h in DIR], |
---|
36 | # blt_source_dir=$withval) |
---|
37 | |
---|
38 | #-------------------------------------------------------------------- |
---|
39 | # We put this here so that you can compile with -DVERSION="1.2" to |
---|
40 | # encode the package version directly into the source files. |
---|
41 | #-------------------------------------------------------------------- |
---|
42 | |
---|
43 | eval AC_DEFINE_UNQUOTED(VERSION, "${VERSION}") |
---|
44 | |
---|
45 | #-------------------------------------------------------------------- |
---|
46 | # Check whether --enable-gcc or --disable-gcc was given. Do this |
---|
47 | # before AC_CYGWIN is called so the compiler can |
---|
48 | # be fully tested by built-in autoconf tools. |
---|
49 | # This macro also calls AC_PROG_CC to set the compiler if --enable-gcc |
---|
50 | # was not used. |
---|
51 | #-------------------------------------------------------------------- |
---|
52 | |
---|
53 | #SC_ENABLE_GCC |
---|
54 | AC_PROG_CXX |
---|
55 | AC_PROG_INSTALL |
---|
56 | |
---|
57 | #-------------------------------------------------------------------- |
---|
58 | # Checks to see if the make program sets the $MAKE variable. |
---|
59 | #-------------------------------------------------------------------- |
---|
60 | |
---|
61 | AC_PROG_MAKE_SET |
---|
62 | |
---|
63 | #-------------------------------------------------------------------- |
---|
64 | # Find ranlib |
---|
65 | #-------------------------------------------------------------------- |
---|
66 | |
---|
67 | AC_PROG_RANLIB |
---|
68 | |
---|
69 | #-------------------------------------------------------------------- |
---|
70 | # This macro performs additional compiler tests. |
---|
71 | #-------------------------------------------------------------------- |
---|
72 | |
---|
73 | AC_CYGWIN |
---|
74 | |
---|
75 | #-------------------------------------------------------------------- |
---|
76 | # Determines the correct binary file extension (.o, .obj, .exe etc.) |
---|
77 | #-------------------------------------------------------------------- |
---|
78 | |
---|
79 | AC_OBJEXT |
---|
80 | AC_EXEEXT |
---|
81 | |
---|
82 | #-------------------------------------------------------------------- |
---|
83 | # "cygpath" is used on windows to generate native path names for include |
---|
84 | # files. |
---|
85 | # These variables should only be used with the compiler and linker since |
---|
86 | # they generate native path names. |
---|
87 | # |
---|
88 | # Unix tclConfig.sh points SRC_DIR at the top-level directory of |
---|
89 | # the Tcl sources, while the Windows tclConfig.sh points SRC_DIR at |
---|
90 | # the win subdirectory. Hence the different usages of SRC_DIR below. |
---|
91 | # |
---|
92 | # This must be done before calling SC_PUBLIC_TCL_HEADERS |
---|
93 | #-------------------------------------------------------------------- |
---|
94 | |
---|
95 | case "`uname -s`" in |
---|
96 | *win32* | *WIN32* | *CYGWIN_NT*) |
---|
97 | CYGPATH="cygpath -w" |
---|
98 | ;; |
---|
99 | *) |
---|
100 | CYGPATH=echo |
---|
101 | ;; |
---|
102 | esac |
---|
103 | |
---|
104 | AC_SUBST(CYGPATH) |
---|
105 | |
---|
106 | #-------------------------------------------------------------------- |
---|
107 | # __CHANGE__ |
---|
108 | # Choose which headers you need. Extension authors should try very |
---|
109 | # hard to only rely on the Tcl public header files. Internal headers |
---|
110 | # contain private data structures and are subject to change without |
---|
111 | # notice. |
---|
112 | # This MUST be called before SC_PATH_TCLCONFIG/SC_LOAD_TCLCONFIG |
---|
113 | #-------------------------------------------------------------------- |
---|
114 | |
---|
115 | SC_PUBLIC_TCL_HEADERS |
---|
116 | #SC_PRIVATE_TCL_HEADERS |
---|
117 | |
---|
118 | #-------------------------------------------------------------------- |
---|
119 | # Load the tclConfig.sh file |
---|
120 | #-------------------------------------------------------------------- |
---|
121 | |
---|
122 | SC_PATH_TCLCONFIG |
---|
123 | SC_LOAD_TCLCONFIG |
---|
124 | |
---|
125 | #-------------------------------------------------------------------- |
---|
126 | # Look for bltInt.h on the normal include path. If not found, look |
---|
127 | # for it in the --with-blt directory. |
---|
128 | #-------------------------------------------------------------------- |
---|
129 | AC_MSG_CHECKING([for bltInt.h]) |
---|
130 | BLT_SRC_DIR="" |
---|
131 | if test "x$blt_source_dir" != "x" ; then |
---|
132 | # |
---|
133 | # Verify that a tclConfig.sh file exists in the directory specified |
---|
134 | # by --with-blt. |
---|
135 | # |
---|
136 | if test -r "$blt_source_dir/bltInt.h" ; then |
---|
137 | BLT_SRC_DIR="$blt_source_dir" |
---|
138 | elif test -r "$blt_source_dir/src/bltInt.h" ; then |
---|
139 | BLT_SRC_DIR="$blt_source_dir/src" |
---|
140 | fi |
---|
141 | else |
---|
142 | # |
---|
143 | # Otherwise, search for the bltInt.h include file... |
---|
144 | # 1. Search previously named locations. |
---|
145 | # |
---|
146 | for dir in \ |
---|
147 | $prefix \ |
---|
148 | $exec_prefix |
---|
149 | do |
---|
150 | if test -r "$dir/bltInt.h" ; then |
---|
151 | BLT_SRC_DIR="$dir" |
---|
152 | break |
---|
153 | elif test -r "$dir/include/bltInt.h" ; then |
---|
154 | BLT_SRC_DIR="$dir/lib" |
---|
155 | break |
---|
156 | fi |
---|
157 | done |
---|
158 | # |
---|
159 | # 2. Search source directories. |
---|
160 | # |
---|
161 | if test "x$BLT_SRC_DIR" = "x" ; then |
---|
162 | for dir in \ |
---|
163 | `ls -dr ../blt[[2-3]].[[0-9]]* 2>/dev/null` \ |
---|
164 | ../blt \ |
---|
165 | `ls -dr ../../blt[[2-3]].[[0-9]]* 2>/dev/null` \ |
---|
166 | ../../blt \ |
---|
167 | `ls -dr ../../../blt[[2-3]].[[0-9]]* 2>/dev/null` \ |
---|
168 | ../../../blt |
---|
169 | do |
---|
170 | if test -r "$dir/bltInt.h" ; then |
---|
171 | tclConfigFile="$dir/bltInt.h" |
---|
172 | break |
---|
173 | fi |
---|
174 | done |
---|
175 | fi |
---|
176 | fi |
---|
177 | |
---|
178 | AC_MSG_RESULT([${BLT_SRC_DIR}]) |
---|
179 | |
---|
180 | if test "x$BLT_SRC_DIR" = "x" ; then |
---|
181 | echo "can't find BLT include file \"bltInt.h\"" |
---|
182 | echo "use --with-blt=DIR to specify the location of the BLT sources" |
---|
183 | exit 1 |
---|
184 | fi |
---|
185 | |
---|
186 | AC_SUBST(BLT_SRC_DIR) |
---|
187 | |
---|
188 | #-------------------------------------------------------------------- |
---|
189 | # __CHANGE__ |
---|
190 | # A few miscellaneous platform-specific items: |
---|
191 | # |
---|
192 | # Define a special symbol for Windows (BUILD_exampleA in this case) so |
---|
193 | # that we create the export library with the dll. See sha1.h on how |
---|
194 | # to use this. |
---|
195 | # |
---|
196 | # Windows creates a few extra files that need to be cleaned up. |
---|
197 | # You can add more files to clean if your extension creates any extra |
---|
198 | # files. |
---|
199 | # |
---|
200 | # Define any extra compiler flags in the PACKAGE_CFLAGS variable. |
---|
201 | # These will be appended to the current set of compiler flags for |
---|
202 | # your system. |
---|
203 | #-------------------------------------------------------------------- |
---|
204 | |
---|
205 | case "`uname -s`" in |
---|
206 | *win32* | *WIN32* | *CYGWIN_NT*) |
---|
207 | AC_DEFINE(BUILD_Rappture) |
---|
208 | CLEANFILES="*.lib *.dll *.exp *.ilk *.pdb vc50.pch" |
---|
209 | AC_SUBST(CLEANFILES) |
---|
210 | ;; |
---|
211 | *) |
---|
212 | CLEANFILES= |
---|
213 | ;; |
---|
214 | esac |
---|
215 | |
---|
216 | #-------------------------------------------------------------------- |
---|
217 | # Check whether --enable-threads or --disable-threads was given. |
---|
218 | # So far only Tcl responds to this one. |
---|
219 | #-------------------------------------------------------------------- |
---|
220 | |
---|
221 | SC_ENABLE_THREADS |
---|
222 | |
---|
223 | #-------------------------------------------------------------------- |
---|
224 | # The statement below defines a collection of symbols related to |
---|
225 | # building as a shared library instead of a static library. |
---|
226 | #-------------------------------------------------------------------- |
---|
227 | |
---|
228 | SC_ENABLE_SHARED |
---|
229 | |
---|
230 | #-------------------------------------------------------------------- |
---|
231 | # This macro figures out what flags to use with the compiler/linker |
---|
232 | # when building shared/static debug/optimized objects. This information |
---|
233 | # is all taken from the tclConfig.sh file. |
---|
234 | #-------------------------------------------------------------------- |
---|
235 | |
---|
236 | CFLAGS_DEBUG=${TCL_CFLAGS_DEBUG} |
---|
237 | CFLAGS_OPTIMIZE=${TCL_CFLAGS_OPTIMIZE} |
---|
238 | LDFLAGS_DEBUG=${TCL_LDFLAGS_DEBUG} |
---|
239 | LDFLAGS_OPTIMIZE=${TCL_LDFLAGS_OPTIMIZE} |
---|
240 | SHLIB_LD=${TCL_SHLIB_LD} |
---|
241 | STLIB_LD=${TCL_STLIB_LD} |
---|
242 | SHLIB_CFLAGS=${TCL_SHLIB_CFLAGS} |
---|
243 | |
---|
244 | AC_SUBST(CFLAGS_DEBUG) |
---|
245 | AC_SUBST(CFLAGS_OPTIMIZE) |
---|
246 | AC_SUBST(STLIB_LD) |
---|
247 | AC_SUBST(SHLIB_LD) |
---|
248 | AC_SUBST(SHLIB_CFLAGS) |
---|
249 | AC_SUBST(SHLIB_LDFLAGS) |
---|
250 | |
---|
251 | #-------------------------------------------------------------------- |
---|
252 | # Set the default compiler switches based on the --enable-symbols |
---|
253 | # option. |
---|
254 | #-------------------------------------------------------------------- |
---|
255 | |
---|
256 | SC_ENABLE_SYMBOLS |
---|
257 | |
---|
258 | if test "${SHARED_BUILD}" = "1" ; then |
---|
259 | CFLAGS='${CFLAGS_DEFAULT} ${CFLAGS_WARNING} ${SHLIB_CFLAGS}' |
---|
260 | else |
---|
261 | CFLAGS='${CFLAGS_DEFAULT} ${CFLAGS_WARNING}' |
---|
262 | fi |
---|
263 | |
---|
264 | #-------------------------------------------------------------------- |
---|
265 | # Everyone should be linking against the Tcl stub library. If you |
---|
266 | # can't for some reason, remove this definition. If you aren't using |
---|
267 | # stubs, you also need to modify the SHLIB_LD_LIBS setting below to |
---|
268 | # link against the non-stubbed Tcl library. |
---|
269 | #-------------------------------------------------------------------- |
---|
270 | |
---|
271 | AC_DEFINE(USE_TCL_STUBS) |
---|
272 | |
---|
273 | #-------------------------------------------------------------------- |
---|
274 | # This macro generates a line to use when building a library. It |
---|
275 | # depends on values set by the SC_ENABLE_SHARED, SC_ENABLE_SYMBOLS, |
---|
276 | # and SC_LOAD_TCLCONFIG macros above. |
---|
277 | #-------------------------------------------------------------------- |
---|
278 | |
---|
279 | SC_MAKE_LIB |
---|
280 | |
---|
281 | #-------------------------------------------------------------------- |
---|
282 | # eval these two values to dereference the ${DBGX} variable. |
---|
283 | #-------------------------------------------------------------------- |
---|
284 | |
---|
285 | eval "SHARED_LIB_SUFFIX=${TCL_SHARED_LIB_SUFFIX}" |
---|
286 | eval "UNSHARED_LIB_SUFFIX=${TCL_UNSHARED_LIB_SUFFIX}" |
---|
287 | |
---|
288 | #-------------------------------------------------------------------- |
---|
289 | # Shared libraries and static libraries have different names. |
---|
290 | #-------------------------------------------------------------------- |
---|
291 | |
---|
292 | case "`uname -s`" in |
---|
293 | *win32* | *WIN32* | *CYGWIN_NT*) |
---|
294 | if test "${SHARED_BUILD}" = "1" ; then |
---|
295 | SHLIB_LD_LIBS="\"`cygpath -w ${TCL_BIN_DIR}/${TCL_STUB_LIB_FILE}`\" ${TCL_SHLIB_LD_LIBS}" |
---|
296 | eval "${PACKAGE}_LIB_FILE=${PACKAGE}${SHARED_LIB_SUFFIX}" |
---|
297 | RANLIB=: |
---|
298 | else |
---|
299 | eval "${PACKAGE}_LIB_FILE=${PACKAGE}${UNSHARED_LIB_SUFFIX}" |
---|
300 | fi |
---|
301 | ;; |
---|
302 | *) |
---|
303 | if test "${SHARED_BUILD}" = "1" ; then |
---|
304 | SHLIB_LD_LIBS="${TCL_STUB_LIB_SPEC}" |
---|
305 | eval "${PACKAGE}_LIB_FILE=lib${PACKAGE}${SHARED_LIB_SUFFIX}" |
---|
306 | RANLIB=: |
---|
307 | else |
---|
308 | eval "${PACKAGE}_LIB_FILE=lib${PACKAGE}${UNSHARED_LIB_SUFFIX}" |
---|
309 | fi |
---|
310 | ;; |
---|
311 | esac |
---|
312 | |
---|
313 | #-------------------------------------------------------------------- |
---|
314 | # __CHANGE__ |
---|
315 | # Change the name from exampeA_LIB_FILE to match your package name. |
---|
316 | #-------------------------------------------------------------------- |
---|
317 | |
---|
318 | AC_SUBST(Rappture_LIB_FILE) |
---|
319 | AC_SUBST(SHLIB_LD_LIBS) |
---|
320 | |
---|
321 | #-------------------------------------------------------------------- |
---|
322 | # Find tclsh so that we can run pkg_mkIndex to generate the pkgIndex.tcl |
---|
323 | # file during the install process. Don't run the TCLSH_PROG through |
---|
324 | # ${CYGPATH} because it's being used directly by make. |
---|
325 | # Require that we use a tclsh shell version 8.2 or later since earlier |
---|
326 | # versions have bugs in the pkg_mkIndex routine. |
---|
327 | #-------------------------------------------------------------------- |
---|
328 | |
---|
329 | AC_PATH_PROGS(TCLSH_PROG, tclsh8.4${EXEEXT} tclsh84${EXEEXT} tclsh${EXEEXT}, :, ${exec_prefix}:${PATH}) |
---|
330 | |
---|
331 | if test "x${TCLSH_PROG}" = "x:" ; then |
---|
332 | AC_MSG_WARN(No tclsh executable found. You will have to build the pkgIndex.tcl file manually.) |
---|
333 | fi |
---|
334 | AC_SUBST(TCLSH_PROG) |
---|
335 | |
---|
336 | #-------------------------------------------------------------------- |
---|
337 | # Finalize patchlevel and version info |
---|
338 | #-------------------------------------------------------------------- |
---|
339 | PATCHLEVEL=`${TCLSH_PROG} cf/patchlevel.tcl` |
---|
340 | EXACT_VERSION=${MAJOR_VERSION}.${MINOR_VERSION}-${PATCHLEVEL} |
---|
341 | NODOT_VERSION=${MAJOR_VERSION}${MINOR_VERSION} |
---|
342 | |
---|
343 | AC_SUBST(PACKAGE) |
---|
344 | AC_SUBST(VERSION) |
---|
345 | AC_SUBST(PATCHLEVEL) |
---|
346 | AC_SUBST(EXACT_VERSION) |
---|
347 | AC_SUBST(NODOT_VERSION) |
---|
348 | |
---|
349 | |
---|
350 | #-------------------------------------------------------------------- |
---|
351 | # Finally, substitute all of the various values into the Makefile. |
---|
352 | #-------------------------------------------------------------------- |
---|
353 | |
---|
354 | AC_OUTPUT([Makefile pkgIndex.tcl init.tcl]) |
---|