Debian Codegraph @

configure.in

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