Debian Codegraph @

configure.in

raw ◀ ▶
Source reconstructed at patch state 6 of 7 — not the installed (fully patched) source.
7 Debian patches touch this file
1 define([AC_CACHE_LOAD], )dnl
2 define([AC_CACHE_SAVE], )dnl
3 AC_INIT(generic/bltInit.c)
4 AC_CONFIG_HEADER(generic/bltConfig.h)
5 AC_CONFIG_AUX_DIR(cf)
6 AC_PREREQ(2.0)
7
8 # -----------------------------------------------------------------------
9 #
10 # Handle command line options
11 #
12 # --with-tcl=DIR
13 # --with-tk=DIR
14 # --with-cc=CC
15 # --with-cflags=flags This is probably for me only
16 # --with-gnu-ld
17 #
18 # -----------------------------------------------------------------------
19
20 INC_SPECS=""
21 LIB_SPECS=""
22 TCL_ONLY_LIB_SPECS=""
23 loader_run_path=""
24 DEFINES=""
25
26 blt_with_tcl=""
27 blt_with_tk=""
28 blt_enable_jpeg="no"
29 blt_enable_cygwin="yes"
30 blt_with_cc=""
31 blt_with_cflags="$CFLAGS"
32 blt_with_gnu_ld="no"
33 blt_with_tcl_includes=""
34 blt_with_tk_includes=""
35 blt_with_tcl_libraries=""
36 blt_with_tk_libraries=""
37 blt_with_scriptdir=""
38
39 AC_ARG_WITH(blt, [ --with-blt=DIR Install BLT scripts in DIR],
40 blt_with_scriptdir=$withval)
41 AC_ARG_WITH(tcl, [ --with-tcl=DIR Find tclConfig.sh in DIR],
42 blt_with_tcl=$withval)
43 AC_ARG_WITH(tk, [ --with-tk=DIR Find tkConfig.sh in DIR],
44 blt_with_tk=$withval)
45 AC_ARG_WITH(tclincls, [ --with-tclincls=DIR Find tcl.h in DIR],
46 blt_with_tcl_includes=$withval)
47 AC_ARG_WITH(tkincls, [ --with-tkincls=DIR Find tk.h in DIR],
48 blt_with_tk_includes=$withval)
49 AC_ARG_WITH(tcllibs, [ --with-tcllibs=DIR Find Tcl library in DIR],
50 blt_with_tcl_libraries=$withval)
51 AC_ARG_WITH(tklibs, [ --with-tklibs=DIR Find Tk library in DIR],
52 blt_with_tk_libraries=$withval)
53 AC_ARG_ENABLE(jpeg, [ --enable-jpeg=DIR Find JPEG headers and libraries in DIR], [
54 unset ac_cv_header_jpeglib_h
55 unset ac_cv_lib_jpeg ac_cv_lib_jpeg_jpeg_read_header
56 blt_enable_jpeg=$enableval ])
57 AC_ARG_ENABLE(cygwin, [ --enable-cygwin Use cygwin Tcl/Tk libraries. Requires cygwin1.dll], [
58 blt_enable_cygwin=$enableval ])
59 AC_ARG_WITH(cc, [ --with-cc=CC Set C compiler to CC], [
60 blt_with_cc=$with_cc
61 unset ac_cv_prog_CC
62 unset ac_cv_prog_CPP ])
63 AC_ARG_WITH(cflags, [ --with-cflags=FLAGS Set compiler flags to FLAGS],
64 blt_with_cflags="$with_cflags")
65 AC_ARG_WITH(gnu_ld, [ --with-gnu-ld Use GNU linker],
66 blt_with_gnu_ld="yes")
67
68 AC_CANONICAL_SYSTEM
69 AC_PREFIX_PROGRAM(wish)
70
71 # -----------------------------------------------------------------------
72 #
73 # Set a variable containing current working directory if /bin/sh
74 # doesn't do it already.
75 #
76 # -----------------------------------------------------------------------
77
78 PWD=`pwd`
79
80 # -----------------------------------------------------------------------
81 #
82 # C compiler and debugging flags
83 #
84 # -----------------------------------------------------------------------
85
86 BLT_ENV_CC=$CC
87
88 #
89 # CC search order
90 #
91 # 1. command line (--with-cc)
92 # 2. environment variable ($CC)
93 # 3. cached variable ($blt_cv_prog_cc)
94 # 4. check for program (AC_PROG_CC)
95 # 4. default to cc
96 #
97
98 AC_MSG_CHECKING([which C compiler])
99 if test "x${blt_with_cc}" != "x" ; then
100 CC=${blt_with_cc}
101 unset ac_cv_prog_CPP
102 unset ac_cv_prog_CC
103 elif test "x${BLT_ENV_CC}" != "x" ; then
104 unset ac_cv_prog_CPP
105 unset ac_cv_prog_CC
106 elif test "x${blt_cv_prog_cc}" != "x" ; then
107 CC=${blt_cv_prog_cc}
108 unset ac_cv_prog_CC
109 else
110 AC_PROG_CC
111 fi
112 if test "x${CC}" = "x" ; then
113 CC=cc
114 fi
115
116 case $target in
117 *-*-cygwin*|*-*-mingw*)
118 if test "${blt_enable_cygwin}" = "no" ; then
119 CC="${CC} -mno-cygwin"
120 fi
121 ;;
122 esac
123
124 AC_MSG_RESULT([$CC])
125
126 unset blt_cv_prog_cc
127 AC_CACHE_VAL(blt_cv_prog_cc, blt_cv_prog_cc=$CC)
128 AC_SUBST(CC)
129 AC_PROG_CPP
130 AS_IF([test "x${GCC}" != "x"],[
131 blt_have_gcc="yes"
132 ],[
133 AC_MSG_CHECKING([if C compiler is really gcc])
134 AC_EGREP_CPP(_cc_is_gcc_, [
135 #ifdef __GNUC__
136 _cc_is_gcc_
137 #endif
138 ], [blt_have_gcc=yes], [blt_have_gcc=no])
139 AC_MSG_RESULT([$blt_have_gcc])
140 ])
141
142 #
143 # CFLAGS search order
144 #
145 # 1. command line (--with-cflags)
146 # 2. cached variable ($blt_cv_prog_cflags)
147 # 3. set to "-O6" if using gcc ($blt_have_gcc)
148 # 4. otherwise, default to "-O"
149 #
150 AC_MSG_CHECKING([default compiler flags])
151 if test "x${blt_with_cflags}" != "x" ; then
152 CFLAGS=${blt_with_cflags}
153 elif test "x${blt_cv_prog_cflags}" != "x" ; then
154 CFLAGS=${blt_cv_prog_cflags}
155 elif test "${blt_have_gcc}" = "yes" ; then
156 CFLAGS=-O6
157 else
158 CFLAGS=-O
159 fi
160 AC_MSG_RESULT([$CFLAGS])
161 unset blt_cv_prog_cflags
162 AC_CACHE_VAL(blt_cv_prog_cflags, blt_cv_prog_cflags=$CFLAGS)
163 AC_SUBST(CFLAGS)
164
165 GCCFLAGS=""
166 if test "${blt_have_gcc}" = "yes" ; then
167 GCCFLAGS="-Wall"
168 if test "${CFLAGS}" = "-g" ; then
169 GCCFLAGS="-Wshadow -Winline -Wpointer-arith ${GCCFLAGS}"
170 fi
171 fi
172 AC_SUBST(GCCFLAGS)
173
174 AC_CYGWIN
175
176 blt_lib_prefix="lib"
177 case $target in
178 *-*-cygwin*|*-*-mingw*)
179 blt_platform="win"
180 if test "$ac_cv_cygwin" = "yes" ; then
181 blt_lib_prefix="cyg"
182 else
183 blt_lib_prefix=""
184 fi
185 ;;
186 *-*-macosx)
187 blt_platform="macosx"
188 ;;
189 *)
190 blt_platform="unix"
191 ;;
192 esac
193
194
195 # -----------------------------------------------------------------------
196 #
197 # Programs: Check for existence of ranlib and install programs
198 #
199 # -----------------------------------------------------------------------
200 AC_PROG_AWK
201 AC_PROG_INSTALL
202 AC_PROG_RANLIB
203 AC_PROG_LN_S
204
205 # -----------------------------------------------------------------------
206 #
207 # Libraries: Check for libraries used
208 #
209 # -----------------------------------------------------------------------
210 AC_CHECK_LIB(socket, main)
211 AC_CHECK_LIB(nsl, main)
212 AC_CHECK_LIB(m, main)
213 # -----------------------------------------------------------------------
214 #
215 # Headers: Check for header files used
216 #
217 # -----------------------------------------------------------------------
218
219 AC_HEADER_STDC
220 AC_HEADER_SYS_WAIT
221 AC_HEADER_TIME
222
223 AC_CHECK_HEADERS(inttypes.h)
224 if test "${ac_cv_header_inttypes_h}" = "yes" ; then
225 HAVE_INTTYPES_H=1
226 else
227 HAVE_INTTYPES_H=0
228 fi
229 AC_SUBST(HAVE_INTTYPES_H)
230
231 AC_CHECK_HEADERS(limits.h sys/param.h)
232 AC_CHECK_HEADERS(string.h ctype.h)
233 AC_CHECK_HEADERS(errno.h float.h math.h ieeefp.h)
234 AC_CHECK_HEADERS(sys/time.h waitflags.h sys/wait.h)
235 AC_CHECK_HEADERS(malloc.h memory.h)
236 AC_CHECK_HEADERS(setjmp.h)
237
238 if test "${blt_enable_jpeg}" != "no" ; then
239 jpeg_save_CPPFLAGS=${CPPFLAGS}
240 CPPFLAGS=""
241 if test "${blt_enable_jpeg}" != "yes" ; then
242 CPPFLAGS="-I${blt_enable_jpeg}/include"
243 fi
244 AC_CHECK_HEADERS(jpeglib.h, [JPEG_INC_SPEC="${CPPFLAGS}"], [JPEG_INC_SPEC=""])
245 CPPFLAGS=${jpeg_save_CPPFLAGS}
246 fi
247
248 # Run this check after jpeglib.h because jpeglib.h sets HAVE_STDLIB_H
249 AC_CHECK_HEADERS(stdlib.h unistd.h)
250
251 # -----------------------------------------------------------------------
252 #
253 # Types: Check for existence of types of size_t and pid_t
254 #
255 # -----------------------------------------------------------------------
256 AC_TYPE_SIZE_T
257 AC_TYPE_PID_T
258
259 AC_MSG_CHECKING([whether union wait is defined correctly])
260 AC_CACHE_VAL(blt_cv_struct_wait_works,
261 AC_TRY_COMPILE([#include <sys/types.h>
262 #include <sys/wait.h>], [
263 /*
264 * Check whether <sys/wait.h> defines the type "union wait"
265 * correctly. It's needed because of weirdness in HP-UX where
266 * "union wait" is defined in both the BSD and SYS-V environments.
267 * Checking the usability of WIFEXITED seems to do the trick.
268 */
269 union wait x;
270 WIFEXITED(x); /* Generates compiler error if WIFEXITED
271 * uses an int. */
272 ],
273 [blt_cv_struct_wait_works="yes"],
274 [blt_cv_struct_wait_works="no"]))
275
276 if test "${blt_cv_struct_wait_works}" = "yes"; then
277 AC_DEFINE(HAVE_UNION_WAIT)
278 fi
279 AC_MSG_RESULT([$blt_cv_struct_wait_works])
280
281 # -----------------------------------------------------------------------
282 #
283 # Compiler characteristics:
284 # Check for existence of types of size_t and pid_t
285 #
286 # -----------------------------------------------------------------------
287
288 AC_C_BIGENDIAN
289 AC_CHECK_SIZEOF(int)
290 AC_CHECK_SIZEOF(long)
291 AC_CHECK_SIZEOF(long long)
292 AC_CHECK_SIZEOF(void *)
293
294 SIZEOF_LONG="${ac_cv_sizeof_long}"
295 SIZEOF_LONG_LONG="${ac_cv_sizeof_long_long}"
296 SIZEOF_VOID_P="${ac_cv_sizeof_void_p}"
297 SIZEOF_INT="${ac_cv_sizeof_int}"
298 AC_SUBST(SIZEOF_INT)
299 AC_SUBST(SIZEOF_LONG)
300 AC_SUBST(SIZEOF_LONG_LONG)
301 AC_SUBST(SIZEOF_VOID_P)
302
303 # -----------------------------------------------------------------------
304 #
305 # Library Functions: Check for strdup, drand48, and srand48.
306 #
307 # -----------------------------------------------------------------------
308
309 AC_HAVE_FUNCS(strdup strcasecmp strncasecmp drand48 srand48 finite isnan)
310
311 # For HPUX it's a little more complicated to search for isfinite
312 AC_MSG_CHECKING([for isfinite])
313 AC_CACHE_VAL(blt_cv_have_isfinite,
314 AC_TRY_LINK([#include <math.h>], [
315 double x = 1.0;
316 if (isfinite(x)) {
317 return 0;
318 }
319 ], [blt_cv_have_isfinite="yes"], [blt_cv_have_isfinite="no"]))
320
321 if test "${blt_cv_have_isfinite}" = "yes"; then
322 AC_DEFINE(HAVE_ISFINITE)
323 fi
324 AC_MSG_RESULT([$blt_cv_have_isfinite])
325
326 # -----------------------------------------------------------------------
327 #
328 # Check the smallest value such that 1.0 + x != 1.0.
329 # For ANSI compilers this is DBL_EPSILON in float.h
330 #
331 #--------------------------------------------------------------------
332
333 AC_MSG_CHECKING([whether DBL_EPSILON is defined in float.h])
334 AC_CACHE_VAL(blt_cv_found_dbl_epsilon,
335 AC_EGREP_CPP(yes,
336 [
337 #ifdef HAVE_FLOAT_H
338 #include <float.h>
339 #endif
340 #ifdef DBL_EPSILON
341 yes
342 #endif
343 ], blt_cv_found_dbl_epsilon=yes, blt_cv_found_dbl_epsilon=no)
344 )
345 AC_MSG_RESULT([${blt_cv_found_dbl_epsilon}])
346
347 if test "${blt_cv_found_dbl_epsilon}" = "no" ; then
348 AC_CACHE_VAL(blt_cv_dbl_epsilon,
349 old_flags="$CFLAGS"
350 CFLAGS="-g -lm"
351 AC_MSG_CHECKING([whether DBL_EPSILON can be computed])
352 AC_TRY_RUN_WITH_OUTPUT([blt_cv_dbl_epsilon], [
353 main () {
354 double e, u;
355 /*
356 * Check the smallest value such that 1.0 + x != 1.0.
357 * For ANSI compilers this is DBL_EPSILON in float.h
358 */
359 u = 1.0;
360 for(;;) {
361 u *= 0.5;
362 if ((1.0 + u) == 1.0) {
363 break;
364 }
365 }
366 e = u * 2.0;
367 printf("%.17e\n", e);
368 exit(0);
369 }])
370 CFLAGS="$old_flags"
371 AC_DEFINE_UNQUOTED(BLT_DBL_EPSILON, ${blt_cv_dbl_epsilon})
372 AC_MSG_RESULT([${blt_cv_dbl_epsilon}])
373 )
374 fi
375
376
377 AC_MSG_CHECKING([whether declaration is needed for strdup])
378 AC_CACHE_VAL(blt_cv_nedd_decl_strdup,
379 AC_EGREP_CPP(strdup, [
380 #ifdef HAVE_STDLIB_H
381 #include <stdlib.h>
382 #endif
383 #ifdef HAVE_STRING_H
384 #include <string.h>
385 #endif
386 #ifdef HAVE_UNISTD_H
387 #include <unistd.h>
388 #endif /* HAVE_UNISTD_H */
389 ], [blt_cv_need_decl_strdup=no], [blt_cv_need_decl_strdup=yes]))
390
391 if test "${blt_cv_need_decl_strdup}" = "yes"; then
392 AC_DEFINE(NEED_DECL_STRDUP)
393 fi
394 AC_MSG_RESULT([$blt_cv_need_decl_strdup])
395
396 AC_MSG_CHECKING([whether declaration is needed for drand48])
397 AC_CACHE_VAL(blt_cv_need_decl_drand48,
398 AC_EGREP_CPP(drand48, [
399 #ifdef HAVE_STDLIB_H
400 #include <stdlib.h>
401 #endif
402 #ifdef HAVE_MATH_H
403 #include <math.h>
404 #endif
405 #ifdef HAVE_UNISTD_H
406 #include <unistd.h>
407 #endif /* HAVE_UNISTD_H */
408 ], [blt_cv_need_decl_drand48=no], [blt_cv_need_decl_drand48=yes]))
409
410 if test "${blt_cv_need_decl_drand48}" = "yes"; then
411 AC_DEFINE(NEED_DECL_DRAND48)
412 fi
413 AC_MSG_RESULT([$blt_cv_need_decl_drand48])
414
415 AC_MSG_CHECKING([whether declaration is needed for srand48])
416 AC_CACHE_VAL(blt_cv_need_decl_srand48,
417 AC_EGREP_CPP(srand48, [
418 #ifdef HAVE_STDLIB_H
419 #include <stdlib.h>
420 #endif
421 #ifdef HAVE_MATH_H
422 #include <math.h>
423 #endif
424 #ifdef HAVE_UNISTD_H
425 #include <unistd.h>
426 #endif /* HAVE_UNISTD_H */
427 ], [blt_cv_need_decl_srand48=no], [blt_cv_need_decl_srand48=yes]))
428
429 if test "${blt_cv_need_decl_srand48}" = "yes"; then
430 AC_DEFINE(NEED_DECL_SRAND48)
431 fi
432 AC_MSG_RESULT([$blt_cv_need_decl_srand48])
433
434 AC_MSG_CHECKING([whether declaration is needed for j1])
435 AC_CACHE_VAL(blt_cv_need_decl_j1,
436 AC_EGREP_CPP(j1, [
437 #ifdef HAVE_STDLIB_H
438 #include <stdlib.h>
439 #endif
440 #ifdef HAVE_MATH_H
441 #include <math.h>
442 #endif
443 #ifdef HAVE_UNISTD_H
444 #include <unistd.h>
445 #endif /* HAVE_UNISTD_H */
446 ], [blt_cv_need_decl_j1=no], [blt_cv_need_decl_j1=yes]))
447
448 if test "${blt_cv_need_decl_j1}" = "yes"; then
449 AC_DEFINE(NEED_DECL_J1)
450 fi
451 AC_MSG_RESULT([$blt_cv_need_decl_j1])
452
453 # -----------------------------------------------------------------------
454 #
455 # System services: X, Tcl, Tk
456 #
457 # -----------------------------------------------------------------------
458 AC_PATH_X
459
460 # -----------------------------------------------------------------------
461 #
462 # Find the Tcl build configuration file "tclConfig.sh"
463 #
464 # -----------------------------------------------------------------------
465
466 AC_MSG_CHECKING([for tclConfig.sh])
467 tcl_config_sh=""
468 if test "x$blt_with_tcl" != "x" ; then
469
470 # Verify that a tclConfig.sh file exists in the directory specified
471 # by --with-tcl.
472
473 for dir in \
474 $blt_with_tcl
475 do
476 if test -r "$dir/tclConfig.sh" ; then
477 tcl_config_sh="$dir/tclConfig.sh"
478 break
479 elif test -r "$dir/lib/tclConfig.sh" ; then
480 tcl_config_sh="$dir/lib/tclConfig.sh"
481 break
482 elif test -r "$dir/$blt_platform/tclConfig.sh" ; then
483 tcl_config_sh="$dir/$blt_platform/tclConfig.sh"
484 break
485 fi
486 done
487 else
488
489 # Otherwise, search for Tcl configuration file.
490
491 # 1. Search previously named locations.
492
493 for dir in \
494 $prefix \
495 $exec_prefix \
496 $blt_cv_tcl_lib
497 do
498 if test -r "$dir/tclConfig.sh" ; then
499 tcl_config_sh="$dir/tclConfig.sh"
500 break
501 elif test -r "$dir/lib/tclConfig.sh" ; then
502 tcl_config_sh="$dir/lib/tclConfig.sh"
503 break
504 elif test -r "$dir/$blt_platform/tclConfig.sh" ; then
505 tcl_config_sh="$dir/$blt_platform/tclConfig.sh"
506 break
507 fi
508 done
509
510 # 2. Search source directories.
511
512 if test "x$tcl_config_sh" = "x" ; then
513 for dir in \
514 `ls -dr ../tcl[[7-9]].[[0-9]]* 2>/dev/null` \
515 ../tcl \
516 `ls -dr ../../tcl[[7-9]].[[0-9]]* 2>/dev/null` \
517 ../../tcl \
518 `ls -dr ../../../tcl[[7-9]].[[0-9]]* 2>/dev/null` \
519 ../../../tcl
520 do
521 if test -r "$dir/$blt_platform/tclConfig.sh" ; then
522 tcl_config_sh="$dir/$blt_platform/tclConfig.sh"
523 break
524 fi
525 done
526 fi
527
528 # 3. Search standard locations.
529
530 if test "x$tcl_config_sh" = "x" ; then
531 for dir in \
532 `ls -dr /usr/local/tcl/tcl[[7-9]].[[0-9]]* 2>/dev/null` \
533 /usr/local/tcl \
534 /usr/local \
535 /usr
536 do
537 if test -r "$dir/tclConfig.sh" ; then
538 tcl_config_sh="$dir/tclConfig.sh"
539 break
540 elif test -r "$dir/lib/tclConfig.sh" ; then
541 tcl_config_sh="$dir/lib/tclConfig.sh"
542 break
543 fi
544 done
545 fi
546 fi
547
548 AC_MSG_RESULT([${tcl_config_sh}])
549
550 if test "x$tcl_config_sh" = "x" ; then
551 echo "can't find Tcl configuration script \"tclConfig.sh\""
552 exit 1
553 fi
554
555 # -----------------------------------------------------------------------
556 #
557 # Find the Tk build configuration file "tkConfig.sh"
558 #
559 # -----------------------------------------------------------------------
560
561 AC_MSG_CHECKING([for tkConfig.sh])
562 tk_config_sh=""
563 if test "x$blt_with_tk" != "x" -o "x$blt_with_tcl" != "x"; then
564
565 # Verify that a tkConfig.sh file exists in the directory specified
566 # by --with-tcl or --with-tk.
567
568 for dir in \
569 $blt_with_tk \
570 $blt_with_tcl
571 do
572 if test -r "$dir/tkConfig.sh" ; then
573 tk_config_sh="$dir/tkConfig.sh"
574 break
575 elif test -r "$dir/lib/tkConfig.sh" ; then
576 tk_config_sh="$dir/lib/tkConfig.sh"
577 break
578 elif test -r "$dir/$blt_platform/tkConfig.sh" ; then
579 tk_config_sh="$dir/$blt_platform/tkConfig.sh"
580 break
581 fi
582 done
583 else
584
585 # Search for Tk configuration file.
586
587 # 1. Search previously named locations.
588
589 for dir in \
590 $prefix \
591 $exec_prefix \
592 $blt_cv_tk_lib \
593 $blt_cv_tcl_lib
594 do
595 if test -r "$dir/tkConfig.sh" ; then
596 tk_config_sh="$dir/tkConfig.sh"
597 break
598 elif test -r "$dir/lib/tkConfig.sh" ; then
599 tk_config_sh="$dir/lib/tkConfig.sh"
600 break
601 elif test -r "$dir/$blt_platform/tkConfig.sh" ; then
602 tk_config_sh="$dir/$blt_platform/tkConfig.sh"
603 break
604 fi
605 done
606
607 # 2. Search source directories.
608
609 if test "x$tk_config_sh" = "x" ; then
610 for dir in \
611 ../tcl \
612 `ls -dr ../tk[[4-9]].[[0-9]]* 2>/dev/null` \
613 ../../tcl \
614 `ls -dr ../../tk[[4-9]].[[0-9]]* 2>/dev/null` \
615 ../../../tcl \
616 `ls -dr ../../../tk[[4-9]].[[0-9]]* 2>/dev/null`
617 do
618 if test -r "$dir/$blt_platform/tkConfig.sh"; then
619 tk_config_sh="$dir/$blt_platform/tkConfig.sh"
620 break
621 fi
622 done
623 fi
624
625 # 3. Search standard locations.
626
627 if test "x$tk_config_sh" = "x" ; then
628 for dir in \
629 `ls -dr /usr/local/tcl/tcl[[7-9]].[[0-9]]* 2>/dev/null` \
630 /usr/local/tcl \
631 /usr/local \
632 ${x_libraries} \
633 /usr
634 do
635 if test -r "$dir/tkConfig.sh" ; then
636 tk_config_sh="$dir/tkConfig.sh"
637 break
638 elif test -r "$dir/lib/tkConfig.sh" ; then
639 tk_config_sh="$dir/lib/tkConfig.sh"
640 break
641 fi
642 done
643 fi
644 fi
645 AC_MSG_RESULT([${tk_config_sh}])
646
647 if test "x$tk_config_sh" = "x" ; then
648 echo "can't find Tk configuration script \"tkConfig.sh\""
649 exit 1
650 fi
651
652 # -----------------------------------------------------------------------
653 #
654 # Source in the Tcl/Tk configuration scripts.
655 #
656 # -----------------------------------------------------------------------
657
658 . $tcl_config_sh
659 . $tk_config_sh
660
661 TCL_INC_DIR=""
662 TK_INC_DIR=""
663
664 if test "x${blt_with_tcl_includes}" != "x" ; then
665 if test -r "${blt_with_tcl_includes}/tcl.h" ; then
666 TCL_INC_DIR=${blt_with_tcl_includes}
667 else
668 echo "Can't find tcl.h in \"${blt_with_tcl_includes}\""
669 exit 1
670 fi
671 else
672 for dir in \
673 ${TCL_PREFIX}/include/tcl${TCL_MAJOR_VERSION}.${TCL_MINOR_VERSION} \
674 ${TCL_PREFIX}/include \
675 ${TCL_SRC_DIR}/generic
676 do
677 if test -r "$dir/tcl.h" ; then
678 TCL_INC_DIR=$dir
679 break
680 fi
681 done
682 if test "x${TCL_INC_DIR}" = "x" ; then
683 echo "Can't find tcl.h header file"
684 exit 1
685 fi
686 fi
687
688 if test "x${blt_with_tk_includes}" != "x" ; then
689 if test -r "${blt_with_tk_includes}/tk.h" ; then
690 TK_INC_DIR=${blt_with_tk_includes}
691 else
692 echo "Can't find tk.h in \"${blt_with_tk_includes}\""
693 exit 1
694 fi
695 else
696 for dir in \
697 ${TK_PREFIX}/include/tk${TK_MAJOR_VERSION}.${TK_MINOR_VERSION} \
698 ${TK_PREFIX}/include \
699 ${TK_SRC_DIR}/generic \
700 ${TCL_INC_DIR}
701 do
702 if test -r "$dir/tk.h" ; then
703 TK_INC_DIR=$dir
704 break
705 fi
706 done
707 if test "x${TK_INC_DIR}" = "x" ; then
708 echo "Can't find tk.h header file"
709 exit 1
710 fi
711 fi
712
713 case $target in
714 *-sunos4*|*-*-netbsd|NetBSD-*|FreeBSD-*|OpenBSD-*|*-*-cygwin*|*-*-mingw*)
715 TCL_LIB_NAME="tcl${TCL_MAJOR_VERSION}${TCL_MINOR_VERSION}"
716 TK_LIB_NAME="tk${TK_MAJOR_VERSION}${TK_MINOR_VERSION}"
717 ;;
718 *)
719 TCL_LIB_NAME="tcl${TCL_MAJOR_VERSION}.${TCL_MINOR_VERSION}"
720 TK_LIB_NAME="tk${TK_MAJOR_VERSION}.${TK_MINOR_VERSION}"
721 ;;
722 esac
723
724 TCL_LIB_SPEC="-l${TCL_LIB_NAME}"
725 TK_LIB_SPEC="-l${TK_LIB_NAME}"
726
727 case $target in
728 *-hpux*)
729 SHLIB_SUFFIX="sl"
730 ;;
731 *)
732 SHLIB_SUFFIX="so"
733 ;;
734 esac
735
736 TCL_LIB_DIR="${TCL_SRC_DIR}/$blt_platform"
737 TK_LIB_DIR="${TK_SRC_DIR}/$blt_platform"
738
739 if test "x${blt_with_tcl_libraries}" != "x" ; then
740 for libname in \
741 "${blt_with_tcl_libraries}/lib${TCL_LIB_NAME}.${SHLIB_SUFFIX}" \
742 "${blt_with_tcl_libraries}/lib${TCL_LIB_NAME}.a"
743 do
744 if test -r "$libname" ; then
745 TCL_LIB_DIR="${blt_with_tcl_libraries}"
746 break
747 fi
748 done
749 if test "x${TCL_LIB_DIR}" = "x" ; then
750 echo "Can't find tcl library in \"${blt_with_tcl_libraries}\""
751 exit 1
752 fi
753 else
754 for libname in \
755 "${TCL_EXEC_PREFIX}/lib/lib${TCL_LIB_NAME}.${SHLIB_SUFFIX}" \
756 "${TCL_EXEC_PREFIX}/lib/lib${TCL_LIB_NAME}.a"
757 do
758 if test -r "$libname" ; then
759 TCL_LIB_DIR="${TCL_EXEC_PREFIX}/lib"
760 break
761 fi
762 done
763 if test "x${TCL_LIB_DIR}" = "x" ; then
764 echo "Can't find tcl library"
765 exit 1
766 fi
767 fi
768
769 if test "x${blt_with_tk_libraries}" != "x" ; then
770 for libname in \
771 "${blt_with_tk_libraries}/lib${TK_LIB_NAME}.${SHLIB_SUFFIX}" \
772 "${blt_with_tk_libraries}/lib${TK_LIB_NAME}.a"
773 do
774 if test -r "$libname" ; then
775 TK_LIB_DIR="${blt_with_tk_libraries}"
776 break
777 fi
778 done
779 if test "x${TK_LIB_DIR}" = "x" ; then
780 echo "Can't find tk library in \"${blt_with_tk_libraries}\""
781 exit 1
782 fi
783 else
784 for libname in \
785 "${TK_EXEC_PREFIX}/lib/lib${TK_LIB_NAME}.${SHLIB_SUFFIX}" \
786 "${TK_EXEC_PREFIX}/lib/lib${TK_LIB_NAME}.a"
787 do
788 if test -r "$libname" ; then
789 TK_LIB_DIR="${TK_EXEC_PREFIX}/lib"
790 break
791 fi
792 done
793 if test "x${TK_LIB_DIR}" = "x" ; then
794 echo "Can't find tk library"
795 exit 1
796 fi
797 fi
798
799 # -----------------------------------------------------------------------
800 #
801 # Include files
802 #
803 # Append to INC_SPECS the various include files specifications
804 # (built fromt the include directory information).
805 #
806 # -----------------------------------------------------------------------
807
808 # JPEG include files
809 if test "${blt_enable_jpeg}" != "no" ; then
810 if test "x${JPEG_INC_SPEC}" != "x" ; then
811 INC_SPECS="${INC_SPECS} ${JPEG_INC_SPEC}"
812 fi
813 fi
814
815 # Tk include files
816 if test "${TK_INC_DIR}" != "/usr/include" ; then
817 INC_SPECS="${INC_SPECS} -I${TK_INC_DIR}"
818 fi
819 INC_SPECS="${INC_SPECS} -I${TK_SRC_DIR}/generic -I${TK_SRC_DIR}/unix"
820
821 # Tcl include files
822 #
823 # Add the include directory specification only if the Tcl
824 # headers reside in a different directory from Tk's.
825 if test "${TCL_INC_DIR}" != "/usr/include" -a \
826 "${TCL_INC_DIR}" != "${TK_INC_DIR}" ; then
827 INC_SPECS="${INC_SPECS} -I${TCL_INC_DIR}"
828 fi
829 INC_SPECS="${INC_SPECS} -I${TCL_SRC_DIR}/generic -I${TCL_SRC_DIR}/unix"
830
831
832 # On Windows, override the default include directory with our own.
833 if test "${blt_platform}" = "win"; then
834 x_includes="NONE"
835 fi
836
837 # X11 include files
838 if test "x${x_includes}" != "x" -a \
839 "${x_includes}" != "NONE" -a \
840 "${x_includes}" != "/usr/include" -a \
841 "${x_includes}" != "${TK_INC_DIR}" -a \
842 "${x_includes}" != "${TCL_INC_DIR}" ; then
843 INC_SPECS="${INC_SPECS} -I${x_includes}"
844 fi
845
846 # -----------------------------------------------------------------------
847 #
848 # Libraries
849 #
850 # Append to LIB the various library specifications
851 # (built from the library directory information).
852 #
853 # -----------------------------------------------------------------------
854
855 # Tk libraries
856 if test "${TK_LIB_DIR}" = "/usr/lib" ; then
857 LIB_SPECS="${LIB_SPECS} ${TK_LIB_SPEC}"
858 else
859 LIB_SPECS="${LIB_SPECS} -L${TK_LIB_DIR} ${TK_LIB_SPEC}"
860 if test "x${loader_run_path}" = "x" ; then
861 loader_run_path="${TK_LIB_DIR}"
862 else
863 loader_run_path="${TK_LIB_DIR}:${loader_run_path}"
864 fi
865 fi
866
867 # Tcl libraries
868 if test "${TCL_LIB_DIR}" = "/usr/lib" -o \
869 "${TCL_LIB_DIR}" = "${TK_LIB_DIR}" ; then
870 LIB_SPECS="${LIB_SPECS} ${TCL_LIB_SPEC}"
871 else
872 LIB_SPECS="${LIB_SPECS} -L${TCL_LIB_DIR} ${TCL_LIB_SPEC}"
873 if test "x${loader_run_path}" = "x" ; then
874 loader_run_path="${TCL_LIB_DIR}"
875 else
876 loader_run_path="${TCL_LIB_DIR}:${loader_run_path}"
877 fi
878 fi
879
880 if test "${TCL_LIB_DIR}" = "/usr/lib" ; then
881 TCL_ONLY_LIB_SPECS="${TCL_LIB_SPEC}"
882 else
883 TCL_ONLY_LIB_SPECS="-L${TCL_LIB_DIR} ${TCL_LIB_SPEC}"
884 fi
885
886
887 # Collect the libraries for AIX that aren't using stubs.
888 aix_lib_specs=""
889
890
891 if test "${blt_platform}" = "win"; then
892 LIB_SPECS="${LIB_SPECS} -mwindows"
893 elif test "${blt_platform}" = "unix"; then
894
895 # Add specification for X11 library only on Unix platforms.
896
897 if test "x${x_libraries}" = "x" -o \
898 "x${x_libraries}" = "NONE" -o \
899 "${x_libraries}" = "/usr/lib" -o \
900 "${x_libraries}" = "${TK_LIB_DIR}" -o \
901 "${x_libraries}" = "${TCL_LIB_DIR}" ; then
902 LIB_SPECS="${LIB_SPECS} -lX11"
903 aix_lib_specs="${aix_lib_specs} -lX11"
904 else
905 LIB_SPECS="${LIB_SPECS} -L${x_libraries} -lX11"
906 aix_lib_specs="${aix_lib_specs} -L${x_libraries} -lX11"
907 if test "x${loader_run_path}" = "x" ; then
908 loader_run_path="${x_libraries}"
909 else
910 loader_run_path="${loader_run_path}:${x_libraries}"
911 fi
912 fi
913 fi
914
915 # JPEG library
916 if test "${blt_enable_jpeg}" != "no" ; then
917 jpeg_save_LDFlags="${LDFLAGS}"
918 JPEG_LIB_SPEC="-ljpeg"
919 JPEG_LIB_DIR=""
920 if test "${blt_enable_jpeg}" != "yes" ; then
921 JPEG_LIB_DIR="${blt_enable_jpeg}/lib"
922 JPEG_LIB_SPEC="-L${JPEG_LIB_DIR} ${JPEG_LIB_SPEC}"
923 LDFLAGS="-L${JPEG_LIB_DIR} ${LDFLAGS}"
924 fi
925 AC_CHECK_LIB(jpeg, jpeg_read_header, [found=yes], [found=no], )
926 if test "${found}" = "yes" ; then
927 LIB_SPECS="${LIB_SPECS} ${JPEG_LIB_SPEC}"
928 aix_lib_specs="${aix_lib_specs} ${JPEG_LIB_SPEC}"
929 if test "x${JPEG_LIB_DIR}" != "x" ; then
930 loader_run_path="${loader_run_path}:${JPEG_LIB_DIR}"
931 fi
932 fi
933 LDFLAGS=${jpeg_save_LDFlags}
934 fi
935
936 save_libs=$LIBS
937 LIBS="$LIB_SPECS $LIBS"
938 AC_CHECK_FUNCS(XExtendedMaxRequestSize)
939 LIBS=$save_libs
940
941 # -----------------------------------------------------------------------
942 #
943 # Set up a new default prefix to installation path. The ways
944 # the prefix can be set and their precedence are as follows:
945 #
946 # 1. --prefix option given to ./configure. (prefix != NONE)
947 # 2. use previously configured Tk prefix
948 #
949 # -----------------------------------------------------------------------
950
951 if test "$prefix" = "NONE" ; then
952 prefix=${TCL_PREFIX}
953 fi
954
955 if test "$exec_prefix" = "NONE" ; then
956 exec_prefix=$prefix
957 fi
958
959 # -------------------------------------------------------------------------
960 #
961 # Extract the BLT version number for the blt.h header
962 #
963 # -------------------------------------------------------------------------
964 AC_MSG_CHECKING([BLT_MAJOR_VERSION])
965 AC_CACHE_VAL(blt_cv_major_version,
966 AC_GREP_SYMBOL(blt_cv_major_version, BLT_MAJOR_VERSION, ${srcdir}/generic/blt.h)
967 )
968 BLT_MAJOR_VERSION=${blt_cv_major_version}
969 AC_MSG_RESULT([$blt_cv_major_version])
970
971 AC_MSG_CHECKING([BLT_MINOR_VERSION])
972 AC_CACHE_VAL(blt_cv_minor_version,
973 AC_GREP_SYMBOL(blt_cv_minor_version, BLT_MINOR_VERSION, ${srcdir}/generic/blt.h)
974 )
975 AC_MSG_RESULT([$blt_cv_minor_version])
976 BLT_MINOR_VERSION=${blt_cv_minor_version}
977
978 BLT_VERSION=${BLT_MAJOR_VERSION}.${BLT_MINOR_VERSION}
979
980 AC_MSG_CHECKING([BLT_PATCH_LEVEL])
981 AC_CACHE_VAL(blt_cv_patch_level,
982 AC_GREP_SYMBOL(blt_cv_patch_level, BLT_PATCH_LEVEL, ${srcdir}/generic/blt.h)
983 )
984 AC_MSG_RESULT([$blt_cv_patch_level])
985 BLT_PATCH_LEVEL=${blt_cv_patch_level}
986
987 # Add BLT to the run path
988 libdir=${exec_prefix}/lib
989
990 if test "x${libdir}" != "x" -a \
991 "${libdir}" != "/usr/lib" -a \
992 "${libdir}" != "${x_libraries}" -a \
993 "${libdir}" != "${TK_LIB_DIR}" -a \
994 "${libdir}" != "${TCL_LIB_DIR}" ; then
995 if test "x${loader_run_path}" = "x" ; then
996 loader_run_path="${libdir}"
997 else
998 loader_run_path="${libdir}:${loader_run_path}"
999 fi
1000 fi
1001
1002 aix_lib_specs="${aix_lib_specs} ${LIBS}"
1003 LIB_SPECS="${LIB_SPECS} ${LIBS}"
1004 TCL_ONLY_LIB_SPECS="${TCL_ONLY_LIB_SPECS} ${LIBS}"
1005
1006 # -------------------------------------------------------------------------
1007 #
1008 # Extract the Tcl version number for the tcl.h header
1009 #
1010 # -------------------------------------------------------------------------
1011 AC_MSG_CHECKING([TCL_VERSION in tcl.h])
1012 AC_CACHE_VAL(blt_cv_tcl_h_version,
1013 AC_GREP_SYMBOL(blt_cv_tcl_h_version, [TCL_VERSION], ${TCL_INC_DIR}/tcl.h)
1014 )
1015 eval TCL_H_VERSION=${blt_cv_tcl_h_version}
1016 AC_MSG_RESULT([$TCL_H_VERSION])
1017 if test "${TCL_H_VERSION}" != "${TCL_VERSION}" ; then
1018 echo "Error: Tcl version mismatch. "
1019 echo " ${TCL_VERSION} ${tcl_config_sh}"
1020 echo " ${TCL_H_VERSION} ${TCL_INC_DIR}/tcl.h"
1021 exit 1
1022 fi
1023 AC_MSG_CHECKING([TK_VERSION in tk.h])
1024 AC_CACHE_VAL(blt_cv_tk_h_version,
1025 AC_GREP_SYMBOL(blt_cv_tk_h_version, [TK_VERSION], ${TK_INC_DIR}/tk.h)
1026 )
1027 eval TK_H_VERSION=${blt_cv_tk_h_version}
1028 AC_MSG_RESULT([$TK_H_VERSION])
1029 if test "${TK_H_VERSION}" != "${TK_VERSION}" ; then
1030 echo "Error: Tk version mismatch."
1031 echo " ${TK_VERSION} ${tk_config_sh}"
1032 echo " ${TK_H_VERSION} ${TK_INC_DIR}/tk.h"
1033 exit 1
1034 fi
1035
1036 if test "$TCL_VERSION" = "7.6" -a "$TK_VERSION" = "4.2" ; then
1037 :
1038 elif test "$TCL_VERSION" = "7.5" -a "$TK_VERSION" = "4.1" ; then
1039 :
1040 elif test "$TCL_VERSION" = "$TK_VERSION" ; then
1041 :
1042 else
1043 echo "Mismatched Tcl/Tk versions ($TCL_VERSION != $TK_VERSION)"
1044 exit 1
1045 fi
1046
1047 #--------------------------------------------------------------------
1048 #
1049 # Check if we can generate shared libraries on this system. Set flags
1050 # to generate shared libraries for systems that we know about. Start
1051 # with the values found in tclConfig.sh, make changes as we know about
1052 # the different systems.
1053 #
1054 #--------------------------------------------------------------------
1055
1056 LIB_BASE_NAME=libBLT
1057
1058 # Initialize shared library build variables
1059
1060 SHLIB_CFLAGS="$TCL_SHLIB_CFLAGS"
1061 SHLIB_LD="$TCL_SHLIB_LD"
1062 SHLIB_LD_FLAGS="$TCL_LD_FLAGS"
1063 SHLIB_RUNPATH="$TCL_LD_SEARCH_FLAGS"
1064
1065 SHLIB_SUFFIX=".so"
1066 SHLIB_TARGET=""
1067 SHLIB_CFLAGS=""
1068 SHLIB_LIB_SPECS="${JPEG_LIB_SPEC}"
1069 SHLIB_TCL_ONLY_LIB_SPECS="${TCL_ONLY_LIB_SPECS}"
1070 SHLIB_TCL_ONLY_LIB_SPECS=""
1071 LDFLAGS="${LDFLAGS}"
1072 LD_RUN_PATH=""
1073 EXTRA_LIB_SPECS=""
1074
1075 build_shared="yes"
1076 library_name=libBLT${BLT_MAJOR_VERSION}${BLT_MINOR_VERSION}
1077
1078 case $target in
1079 *-aix4.[[2-9]]*)
1080 # No Position-Independent flags needed
1081 SHLIB_CFLAGS=""
1082
1083 # Use the installed export file or the one found in the source directory.
1084
1085 if test -r "${TCL_LIB_DIR}/lib${TCL_LIB_NAME}.exp" ; then
1086 tcl_exp="${TCL_LIB_DIR}/lib${TCL_LIB_NAME}.exp"
1087 else
1088 tcl_exp="${TCL_SRC_DIR}/unix/lib.exp"
1089 fi
1090 if test -r "${TK_LIB_DIR}/lib${TK_LIB_NAME}.exp" ; then
1091 tk_exp="${TK_LIB_DIR}/lib${TK_LIB_NAME}.exp"
1092 else
1093 tk_exp="${TK_SRC_DIR}/unix/lib.exp"
1094 fi
1095
1096 full_src_path=`cd ${srcdir}; pwd`
1097
1098 # Use shell-script to link shared library
1099 SHLIB_LD="${full_src_path}/cf/ldAix /bin/ld -bhalt:4 -bM:SRE -bE:lib.exp -H512 -T512 -bnoentry -bI:${tk_exp} -bI:${tcl_exp}"
1100
1101 SHLIB_LIB_SPECS="${aix_lib_specs} -lc"
1102
1103 LDFLAGS="-L${loader_run_path}"
1104 EXTRA_LIB_SPECS="-ldl"
1105 ;;
1106
1107 *-aix*)
1108 # No Position-Independent flags needed
1109 SHLIB_CFLAGS=""
1110
1111 # Use the installed export file or the one found in the source directory.
1112
1113 if test -r "${TCL_LIB_DIR}/lib${TCL_LIB_NAME}.exp" ; then
1114 tcl_exp="${TCL_LIB_DIR}/lib${TCL_LIB_NAME}.exp"
1115 else
1116 tcl_exp="${TCL_SRC_DIR}/unix/lib.exp"
1117 fi
1118 if test -r "${TK_LIB_DIR}/lib${TK_LIB_NAME}.exp" ; then
1119 tk_exp="${TK_LIB_DIR}/lib${TK_LIB_NAME}.exp"
1120 else
1121 tk_exp="${TK_SRC_DIR}/unix/lib.exp"
1122 fi
1123
1124 full_src_path=`cd ${srcdir}/cf; pwd`
1125
1126 # Use shell-script to link shared library
1127
1128 SHLIB_LD="${full_src_path}/ldAix /bin/ld -bhalt:4 -bM:SRE -bE:lib.exp -H512 -T512 -bnoentry -bI:${tk_exp} -bI:${tcl_exp}"
1129
1130 SHLIB_LIB_SPECS="${aix_lib_specs} -lc"
1131
1132 LDFLAGS="-L${loader_run_path}"
1133 EXTRA_LIB_SPECS="-lld"
1134 ;;
1135
1136 *-bsdi2*|*-bsdi3*)
1137 SHLIB_CFLAGS=""
1138 SHLIB_LD="shlicc"
1139 SHLIB_LD_FLAGS="-r"
1140
1141 EXTRA_LIB_SPECS="-ldl"
1142 ;;
1143
1144 *-bsdi4*)
1145 SHLIB_CFLAGS="-export-dynamic -fPIC"
1146 SHLIB_LD="${CC}"
1147 SHLIB_LD_FLAGS='-shared -Wl,-E -Wl,-soname,$@'
1148 ;;
1149
1150 *-*-cygwin* | *-*-mingw*)
1151 SHLIB_LD="${CC}"
1152 SHLIB_LD_FLAGS='-shared -Wl,-E -Wl,--out-implib,$@'
1153 EXTRA_LIB_SPECS="-lwinspool"
1154 LDFLAGS=""
1155 ;;
1156
1157 *-dgux*)
1158 SHLIB_CFLAGS="-K PIC"
1159 SHLIB_LD="cc"
1160 SHLIB_LD_FLAGS="-G"
1161
1162 EXTRA_LIB_SPECS="-ldl"
1163 ;;
1164
1165 *-hpux*)
1166 if test "$blt_have_gcc" = "no" ; then
1167 DEFINES="$DEFINES -D_HPUX_SOURCE"
1168 fi
1169 AC_CHECK_LIB(dld, shl_load, [found=yes], [found=no])
1170 if test "${found}" = "yes" ; then
1171 SHLIB_CFLAGS="+Z"
1172 SHLIB_LD="ld"
1173 SHLIB_LD_FLAGS="-b -E -n +s +b,${loader_run_path}:."
1174 SHLIB_SUFFIX=".sl"
1175
1176 # The run path is included in both LDFLAGS and SHLIB_LD_FLAGS
1177 # because SHLIB_LD is ld and LD is cc/gcc.
1178
1179 LDFLAGS="-Wl,-E -Wl,+s,+b,${loader_run_path}:."
1180 EXTRA_LIB_SPECS="-ldld"
1181 fi
1182 ;;
1183
1184 *-irix64-6.5*)
1185 SHLIB_CFLAGS=""
1186 SHLIB_LD="ld"
1187 SHLIB_LD_FLAGS="-32 -shared -rdata_shared"
1188 LD_RUN_PATH="-Wl,-rpath,${loader_run_path}"
1189 ;;
1190
1191 *-irix-[56].*|*-irix64-*)
1192 SHLIB_CFLAGS=""
1193 SHLIB_LD="ld"
1194 SHLIB_LD_FLAGS="-shared -rdata_shared"
1195 LD_RUN_PATH="-Wl,-rpath,${loader_run_path}"
1196 LDFLAGS=""
1197 if test "$blt_have_gcc" = "yes" ; then
1198 SHLIB_CFLAGS="-mabi=n32 $SHLIB_CFLAGS"
1199 SHLIB_LD_FLAGS="-mabi=n32 $SHLIB_LD_FLAGS"
1200 LDFLAGS="-mabi=n32 $LDFLAGS"
1201 else
1202 CFLAGS="-n32 $CFLAGS"
1203 LDFLAGS="-n32 $LDFLAGS"
1204 fi
1205 ;;
1206
1207 *-linux*|*-gnu*)
1208 SHLIB_CFLAGS="-fPIC"
1209 SHLIB_LD="${CC}"
1210 SHLIB_LD_FLAGS='-rdynamic -shared -Wl,-E -Wl,-soname,$@'
1211 LD_RUN_PATH=""
1212
1213 LDFLAGS="${LDFLAGS}"
1214 EXTRA_LIB_SPECS="-ldl"
1215 ;;
1216
1217 *-mp-ras-02*)
1218 SHLIB_CFLAGS="-G -K PIC"
1219 SHLIB_LD="${CC}"
1220 SHLIB_LD_FLAGS=""
1221 ;;
1222
1223 *-mp-ras-*)
1224 SHLIB_CFLAGS="-G -K PIC"
1225 SHLIB_LD="${CC}"
1226 SHLIB_LD_FLAGS="-Wl,-Bexport"
1227 ;;
1228
1229 *-ncr-sysv4-*2*)
1230 SHLIB_CFLAGS="-K PIC"
1231 SHLIB_LD="cc"
1232 SHLIB_LD_FLAGS="-G"
1233
1234 EXTRA_LIB_SPECS="-ldl"
1235 ;;
1236
1237 *-ncr-sysv4*)
1238 SHLIB_CFLAGS="-K PIC"
1239 SHLIB_LD="cc"
1240 SHLIB_LD_FLAGS="-G -Wl,-Bexport"
1241
1242 LDFLAGS="-Wl,-Bexport"
1243 EXTRA_LIB_SPECS="-ldl"
1244 ;;
1245
1246 *-netbsd*|*-freebsd*|*-openbsd*)
1247 # Not available on all versions: check for include file.
1248 AC_CHECK_HEADER(dlfcn.h, test_ok=yes, test_ok=no)
1249 if test "$test_ok" = yes; then
1250 SHLIB_CFLAGS="-fpic"
1251 SHLIB_LD="ld"
1252 SHLIB_LD_FLAGS="-Bshareable -x"
1253 fi
1254 ;;
1255
1256 *-nextstep*)
1257 SHLIB_CFLAGS=""
1258 SHLIB_LD="cc"
1259 SHLIB_LD_FLAGS="-nostdlib -r"
1260 ;;
1261
1262 *-osf1-1.[012]*)
1263 # OSF/1 1.[012] from OSF, and derivatives, including Paragon OSF/1
1264
1265 SHLIB_CFLAGS=""
1266
1267 # Warning: Ugly Makefile Hack
1268 # Make package name same as library name
1269
1270 SHLIB_LD='ld -R -export $@:'
1271 ;;
1272
1273 *-osf1-1.*)
1274 # OSF/1 1.3 from OSF using ELF, and derivatives, including AD2
1275
1276 SHLIB_CFLAGS="-fpic"
1277 SHLIB_LD="ld -shared"
1278 ;;
1279
1280 *-osf1V*)
1281 # Digital OSF/1
1282
1283 SHLIB_CFLAGS=""
1284 SHLIB_LD='ld'
1285 SHLIB_LD_FLAGS='-shared -expect_unresolved "*"'
1286 LD_RUN_PATH="-Wl,-rpath,${loader_run_path}"
1287 LDFLAGS=""
1288 ;;
1289
1290 *-sco*)
1291 # Note, dlopen is available only on SCO 3.2.5 and greater. However,
1292 # this test works, since "uname -s" was non-standard in 3.2.4 and
1293 # below.
1294
1295 SHLIB_CFLAGS="-Kpic -belf"
1296 SHLIB_LD="ld"
1297 SHLIB_LD_FLAGS="-G"
1298 LDFLAGS="-belf -Wl,-Bexport"
1299 ;;
1300
1301 *-sni-sysv*)
1302
1303 SHLIB_CFLAGS="-K PIC"
1304 SHLIB_LD="cc"
1305 SHLIB_LD_FLAGS="-G"
1306
1307 EXTRA_LIB_SPECS="-ldl"
1308 ;;
1309
1310 *-sunos4*)
1311
1312 SHLIB_CFLAGS="-PIC"
1313 SHLIB_LD="ld"
1314 SHLIB_LD_FLAGS="-assert pure-text"
1315
1316 EXTRA_LIB_SPECS="-ldl"
1317 ;;
1318
1319 *-solaris2*)
1320
1321 SHLIB_CFLAGS="-KPIC"
1322 if test "${blt_with_gnu_ld}" = "yes" -a "$blt_have_gcc" = "yes" ; then
1323 SHLIB_LD="gcc"
1324 SHLIB_LD_FLAGS='-rdynamic -shared -Wl,-E -Wl,-soname,$@'
1325 LD_RUN_PATH="-Wl,-rpath,${loader_run_path}"
1326 else
1327 SHLIB_LD="/usr/ccs/bin/ld"
1328 SHLIB_LD_FLAGS="-G -z text"
1329 LD_RUN_PATH="-R ${loader_run_path}"
1330 fi
1331 EXTRA_LIB_SPECS="-ldl"
1332 ;;
1333
1334 *-mips-dde-sysv*)
1335
1336 SHLIB_CFLAGS="-KPIC"
1337 SHLIB_LD="cc"
1338 SHLIB_LD_FLAGS="-G"
1339
1340 EXTRA_LIB_SPECS="-ldl"
1341 ;;
1342
1343 *-pc-sysv4* | *-unixware-5*)
1344 SHLIB_CFLAGS="-G -KPIC"
1345 SHLIB_LD="${CC}"
1346 SHLIB_LD_FLAGS=" -Wl,-Bexport"
1347 ;;
1348
1349 *)
1350 build_shared="no"
1351 ;;
1352
1353 esac
1354
1355 # If we're running gcc, then set SHLIB_CFLAGS flags for compiling
1356 # shared libraries for gcc, instead of those of the vendor's
1357 # compiler.
1358
1359
1360 if test "$blt_have_gcc" = "yes" ; then
1361 SHLIB_CFLAGS="-fPIC"
1362 fi
1363
1364 # We can't back link against static versions of Tcl/Tk.
1365 # If # ${TCL_SHARED_BUILD} can't be found or isn't "1", assume that
1366 # shared libraies weren't built.
1367
1368 if test "${TCL_SHARED_BUILD}" != "1" ; then
1369 SHLIB_LIB_SPECS=""
1370 fi
1371
1372 if test "${build_shared}" = "yes" ; then
1373 SHLIB_TARGET="build_shared"
1374 AC_SUBST(SHLIB_CFLAGS)
1375 AC_SUBST(SHLIB_TARGET)
1376 AC_SUBST(SHLIB_LD)
1377 AC_SUBST(SHLIB_LD_FLAGS)
1378 AC_SUBST(SHLIB_LIB_SPECS)
1379 AC_SUBST(SHLIB_TCL_ONLY_LIB_SPECS)
1380 AC_SUBST(SHLIB_SUFFIX)
1381 fi
1382
1383 AC_SUBST(LDFLAGS)
1384 AC_SUBST(LD_RUN_PATH)
1385
1386 LIBS=${LIB_SPECS}
1387 AC_SUBST(LIB_SPECS)
1388 AC_SUBST(TCL_ONLY_LIB_SPECS)
1389 AC_SUBST(EXTRA_LIB_SPECS)
1390
1391 INCLUDES=${INC_SPECS}
1392 AC_SUBST(INCLUDES)
1393 AC_SUBST(DEFINES)
1394 AC_SUBST(BLT_MAJOR_VERSION)
1395 AC_SUBST(BLT_MINOR_VERSION)
1396 AC_SUBST(BLT_PATCH_LEVEL)
1397 AC_SUBST(BLT_VERSION)
1398 AC_SUBST(AUX_LIBS)
1399 AC_SUBST(TCL_LIB_DIR)
1400 AC_SUBST(TCL_VERSION)
1401 BLT_LIB_PREFIX=${blt_lib_prefix}
1402 AC_SUBST(BLT_LIB_PREFIX)
1403
1404 #--------------------------------------------------------------------
1405 # The BLT script directory was either specified or we
1406 # assume <prefix>/lib
1407 #--------------------------------------------------------------------
1408 if test "x${blt_with_scriptdir}" = "x" ; then
1409 BLT_LIBRARY="${prefix}/lib/blt${BLT_VERSION}"
1410 else
1411 BLT_LIBRARY="${blt_with_scriptdir}/blt${BLT_VERSION}"
1412 fi
1413 AC_SUBST(BLT_LIBRARY)
1414
1415 #--------------------------------------------------------------------
1416 # Print out some of the more important settings
1417 #--------------------------------------------------------------------
1418 echo ""
1419 echo "Configuration results:"
1420 echo ""
1421 echo " tcl.h found in $TCL_INC_DIR"
1422 echo " tk.h found in $TK_INC_DIR"
1423 echo " X11/Xlib.h found in $x_includes"
1424 echo " lib${TCL_LIB_NAME} found in $TCL_LIB_DIR"
1425 echo " lib${TK_LIB_NAME} found in $TK_LIB_DIR"
1426 echo " libX11 found in $x_libraries"
1427 echo ""
1428 echo "Directories where BLT is to be installed:"
1429 echo ""
1430 echo " \"\$prefix\" is $prefix"
1431 echo " \"\$exec_prefix\" is $exec_prefix"
1432 echo ""
1433 echo " bltwish to be installed in $bindir"
1434 echo " libBLT.a to be installed in $libdir"
1435 echo " scripts to be installed in $BLT_LIBRARY"
1436 echo " manual pages to be installed in $mandir"
1437 echo ""
1438
1439 #--------------------------------------------------------------------
1440 #
1441 # Generate the following Makefiles
1442 #
1443 # ./Makefile
1444 # ./generic/Makefile
1445 # ./generic/shared/Makefile
1446 # ./man/Makefile
1447 # ./library/Makefile
1448 # ./demos/Makefile
1449 #
1450 #--------------------------------------------------------------------
1451 src_Makefile="generic/Makefile"
1452 if test "${blt_platform}" = "win"; then
1453 src_Makefile="generic/Makefile:generic/Makefile-cyg.in"
1454 fi
1455 AC_OUTPUT(Makefile ${src_Makefile} generic/bltHash.h generic/shared/Makefile man/Makefile library/Makefile demos/Makefile)
1456