1 |
dnl aclocal.m4 |
2 |
dnl macros autoconf uses when building configure from configure.in |
3 |
dnl |
4 |
dnl $Id: aclocal.m4,v 1.5 2001/04/25 09:33:42 tothwolf Exp $ |
5 |
dnl |
6 |
|
7 |
|
8 |
dnl EGG_MSG_CONFIGURE_START() |
9 |
dnl |
10 |
AC_DEFUN(EGG_MSG_CONFIGURE_START, [dnl |
11 |
AC_MSG_RESULT() |
12 |
AC_MSG_RESULT(This is eggdrop's GNU configure script.) |
13 |
AC_MSG_RESULT(It's going to run a bunch of strange tests to hopefully) |
14 |
AC_MSG_RESULT(make your compile work without much twiddling.) |
15 |
AC_MSG_RESULT() |
16 |
])dnl |
17 |
|
18 |
|
19 |
dnl EGG_MSG_CONFIGURE_END() |
20 |
dnl |
21 |
AC_DEFUN(EGG_MSG_CONFIGURE_END, [dnl |
22 |
AC_MSG_RESULT() |
23 |
AC_MSG_RESULT(Configure is done.) |
24 |
AC_MSG_RESULT() |
25 |
AC_MSG_RESULT(Type 'make config' to configure modules. Or 'make iconfig' to) |
26 |
AC_MSG_RESULT(interactively choose which modules to compile.) |
27 |
AC_MSG_RESULT() |
28 |
if test -f "./$EGGEXEC" |
29 |
then |
30 |
AC_MSG_RESULT([After that, type 'make clean' and then 'make' to create the bot.]) |
31 |
else |
32 |
AC_MSG_RESULT([After that, type 'make' to create the bot.]) |
33 |
fi |
34 |
AC_MSG_RESULT() |
35 |
])dnl |
36 |
|
37 |
|
38 |
dnl EGG_CHECK_CC() |
39 |
dnl |
40 |
dnl FIXME: make a better test |
41 |
dnl |
42 |
AC_DEFUN(EGG_CHECK_CC, [dnl |
43 |
if test "${cross_compiling-x}" = "x" |
44 |
then |
45 |
cat << 'EOF' >&2 |
46 |
configure: error: |
47 |
|
48 |
This system does not appear to have a working C compiler. |
49 |
A working C compiler is required to compile eggdrop. |
50 |
|
51 |
EOF |
52 |
exit 1 |
53 |
fi |
54 |
])dnl |
55 |
|
56 |
|
57 |
dnl EGG_CHECK_CCPIPE() |
58 |
dnl |
59 |
dnl Checks whether the compiler supports the `-pipe' flag, which |
60 |
dnl speeds up the compilation. |
61 |
AC_DEFUN(EGG_CHECK_CCPIPE, [dnl |
62 |
if test -z "$no_pipe" |
63 |
then |
64 |
if test -n "$GCC" |
65 |
then |
66 |
AC_CACHE_CHECK(whether the compiler understands -pipe, egg_cv_var_ccpipe, [dnl |
67 |
ac_old_CC="$CC" |
68 |
CC="$CC -pipe" |
69 |
AC_TRY_COMPILE(,, egg_cv_var_ccpipe="yes", egg_cv_var_ccpipe="no") |
70 |
CC="$ac_old_CC" |
71 |
]) |
72 |
if test "$egg_cv_var_ccpipe" = "yes" |
73 |
then |
74 |
CC="$CC -pipe" |
75 |
fi |
76 |
fi |
77 |
fi |
78 |
])dnl |
79 |
|
80 |
|
81 |
dnl EGG_PROG_STRIP() |
82 |
dnl |
83 |
AC_DEFUN(EGG_PROG_STRIP, [dnl |
84 |
AC_CHECK_PROG(STRIP, strip, strip) |
85 |
if test "${STRIP-x}" = "x" |
86 |
then |
87 |
STRIP=touch |
88 |
fi |
89 |
])dnl |
90 |
|
91 |
|
92 |
dnl EGG_PROG_AWK() |
93 |
dnl |
94 |
AC_DEFUN(EGG_PROG_AWK, [dnl |
95 |
# awk is needed for Tcl library and header checks, and eggdrop version subst |
96 |
AC_PROG_AWK |
97 |
if test "${AWK-x}" = "x" |
98 |
then |
99 |
cat << 'EOF' >&2 |
100 |
configure: error: |
101 |
|
102 |
This system seems to lack a working 'awk' command. |
103 |
A working 'awk' command is required to compile eggdrop. |
104 |
|
105 |
EOF |
106 |
exit 1 |
107 |
fi |
108 |
])dnl |
109 |
|
110 |
|
111 |
dnl EGG_PROG_BASENAME() |
112 |
dnl |
113 |
AC_DEFUN(EGG_PROG_BASENAME, [dnl |
114 |
# basename is needed for Tcl library and header checks |
115 |
AC_CHECK_PROG(BASENAME, basename, basename) |
116 |
if test "${BASENAME-x}" = "x" |
117 |
then |
118 |
cat << 'EOF' >&2 |
119 |
configure: error: |
120 |
|
121 |
This system seems to lack a working 'basename' command. |
122 |
A working 'basename' command is required to compile eggdrop. |
123 |
|
124 |
EOF |
125 |
exit 1 |
126 |
fi |
127 |
])dnl |
128 |
|
129 |
|
130 |
dnl EGG_CHECK_OS() |
131 |
dnl |
132 |
dnl FIXME/NOTICE: |
133 |
dnl This function is obsolete. Any NEW code/checks should be written |
134 |
dnl as individual tests that will be checked on ALL operating systems. |
135 |
dnl |
136 |
AC_DEFUN(EGG_CHECK_OS, [dnl |
137 |
LINUX=no |
138 |
IRIX=no |
139 |
SUNOS=no |
140 |
HPUX=no |
141 |
MOD_CC="$CC" |
142 |
MOD_LD="$CC" |
143 |
MOD_STRIP="$STRIP" |
144 |
SHLIB_CC="$CC" |
145 |
SHLIB_LD="$CC" |
146 |
SHLIB_STRIP="$STRIP" |
147 |
NEED_DL=1 |
148 |
DEFAULT_MAKE=debug |
149 |
MOD_EXT=so |
150 |
|
151 |
AC_CACHE_CHECK(system type, egg_cv_var_system_type, egg_cv_var_system_type=`$UNAME -s`) |
152 |
AC_CACHE_CHECK(system release, egg_cv_var_system_release, egg_cv_var_system_release=`$UNAME -r`) |
153 |
|
154 |
case "$egg_cv_var_system_type" in |
155 |
BSD/OS) |
156 |
case "`echo $egg_cv_var_system_release | cut -d . -f 1`" in |
157 |
2) |
158 |
NEED_DL=0 |
159 |
DEFAULT_MAKE=static |
160 |
;; |
161 |
3) |
162 |
MOD_CC=shlicc |
163 |
MOD_LD=shlicc |
164 |
MOD_STRIP="$STRIP -d" |
165 |
SHLIB_LD="shlicc -r" |
166 |
SHLIB_STRIP=touch |
167 |
AC_DEFINE(MODULES_OK)dnl |
168 |
;; |
169 |
*) |
170 |
CFLAGS="$CFLAGS -Wall" |
171 |
MOD_LD="$CC" |
172 |
MOD_STRIP="$STRIP -d" |
173 |
SHLIB_CC="$CC -export-dynamic -fPIC" |
174 |
SHLIB_LD="$CC -shared -nostartfiles" |
175 |
AC_DEFINE(MODULES_OK)dnl |
176 |
;; |
177 |
esac |
178 |
;; |
179 |
CYGWIN*) |
180 |
case "`echo $egg_cv_var_system_release | cut -c 1-3`" in |
181 |
1.*) |
182 |
NEED_DL=0 |
183 |
SHLIB_LD="$CC -shared" |
184 |
CC="$CC -mwin32" |
185 |
MOD_CC="$CC" |
186 |
MOD_LD="$CC" |
187 |
AC_MSG_CHECKING(for /usr/lib/binmode.o) |
188 |
if test -r /usr/lib/binmode.o |
189 |
then |
190 |
AC_MSG_RESULT(yes) |
191 |
LIBS="$LIBS /usr/lib/binmode.o" |
192 |
else |
193 |
AC_MSG_RESULT(no) |
194 |
AC_MSG_WARN(Make sure the directory eggdrop is installed into is mounted in binary mode.) |
195 |
fi |
196 |
MOD_EXT=dll |
197 |
AC_DEFINE(MODULES_OK)dnl |
198 |
;; |
199 |
*) |
200 |
NEED_DL=0 |
201 |
DEFAULT_MAKE=static |
202 |
AC_MSG_WARN(Make sure the directory eggdrop is installed into is mounted in binary mode.) |
203 |
;; |
204 |
esac |
205 |
;; |
206 |
HP-UX) |
207 |
HPUX=yes |
208 |
MOD_LD="$CC -fPIC -shared" |
209 |
SHLIB_CC="$CC -fPIC" |
210 |
SHLIB_LD="ld -b" |
211 |
NEED_DL=0 |
212 |
AC_DEFINE(MODULES_OK)dnl |
213 |
AC_DEFINE(HPUX_HACKS)dnl |
214 |
if test "`echo $egg_cv_var_system_release | cut -d . -f 2`" = "10" |
215 |
then |
216 |
AC_DEFINE(HPUX10_HACKS)dnl |
217 |
fi |
218 |
;; |
219 |
dell) |
220 |
AC_MSG_RESULT(Dell SVR4) |
221 |
SHLIB_STRIP=touch |
222 |
NEED_DL=0 |
223 |
MOD_LD="$CC -lelf -lucb" |
224 |
;; |
225 |
IRIX) |
226 |
SHLIB_LD="ld -n32 -shared -rdata_shared" |
227 |
IRIX=yes |
228 |
SHLIB_STRIP=touch |
229 |
NEED_DL=0 |
230 |
DEFAULT_MAKE=static |
231 |
;; |
232 |
Ultrix) |
233 |
NEED_DL=0 |
234 |
SHLIB_STRIP=touch |
235 |
DEFAULT_MAKE=static |
236 |
SHELL=/bin/sh5 |
237 |
;; |
238 |
SINIX*) |
239 |
NEED_DL=0 |
240 |
SHLIB_STRIP=touch |
241 |
DEFAULT_MAKE=static |
242 |
SHLIB_CC="cc -G" |
243 |
;; |
244 |
BeOS) |
245 |
NEED_DL=0 |
246 |
SHLIB_STRIP=strip |
247 |
DEFAULT_MAKE=static |
248 |
;; |
249 |
Linux) |
250 |
LINUX=yes |
251 |
CFLAGS="$CFLAGS -Wall" |
252 |
MOD_LD="$CC" |
253 |
SHLIB_CC="$CC -fPIC" |
254 |
SHLIB_LD="$CC -shared -nostartfiles" |
255 |
AC_DEFINE(MODULES_OK)dnl |
256 |
;; |
257 |
Lynx) |
258 |
NEED_DL=0 |
259 |
DEFAULT_MAKE=static |
260 |
SHLIB_STRIP=strip |
261 |
;; |
262 |
OSF1) |
263 |
case "`echo $egg_cv_var_system_release | cut -d . -f 1`" in |
264 |
V*) |
265 |
# FIXME: we should check this in a seperate test |
266 |
# Digital OSF uses an ancient version of gawk |
267 |
if test "$AWK" = "gawk" |
268 |
then |
269 |
AWK=awk |
270 |
fi |
271 |
MOD_CC=cc |
272 |
MOD_LD=cc |
273 |
SHLIB_CC=cc |
274 |
SHLIB_LD="ld -shared -expect_unresolved \"'*'\"" |
275 |
SHLIB_STRIP=touch |
276 |
AC_DEFINE(MODULES_OK)dnl |
277 |
;; |
278 |
1.0|1.1|1.2) |
279 |
SHLIB_LD="ld -R -export $@:" |
280 |
AC_DEFINE(MODULES_OK)dnl |
281 |
AC_DEFINE(OSF1_HACKS)dnl |
282 |
;; |
283 |
1.*) |
284 |
SHLIB_CC="$CC -fpic" |
285 |
SHLIB_LD="ld -shared" |
286 |
AC_DEFINE(MODULES_OK)dnl |
287 |
AC_DEFINE(OSF1_HACKS)dnl |
288 |
;; |
289 |
*) |
290 |
NEED_DL=0 |
291 |
DEFAULT_MAKE=static |
292 |
;; |
293 |
esac |
294 |
AC_DEFINE(STOP_UAC)dnl |
295 |
;; |
296 |
SunOS) |
297 |
if test "`echo $egg_cv_var_system_release | cut -d . -f 1`" = "5" |
298 |
then |
299 |
# Solaris |
300 |
if test -n "$GCC" |
301 |
then |
302 |
SHLIB_CC="$CC -fPIC" |
303 |
SHLIB_LD="$CC" |
304 |
else |
305 |
SHLIB_CC="$CC -KPIC" |
306 |
SHLIB_LD="$CC -G -z text" |
307 |
fi |
308 |
else |
309 |
# SunOS 4 |
310 |
SUNOS=yes |
311 |
SHLIB_LD=ld |
312 |
SHLIB_CC="$CC -PIC" |
313 |
AC_DEFINE(DLOPEN_1)dnl |
314 |
fi |
315 |
AC_DEFINE(MODULES_OK)dnl |
316 |
;; |
317 |
*BSD) |
318 |
# FreeBSD/OpenBSD/NetBSD |
319 |
SHLIB_CC="$CC -fPIC" |
320 |
SHLIB_LD="ld -Bshareable -x" |
321 |
AC_DEFINE(MODULES_OK)dnl |
322 |
;; |
323 |
*) |
324 |
AC_MSG_CHECKING(if system is Mach based) |
325 |
if test -r /mach |
326 |
then |
327 |
AC_MSG_RESULT(yes) |
328 |
NEED_DL=0 |
329 |
DEFAULT_MAKE=static |
330 |
AC_DEFINE(BORGCUBES)dnl |
331 |
else |
332 |
AC_MSG_RESULT(no) |
333 |
AC_MSG_CHECKING(if system is QNX) |
334 |
if test -r /cmds |
335 |
then |
336 |
AC_MSG_RESULT(yes) |
337 |
SHLIB_STRIP=touch |
338 |
NEED_DL=0 |
339 |
DEFAULT_MAKE=static |
340 |
else |
341 |
AC_MSG_RESULT(no) |
342 |
AC_MSG_RESULT(Something unknown!) |
343 |
AC_MSG_RESULT([If you get dynamic modules to work, be sure to let the devel team know HOW :)]) |
344 |
NEED_DL=0 |
345 |
DEFAULT_MAKE=static |
346 |
fi |
347 |
fi |
348 |
;; |
349 |
esac |
350 |
AC_SUBST(MOD_LD)dnl |
351 |
AC_SUBST(MOD_CC)dnl |
352 |
AC_SUBST(MOD_STRIP)dnl |
353 |
AC_SUBST(SHLIB_LD)dnl |
354 |
AC_SUBST(SHLIB_CC)dnl |
355 |
AC_SUBST(SHLIB_STRIP)dnl |
356 |
AC_SUBST(DEFAULT_MAKE)dnl |
357 |
AC_SUBST(MOD_EXT)dnl |
358 |
AC_DEFINE_UNQUOTED(EGG_MOD_EXT, "$MOD_EXT")dnl |
359 |
])dnl |
360 |
|
361 |
|
362 |
dnl EGG_CHECK_LIBS() |
363 |
dnl |
364 |
AC_DEFUN(EGG_CHECK_LIBS, [dnl |
365 |
# FIXME: this needs to be fixed so that it works on IRIX |
366 |
if test "$IRIX" = "yes" |
367 |
then |
368 |
AC_MSG_WARN(Skipping library tests because they CONFUSE Irix.) |
369 |
else |
370 |
AC_CHECK_LIB(socket, socket) |
371 |
AC_CHECK_LIB(nsl, connect) |
372 |
AC_CHECK_LIB(dns, gethostbyname) |
373 |
AC_CHECK_LIB(dl, dlopen) |
374 |
AC_CHECK_LIB(m, tan, EGG_MATH_LIB="-lm") |
375 |
# This is needed for Tcl libraries compiled with thread support |
376 |
AC_CHECK_LIB(pthread, pthread_mutex_init, [dnl |
377 |
ac_cv_lib_pthread_pthread_mutex_init=yes |
378 |
ac_cv_lib_pthread="-lpthread"], [dnl |
379 |
AC_CHECK_LIB(pthread, __pthread_mutex_init, [dnl |
380 |
ac_cv_lib_pthread_pthread_mutex_init=yes |
381 |
ac_cv_lib_pthread="-lpthread"], [dnl |
382 |
AC_CHECK_LIB(pthreads, pthread_mutex_init, [dnl |
383 |
ac_cv_lib_pthread_pthread_mutex_init=yes |
384 |
ac_cv_lib_pthread="-lpthreads"], [dnl |
385 |
AC_CHECK_FUNC(pthread_mutex_init, [dnl |
386 |
ac_cv_lib_pthread_pthread_mutex_init=yes |
387 |
ac_cv_lib_pthread=""], |
388 |
ac_cv_lib_pthread_pthread_mutex_init=no)])])]) |
389 |
if test "$SUNOS" = "yes" |
390 |
then |
391 |
# For suns without yp or something like that |
392 |
AC_CHECK_LIB(dl, main) |
393 |
else |
394 |
if test "$HPUX" = "yes" |
395 |
then |
396 |
AC_CHECK_LIB(dld, shl_load) |
397 |
fi |
398 |
fi |
399 |
fi |
400 |
])dnl |
401 |
|
402 |
|
403 |
dnl |
404 |
dnl EGG_CHECK_32BIT_TYPE() |
405 |
AC_DEFUN(EGG_CHECK_32BIT_TYPE, [dnl |
406 |
AC_CHECK_SIZEOF(unsigned int, 4) |
407 |
if test "$ac_cv_sizeof_unsigned_int" = 4 |
408 |
then |
409 |
AC_DEFINE(UNSIGNED_INT32) |
410 |
else |
411 |
AC_CHECK_SIZEOF(unsigned long, 4) |
412 |
if test "$ac_cv_sizeof_unsigned_long" = 4 |
413 |
then |
414 |
AC_DEFINE(UNSIGNED_LONG32) |
415 |
fi |
416 |
fi |
417 |
])dnl |
418 |
|
419 |
|
420 |
dnl EGG_CHECK_FUNC_VSPRINTF() |
421 |
dnl |
422 |
AC_DEFUN(EGG_CHECK_FUNC_VSPRINTF, [dnl |
423 |
AC_CHECK_FUNCS(vsprintf) |
424 |
if test "$ac_cv_func_vsprintf" = "no" |
425 |
then |
426 |
cat << 'EOF' >&2 |
427 |
configure: error: |
428 |
|
429 |
Your system does not have the sprintf/vsprintf libraries. |
430 |
These are required to compile almost anything. Sorry. |
431 |
|
432 |
EOF |
433 |
exit 1 |
434 |
fi |
435 |
])dnl |
436 |
|
437 |
|
438 |
dnl EGG_HEADER_STDC() |
439 |
dnl |
440 |
AC_DEFUN(EGG_HEADER_STDC, [dnl |
441 |
if test "$ac_cv_header_stdc" = "no" |
442 |
then |
443 |
cat << 'EOF' >&2 |
444 |
configure: error: |
445 |
|
446 |
Your system must support ANSI C Header files. |
447 |
These are required for the language support. Sorry. |
448 |
|
449 |
EOF |
450 |
exit 1 |
451 |
fi |
452 |
])dnl |
453 |
|
454 |
|
455 |
dnl EGG_CHECK_LIBSAFE_SSCANF() |
456 |
dnl |
457 |
AC_DEFUN(EGG_CHECK_LIBSAFE_SSCANF, [dnl |
458 |
AC_CACHE_CHECK(for broken libsafe sscanf, egg_cv_var_libsafe_sscanf, [dnl |
459 |
AC_TRY_RUN([ |
460 |
#include <stdio.h> |
461 |
|
462 |
int main() |
463 |
{ |
464 |
char *src = "0x001,guppyism\n"; |
465 |
char dst[10]; |
466 |
int idx; |
467 |
if (sscanf(src, "0x%x,%10c", &idx, dst) == 1) |
468 |
exit(1); |
469 |
return 0; |
470 |
} |
471 |
], egg_cv_var_libsafe_sscanf="no", egg_cv_var_libsafe_sscanf="yes", |
472 |
egg_cv_var_libsafe_sscanf="no") |
473 |
]) |
474 |
if test "$egg_cv_var_libsafe_sscanf" = "yes" |
475 |
then |
476 |
AC_DEFINE(LIBSAFE_HACKS)dnl |
477 |
fi |
478 |
])dnl |
479 |
|
480 |
|
481 |
dnl EGG_CYGWIN() |
482 |
dnl |
483 |
dnl Check for Cygwin support. |
484 |
AC_DEFUN(EGG_CYGWIN, [dnl |
485 |
AC_CYGWIN |
486 |
if test "$ac_cv_cygwin" = "yes" |
487 |
then |
488 |
AC_DEFINE(CYGWIN_HACKS)dnl |
489 |
fi |
490 |
])dnl |
491 |
|
492 |
|
493 |
dnl EGG_EXEEXT() |
494 |
dnl |
495 |
dnl Test for executable suffix and define eggdrop's executable name |
496 |
dnl accordingly. |
497 |
AC_DEFUN(EGG_EXEEXT, [dnl |
498 |
EGGEXEC=eggdrop |
499 |
AC_EXEEXT |
500 |
if test ! "${EXEEXT-x}" = "x" |
501 |
then |
502 |
EGGEXEC="eggdrop$EXEEXT" |
503 |
fi |
504 |
AC_SUBST(EGGEXEC)dnl |
505 |
])dnl |
506 |
|
507 |
|
508 |
dnl EGG_TCL_ARG_WITH() |
509 |
dnl |
510 |
AC_DEFUN(EGG_TCL_ARG_WITH, [dnl |
511 |
# oohh new configure --variables for those with multiple tcl libs |
512 |
AC_ARG_WITH(tcllib, [ --with-tcllib=PATH full path to tcl library], tcllibname="$withval") |
513 |
AC_ARG_WITH(tclinc, [ --with-tclinc=PATH full path to tcl header], tclincname="$withval") |
514 |
|
515 |
WARN=0 |
516 |
# Make sure either both or neither $tcllibname and $tclincname are set |
517 |
if test ! "${tcllibname-x}" = "x" |
518 |
then |
519 |
if test "${tclincname-x}" = "x" |
520 |
then |
521 |
WARN=1 |
522 |
tcllibname="" |
523 |
TCLLIB="" |
524 |
TCLINC="" |
525 |
fi |
526 |
else |
527 |
if test ! "${tclincname-x}" = "x" |
528 |
then |
529 |
WARN=1 |
530 |
tclincname="" |
531 |
TCLLIB="" |
532 |
TCLINC="" |
533 |
fi |
534 |
fi |
535 |
if test "$WARN" = 1 |
536 |
then |
537 |
cat << 'EOF' >&2 |
538 |
configure: warning: |
539 |
|
540 |
You must specify both --with-tcllib and --with-tclinc for them to work. |
541 |
configure will now attempt to autodetect both the Tcl library and header... |
542 |
|
543 |
EOF |
544 |
fi |
545 |
])dnl |
546 |
|
547 |
|
548 |
dnl EGG_TCL_ENV() |
549 |
dnl |
550 |
AC_DEFUN(EGG_TCL_ENV, [dnl |
551 |
WARN=0 |
552 |
# Make sure either both or neither $TCLLIB and $TCLINC are set |
553 |
if test ! "${TCLLIB-x}" = "x" |
554 |
then |
555 |
if test "${TCLINC-x}" = "x" |
556 |
then |
557 |
WARN=1 |
558 |
WVAR1=TCLLIB |
559 |
WVAR2=TCLINC |
560 |
TCLLIB="" |
561 |
fi |
562 |
else |
563 |
if test ! "${TCLINC-x}" = "x" |
564 |
then |
565 |
WARN=1 |
566 |
WVAR1=TCLINC |
567 |
WVAR2=TCLLIB |
568 |
TCLINC="" |
569 |
fi |
570 |
fi |
571 |
if test "$WARN" = 1 |
572 |
then |
573 |
cat << EOF >&2 |
574 |
configure: warning: |
575 |
|
576 |
Environment variable $WVAR1 was set, but I did not detect ${WVAR2}. |
577 |
Please set both TCLLIB and TCLINC correctly if you wish to use them. |
578 |
configure will now attempt to autodetect both the Tcl library and header... |
579 |
|
580 |
EOF |
581 |
fi |
582 |
])dnl |
583 |
|
584 |
|
585 |
dnl EGG_TCL_WITH_TCLLIB() |
586 |
dnl |
587 |
AC_DEFUN(EGG_TCL_WITH_TCLLIB, [dnl |
588 |
# Look for Tcl library: if $tcllibname is set, check there first |
589 |
if test ! "${tcllibname-x}" = "x" |
590 |
then |
591 |
if test -f "$tcllibname" && test -r "$tcllibname" |
592 |
then |
593 |
TCLLIB=`echo $tcllibname | sed 's%/[[^/]][[^/]]*$%%'` |
594 |
TCLLIBFN=`$BASENAME $tcllibname | cut -c4-` |
595 |
TCLLIBEXT=".`echo $TCLLIBFN | $AWK '{j=split([$]1, i, "."); print i[[j]]}'`" |
596 |
TCLLIBFNS=`$BASENAME $tcllibname $TCLLIBEXT | cut -c4-` |
597 |
else |
598 |
cat << EOF >&2 |
599 |
configure: warning: |
600 |
|
601 |
The file '$tcllibname' given to option --with-tcllib is not valid. |
602 |
configure will now attempt to autodetect both the Tcl library and header... |
603 |
|
604 |
EOF |
605 |
tcllibname="" |
606 |
tclincname="" |
607 |
TCLLIB="" |
608 |
TCLLIBFN="" |
609 |
TCLINC="" |
610 |
TCLINCFN="" |
611 |
fi |
612 |
fi |
613 |
])dnl |
614 |
|
615 |
|
616 |
dnl EGG_TCL_WITH_TCLINC() |
617 |
dnl |
618 |
AC_DEFUN(EGG_TCL_WITH_TCLINC, [dnl |
619 |
# Look for Tcl header: if $tclincname is set, check there first |
620 |
if test ! "${tclincname-x}" = "x" |
621 |
then |
622 |
if test -f "$tclincname" && test -r "$tclincname" |
623 |
then |
624 |
TCLINC=`echo $tclincname | sed 's%/[[^/]][[^/]]*$%%'` |
625 |
TCLINCFN=`$BASENAME $tclincname` |
626 |
else |
627 |
cat << EOF >&2 |
628 |
configure: warning: |
629 |
|
630 |
The file '$tclincname' given to option --with-tclinc is not valid. |
631 |
configure will now attempt to autodetect both the Tcl library and header... |
632 |
|
633 |
EOF |
634 |
tcllibname="" |
635 |
tclincname="" |
636 |
TCLLIB="" |
637 |
TCLLIBFN="" |
638 |
TCLINC="" |
639 |
TCLINCFN="" |
640 |
fi |
641 |
fi |
642 |
])dnl |
643 |
|
644 |
|
645 |
dnl EGG_TCL_FIND_LIBRARY() |
646 |
dnl |
647 |
AC_DEFUN(EGG_TCL_FIND_LIBRARY, [dnl |
648 |
# Look for Tcl library: if $TCLLIB is set, check there first |
649 |
if test "${TCLLIBFN-x}" = "x" |
650 |
then |
651 |
if test ! "${TCLLIB-x}" = "x" |
652 |
then |
653 |
if test -d "$TCLLIB" |
654 |
then |
655 |
for tcllibfns in $tcllibnames |
656 |
do |
657 |
for tcllibext in $tcllibextensions |
658 |
do |
659 |
if test -r "$TCLLIB/lib$tcllibfns$tcllibext" |
660 |
then |
661 |
TCLLIBFN="$tcllibfns$tcllibext" |
662 |
TCLLIBEXT="$tcllibext" |
663 |
TCLLIBFNS="$tcllibfns" |
664 |
break 2 |
665 |
fi |
666 |
done |
667 |
done |
668 |
fi |
669 |
if test "${TCLLIBFN-x}" = "x" |
670 |
then |
671 |
cat << 'EOF' >&2 |
672 |
configure: warning: |
673 |
|
674 |
Environment variable TCLLIB was set, but incorrect. |
675 |
Please set both TCLLIB and TCLINC correctly if you wish to use them. |
676 |
configure will now attempt to autodetect both the Tcl library and header... |
677 |
|
678 |
EOF |
679 |
TCLLIB="" |
680 |
TCLLIBFN="" |
681 |
TCLINC="" |
682 |
TCLINCFN="" |
683 |
fi |
684 |
fi |
685 |
fi |
686 |
])dnl |
687 |
|
688 |
|
689 |
dnl EGG_TCL_FIND_HEADER() |
690 |
dnl |
691 |
AC_DEFUN(EGG_TCL_FIND_HEADER, [dnl |
692 |
# Look for Tcl header: if $TCLINC is set, check there first |
693 |
if test "${TCLINCFN-x}" = "x" |
694 |
then |
695 |
if test ! "${TCLINC-x}" = "x" |
696 |
then |
697 |
if test -d "$TCLINC" |
698 |
then |
699 |
for tclheaderfn in $tclheadernames |
700 |
do |
701 |
if test -r "$TCLINC/$tclheaderfn" |
702 |
then |
703 |
TCLINCFN="$tclheaderfn" |
704 |
break |
705 |
fi |
706 |
done |
707 |
fi |
708 |
if test "${TCLINCFN-x}" = "x" |
709 |
then |
710 |
cat << 'EOF' >&2 |
711 |
configure: warning: |
712 |
|
713 |
Environment variable TCLINC was set, but incorrect. |
714 |
Please set both TCLLIB and TCLINC correctly if you wish to use them. |
715 |
configure will now attempt to autodetect both the Tcl library and header... |
716 |
|
717 |
EOF |
718 |
TCLLIB="" |
719 |
TCLLIBFN="" |
720 |
TCLINC="" |
721 |
TCLINCFN="" |
722 |
fi |
723 |
fi |
724 |
fi |
725 |
])dnl |
726 |
|
727 |
|
728 |
dnl EGG_TCL_CHECK_LIBRARY() |
729 |
dnl |
730 |
AC_DEFUN(EGG_TCL_CHECK_LIBRARY, [dnl |
731 |
AC_MSG_CHECKING(for Tcl library) |
732 |
|
733 |
# Attempt autodetect for $TCLLIBFN if it's not set |
734 |
if test ! "${TCLLIBFN-x}" = "x" |
735 |
then |
736 |
AC_MSG_RESULT(using $TCLLIB/lib$TCLLIBFN) |
737 |
else |
738 |
for tcllibfns in $tcllibnames |
739 |
do |
740 |
for tcllibext in $tcllibextensions |
741 |
do |
742 |
for tcllibpath in $tcllibpaths |
743 |
do |
744 |
if test -r "$tcllibpath/lib$tcllibfns$tcllibext" |
745 |
then |
746 |
AC_MSG_RESULT(found $tcllibpath/lib$tcllibfns$tcllibext) |
747 |
TCLLIB="$tcllibpath" |
748 |
TCLLIBFN="$tcllibfns$tcllibext" |
749 |
TCLLIBEXT="$tcllibext" |
750 |
TCLLIBFNS="$tcllibfns" |
751 |
break 3 |
752 |
fi |
753 |
done |
754 |
done |
755 |
done |
756 |
fi |
757 |
|
758 |
# Show if $TCLLIBFN wasn't found |
759 |
if test "${TCLLIBFN-x}" = "x" |
760 |
then |
761 |
AC_MSG_RESULT(not found) |
762 |
fi |
763 |
AC_SUBST(TCLLIB)dnl |
764 |
AC_SUBST(TCLLIBFN)dnl |
765 |
])dnl |
766 |
|
767 |
|
768 |
dnl EGG_TCL_CHECK_HEADER() |
769 |
dnl |
770 |
AC_DEFUN(EGG_TCL_CHECK_HEADER, [dnl |
771 |
AC_MSG_CHECKING(for Tcl header) |
772 |
|
773 |
# Attempt autodetect for $TCLINCFN if it's not set |
774 |
if test ! "${TCLINCFN-x}" = "x" |
775 |
then |
776 |
AC_MSG_RESULT(using $TCLINC/$TCLINCFN) |
777 |
else |
778 |
for tclheaderpath in $tclheaderpaths |
779 |
do |
780 |
for tclheaderfn in $tclheadernames |
781 |
do |
782 |
if test -r "$tclheaderpath/$tclheaderfn" |
783 |
then |
784 |
AC_MSG_RESULT(found $tclheaderpath/$tclheaderfn) |
785 |
TCLINC="$tclheaderpath" |
786 |
TCLINCFN="$tclheaderfn" |
787 |
break 2 |
788 |
fi |
789 |
done |
790 |
done |
791 |
# FreeBSD hack ... |
792 |
if test "${TCLINCFN-x}" = "x" |
793 |
then |
794 |
for tcllibfns in $tcllibnames |
795 |
do |
796 |
for tclheaderpath in $tclheaderpaths |
797 |
do |
798 |
for tclheaderfn in $tclheadernames |
799 |
do |
800 |
if test -r "$tclheaderpath/$tcllibfns/$tclheaderfn" |
801 |
then |
802 |
AC_MSG_RESULT(found $tclheaderpath/$tcllibfns/$tclheaderfn) |
803 |
TCLINC="$tclheaderpath/$tcllibfns" |
804 |
TCLINCFN="$tclheaderfn" |
805 |
break 3 |
806 |
fi |
807 |
done |
808 |
done |
809 |
done |
810 |
fi |
811 |
fi |
812 |
|
813 |
# Show if $TCLINCFN wasn't found |
814 |
if test "${TCLINCFN-x}" = "x" |
815 |
then |
816 |
AC_MSG_RESULT(not found) |
817 |
fi |
818 |
AC_SUBST(TCLINC)dnl |
819 |
AC_SUBST(TCLINCFN)dnl |
820 |
])dnl |
821 |
|
822 |
|
823 |
dnl EGG_CACHE_UNSET(CACHE-ID) |
824 |
dnl |
825 |
dnl Unsets a certain cache item. Typically called before using |
826 |
dnl the AC_CACHE_*() macros. |
827 |
AC_DEFUN(EGG_CACHE_UNSET, [dnl |
828 |
unset $1 |
829 |
]) |
830 |
|
831 |
|
832 |
dnl EGG_TCL_DETECT_CHANGE() |
833 |
dnl |
834 |
dnl Detect whether the tcl system has changed since our last |
835 |
dnl configure run. Set egg_tcl_changed accordingly. |
836 |
dnl |
837 |
dnl Tcl related feature and version checks should re-run their |
838 |
dnl checks as soon as egg_tcl_changed is set to "yes". |
839 |
AC_DEFUN(EGG_TCL_DETECT_CHANGE, [dnl |
840 |
AC_MSG_CHECKING(whether the tcl system has changed) |
841 |
egg_tcl_changed=yes |
842 |
egg_tcl_id="$TCLLIB:$TCLLIBFN:$TCLINC:$TCLINCFN" |
843 |
if test ! "$egg_tcl_id" = ":::" |
844 |
then |
845 |
egg_tcl_cached=yes |
846 |
AC_CACHE_VAL(egg_cv_var_tcl_id, [dnl |
847 |
egg_cv_var_tcl_id="$egg_tcl_id" |
848 |
egg_tcl_cached=no |
849 |
]) |
850 |
if test "$egg_tcl_cached" = "yes" |
851 |
then |
852 |
if test "${egg_cv_var_tcl_id-x}" = "${egg_tcl_id-x}" |
853 |
then |
854 |
egg_tcl_changed=no |
855 |
else |
856 |
egg_cv_var_tcl_id="$egg_tcl_id" |
857 |
fi |
858 |
fi |
859 |
fi |
860 |
if test "$egg_tcl_changed" = "yes" |
861 |
then |
862 |
AC_MSG_RESULT(yes) |
863 |
else |
864 |
AC_MSG_RESULT(no) |
865 |
fi |
866 |
]) |
867 |
|
868 |
|
869 |
dnl EGG_TCL_CHECK_VERSION() |
870 |
dnl |
871 |
AC_DEFUN(EGG_TCL_CHECK_VERSION, [dnl |
872 |
# Both TCLLIBFN & TCLINCFN must be set, or we bail |
873 |
TCL_FOUND=0 |
874 |
if test ! "${TCLLIBFN-x}" = "x" && test ! "${TCLINCFN-x}" = "x" |
875 |
then |
876 |
TCL_FOUND=1 |
877 |
|
878 |
# Check Tcl's version |
879 |
if test "$egg_tcl_changed" = "yes" |
880 |
then |
881 |
EGG_CACHE_UNSET(egg_cv_var_tcl_version) |
882 |
fi |
883 |
AC_MSG_CHECKING(for Tcl version) |
884 |
AC_CACHE_VAL(egg_cv_var_tcl_version, [dnl |
885 |
egg_cv_var_tcl_version=`grep TCL_VERSION $TCLINC/$TCLINCFN | head -1 | $AWK '{gsub(/\"/, "", [$]3); print [$]3}'` |
886 |
]) |
887 |
|
888 |
if test ! "${egg_cv_var_tcl_version-x}" = "x" |
889 |
then |
890 |
AC_MSG_RESULT($egg_cv_var_tcl_version) |
891 |
else |
892 |
AC_MSG_RESULT(not found) |
893 |
TCL_FOUND=0 |
894 |
fi |
895 |
|
896 |
# Check Tcl's patch level (if avaliable) |
897 |
if test "$egg_tcl_changed" = "yes" |
898 |
then |
899 |
EGG_CACHE_UNSET(egg_cv_var_tcl_patch_level) |
900 |
fi |
901 |
AC_MSG_CHECKING(for Tcl patch level) |
902 |
AC_CACHE_VAL(egg_cv_var_tcl_patch_level, [dnl |
903 |
eval "egg_cv_var_tcl_patch_level=`grep TCL_PATCH_LEVEL $TCLINC/$TCLINCFN | head -1 | $AWK '{gsub(/\"/, "", [$]3); print [$]3}'`" |
904 |
]) |
905 |
|
906 |
if test ! "${egg_cv_var_tcl_patch_level-x}" = "x" |
907 |
then |
908 |
AC_MSG_RESULT($egg_cv_var_tcl_patch_level) |
909 |
else |
910 |
egg_cv_var_tcl_patch_level="unknown" |
911 |
AC_MSG_RESULT(unknown) |
912 |
fi |
913 |
fi |
914 |
|
915 |
# Check if we found Tcl's version |
916 |
if test "$TCL_FOUND" = 0 |
917 |
then |
918 |
cat << 'EOF' >&2 |
919 |
configure: error: |
920 |
|
921 |
I can't find Tcl on this system. |
922 |
|
923 |
Eggdrop requires Tcl to compile. If you already have Tcl installed |
924 |
on this system, and I just wasn't looking in the right place for it, |
925 |
set the environment variables TCLLIB and TCLINC so I will know where |
926 |
to find 'libtcl.a' (or 'libtcl.so') and 'tcl.h' (respectively). Then |
927 |
run 'configure' again. |
928 |
|
929 |
Read the README file if you don't know what Tcl is or how to get it |
930 |
and install it. |
931 |
|
932 |
EOF |
933 |
exit 1 |
934 |
fi |
935 |
])dnl |
936 |
|
937 |
|
938 |
dnl EGG_TCL_CHECK_PRE70() |
939 |
dnl |
940 |
AC_DEFUN(EGG_TCL_CHECK_PRE70, [dnl |
941 |
# Is this version of Tcl too old for us to use ? |
942 |
TCL_VER_PRE70=`echo $egg_cv_var_tcl_version | $AWK '{split([$]1, i, "."); if (i[[1]] < 7) print "yes"; else print "no"}'` |
943 |
if test "$TCL_VER_PRE70" = "yes" |
944 |
then |
945 |
cat << EOF >&2 |
946 |
configure: error: |
947 |
|
948 |
Your Tcl version is much too old for eggdrop to use. |
949 |
I suggest you download and complie a more recent version. |
950 |
The most reliable current version is $tclrecommendver and |
951 |
can be downloaded from $tclrecommendsite |
952 |
|
953 |
EOF |
954 |
exit 1 |
955 |
fi |
956 |
])dnl |
957 |
|
958 |
|
959 |
dnl EGG_TCL_CHECK_PRE75() |
960 |
dnl |
961 |
AC_DEFUN(EGG_TCL_CHECK_PRE75, [dnl |
962 |
# Are we using a pre 7.5 Tcl version ? |
963 |
TCL_VER_PRE75=`echo $egg_cv_var_tcl_version | $AWK '{split([$]1, i, "."); if (((i[[1]] == 7) && (i[[2]] < 5)) || (i[[1]] < 7)) print "yes"; else print "no"}'` |
964 |
if test "$TCL_VER_PRE75" = "yes" |
965 |
then |
966 |
AC_DEFINE(HAVE_PRE7_5_TCL)dnl |
967 |
fi |
968 |
])dnl |
969 |
|
970 |
|
971 |
dnl EGG_TCL_TESTLIBS() |
972 |
dnl |
973 |
AC_DEFUN(EGG_TCL_TESTLIBS, [dnl |
974 |
# Set variables for Tcl library tests |
975 |
TCL_TEST_LIB="$TCLLIBFNS" |
976 |
TCL_TEST_OTHERLIBS="-L$TCLLIB $EGG_MATH_LIB" |
977 |
|
978 |
if test ! "${ac_cv_lib_pthread-x}" = "x" |
979 |
then |
980 |
TCL_TEST_OTHERLIBS="$TCL_TEST_OTHERLIBS $ac_cv_lib_pthread" |
981 |
fi |
982 |
])dnl |
983 |
|
984 |
|
985 |
dnl EGG_TCL_CHECK_FREE() |
986 |
dnl |
987 |
AC_DEFUN(EGG_TCL_CHECK_FREE, [dnl |
988 |
if test "$egg_tcl_changed" = "yes" |
989 |
then |
990 |
EGG_CACHE_UNSET(egg_cv_var_tcl_free) |
991 |
fi |
992 |
|
993 |
# Check for Tcl_Free() |
994 |
AC_CHECK_LIB($TCL_TEST_LIB, Tcl_Free, egg_cv_var_tcl_free="yes", egg_cv_var_tcl_free="no", $TCL_TEST_OTHERLIBS) |
995 |
|
996 |
if test "$egg_cv_var_tcl_free" = "yes" |
997 |
then |
998 |
AC_DEFINE(HAVE_TCL_FREE)dnl |
999 |
fi |
1000 |
])dnl |
1001 |
|
1002 |
|
1003 |
dnl EGG_TCL_ENABLE_THREADS() |
1004 |
dnl |
1005 |
AC_DEFUN(EGG_TCL_ENABLE_THREADS, [dnl |
1006 |
AC_ARG_ENABLE(tcl-threads, |
1007 |
[ --disable-tcl-threads Disable threaded tcl support if detected. (Ignore this |
1008 |
option unless you know what you are doing)], |
1009 |
enable_tcl_threads="$enableval", |
1010 |
enable_tcl_threads=yes) |
1011 |
])dnl |
1012 |
|
1013 |
|
1014 |
dnl EGG_TCL_CHECK_THREADS() |
1015 |
dnl |
1016 |
AC_DEFUN(EGG_TCL_CHECK_THREADS, [dnl |
1017 |
if test "$egg_tcl_changed" = "yes" |
1018 |
then |
1019 |
EGG_CACHE_UNSET(egg_cv_var_tcl_threaded) |
1020 |
fi |
1021 |
|
1022 |
# Check for TclpFinalizeThreadData() |
1023 |
AC_CHECK_LIB($TCL_TEST_LIB, TclpFinalizeThreadData, egg_cv_var_tcl_threaded="yes", egg_cv_var_tcl_threaded="no", $TCL_TEST_OTHERLIBS) |
1024 |
|
1025 |
if test "$egg_cv_var_tcl_threaded" = "yes" |
1026 |
then |
1027 |
if test "$enable_tcl_threads" = "no" |
1028 |
then |
1029 |
|
1030 |
cat << 'EOF' >&2 |
1031 |
configure: warning: |
1032 |
|
1033 |
You have disabled threads support on a system with a threaded Tcl library. |
1034 |
Tcl features that rely on scheduled events may not function properly. |
1035 |
|
1036 |
EOF |
1037 |
else |
1038 |
AC_DEFINE(HAVE_TCL_THREADS)dnl |
1039 |
fi |
1040 |
|
1041 |
# Add pthread library to $LIBS if we need it |
1042 |
if test ! "${ac_cv_lib_pthread-x}" = "x" |
1043 |
then |
1044 |
LIBS="$ac_cv_lib_pthread $LIBS" |
1045 |
fi |
1046 |
fi |
1047 |
])dnl |
1048 |
|
1049 |
|
1050 |
dnl EGG_TCL_LIB_REQS() |
1051 |
dnl |
1052 |
AC_DEFUN(EGG_TCL_LIB_REQS, [dnl |
1053 |
if test ! "$TCLLIBEXT" = ".a" |
1054 |
then |
1055 |
TCL_REQS="$TCLLIB/lib$TCLLIBFN" |
1056 |
TCL_LIBS="-L$TCLLIB -l$TCLLIBFNS $EGG_MATH_LIB" |
1057 |
else |
1058 |
|
1059 |
# Set default make as static for unshared Tcl library |
1060 |
if test ! "$DEFAULT_MAKE" = "static" |
1061 |
then |
1062 |
cat << 'EOF' >&2 |
1063 |
configure: warning: |
1064 |
|
1065 |
Your Tcl library is not a shared lib. |
1066 |
configure will now set default make type to static... |
1067 |
|
1068 |
EOF |
1069 |
DEFAULT_MAKE=static |
1070 |
AC_SUBST(DEFAULT_MAKE)dnl |
1071 |
fi |
1072 |
|
1073 |
# Are we using a pre 7.4 Tcl version ? |
1074 |
TCL_VER_PRE74=`echo $egg_cv_var_tcl_version | $AWK '{split([$]1, i, "."); if (((i[[1]] == 7) && (i[[2]] < 4)) || (i[[1]] < 7)) print "yes"; else print "no"}'` |
1075 |
if test "$TCL_VER_PRE74" = "no" |
1076 |
then |
1077 |
|
1078 |
# Was the --with-tcllib option given ? |
1079 |
if test ! "${tcllibname-x}" = "x" |
1080 |
then |
1081 |
TCL_REQS="$TCLLIB/lib$TCLLIBFN" |
1082 |
TCL_LIBS="$TCLLIB/lib$TCLLIBFN $EGG_MATH_LIB" |
1083 |
else |
1084 |
TCL_REQS="$TCLLIB/lib$TCLLIBFN" |
1085 |
TCL_LIBS="-L$TCLLIB -l$TCLLIBFNS $EGG_MATH_LIB" |
1086 |
fi |
1087 |
else |
1088 |
cat << EOF >&2 |
1089 |
configure: warning: |
1090 |
|
1091 |
Your Tcl version ($egg_cv_var_tcl_version) is older then 7.4. |
1092 |
There are known problems, but we will attempt to work around them. |
1093 |
|
1094 |
EOF |
1095 |
TCL_REQS="libtcle.a" |
1096 |
TCL_LIBS="-L`pwd` -ltcle $EGG_MATH_LIB" |
1097 |
fi |
1098 |
fi |
1099 |
AC_SUBST(TCL_REQS)dnl |
1100 |
AC_SUBST(TCL_LIBS)dnl |
1101 |
])dnl |
1102 |
|
1103 |
|
1104 |
dnl EGG_FUNC_DLOPEN() |
1105 |
dnl |
1106 |
AC_DEFUN(EGG_FUNC_DLOPEN, [dnl |
1107 |
if test "$NEED_DL" = 1 && test "$ac_cv_func_dlopen" = "no" |
1108 |
then |
1109 |
if test "$LINUX" = "yes" |
1110 |
then |
1111 |
cat << 'EOF' >&2 |
1112 |
configure: warning: |
1113 |
|
1114 |
Since you are on a Linux system, this has a known problem... |
1115 |
I know a kludge for it, |
1116 |
EOF |
1117 |
|
1118 |
if test -r "/lib/libdl.so.1" |
1119 |
then |
1120 |
cat << 'EOF' >&2 |
1121 |
and you seem to have it, so we'll do that... |
1122 |
|
1123 |
EOF |
1124 |
AC_DEFINE(HAVE_DLOPEN)dnl |
1125 |
LIBS="/lib/libdl.so.1 $LIBS" |
1126 |
else |
1127 |
cat << 'EOF' >&2 |
1128 |
which you DON'T seem to have... doh! |
1129 |
perhaps you may still have the stuff lying around somewhere |
1130 |
if you work out where it is, add it to your XLIBS= lines |
1131 |
and #define HAVE_DLOPEN in config.h |
1132 |
|
1133 |
we'll proceed on anyway, but you probably won't be able |
1134 |
to 'make eggdrop' but you might be able to make the |
1135 |
static bot (I'll default your make to this version). |
1136 |
|
1137 |
EOF |
1138 |
DEFAULT_MAKE=static |
1139 |
fi |
1140 |
else |
1141 |
cat << 'EOF' >&2 |
1142 |
configure: warning: |
1143 |
|
1144 |
You don't seem to have libdl anywhere I can find it, this will |
1145 |
prevent you from doing dynamic modules, I'll set your default |
1146 |
make to static linking. |
1147 |
|
1148 |
EOF |
1149 |
DEFAULT_MAKE=static |
1150 |
fi |
1151 |
fi |
1152 |
])dnl |
1153 |
|
1154 |
|
1155 |
dnl EGG_SUBST_EGGVERSION() |
1156 |
dnl |
1157 |
AC_DEFUN(EGG_SUBST_EGGVERSION, [dnl |
1158 |
EGGVERSION=`grep 'char.egg_version' $srcdir/src/main.c | $AWK '{gsub(/(\"|\;)/, "", [$]4); print [$]4}'` |
1159 |
egg_version_num=`echo $EGGVERSION | $AWK 'BEGIN {FS = "."} {printf("%d%02d%02d", [$]1, [$]2, [$]3)}'` |
1160 |
AC_SUBST(EGGVERSION)dnl |
1161 |
AC_DEFINE_UNQUOTED(EGG_VERSION, $egg_version_num)dnl |
1162 |
])dnl |
1163 |
|
1164 |
|
1165 |
dnl EGG_SUBST_DEST() |
1166 |
dnl |
1167 |
AC_DEFUN(EGG_SUBST_DEST, [dnl |
1168 |
if test "${DEST-x}" = "x" |
1169 |
then |
1170 |
DEST=\${prefix} |
1171 |
fi |
1172 |
AC_SUBST(DEST)dnl |
1173 |
])dnl |
1174 |
|
1175 |
|
1176 |
dnl EGG_SUBST_MOD_UPDIR() |
1177 |
dnl |
1178 |
dnl Since module's Makefiles aren't generated by configure, some |
1179 |
dnl paths in src/mod/Makefile.in take care of them. For correct |
1180 |
dnl path "calculation", we need to keep absolute paths in mind |
1181 |
dnl (which don't need a "../" pre-pended). |
1182 |
AC_DEFUN(EGG_SUBST_MOD_UPDIR, [dnl |
1183 |
case "$srcdir" in |
1184 |
[[\\/]]* | ?:[[\\/]]*) |
1185 |
MOD_UPDIR="" |
1186 |
;; |
1187 |
*) |
1188 |
MOD_UPDIR="../" |
1189 |
;; |
1190 |
esac |
1191 |
AC_SUBST(MOD_UPDIR)dnl |
1192 |
])dnl |
1193 |
|
1194 |
|
1195 |
dnl EGG_REPLACE_IF_CHANGED(FILE-NAME, CONTENTS-CMDS, INIT-CMDS) |
1196 |
dnl |
1197 |
dnl Replace FILE-NAME if the newly created contents differs from the existing |
1198 |
dnl file contents. Otherwise leave the file allone. This avoids needless |
1199 |
dnl recompiles. |
1200 |
dnl |
1201 |
define(EGG_REPLACE_IF_CHANGED, [dnl |
1202 |
AC_OUTPUT_COMMANDS([ |
1203 |
egg_replace_file="$1" |
1204 |
echo "creating $1" |
1205 |
$2 |
1206 |
if test -f "$egg_replace_file" && cmp -s conftest.out $egg_replace_file |
1207 |
then |
1208 |
echo "$1 is unchanged" |
1209 |
else |
1210 |
mv conftest.out $egg_replace_file |
1211 |
fi |
1212 |
rm -f conftest.out], [$3])dnl |
1213 |
])dnl |
1214 |
|
1215 |
|
1216 |
dnl EGG_TCL_LUSH() |
1217 |
dnl |
1218 |
AC_DEFUN(EGG_TCL_LUSH, [dnl |
1219 |
EGG_REPLACE_IF_CHANGED(lush.h, [ |
1220 |
cat > conftest.out << EGGEOF |
1221 |
/* Ignore me but do not erase me. I am a kludge. */ |
1222 |
|
1223 |
#include "$egg_tclinc/$egg_tclincfn" |
1224 |
EGGEOF], [ |
1225 |
egg_tclinc="$TCLINC" |
1226 |
egg_tclincfn="$TCLINCFN"])dnl |
1227 |
])dnl |
1228 |
|
1229 |
|
1230 |
dnl EGG_CATCH_MAKEFILE_REBUILD() |
1231 |
dnl |
1232 |
AC_DEFUN(EGG_CATCH_MAKEFILE_REBUILD, [dnl |
1233 |
AC_OUTPUT_COMMANDS([ |
1234 |
if test -f .modules |
1235 |
then |
1236 |
$ac_given_srcdir/misc/modconfig --top_srcdir="$ac_given_srcdir" Makefile |
1237 |
fi]) |
1238 |
])dnl |
1239 |
|
1240 |
|
1241 |
dnl EGG_SAVE_PARAMETERS() |
1242 |
dnl |
1243 |
AC_DEFUN(EGG_SAVE_PARAMETERS, [dnl |
1244 |
dnl Normally, we shouldn't use this level as it's not intended for this |
1245 |
dnl type of code, but there's no other way to run it before the main |
1246 |
dnl parameter loop in configure. |
1247 |
AC_DIVERT_PUSH(AC_DIVERSION_NOTICE)dnl |
1248 |
egg_ac_parameters="[$]*" |
1249 |
AC_DIVERT_POP()dnl to NORMAL |
1250 |
AC_SUBST(egg_ac_parameters)dnl |
1251 |
])dnl |