1 dnl This file is included into all any other acinclude file that needs
2 dnl to use these macros.
4 dnl This is copied from autoconf 2.12, but does calls our own AC_PROG_CC_WORKS,
5 dnl and doesn't call AC_PROG_CXX_GNU, cause we test for that in AC_PROG_CC_WORKS.
6 dnl We are probably using a cross compiler, which will not be able to fully
7 dnl link an executable. This should really be fixed in autoconf itself.
8 dnl Find a working G++ cross compiler. This only works for the GNU C++ compiler.
9 AC_DEFUN(CYG_AC_PROG_CXX_CROSS,
10 [AC_BEFORE([$0], [AC_PROG_CXXCPP])
11 AC_CHECK_PROGS(CXX, $CCC c++ g++ gcc CC cxx cc++, gcc)
15 if test $ac_cv_prog_gxx = yes; then
17 dnl Check whether -g works, even if CXXFLAGS is set, in case the package
18 dnl plays around with CXXFLAGS (such as to build both debugging and
19 dnl normal versions of a library), tasteless as that idea is.
20 ac_test_CXXFLAGS="${CXXFLAGS+set}"
21 ac_save_CXXFLAGS="$CXXFLAGS"
24 if test "$ac_test_CXXFLAGS" = set; then
25 CXXFLAGS="$ac_save_CXXFLAGS"
26 elif test $ac_cv_prog_cxx_g = yes; then
33 test "${CXXFLAGS+set}" = set || CXXFLAGS="-g"
37 dnl See if the G++ compiler we found works.
38 AC_DEFUN(CYG_AC_PROG_GXX_WORKS,
39 [AC_MSG_CHECKING([whether the G++ compiler ($CXX $CXXFLAGS $LDFLAGS) actually works])
42 dnl Try a test case. We only compile, because it's close to impossible
43 dnl to get a correct fully linked executable with a cross compiler. For
44 dnl most cross compilers, this test is bogus. For G++, we can use various
45 dnl other compile line options to get a decent idea that the cross compiler
46 dnl actually does work, even though we can't produce an executable without
47 dnl more info about the target it's being compiled for. This only works
48 dnl for the GNU C++ compiler.
50 dnl Transform the name of the compiler to it's cross variant, unless
51 dnl CXX is set. This is also what CXX gets set to in the generated
53 if test x"${CXX}" = xc++ ; then
54 CXX=`echo gcc | sed -e "${program_transform_name}"`
57 dnl Get G++'s full path to libgcc.a
58 libgccpath=`${CXX} --print-libgcc`
60 dnl If we don't have a path with libgcc.a on the end, this isn't G++.
61 if test `echo $libgccpath | sed -e 's:/.*/::'` = libgcc.a ; then
67 dnl If we are using G++, look for the files that need to exist if this
69 if test x"${ac_cv_prog_gxx}" = xyes ; then
70 gccfiles=`echo $libgccpath | sed -e 's:/libgcc.a::'`
71 if test -f ${gccfiles}/specs -a -f ${gccfiles}/cpp -a -f ${gccfiles}/cc1plus; then
76 gcclibs=`echo $libgccpath | sed -e 's:lib/gcc-lib/::' -e 's:/libgcc.a::' -e 's,\(.*\)/.*,\1,g'`/lib
77 if test -d ${gcclibs}/ldscripts -a -f ${gcclibs}/libc.a -a -f ${gcclibs}/libstdc++.a ; then
84 dnl If everything is OK, then we can safely assume the compiler works.
85 if test x"${gccfiles}" = xno -o x"${gcclibs}" = xno; then
86 ac_cv_prog_cxx_works=no
87 AC_MSG_ERROR(${CXX} is a non-working cross compiler)
89 ac_cv_prog_cxx_works=yes
93 AC_MSG_RESULT($ac_cv_prog_cxx_works)
94 if test x"$ac_cv_prog_cxx_works" = xno; then
95 AC_MSG_ERROR([installation or configuration problem: C++ compiler cannot create executables.])
97 AC_MSG_CHECKING([whether the G++ compiler ($CXX $CXXFLAGS $LDFLAGS) is a cross-compiler])
98 AC_MSG_RESULT($ac_cv_prog_cxx_cross)
99 cross_compiling=$ac_cv_prog_cxx_cross
103 dnl ====================================================================
104 dnl Find a working GCC cross compiler. This only works for the GNU gcc compiler.
105 dnl This is based on the macros above for G++.
106 AC_DEFUN(CYG_AC_PROG_CC_CROSS,
107 [AC_BEFORE([$0], [AC_PROG_CCPP])
108 AC_CHECK_PROGS(CC, cc, gcc)
110 CYG_AC_PROG_GCC_WORKS
112 if test $ac_cv_prog_gcc = yes; then
114 dnl Check whether -g works, even if CFLAGS is set, in case the package
115 dnl plays around with CFLAGS (such as to build both debugging and
116 dnl normal versions of a library), tasteless as that idea is.
117 ac_test_CFLAGS="${CFLAGS+set}"
118 ac_save_CFLAGS="$CFLAGS"
121 if test "$ac_test_CFLAGS" = set; then
122 CFLAGS="$ac_save_CFLAGS"
123 elif test $ac_cv_prog_cc_g = yes; then
130 test "${CFLAGS+set}" = set || CFLAGS="-g"
134 dnl See if the GCC compiler we found works.
135 AC_DEFUN(CYG_AC_PROG_GCC_WORKS,
136 [AC_MSG_CHECKING([whether the Gcc compiler ($CC $CFLAGS $LDFLAGS) actually works])
139 dnl Try a test case. We only compile, because it's close to impossible
140 dnl to get a correct fully linked executable with a cross
141 dnl compiler. For most cross compilers, this test is bogus. For G++,
142 dnl we can use various other compile line options to get a decent idea
143 dnl that the cross compiler actually does work, even though we can't
144 dnl produce an executable without more info about the target it's
145 dnl being compiled for. This only works for the GNU C++ compiler.
147 dnl Transform the name of the compiler to it's cross variant, unless
148 dnl CXX is set. This is also what CC gets set to in the generated Makefile.
149 if test x"${CC}" = xcc ; then
150 CC=`echo gcc | sed -e "${program_transform_name}"`
153 dnl Get Gcc's full path to libgcc.a
154 libgccpath=`${CC} --print-libgcc`
156 dnl If we don't have a path with libgcc.a on the end, this isn't G++.
157 if test `echo $libgccpath | sed -e 's:/.*/::'` = libgcc.a ; then
163 dnl If we are using Gcc, look for the files that need to exist if this
165 if test x"${ac_cv_prog_gcc}" = xyes ; then
166 gccfiles=`echo $libgccpath | sed -e 's:/libgcc.a::'`
167 if test -f ${gccfiles}/specs -a -f ${gccfiles}/cpp -a -f ${gccfiles}/cc1plus; then
172 gcclibs=`echo $libgccpath | sed -e 's:lib/gcc-lib/::' -e 's:/libgcc.a::' -e 's,\(.*\)/.*,\1,g'`/lib
173 if test -d ${gcclibs}/ldscripts -a -f ${gcclibs}/libc.a -a -f ${gcclibs}/libstdc++.a ; then
180 dnl If everything is OK, then we can safely assume the compiler works.
181 if test x"${gccfiles}" = xno -o x"${gcclibs}" = xno; then
182 ac_cv_prog_cc_works=no
183 AC_MSG_ERROR(${CC} is a non-working cross compiler)
185 ac_cv_prog_cc_works=yes
189 AC_MSG_RESULT($ac_cv_prog_cc_works)
190 if test x"$ac_cv_prog_cc_works" = xno; then
191 AC_MSG_ERROR([installation or configuration problem: C++ compiler cannot create executables.])
193 AC_MSG_CHECKING([whether the Gcc compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler])
194 AC_MSG_RESULT($ac_cv_prog_cc_cross)
195 cross_compiling=$ac_cv_prog_cc_cross
199 dnl ====================================================================
200 dnl Find the HAL library. HAL is the BSP for ECC.
201 AC_DEFUN(CYG_AC_PATH_HAL, [
202 AC_MSG_CHECKING(for the HAL source files)
203 dirlist=".. ../../ ../../../ ../../../../ ../../../../../ ../../../../../../ ../../../../../../.. ../../../../../../../.. ../../../../../../../../.. ../../../../../../../../../.."
204 AC_CACHE_VAL(ac_cv_c_haldir,[
205 dnl We have the translate the target triplet to the directory name
206 dnl cause they unfortunately don't match.
207 case ${target_cpu} in
208 powerpc*) cpudir=powerpc ;;
209 mn10300*) cpudir=panx ;;
210 mips*) cpudir=mips ;;
213 for i in $dirlist; do
214 if test -f "$srcdir/$i/hal/${cpudir}/arch/current/include/basetype.h" ; then
215 ac_cv_c_haldir=`(cd $srcdir/$i/hal/${cpudir}/arch/current/; pwd)`
219 if test x"${ac_cv_c_haldir}" != x; then
220 HALDIR="${ac_cv_c_haldir}"
221 AC_MSG_RESULT(${ac_cv_c_haldir})
228 dnl ====================================================================
229 dnl Find the ECC kernel headers.
230 AC_DEFUN(CYG_AC_PATH_KERNEL, [
231 AC_MSG_CHECKING(for the kernel header files in the source tree)
232 dirlist=".. ../../ ../../../ ../../../../ ../../../../../ ../../../../../../ ../../../../../../.. ../../../../../../../.. ../../../../../../../../.. ../../../../../../../../../.."
233 AC_CACHE_VAL(ac_cv_c_kernel,[
234 for i in $dirlist; do
235 if test -f "$srcdir/$i/kernel/current/include/kernel.hxx" ; then
236 ac_cv_c_kernel=`(cd $srcdir/$i/kernel/current/include; pwd)`
240 if test x"${ac_cv_c_kernel}" != x; then
241 KERNELHDIR="-I${ac_cv_c_kernel}"
242 AC_MSG_RESULT(${ac_cv_c_kernel})
246 AC_MSG_CHECKING(for the kernel library in the build tree)
247 dirlist=".. ../../ ../../../ ../../../../ ../../../../../ ../../../../../../ ../../../../../../.. ../../../../../../../.. ../../../../../../../../.. ../../../../../../../../../.."
248 AC_CACHE_VAL(ac_cv_c_klib,[
249 for i in $dirlist; do
250 if test -f "$i/kernel/current/src/Makefile" ; then
251 ac_cv_c_klib=`(cd $i/kernel/current/src; pwd)`
255 if test x"${ac_cv_c_klib}" != x; then
256 KERNELLIB="-L${ac_cv_c_klib}"
257 AC_MSG_RESULT(${ac_cv_c_klib})
265 dnl ====================================================================
266 dnl Find the ECC kernel's config file. This config.h is not produced
267 dnl by autoconf, but is handcrafted.
268 AC_DEFUN(CYG_AC_PATH_CONFIG, [
269 AC_MSG_CHECKING(for the kernel's config.h header files in the source tree)
270 dirlist=".. ../../ ../../../ ../../../../ ../../../../../ ../../../../../../ ../../../../../../.. ../../../../../../../.. ../../../../../../../../.. ../../../../../../../../../.."
271 AC_CACHE_VAL(ac_cv_c_configh,[
272 for i in $dirlist; do
273 if test -f "$srcdir/$i/kernel/current/src/devo/config.h" ; then
274 ac_cv_c_configh=`(cd $srcdir/$i/kernel/current/src/devo; pwd)`
278 if test x"${ac_cv_c_configh}" != x; then
279 CONFIG_H="-I${ac_cv_c_configh}"
280 AC_MSG_RESULT(${ac_cv_c_configh})
287 dnl ====================================================================
288 dnl Find the BFD library in the build tree. This is used to access and
289 dnl manipulate object or executable files.
290 AC_DEFUN(CYG_AC_PATH_BFD, [
291 AC_MSG_CHECKING(for the bfd header in the build tree)
292 dirlist=".. ../../ ../../../ ../../../../ ../../../../../ ../../../../../../ ../../../../../../.. ../../../../../../../.. ../../../../../../../../.. ../../../../../../../../../.."
293 dnl Look for the header file
294 AC_CACHE_VAL(ac_cv_c_bfdh,[
295 for i in $dirlist; do
296 if test -f "$i/bfd/bfd.h" ; then
297 ac_cv_c_bfdh=`(cd $i/bfd; pwd)`
302 if test x"${ac_cv_c_bfdh}" != x; then
303 BFDHDIR="-I${ac_cv_c_bfdh}"
304 AC_MSG_RESULT(${ac_cv_c_bfdh})
310 dnl Look for the library
311 AC_MSG_CHECKING(for the bfd library in the build tree)
312 AC_CACHE_VAL(ac_cv_c_bfdlib,[
313 for i in $dirlist; do
314 if test -f "$i/bfd/Makefile" ; then
315 ac_cv_c_bfdlib=`(cd $i/bfd; pwd)`
319 dnl We list two directories cause bfd now uses libtool
320 if test x"${ac_cv_c_bfdlib}" != x; then
321 BFDLIB="-L${ac_cv_c_bfdlib} -L${ac_cv_c_bfdlib}/.libs"
322 AC_MSG_RESULT(${ac_cv_c_bfdlib})
329 dnl ====================================================================
330 dnl Find the libiberty library. This defines many commonly used C
331 dnl functions that exists in various states based on the underlying OS.
332 AC_DEFUN(CYG_AC_PATH_LIBERTY, [
333 AC_MSG_CHECKING(for the liberty library in the build tree)
334 dirlist=".. ../../ ../../../ ../../../../ ../../../../../ ../../../../../../ ../../../../../../.. ../../../../../../../.. ../../../../../../../../.. ../../../../../../../../../.."
335 AC_CACHE_VAL(ac_cv_c_liberty,[
336 for i in $dirlist; do
337 if test -f "$i/libiberty/Makefile" ; then
338 ac_cv_c_liberty=`(cd $i/libiberty; pwd)`
342 if test x"${ac_cv_c_liberty}" != x; then
343 LIBERTY="-L${ac_cv_c_liberty}"
344 AC_MSG_RESULT(${ac_cv_c_liberty})
351 dnl ====================================================================
352 dnl Find the opcodes library. This is used to do dissasemblies.
353 AC_DEFUN(CYG_AC_PATH_OPCODES, [
354 AC_MSG_CHECKING(for the opcodes library in the build tree)
355 dirlist=".. ../../ ../../../ ../../../../ ../../../../../ ../../../../../../ ../../../../../../.. ../../../../../../../.. ../../../../../../../../.. ../../../../../../../../../.."
356 AC_CACHE_VAL(ac_cv_c_opc,[
357 for i in $dirlist; do
358 if test -f "$i/opcodes/Makefile" ; then
359 ac_cv_c_opc=`(cd $i/opcodes; pwd)`
363 if test x"${ac_cv_c_opc}" != x; then
364 OPCODESLIB="-L${ac_cv_c_opc}"
365 AC_MSG_RESULT(${ac_cv_c_opc})
372 dnl ====================================================================
373 dnl Look for the DejaGnu header file in the source tree. This file
374 dnl defines the functions used to testing support.
375 AC_DEFUN(CYG_AC_PATH_DEJAGNU, [
376 AC_MSG_CHECKING(for the testing support files in the source tree)
377 dirlist=".. ../../ ../../../ ../../../../ ../../../../../ ../../../../../../ ../../../../../../.. ../../../../../../../.. ../../../../../../../../.. ../../../../../../../../../.."
378 AC_CACHE_VAL(ac_cv_c_dejagnu,[
379 for i in $dirlist; do
380 if test -f "$srcdir/$i/ecc/ecc/infra/testlib/current/include/dejagnu.h" ; then
381 ac_cv_c_dejagnu=`(cd $srcdir/$i/ecc/ecc/infra/testlib/current/include; pwd)`
385 if test x"${ac_cv_c_dejagnu}" != x; then
386 DEJAGNUHDIR="-I${ac_cv_c_dejagnu}"
387 AC_MSG_RESULT(${ac_cv_c_dejagnu})
391 AC_CACHE_VAL(ac_cv_c_dejagnulib,[
392 for i in $dirlist; do
393 if test -f "$srcdir/$i/infra/testlib/current/lib/hostutil.exp" ; then
394 ac_cv_c_dejagnulib=`(cd $srcdir/$i/infra/testlib/current/lib; pwd)`
398 if test x"${ac_cv_c_dejagnulib}" != x; then
399 DEJAGNULIB="${ac_cv_c_dejagnulib}"
403 AC_MSG_CHECKING(for runtest in the source tree)
404 AC_CACHE_VAL(ac_cv_c_runtest,[
405 for i in $dirlist; do
406 if test -f "$srcdir/$i/dejagnu/runtest" ; then
407 ac_cv_c_runtest=`(cd $srcdir/$i/dejagnu; pwd)`
411 if test x"${ac_cv_c_runtest}" != x; then
412 RUNTESTDIR="${ac_cv_c_runtest}"
413 AC_MSG_RESULT(${ac_cv_c_runtest})
420 AC_SUBST(DEJAGNUHDIR)
423 dnl ====================================================================
424 dnl Find the libintl library in the build tree. This is for
425 dnl internationalization support.
426 AC_DEFUN(CYG_AC_PATH_INTL, [
427 AC_MSG_CHECKING(for the intl header in the build tree)
428 dirlist=".. ../../ ../../../ ../../../../ ../../../../../ ../../../../../../ ../../../../../../.. ../../../../../../../.. ../../../../../../../../.. ../../../../../../../../../.."
429 dnl Look for the header file
430 AC_CACHE_VAL(ac_cv_c_intlh,[
431 for i in $dirlist; do
432 if test -f "$i/intl/libintl.h" ; then
433 ac_cv_c_intlh=`(cd $i/intl; pwd)`
438 if test x"${ac_cv_c_intlh}" != x; then
439 INTLHDIR="-I${ac_cv_c_intlh}"
440 AC_MSG_RESULT(${ac_cv_c_intlh})
446 dnl Look for the library
447 AC_MSG_CHECKING(for the libintl library in the build tree)
448 AC_CACHE_VAL(ac_cv_c_intllib,[
449 for i in $dirlist; do
450 if test -f "$i/intl/Makefile" ; then
451 ac_cv_c_intllib=`(cd $i/intl; pwd)`
455 if test x"${ac_cv_c_intllib}" != x; then
456 INTLLIB="-L${ac_cv_c_intllib} -lintl"
457 AC_MSG_RESULT(${ac_cv_c_intllib})
464 dnl ====================================================================
465 dnl Find the simulator library.
466 AC_DEFUN(CYG_AC_PATH_SIM, [
467 dirlist=".. ../../ ../../../ ../../../../ ../../../../../ ../../../../../../ ../../../../../../.. ../../../../../../../.. ../../../../../../../../.. ../../../../../../../../../.. ../../../../../../../../../.."
468 case "$target_cpu" in
469 powerpc) target_dir=ppc ;;
470 sparc*) target_dir=erc32 ;;
471 mips*) target_dir=mips ;;
472 *) target_dir=$target_cpu ;;
474 dnl First look for the header file
475 AC_MSG_CHECKING(for the simulator header file)
476 AC_CACHE_VAL(ac_cv_c_simh,[
477 for i in $dirlist; do
478 if test -f "${srcdir}/$i/include/remote-sim.h" ; then
479 ac_cv_c_simh=`(cd ${srcdir}/$i/include; pwd)`
484 if test x"${ac_cv_c_simh}" != x; then
485 SIMHDIR="-I${ac_cv_c_simh}"
486 AC_MSG_RESULT(${ac_cv_c_simh})
492 dnl See whether it's a devo or Foundry branch simulator
493 AC_MSG_CHECKING(Whether this is a devo simulator )
494 AC_CACHE_VAL(ac_cv_c_simdevo,[
495 CPPFLAGS="$CPPFLAGS $SIMHDIR"
496 AC_EGREP_HEADER([SIM_DESC sim_open.*struct _bfd], remote-sim.h,
500 if test x"$ac_cv_c_simdevo" = x"yes" ; then
501 AC_DEFINE(HAVE_DEVO_SIM)
503 AC_MSG_RESULT(${ac_cv_c_simdevo})
504 AC_SUBST(HAVE_DEVO_SIM)
506 dnl Next look for the library
507 AC_MSG_CHECKING(for the simulator library)
508 AC_CACHE_VAL(ac_cv_c_simlib,[
509 for i in $dirlist; do
510 if test -f "$i/sim/$target_dir/Makefile" ; then
511 ac_cv_c_simlib=`(cd $i/sim/$target_dir; pwd)`
515 if test x"${ac_cv_c_simlib}" != x; then
516 SIMLIB="-L${ac_cv_c_simlib}"
519 dnl FIXME: this is kinda bogus, cause umtimately the TM will build
520 dnl all the libraries for several architectures. But for now, this
521 dnl will work till then.
522 dnl AC_MSG_CHECKING(for the simulator installed with the compiler libraries)
523 dnl Transform the name of the compiler to it's cross variant, unless
524 dnl CXX is set. This is also what CXX gets set to in the generated
526 CROSS_GCC=`echo gcc | sed -e "s/^/$target/"`
528 dnl Get G++'s full path to libgcc.a
530 gccpath=`${CROSS_GCC} --print-libgcc | sed -e 's:[a-z0-9A-Z\.\-]*/libgcc.a::' -e 's:lib/gcc-lib/::'`lib
532 if test -f $gccpath/libsim.a -o -f $gccpath/libsim.so ; then
533 ac_cv_c_simlib="$gccpath/"
534 SIMLIB="-L${ac_cv_c_simlib}"
535 AC_MSG_RESULT(${ac_cv_c_simlib})
537 AM_CONDITIONAL(PSIM, test x$psim = xno)
540 dnl ac_cv_c_simlib=none
546 dnl ====================================================================
547 dnl Find the libiberty library.
548 AC_DEFUN(CYG_AC_PATH_LIBIBERTY, [
549 AC_MSG_CHECKING(for the libiberty library in the build tree)
550 dirlist=".. ../../ ../../../ ../../../../ ../../../../../ ../../../../../../ ../../../../../../.. ../../../../../../../.. ../../../../../../../../.. ../../../../../../../../../.."
551 AC_CACHE_VAL(ac_cv_c_libib,[
552 for i in $dirlist; do
553 if test -f "$i/libiberty/Makefile" ; then
554 ac_cv_c_libib=`(cd $i/libiberty/; pwd)`
558 if test x"${ac_cv_c_libib}" != x; then
559 LIBIBERTY="-L${ac_cv_c_libib}"
560 AC_MSG_RESULT(${ac_cv_c_libib})
567 dnl ====================================================================
568 AC_DEFUN(CYG_AC_PATH_DEVO, [
569 AC_MSG_CHECKING(for devo headers in the source tree)
570 dirlist=".. ../../ ../../../ ../../../../ ../../../../../ ../../../../../../ ../../../../../../.. ../../../../../../../.. ../../../../../../../../.. ../../../../../../../../../.."
571 AC_CACHE_VAL(ac_cv_c_devoh,[
572 for i in $dirlist; do
573 if test -f "${srcdir}/$i/include/remote-sim.h" ; then
574 ac_cv_c_devoh=`(cd ${srcdir}/$i/include; pwd)`
578 if test x"${ac_cv_c_devoh}" != x; then
579 DEVOHDIR="-I${ac_cv_c_devoh}"
580 AC_MSG_RESULT(${ac_cv_c_devoh})
587 dnl ====================================================================
588 dnl find the IDE library and headers.
589 AC_DEFUN(CYG_AC_PATH_IDE, [
590 AC_MSG_CHECKING(for IDE headers in the source tree)
591 dirlist=".. ../../ ../../../ ../../../../ ../../../../../ ../../../../../../ ../../../../../../.. ../../../../../../../.. ../../../../../../../../.. ../../../../../../../../../.."
594 AC_CACHE_VAL(ac_cv_c_ideh,[
595 for i in $dirlist; do
596 if test -f "${srcdir}/$i/libide/src/event.h" ; then
597 ac_cv_c_ideh=`(cd ${srcdir}/$i/libide/src; pwd)`;
601 if test x"${ac_cv_c_ideh}" != x; then
602 IDEHDIR="-I${ac_cv_c_ideh}"
603 AC_MSG_RESULT(${ac_cv_c_ideh})
608 AC_MSG_CHECKING(for LIBIDE TCL headers in the source tree)
609 AC_CACHE_VAL(ac_cv_c_idetclh,[
610 for i in $dirlist; do
611 if test -f "${srcdir}/$i/libidetcl/src/idetcl.h" ; then
612 ac_cv_c_idetclh=`(cd ${srcdir}/$i/libidetcl/src; pwd)`;
616 if test x"${ac_cv_c_idetclh}" != x; then
617 IDEHDIR="${IDEHDIR} -I${ac_cv_c_idetclh}"
618 AC_MSG_RESULT(${ac_cv_c_idetclh})
623 AC_MSG_CHECKING(for IDE headers in the build tree)
624 AC_CACHE_VAL(ac_cv_c_ideh2,[
625 for i in $dirlist; do
626 if test -f "$i/libide/src/Makefile" ; then
627 ac_cv_c_ideh2=`(cd $i/libide/src; pwd)`;
631 if test x"${ac_cv_c_ideh2}" != x; then
632 IDEHDIR="${IDEHDIR} -I${ac_cv_c_ideh2}"
633 AC_MSG_RESULT(${ac_cv_c_ideh2})
638 dnl look for the library
639 AC_MSG_CHECKING(for IDE library)
640 AC_CACHE_VAL(ac_cv_c_idelib,[
641 if test x"${ac_cv_c_idelib}" = x ; then
642 for i in $dirlist; do
643 if test -f "$i/libide/src/Makefile" ; then
644 ac_cv_c_idelib=`(cd $i/libide/src; pwd)`
649 if test x"${ac_cv_c_idelib}" != x ; then
650 IDELIB="-L${ac_cv_c_idelib}"
651 AC_MSG_RESULT(${ac_cv_c_idelib})
656 dnl find libiddetcl.a if it exists
657 AC_MSG_CHECKING(for IDE TCL library)
658 AC_CACHE_VAL(ac_cv_c_idetcllib,[
659 if test x"${ac_cv_c_idetcllib}" = x ; then
660 for i in $dirlist; do
661 if test -f "$i/libidetcl/src/Makefile" ; then
662 ac_cv_c_idetcllib=`(cd $i/libidetcl/src; pwd)`
668 if test x"${ac_cv_c_idetcllib}" != x ; then
669 IDELIB="${IDELIB} -L${ac_cv_c_idetcllib}"
671 AC_MSG_RESULT(${ac_cv_c_idetcllib})
680 dnl ====================================================================
681 dnl Find all the ILU headers and libraries
682 AC_DEFUN(CYG_AC_PATH_ILU, [
683 AC_MSG_CHECKING(for ILU kernel headers in the source tree)
684 dirlist=".. ../../ ../../../ ../../../../ ../../../../../ ../../../../../../ ../../../../../../.. ../../../../../../../.. ../../../../../../../../.. ../../../../../../../../../.."
685 AC_CACHE_VAL(ac_cv_c_iluh,[
686 for i in $dirlist; do
687 if test -f "${srcdir}/$i/ilu/runtime/kernel/method.h" ; then
688 ac_cv_c_iluh=`(cd ${srcdir}/$i/ilu/runtime/kernel; pwd)`
692 if test x"${ac_cv_c_iluh}" != x; then
693 ILUHDIR="-I${ac_cv_c_iluh}"
694 AC_MSG_RESULT(${ac_cv_c_iluh})
699 AC_MSG_CHECKING(for ILU kernel headers in the build tree)
700 dirlist=".. ../../ ../../../ ../../../../ ../../../../../ ../../../../../../ ../../../../../../.. ../../../../../../../.. ../../../../../../../../.. ../../../../../../../../../.."
701 AC_CACHE_VAL(ac_cv_c_iluh5,[
702 for i in $dirlist; do
703 if test -f "$i/ilu/runtime/kernel/iluconf.h" ; then
704 ac_cv_c_iluh5=`(cd $i/ilu/runtime/kernel; pwd)`
708 if test x"${ac_cv_c_iluh5}" != x; then
709 ILUHDIR="${ILUHDIR} -I${ac_cv_c_iluh5}"
710 AC_MSG_RESULT(${ac_cv_c_iluh5})
715 AC_MSG_CHECKING(for ILU C++ headers in the source tree)
716 AC_CACHE_VAL(ac_cv_c_iluh2,[
717 for i in $dirlist; do
718 if test -f "${srcdir}/$i/ilu/stubbers/cpp/resource.h" ; then
719 ac_cv_c_iluh2=`(cd ${srcdir}/$i/ilu/stubbers/cpp; pwd)`
723 if test x"${ac_cv_c_iluh2}" != x; then
724 ILUHDIR="${ILUHDIR} -I${ac_cv_c_iluh2}"
725 AC_MSG_RESULT(${ac_cv_c_iluh2})
730 AC_MSG_CHECKING(for ILU C headers)
731 AC_CACHE_VAL(ac_cv_c_iluh3,[
732 for i in $dirlist; do
733 if test -f "${srcdir}/$i/ilu/stubbers/c/resource.h" ; then
734 ac_cv_c_iluh3=`(cd ${srcdir}/$i/ilu/stubbers/c ; pwd)`
738 if test x"${ac_cv_c_iluh3}" != x; then
739 ILUHDIR="${ILUHDIR} -I${ac_cv_c_iluh3}"
740 AC_MSG_RESULT(${ac_cv_c_iluh3})
745 AC_MSG_CHECKING(for ILU C runtime headers)
746 AC_CACHE_VAL(ac_cv_c_iluh4,[
747 for i in $dirlist; do
748 if test -f "${srcdir}/$i/ilu/runtime/c/ilucstub.h" ; then
749 ac_cv_c_iluh4=`(cd ${srcdir}/$i/ilu/runtime/c ; pwd)`
753 if test x"${ac_cv_c_iluh4}" != x; then
754 ILUHDIR="${ILUHDIR} -I${ac_cv_c_iluh4}"
755 AC_MSG_RESULT(${ac_cv_c_iluh4})
760 AC_CACHE_VAL(ac_cv_c_ilupath,[
761 for i in $dirlist; do
762 if test -f "$i/ilu/Makefile" ; then
763 ac_cv_c_ilupath=`(cd $i/ilu; pwd)`
768 ILUTOP=${ac_cv_c_ilupath}
770 AC_MSG_CHECKING(for the ILU library in the build tree)
771 AC_CACHE_VAL(ac_cv_c_ilulib,[
772 if test -f "$ac_cv_c_ilupath/runtime/kernel/Makefile" ; then
773 ac_cv_c_ilulib=`(cd $ac_cv_c_ilupath/runtime/kernel; pwd)`
774 AC_MSG_RESULT(found ${ac_cv_c_ilulib}/libilu.a)
779 AC_MSG_CHECKING(for the ILU C++ bindings library in the build tree)
780 AC_CACHE_VAL(ac_cv_c_ilulib2,[
781 if test -f "$ac_cv_c_ilupath/runtime/cpp/Makefile" ; then
782 ac_cv_c_ilulib2=`(cd $ac_cv_c_ilupath/runtime/cpp; pwd)`
783 AC_MSG_RESULT(found ${ac_cv_c_ilulib2}/libilu-c++.a)
788 AC_MSG_CHECKING(for the ILU C bindings library in the build tree)
789 AC_CACHE_VAL(ac_cv_c_ilulib3,[
790 if test -f "$ac_cv_c_ilupath/runtime/c/Makefile" ; then
791 ac_cv_c_ilulib3=`(cd $ac_cv_c_ilupath/runtime/c; pwd)`
792 AC_MSG_RESULT(found ${ac_cv_c_ilulib3}/libilu-c.a)
797 AC_MSG_CHECKING(for the ILU Tk bindings library in the build tree)
798 AC_CACHE_VAL(ac_cv_c_ilulib4,[
799 if test -f "$ac_cv_c_ilupath/runtime/mainloop/Makefile" ; then
800 ac_cv_c_ilulib4=`(cd $ac_cv_c_ilupath/runtime/mainloop; pwd)`
801 AC_MSG_RESULT(found ${ac_cv_c_ilulib4}/libilu-tk.a)
806 if test x"${ac_cv_c_ilulib}" = x -a x"${ac_cv_c_ilulib2}" = x; then
810 if test x"${ac_cv_c_ilulib}" != x -a x"${ac_cv_c_ilulib2}" != x; then
811 ILULIB="-L${ac_cv_c_ilulib} -L${ac_cv_c_ilulib2} -L${ac_cv_c_ilulib3} -L${ac_cv_c_ilulib4}"
816 if test x"${ILULIB}" = x; then
817 AC_MSG_CHECKING(for ILU libraries installed with the compiler)
818 AC_CACHE_VAL(ac_cv_c_ilulib5,[
819 NATIVE_GCC=`echo gcc | sed -e "${program_transform_name}"`
821 dnl Get G++'s full path to it's libraries
822 ac_cv_c_ilulib5=`${NATIVE_GCC} --print-libgcc | sed -e 's:lib/gcc-lib/.*::'`lib
823 if test -f $ac_cv_c_ilulib5/libilu-c.a -o -f $ac_cv_c_ilulib5/libilu-c.so ; then
824 if test x"${ILUHDIR}" = x; then
825 ILUHDIR="-I${ac_cv_c_ilulib5}/../include"
827 ILULIB="-L${ac_cv_c_ilulib5}"
828 AC_MSG_RESULT(${ac_cv_c_ilulib5})
839 dnl ====================================================================
840 dnl Find the target manager client side headers and library.
841 AC_DEFUN(CYG_AC_PATH_TMGR, [
842 AC_MSG_CHECKING(for Target Manager client headers in the source tree)
843 dirlist=".. ../../ ../../../ ../../../../ ../../../../../ ../../../../../../ ../../../../../../.. ../../../../../../../.. ../../../../../../../../.. ../../../../../../../../../.. "
846 AC_CACHE_VAL(ac_cv_c_tmgrh,[
847 for i in $dirlist; do
848 if test -f "${srcdir}/$i/ecc/ecc/infra/targ_mgr/current/host/targ_mgr/src/targcli.h" ; then
849 ac_cv_c_tmgrh=`(cd ${srcdir}/$i/ecc/ecc/infra/targ_mgr/current/host/targ_mgr/src/; pwd)`;
853 if test x"${ac_cv_c_tmgrh}" != x; then
854 TMGRHDIR="-I${ac_cv_c_tmgrh}"
855 AC_MSG_RESULT(${ac_cv_c_tmgrh})
860 AC_MSG_CHECKING(for Target Manager client headers in the build tree)
861 AC_CACHE_VAL(ac_cv_c_tmgrh2,[
862 for i in $dirlist; do
863 if test -f "$i/ecc/ecc/infra/targ_mgr/current/host/targ_mgr/src/Makefile" ; then
864 ac_cv_c_tmgrh2=`(cd $i/ecc/ecc/infra/targ_mgr/current/host/targ_mgr/src/; pwd)`;
868 if test x"${ac_cv_c_tmgrh2}" != x; then
869 TMGRHDIR="${TMGRHDIR} -I${ac_cv_c_tmgrh2}"
870 AC_MSG_RESULT(${ac_cv_c_tmgrh2})
875 if test x"${ac_cv_c_tmgrh}" = x -a x"${ac_cv_c_tmgrh2}" = x; then
876 TMGRHDIR="# no Target Manager client headers found"
879 AC_MSG_CHECKING(for Target Manager client library)
880 AC_CACHE_VAL(ac_cv_c_tmgrlib,[
881 if test x"${ac_cv_c_tmgrlib}" = x ; then
882 for i in $dirlist; do
883 if test -f "$i/ecc/ecc/infra/targ_mgr/current/host/targ_mgr/src/Makefile" ; then
884 # We have to add .libs on the end cause the tmgr uses libtool,
886 ac_cv_c_tmgrlib=`(cd $i/ecc/ecc/infra/targ_mgr/current/host/targ_mgr/src/; pwd)`
887 # we have to do this, cause libtool hasn't built the lib
889 ac_cv_c_tmgrlib="${ac_cv_c_tmgrlib}/.libs"
895 if test x"${ac_cv_c_tmgrlib}" != x ; then
896 TMGRLIB="-L${ac_cv_c_tmgrlib}"
897 AC_MSG_RESULT(${ac_cv_c_tmgrlib})
905 dnl ====================================================================
906 dnl This defines the byte order for the host. We can't use
907 dnl AC_C_BIGENDIAN, cause we want to create a config file and
908 dnl substitue the real value, so the header files work right
909 AC_DEFUN(CYG_AC_C_ENDIAN, [
910 AC_MSG_CHECKING(to see if this is a little endian host)
911 AC_CACHE_VAL(ac_cv_c_little_endian, [
912 ac_cv_c_little_endian=unknown
913 # See if sys/param.h defines the BYTE_ORDER macro.
914 AC_TRY_COMPILE([#include <sys/types.h>
915 #include <sys/param.h>], [
916 #if !BYTE_ORDER || !_BIG_ENDIAN || !_LITTLE_ENDIAN
918 #endif], [# It does; now see whether it defined to _LITTLE_ENDIAN or not.
919 AC_TRY_COMPILE([#include <sys/types.h>
920 #include <sys/param.h>], [
921 #if BYTE_ORDER != _LITTLE_ENDIAN
923 #endif], ac_cv_c_little_endian=yes, ac_cv_c_little_endian=no)
925 if test ${ac_cv_c_little_endian} = unknown; then
930 /* Are we little or big endian? From Harbison&Steele. */
934 char c[sizeof (long)];
939 ac_cv_c_little_endian=no,
940 ac_cv_c_little_endian=yes,[
941 dnl Yes, this is ugly, and only used for a canadian cross anyway. This
942 dnl is just to keep configure from stopping here.
945 i[3456]86-*-*) ac_cv_c_little_endian=yes ;;
946 sparc*-*-*) ac_cv_c_little_endian=no ;;
948 *) AC_MSG_WARN(Can't cross compile this test) ;;
953 if test x"${ac_cv_c_little_endian}" = xyes; then
954 AC_DEFINE(LITTLE_ENDIAN_HOST)
955 ENDIAN="CYG_LSBFIRST";
957 ENDIAN="CYG_MSBFIRST";
959 AC_MSG_RESULT(${ac_cv_c_little_endian})
963 dnl ====================================================================
964 dnl Look for the path to libgcc, so we can use it to directly link
965 dnl in libgcc.a with LD.
966 AC_DEFUN(CYG_AC_PATH_LIBGCC,
967 [AC_MSG_CHECKING([Looking for the path to libgcc.a])
971 dnl Get Gcc's full path to libgcc.a
972 libgccpath=`${CC} --print-libgcc`
974 dnl If we don't have a path with libgcc.a on the end, this isn't G++.
975 if test `echo $libgccpath | sed -e 's:/.*/::'` = libgcc.a ; then
982 if test x"${ac_cv_prog_gcc}" = xyes ; then
983 gccpath=`echo $libgccpath | sed -e 's:/libgcc.a::'`
984 LIBGCC="-L${gccpath}"
985 AC_MSG_RESULT(${gccpath})
988 AC_MSG_ERROR(Not using gcc)
995 dnl ====================================================================
996 dnl Ok, lets find the tcl source trees so we can use the headers
997 dnl Warning: transition of version 9 to 10 will break this algorithm
998 dnl because 10 sorts before 9. We also look for just tcl. We have to
999 dnl be careful that we don't match stuff like tclX by accident.
1000 dnl the alternative search directory is involked by --with-tclinclude
1001 AC_DEFUN(CYG_AC_PATH_TCL, [
1003 CYG_AC_PATH_TCLCONFIG
1004 CYG_AC_LOAD_TCLCONFIG
1006 AC_DEFUN(CYG_AC_PATH_TCLH, [
1007 dirlist=".. ../../ ../../../ ../../../../ ../../../../../ ../../../../../../ ../../../../../../.. ../../../../../../../.. ../../../../../../../../.. ../../../../../../../../../.."
1009 AC_MSG_CHECKING(for Tcl headers in the source tree)
1010 AC_ARG_WITH(tclinclude, [ --with-tclinclude directory where tcl headers are], with_tclinclude=${withval})
1011 AC_CACHE_VAL(ac_cv_c_tclh,[
1012 dnl first check to see if --with-tclinclude was specified
1013 if test x"${with_tclinclude}" != x ; then
1014 if test -f ${with_tclinclude}/tcl.h ; then
1015 ac_cv_c_tclh=`(cd ${with_tclinclude}; pwd)`
1016 elif test -f ${with_tclinclude}/generic/tcl.h ; then
1017 ac_cv_c_tclh=`(cd ${with_tclinclude}/generic; pwd)`
1019 AC_MSG_ERROR([${with_tclinclude} directory doesn't contain headers])
1023 dnl next check if it came with Tcl configuration file
1024 if test x"${ac_cv_c_tclconfig}" != x ; then
1025 for i in $dirlist; do
1026 if test -f $ac_cv_c_tclconfig/$i/generic/tcl.h ; then
1027 ac_cv_c_tclh=`(cd $ac_cv_c_tclconfig/$i/generic; pwd)`
1033 dnl next check in private source directory
1034 dnl since ls returns lowest version numbers first, reverse its output
1035 if test x"${ac_cv_c_tclh}" = x ; then
1036 dnl find the top level Tcl source directory
1037 for i in $dirlist; do
1038 if test -n "`ls -dr $srcdir/$i/tcl* 2>/dev/null`" ; then
1044 dnl find the exact Tcl source dir. We do it this way, cause there
1045 dnl might be multiple version of Tcl, and we want the most recent one.
1046 for i in `ls -dr $tclpath/tcl* 2>/dev/null ` ; do
1047 if test -f $i/generic/tcl.h ; then
1048 ac_cv_c_tclh=`(cd $i/generic; pwd)`
1054 dnl check if its installed with the compiler
1055 if test x"${ac_cv_c_tclh}" = x ; then
1056 dnl Get the path to the compiler
1057 ccpath=`which ${CC} | sed -e 's:/bin/.*::'`/include
1058 if test -f $ccpath/tcl.h; then
1059 ac_cv_c_tclh=$ccpath
1063 dnl see if one is installed
1064 if test x"${ac_cv_c_tclh}" = x ; then
1066 AC_CHECK_HEADER(tcl.h, ac_cv_c_tclh=installed, ac_cv_c_tclh="")
1068 AC_MSG_RESULT(${ac_cv_c_tclh})
1072 if test x"${ac_cv_c_tclh}" = x ; then
1073 AC_MSG_ERROR([Can't find any Tcl headers])
1075 if test x"${ac_cv_c_tclh}" != x ; then
1077 if test x"${ac_cv_c_tclh}" != x"installed" ; then
1078 AC_MSG_RESULT(${ac_cv_c_tclh})
1079 TCLHDIR="-I${ac_cv_c_tclh}"
1086 dnl ====================================================================
1087 dnl Ok, lets find the tcl configuration
1088 AC_DEFUN(CYG_AC_PATH_TCLCONFIG, [
1089 dirlist=".. ../../ ../../../ ../../../../ ../../../../../ ../../../../../../ ../../../../../../.. ../../../../../../../.. ../../../../../../../../.. ../../../../../../../../../.."
1090 dnl First, look for one uninstalled.
1091 dnl the alternative search directory is invoked by --with-tclconfig
1092 if test x"${no_tcl}" = x ; then
1093 dnl we reset no_tcl in case something fails here
1095 AC_ARG_WITH(tclconfig, [ --with-tclconfig directory containing tcl configuration (tclConfig.sh)],
1096 with_tclconfig=${withval})
1097 AC_MSG_CHECKING([for Tcl configuration script])
1098 AC_CACHE_VAL(ac_cv_c_tclconfig,[
1100 dnl First check to see if --with-tclconfig was specified.
1101 if test x"${with_tclconfig}" != x ; then
1102 if test -f "${with_tclconfig}/tclConfig.sh" ; then
1103 ac_cv_c_tclconfig=`(cd ${with_tclconfig}; pwd)`
1105 AC_MSG_ERROR([${with_tclconfig} directory doesn't contain tclConfig.sh])
1109 dnl next check if it came with Tcl configuration file in the source tree
1110 if test x"${ac_cv_c_tclconfig}" = x ; then
1111 for i in $dirlist; do
1112 if test -f $srcdir/$i/unix/tclConfig.sh ; then
1113 ac_cv_c_tclconfig=`(cd $srcdir/$i/unix; pwd)`
1118 dnl check in a few other locations
1119 if test x"${ac_cv_c_tclconfig}" = x ; then
1120 dnl find the top level Tcl source directory
1121 for i in $dirlist; do
1122 if test -n "`ls -dr $i/tcl* 2>/dev/null`" ; then
1128 dnl find the exact Tcl dir. We do it this way, cause there
1129 dnl might be multiple version of Tcl, and we want the most recent one.
1130 for i in `ls -dr $tclconfpath/tcl* 2>/dev/null ` ; do
1131 if test -f $i/unix/tclConfig.sh ; then
1132 ac_cv_c_tclconfig=`(cd $i/unix; pwd)`
1138 dnl Check to see if it's installed. We have to look in the $CC path
1139 dnl to find it, cause our $prefix may not match the compilers.
1140 if test x"${ac_cv_c_tclconfig}" = x ; then
1141 dnl Get the path to the compiler
1142 ccpath=`which ${CC} | sed -e 's:/bin/.*::'`/lib
1143 if test -f $ccpath/tclConfig.sh; then
1144 ac_cv_c_tclconfig=$ccpath
1147 ]) dnl end of cache_val
1149 if test x"${ac_cv_c_tclconfig}" = x ; then
1151 AC_MSG_WARN(Can't find Tcl configuration definitions)
1154 TCLCONFIG=${ac_cv_c_tclconfig}/tclConfig.sh
1155 AC_MSG_RESULT(${TCLCONFIG})
1161 dnl Defined as a separate macro so we don't have to cache the values
1162 dnl from PATH_TCLCONFIG (because this can also be cached).
1163 AC_DEFUN(CYG_AC_LOAD_TCLCONFIG, [
1166 dnl AC_SUBST(TCL_VERSION)
1167 dnl AC_SUBST(TCL_MAJOR_VERSION)
1168 dnl AC_SUBST(TCL_MINOR_VERSION)
1169 dnl AC_SUBST(TCL_CC)
1172 dnl not used, don't export to save symbols
1173 dnl AC_SUBST(TCL_LIB_FILE)
1175 dnl not used, don't export to save symbols
1176 dnl AC_SUBST(TCL_PREFIX)
1178 dnl not used, don't export to save symbols
1179 dnl AC_SUBST(TCL_EXEC_PREFIX)
1181 AC_SUBST(TCL_SHLIB_CFLAGS)
1182 AC_SUBST(TCL_SHLIB_LD)
1183 dnl don't export, not used outside of configure
1184 dnl AC_SUBST(TCL_SHLIB_LD_LIBS)
1185 dnl AC_SUBST(TCL_SHLIB_SUFFIX)
1186 dnl not used, don't export to save symbols
1187 dnl AC_SUBST(TCL_DL_LIBS)
1188 AC_SUBST(TCL_LD_FLAGS)
1189 AC_SUBST(TCL_LD_SEARCH_FLAGS)
1190 dnl don't export, not used outside of configure
1191 dnl AC_SUBST(TCL_COMPAT_OBJS)
1192 AC_SUBST(TCL_RANLIB)
1193 AC_SUBST(TCL_BUILD_LIB_SPEC)
1194 AC_SUBST(TCL_LIB_SPEC)
1195 dnl AC_SUBST(TCL_LIB_VERSIONS_OK)
1197 dnl not used, don't export to save symbols
1198 dnl AC_SUBST(TCL_SHARED_LIB_SUFFIX)
1200 dnl not used, don't export to save symbols
1201 dnl AC_SUBST(TCL_UNSHARED_LIB_SUFFIX)
1204 dnl ====================================================================
1205 AC_DEFUN(CYG_AC_PATH_TK, [
1207 CYG_AC_PATH_TKCONFIG
1208 CYG_AC_LOAD_TKCONFIG
1210 AC_DEFUN(CYG_AC_PATH_TKH, [
1212 # Ok, lets find the tk source trees so we can use the headers
1213 # If the directory (presumably symlink) named "tk" exists, use that one
1214 # in preference to any others. Same logic is used when choosing library
1215 # and again with Tcl. The search order is the best place to look first, then in
1216 # decreasing significance. The loop breaks if the trigger file is found.
1217 # Note the gross little conversion here of srcdir by cd'ing to the found
1218 # directory. This converts the path from a relative to an absolute, so
1219 # recursive cache variables for the path will work right. We check all
1220 # the possible paths in one loop rather than many seperate loops to speed
1222 # the alternative search directory is involked by --with-tkinclude
1224 dirlist=".. ../../ ../../../ ../../../../ ../../../../../ ../../../../../../ ../../../../../../.. ../../../../../../../.. ../../../../../../../../.. ../../../../../../../../../.."
1226 AC_MSG_CHECKING(for Tk headers in the source tree)
1227 AC_ARG_WITH(tkinclude, [ --with-tkinclude directory where tk headers are], with_tkinclude=${withval})
1228 AC_CACHE_VAL(ac_cv_c_tkh,[
1229 dnl first check to see if --with-tkinclude was specified
1230 if test x"${with_tkinclude}" != x ; then
1231 if test -f ${with_tkinclude}/tk.h ; then
1232 ac_cv_c_tkh=`(cd ${with_tkinclude}; pwd)`
1233 elif test -f ${with_tkinclude}/generic/tk.h ; then
1234 ac_cv_c_tkh=`(cd ${with_tkinclude}/generic; pwd)`
1236 AC_MSG_ERROR([${with_tkinclude} directory doesn't contain headers])
1240 dnl next check if it came with Tk configuration file
1241 if test x"${ac_cv_c_tkconfig}" != x ; then
1242 for i in $dirlist; do
1243 if test -f $ac_cv_c_tkconfig/$i/generic/tk.h ; then
1244 ac_cv_c_tkh=`(cd $ac_cv_c_tkconfig/$i/generic; pwd)`
1250 dnl next check in private source directory
1251 dnl since ls returns lowest version numbers first, reverse its output
1252 if test x"${ac_cv_c_tkh}" = x ; then
1253 dnl find the top level Tk source directory
1254 for i in $dirlist; do
1255 if test -n "`ls -dr $srcdir/$i/tk* 2>/dev/null`" ; then
1261 dnl find the exact Tk source dir. We do it this way, cause there
1262 dnl might be multiple version of Tk, and we want the most recent one.
1263 for i in `ls -dr $tkpath/tk* 2>/dev/null ` ; do
1264 if test -f $i/generic/tk.h ; then
1265 ac_cv_c_tkh=`(cd $i/generic; pwd)`
1271 dnl see if one is installed
1272 if test x"${ac_cv_c_tkh}" = x ; then
1274 dnl Get the path to the compiler. We do it this way instead of using
1275 dnl AC_CHECK_HEADER, cause this doesn't depend in having X configured.
1276 ccpath=`which ${CC} | sed -e 's:/bin/.*::'`/include
1277 if test -f $ccpath/tk.h; then
1281 AC_MSG_RESULT(${ac_cv_c_tkh})
1285 if test x"${ac_cv_c_tkh}" = x ; then
1286 AC_MSG_ERROR([Can't find any Tk headers])
1288 if test x"${ac_cv_c_tkh}" != x ; then
1290 if test x"${ac_cv_c_tkh}" != x"installed" ; then
1291 AC_MSG_RESULT([found in ${ac_cv_c_tkh}])
1292 TKHDIR="-I${ac_cv_c_tkh}"
1299 AC_DEFUN(CYG_AC_PATH_TKCONFIG, [
1300 dirlist=".. ../../ ../../../ ../../../../ ../../../../../ ../../../../../../ ../../../../../../.. ../../../../../../../.. ../../../../../../../../.. ../../../../../../../../../.."
1301 dnl First, look for one uninstalled.
1302 dnl the alternative search directory is invoked by --with-tkconfig
1303 if test x"${no_tk}" = x ; then
1304 dnl we reset no_tk in case something fails here
1306 AC_ARG_WITH(tkconfig, [ --with-tkconfig directory containing tk configuration (tkConfig.sh)],
1307 with_tkconfig=${withval})
1308 AC_MSG_CHECKING([for Tk configuration script])
1309 AC_CACHE_VAL(ac_cv_c_tkconfig,[
1311 dnl First check to see if --with-tkconfig was specified.
1312 if test x"${with_tkconfig}" != x ; then
1313 if test -f "${with_tkconfig}/tkConfig.sh" ; then
1314 ac_cv_c_tkconfig=`(cd ${with_tkconfig}; pwd)`
1316 AC_MSG_ERROR([${with_tkconfig} directory doesn't contain tkConfig.sh])
1320 dnl next check if it came with Tk configuration file in the source tree
1321 if test x"${ac_cv_c_tkconfig}" = x ; then
1322 for i in $dirlist; do
1323 if test -f $srcdir/$i/unix/tkConfig.sh ; then
1324 ac_cv_c_tkconfig=`(cd $srcdir/$i/unix; pwd)`
1329 dnl check in a few other locations
1330 if test x"${ac_cv_c_tkconfig}" = x ; then
1331 dnl find the top level Tk source directory
1332 for i in $dirlist; do
1333 if test -n "`ls -dr $i/tk* 2>/dev/null`" ; then
1339 dnl find the exact Tk dir. We do it this way, cause there
1340 dnl might be multiple version of Tk, and we want the most recent one.
1341 for i in `ls -dr $tkconfpath/tk* 2>/dev/null ` ; do
1342 if test -f $i/unix/tkConfig.sh ; then
1343 ac_cv_c_tkconfig=`(cd $i/unix; pwd)`
1349 dnl Check to see if it's installed. We have to look in the $CC path
1350 dnl to find it, cause our $prefix may not match the compilers.
1351 if test x"${ac_cv_c_tkconfig}" = x ; then
1352 dnl Get the path to the compiler
1353 ccpath=`which ${CC} | sed -e 's:/bin/.*::'`/lib
1354 if test -f $ccpath/tkConfig.sh; then
1355 ac_cv_c_tkconfig=$ccpath
1358 ]) dnl end of cache_val
1360 if test x"${ac_cv_c_tkconfig}" = x ; then
1362 AC_MSG_WARN(Can't find Tk configuration definitions)
1365 TKCONFIG=${ac_cv_c_tkconfig}/tkConfig.sh
1366 AC_MSG_RESULT(${TKCONFIG})
1372 dnl Defined as a separate macro so we don't have to cache the values
1373 dnl from PATH_TKCONFIG (because this can also be cached).
1374 AC_DEFUN(CYG_AC_LOAD_TKCONFIG, [
1375 if test -f "$TKCONFIG" ; then
1379 AC_SUBST(TK_VERSION)
1380 dnl not actually used, don't export to save symbols
1381 dnl AC_SUBST(TK_MAJOR_VERSION)
1382 dnl AC_SUBST(TK_MINOR_VERSION)
1385 dnl not used, don't export to save symbols
1386 dnl AC_SUBST(TK_LIB_FILE)
1389 dnl not used, don't export to save symbols
1390 dnl AC_SUBST(TK_PREFIX)
1392 dnl not used, don't export to save symbols
1393 dnl AC_SUBST(TK_EXEC_PREFIX)
1394 AC_SUBST(TK_BUILD_INCLUDES)
1395 AC_SUBST(TK_XINCLUDES)
1397 AC_SUBST(TK_BUILD_LIB_SPEC)
1398 AC_SUBST(TK_LIB_SPEC)
1401 dnl ====================================================================
1402 dnl Ok, lets find the itcl source trees so we can use the headers
1403 dnl the alternative search directory is involked by --with-itclinclude
1404 AC_DEFUN(CYG_AC_PATH_ITCL, [
1408 CYG_AC_PATH_ITCLMKIDX
1410 AC_DEFUN(CYG_AC_PATH_ITCLH, [
1411 dirlist=".. ../../ ../../../ ../../../../ ../../../../../ ../../../../../../ ../../../../../../.. ../../../../../../../.. ../../../../../../../../.. ../../../../../../../../../.."
1413 AC_MSG_CHECKING(for Itcl headers in the source tree)
1414 AC_ARG_WITH(itclinclude, [ --with-itclinclude directory where itcl headers are], with_itclinclude=${withval})
1415 AC_CACHE_VAL(ac_cv_c_itclh,[
1416 dnl first check to see if --with-itclinclude was specified
1417 if test x"${with_itclinclude}" != x ; then
1418 if test -f ${with_itclinclude}/itcl.h ; then
1419 ac_cv_c_itclh=`(cd ${with_itclinclude}; pwd)`
1420 elif test -f ${with_itclinclude}/src/itcl.h ; then
1421 ac_cv_c_itclh=`(cd ${with_itclinclude}/src; pwd)`
1423 AC_MSG_ERROR([${with_itclinclude} directory doesn't contain headers])
1427 dnl next check if it came with Itcl configuration file
1428 if test x"${ac_cv_c_itclconfig}" != x ; then
1429 for i in $dirlist; do
1430 if test -f $ac_cv_c_itclconfig/$i/src/itcl.h ; then
1431 ac_cv_c_itclh=`(cd $ac_cv_c_itclconfig/$i/src; pwd)`
1437 dnl next check in private source directory
1438 dnl since ls returns lowest version numbers first, reverse its output
1439 if test x"${ac_cv_c_itclh}" = x ; then
1440 dnl find the top level Itcl source directory
1441 for i in $dirlist; do
1442 if test -n "`ls -dr $srcdir/$i/itcl* 2>/dev/null`" ; then
1448 dnl find the exact Itcl source dir. We do it this way, cause there
1449 dnl might be multiple version of Itcl, and we want the most recent one.
1450 for i in `ls -dr $itclpath/itcl* 2>/dev/null ` ; do
1451 if test -f $i/src/itcl.h ; then
1452 ac_cv_c_itclh=`(cd $i/src; pwd)`
1458 dnl see if one is installed
1459 if test x"${ac_cv_c_itclh}" = x ; then
1461 AC_CHECK_HEADER(itcl.h, ac_cv_c_itclh=installed, ac_cv_c_itclh="")
1463 AC_MSG_RESULT(${ac_cv_c_itclh})
1467 if test x"${ac_cv_c_itclh}" = x ; then
1468 AC_MSG_ERROR([Can't find any Itcl headers])
1470 if test x"${ac_cv_c_itclh}" != x ; then
1472 if test x"${ac_cv_c_itclh}" != x"installed" ; then
1473 AC_MSG_RESULT(${ac_cv_c_itclh})
1474 ITCLHDIR="-I${ac_cv_c_itclh}"
1481 dnl Ok, lets find the itcl library
1482 dnl First, look for one uninstalled.
1483 dnl the alternative search directory is invoked by --with-itcllib
1484 AC_DEFUN(CYG_AC_PATH_ITCLLIB, [
1485 dirlist=".. ../../ ../../../ ../../../../ ../../../../../ ../../../../../../ ../../../../../../.. ../../../../../../../.. ../../../../../../../../.. ../../../../../../../../../.."
1486 if test x"${no_itcl}" = x ; then
1487 dnl we reset no_itcl incase something fails here
1489 AC_ARG_WITH(itcllib,
1490 [ --with-itcllib directory where the itcl library is],
1491 with_itcllib=${withval})
1492 AC_MSG_CHECKING([for Itcl library])
1493 AC_CACHE_VAL(ac_cv_c_itcllib,[
1494 dnl First check to see if --with-itcllib was specified.
1495 if test x"${with_itcllib}" != x ; then
1496 if test -f "${with_itcllib}/libitcl$TCL_SHARED_LIB_SUFFIX" ; then
1497 ac_cv_c_itcllib=`(cd ${with_itcllib}; pwd)`/libitcl$TCL_SHARED_LIB_SUFFIX
1499 if test -f "${with_itcllib}/libitcl$TCL_UNSHARED_LIB_SUFFIX"; then
1500 ac_cv_c_itcllib=`(cd ${with_itcllib}; pwd)`/libitcl$TCL_UNSHARED_LIB_SUFFIX
1504 dnl then check for a Itcl library. Since these are uninstalled,
1505 dnl use the simple lib name root.
1506 if test x"${ac_cv_c_itcllib}" = x ; then
1507 dnl find the top level Itcl build directory
1508 for i in $dirlist; do
1509 if test -n "`ls -dr $i/itcl* 2>/dev/null`" ; then
1514 dnl Itcl 7.5 and greater puts library in subdir. Look there first.
1515 if test -f "$itclpath/src/libitcl.$TCL_SHLIB_SUFFIX" ; then
1516 ac_cv_c_itcllib=`(cd $itclpath/src; pwd)`
1517 elif test -f "$itclpath/src/libitcl.a"; then
1518 ac_cv_c_itcllib=`(cd $itclpath/src; pwd)`
1521 dnl check in a few other private locations
1522 if test x"${ac_cv_c_itcllib}" = x ; then
1523 for i in ${dirlist}; do
1524 if test -n "`ls -dr ${srcdir}/$i/itcl* 2>/dev/null`" ; then
1525 itclpath=${srcdir}/$i
1529 for i in `ls -dr ${itclpath}/itcl* 2>/dev/null` ; do
1530 dnl Itcl 7.5 and greater puts library in subdir. Look there first.
1531 if test -f "$i/src/libitcl$TCL_SHLIB_SUFFIX" ; then
1532 ac_cv_c_itcllib=`(cd $i/src; pwd)`
1534 elif test -f "$i/src/libitcl.a"; then
1535 ac_cv_c_itcllib=`(cd $i/src; pwd)`
1541 dnl see if one is conveniently installed with the compiler
1542 if test x"${ac_cv_c_itcllib}" = x ; then
1543 dnl Get the path to the compiler
1544 ccpath=`which ${CC} | sed -e 's:/bin/.*::'`/lib
1545 dnl Itcl 7.5 and greater puts library in subdir. Look there first.
1546 if test -f "${ccpath}/libitcl$TCL_SHLIB_SUFFIX" ; then
1547 ac_cv_c_itcllib=`(cd ${ccpath}; pwd)`
1548 elif test -f "${ccpath}/libitcl.a"; then
1549 ac_cv_c_itcllib=`(cd ${ccpath}; pwd)`
1553 if test x"${ac_cv_c_itcllib}" = x ; then
1555 AC_MSG_WARN(Can't find Itcl library)
1557 ITCLLIB="-L${ac_cv_c_itcllib}"
1558 AC_MSG_RESULT(${ac_cv_c_itcllib})
1568 dnl ====================================================================
1569 dnl Ok, lets find the itcl source trees so we can use the itcl_sh script
1570 dnl the alternative search directory is involked by --with-itclinclude
1571 AC_DEFUN(CYG_AC_PATH_ITCLSH, [
1572 dirlist=".. ../../ ../../../ ../../../../ ../../../../../ ../../../../../../ ../../../../../../.. ../../../../../../../.. ../../../../../../../../.. ../../../../../../../../../.."
1574 AC_MSG_CHECKING(for the itcl_sh script)
1575 AC_ARG_WITH(itclinclude, [ --with-itclinclude directory where itcl headers are], with_itclinclude=${withval})
1576 AC_CACHE_VAL(ac_cv_c_itclsh,[
1577 dnl first check to see if --with-itclinclude was specified
1578 if test x"${with_itclinclude}" != x ; then
1579 if test -f ${with_itclinclude}/itcl_sh ; then
1580 ac_cv_c_itclsh=`(cd ${with_itclinclude}; pwd)`
1581 elif test -f ${with_itclinclude}/src/itcl_sh ; then
1582 ac_cv_c_itclsh=`(cd ${with_itclinclude}/src; pwd)`
1584 AC_MSG_ERROR([${with_itclinclude} directory doesn't contain itcl_sh])
1588 dnl next check in private source directory
1589 dnl since ls returns lowest version numbers first, reverse its output
1590 if test x"${ac_cv_c_itclsh}" = x ; then
1591 dnl find the top level Itcl source directory
1592 for i in $dirlist; do
1593 if test -n "`ls -dr $srcdir/$i/itcl* 2>/dev/null`" ; then
1599 dnl find the exact Itcl source dir. We do it this way, cause there
1600 dnl might be multiple version of Itcl, and we want the most recent one.
1601 for i in `ls -dr $itclpath/itcl* 2>/dev/null ` ; do
1602 if test -f $i/src/itcl_sh ; then
1603 ac_cv_c_itclsh=`(cd $i/src; pwd)`/itcl_sh
1609 dnl see if one is installed
1610 if test x"${ac_cv_c_itclsh}" = x ; then
1612 AC_PATH_PROG(ac_cv_c_itclsh, itcl_sh)
1614 AC_MSG_RESULT(${ac_cv_c_itclsh})
1618 if test x"${ac_cv_c_itclsh}" = x ; then
1619 AC_MSG_ERROR([Can't find the itcl_sh script])
1621 if test x"${ac_cv_c_itclsh}" != x ; then
1623 AC_MSG_RESULT(${ac_cv_c_itclsh})
1624 ITCLSH="${ac_cv_c_itclsh}"
1630 dnl ====================================================================
1631 dnl Ok, lets find the itcl source trees so we can use the itcl_sh script
1632 dnl the alternative search directory is involked by --with-itclinclude
1633 AC_DEFUN(CYG_AC_PATH_ITCLMKIDX, [
1634 dirlist=".. ../../ ../../../ ../../../../ ../../../../../ ../../../../../../ ../../../../../../.. ../../../../../../../.. ../../../../../../../../.. ../../../../../../../../../.."
1636 AC_MSG_CHECKING(for itcl_mkindex.tcl script)
1637 AC_ARG_WITH(itclinclude, [ --with-itclinclude directory where itcl headers are], with_itclinclude=${withval})
1638 AC_CACHE_VAL(ac_cv_c_itclmkidx,[
1639 dnl first check to see if --with-itclinclude was specified
1640 if test x"${with_itclinclude}" != x ; then
1641 if test -f ${with_itclinclude}/itcl_sh ; then
1642 ac_cv_c_itclmkidx=`(cd ${with_itclinclude}; pwd)`
1643 elif test -f ${with_itclinclude}/src/itcl_sh ; then
1644 ac_cv_c_itclmkidx=`(cd ${with_itclinclude}/src; pwd)`
1646 AC_MSG_ERROR([${with_itclinclude} directory doesn't contain itcl_sh])
1650 dnl next check in private source directory
1651 dnl since ls returns lowest version numbers first, reverse its output
1652 if test x"${ac_cv_c_itclmkidx}" = x ; then
1653 dnl find the top level Itcl source directory
1654 for i in $dirlist; do
1655 if test -n "`ls -dr $srcdir/$i/itcl* 2>/dev/null`" ; then
1661 dnl find the exact Itcl source dir. We do it this way, cause there
1662 dnl might be multiple version of Itcl, and we want the most recent one.
1663 for i in `ls -dr $itclpath/itcl* 2>/dev/null ` ; do
1664 if test -f $i/library/itcl_mkindex.tcl ; then
1665 ac_cv_c_itclmkidx=`(cd $i/library; pwd)`/itcl_mkindex.tcl
1670 if test x"${ac_cv_c_itclmkidx}" = x ; then
1671 dnl Get the path to the compiler
1672 ccpath=`which ${CC} | sed -e 's:/bin/.*::'`/share
1673 dnl Itcl 7.5 and greater puts library in subdir. Look there first.
1674 for i in `ls -dr $ccpath/itcl* 2>/dev/null ` ; do
1675 if test -f $i/itcl_mkindex.tcl ; then
1676 ac_cv_c_itclmkidx=`(cd $i; pwd)`/itcl_mkindex.tcl
1683 if test x"${ac_cv_c_itclmkidx}" = x ; then
1684 AC_MSG_ERROR([Can't find the itcl_mkindex.tcl script])
1686 if test x"${ac_cv_c_itclmkidx}" != x ; then
1688 AC_MSG_RESULT(${ac_cv_c_itclmkidx})
1689 ITCLMKIDX="${ac_cv_c_itclmkidx}"
1696 dnl ====================================================================
1697 dnl Ok, lets find the tix source trees so we can use the headers
1698 dnl the alternative search directory is involked by --with-tixinclude
1699 AC_DEFUN(CYG_AC_PATH_TIX, [
1703 AC_DEFUN(CYG_AC_PATH_TIXH, [
1704 dirlist=".. ../../ ../../../ ../../../../ ../../../../../ ../../../../../../ ../../../../../../.. ../../../../../../../.. ../../../../../../../../.. ../../../../../../../../../.."
1706 AC_MSG_CHECKING(for Tix headers in the source tree)
1707 AC_ARG_WITH(tixinclude, [ --with-tixinclude directory where tix headers are], with_tixinclude=${withval})
1708 AC_CACHE_VAL(ac_cv_c_tixh,[
1709 dnl first check to see if --with-tixinclude was specified
1710 if test x"${with_tixinclude}" != x ; then
1711 if test -f ${with_tixinclude}/tix.h ; then
1712 ac_cv_c_tixh=`(cd ${with_tixinclude}; pwd)`
1713 elif test -f ${with_tixinclude}/generic/tix.h ; then
1714 ac_cv_c_tixh=`(cd ${with_tixinclude}/generic; pwd)`
1716 AC_MSG_ERROR([${with_tixinclude} directory doesn't contain headers])
1720 dnl next check if it came with Tix configuration file
1721 if test x"${ac_cv_c_tixconfig}" != x ; then
1722 for i in $dirlist; do
1723 if test -f $ac_cv_c_tixconfig/$i/generic/tix.h ; then
1724 ac_cv_c_tixh=`(cd $ac_cv_c_tixconfig/$i/generic; pwd)`
1730 dnl next check in private source directory
1731 dnl since ls returns lowest version numbers first, reverse its output
1732 if test x"${ac_cv_c_tixh}" = x ; then
1733 dnl find the top level Tix source directory
1734 for i in $dirlist; do
1735 if test -n "`ls -dr $srcdir/$i/tix* 2>/dev/null`" ; then
1741 dnl find the exact Tix source dir. We do it this way, cause there
1742 dnl might be multiple version of Tix, and we want the most recent one.
1743 for i in `ls -dr $tixpath/tix* 2>/dev/null ` ; do
1744 if test -f $i/generic/tix.h ; then
1745 ac_cv_c_tixh=`(cd $i/generic; pwd)`
1751 dnl see if one is installed
1752 if test x"${ac_cv_c_tixh}" = x ; then
1754 dnl Get the path to the compiler
1756 dnl Get the path to the compiler. We do it this way instead of using
1757 dnl AC_CHECK_HEADER, cause this doesn't depend in having X configured.
1758 ccpath=`which ${CC} | sed -e 's:/bin/.*::'`/include
1759 if test -f $ccpath/tix.h; then
1760 ac_cv_c_tixh=installed
1763 AC_MSG_RESULT(${ac_cv_c_tixh})
1766 if test x"${ac_cv_c_tixh}" = x ; then
1767 AC_MSG_ERROR([Can't find any Tix headers])
1769 if test x"${ac_cv_c_tixh}" != x ; then
1771 AC_MSG_RESULT(${ac_cv_c_tixh})
1772 if test x"${ac_cv_c_tixh}" != x"installed" ; then
1773 TIXHDIR="-I${ac_cv_c_tixh}"
1781 dnl Ok, lets find the tix library
1782 dnl First, look for one uninstalled.
1783 dnl the alternative search directory is invoked by --with-tixlib
1784 AC_DEFUN(CYG_AC_PATH_TIXLIB, [
1785 dirlist=".. ../../ ../../../ ../../../../ ../../../../../ ../../../../../../ ../../../../../../.. ../../../../../../../.. ../../../../../../../../.. ../../../../../../../../../.."
1786 if test x"${no_tcl}" = x; then
1787 dnl we reset no_tix incase something fails here
1790 [ --with-tixlib directory where the tix library is],
1791 with_tixlib=${withval})
1792 AC_MSG_CHECKING([for Tix library])
1793 AC_CACHE_VAL(ac_cv_c_tixlib,[
1794 dnl First check to see if --with-tixlib was specified.
1795 if test x"${with_tixlib}" != x ; then
1796 if test -f "${with_tixlib}/libtix${TCL_SHARED_LIB_SUFFIX}" ; then
1797 ac_cv_c_tixlib=`(cd ${with_tixlib}; pwd)`/libtix${TCL_SHARED_LIB_SUFFIX}
1799 if test -f "${with_tixlib}/libtix${TCL_UNSHARED_LIB_SUFFIX}"; then
1800 ac_cv_c_tixlib=`(cd ${with_tixlib}; pwd)`/libtix${TCL_UNSHARED_LIB_SUFFIX}
1805 dnl then check for a Tix library. Since these are uninstalled,
1806 if test x"${ac_cv_c_tixlib}" = x ; then
1807 dnl find the top level Tix build directory
1808 for i in ${dirlist}; do
1809 if test -n "`ls -dr $i/tix* 2>/dev/null`" ; then
1810 tixpath="$i/tix/unix/tk${TK_VERSION}"
1814 if test x"${tixpath}" != x; then
1815 tixversion=`grep "^TIX_VERSION" ${tixpath}/Makefile | sed -e 's:TIX_VERSION = ::'`
1816 if test -f "${tixpath}/libtix${tixversion}.${TCL_VERSION}${TCL_SHLIB_SUFFIX}" ; then
1817 ac_cv_c_tixlib=`(cd $tixpath; pwd)`/libtix${tixversion}.${TCL_VERSION}${TCL_SHLIB_SUFFIX}
1819 if test -f "${tixpath}/libtix${tixversion}.${TCL_VERSION}.a" ; then
1820 ac_cv_c_tixlib=`(cd ${tixpath}; pwd)`/libtix${tixversion}.${TCL_VERSION}.a
1826 dnl see if one is conveniently installed with the compiler
1827 if test x"${ac_cv_c_tixlib}" = x ; then
1828 dnl Get the path to the compiler
1829 ccpath=`which ${CC} | sed -e 's:/bin/.*::'`/lib
1831 for i in `ls -dr $ccpath/libtix[0-9]* 2>/dev/null ` ; do
1833 if test -f $i ; then
1840 if test x"${ac_cv_c_tixlib}" = x ; then
1841 TK_BUILD_LIB_SPEC=""
1842 AC_MSG_WARN(Can't find Tix library)
1845 libname=`echo "${ac_cv_c_tixlib}" | sed -e 's:.*tk[0-9\.]*/lib::' -e 's:.*lib/lib::' -e 's:\.a::'`
1847 if test x"${ccpath}" != x ; then
1848 TIX_BUILD_LIB_SPEC="-l${libname}"
1850 libpath=`echo "${ac_cv_c_tixlib}" | sed -e 's:libtix.*::'`
1851 TIX_BUILD_LIB_SPEC="-L${libpath} -l${libname}"
1853 AC_MSG_RESULT(${ac_cv_c_tixlib})
1860 AC_SUBST(TIX_VERSION)
1861 AC_SUBST(TIX_BUILD_LIB_SPEC)
1864 dnl ====================================================================
1865 dnl Ok, lets find the libgui source trees so we can use the headers
1866 dnl the alternative search directory is involked by --with-libguiinclude
1867 AC_DEFUN(CYG_AC_PATH_LIBGUI, [
1869 CYG_AC_PATH_LIBGUILIB
1871 AC_DEFUN(CYG_AC_PATH_LIBGUIH, [
1872 dirlist=".. ../../ ../../../ ../../../../ ../../../../../ ../../../../../../ ../../../../../../.. ../../../../../../../.. ../../../../../../../../.. ../../../../../../../../../..../../../../../../../../../../.."
1874 AC_MSG_CHECKING(for Libgui headers in the source tree)
1875 AC_ARG_WITH(libguiinclude, [ --with-libguiinclude directory where libgui headers are], with_libguiinclude=${withval})
1876 AC_CACHE_VAL(ac_cv_c_libguih,[
1877 dnl first check to see if --with-libguiinclude was specified
1878 if test x"${with_libguiinclude}" != x ; then
1879 if test -f ${with_libguiinclude}/guitcl.h ; then
1880 ac_cv_c_libguih=`(cd ${with_libguiinclude}; pwd)`
1881 elif test -f ${with_libguiinclude}/src/guitcl.h ; then
1882 ac_cv_c_libguih=`(cd ${with_libguiinclude}/src; pwd)`
1884 AC_MSG_ERROR([${with_libguiinclude} directory doesn't contain headers])
1888 dnl next check if it came with Libgui configuration file
1889 if test x"${ac_cv_c_libguiconfig}" != x ; then
1890 for i in $dirlist; do
1891 if test -f $ac_cv_c_libguiconfig/$i/src/guitcl.h ; then
1892 ac_cv_c_libguih=`(cd $ac_cv_c_libguiconfig/$i/src; pwd)`
1898 dnl next check in private source directory
1899 dnl since ls returns lowest version numbers first, reverse its output
1900 if test x"${ac_cv_c_libguih}" = x ; then
1901 dnl find the top level Libgui source directory
1902 for i in $dirlist; do
1903 if test -n "`ls -dr $srcdir/$i/libgui* 2>/dev/null`" ; then
1904 libguipath=$srcdir/$i
1909 dnl find the exact Libgui source dir. We do it this way, cause there
1910 dnl might be multiple version of Libgui, and we want the most recent one.
1911 for i in `ls -dr $libguipath/libgui* 2>/dev/null ` ; do
1912 if test -f $i/src/guitcl.h ; then
1913 ac_cv_c_libguih=`(cd $i/src; pwd)`
1919 dnl see if one is installed
1920 if test x"${ac_cv_c_libguih}" = x ; then
1922 AC_CHECK_HEADER(guitcl.h, ac_cv_c_libguih=installed, ac_cv_c_libguih="")
1926 if test x"${ac_cv_c_libguih}" = x ; then
1927 AC_MSG_WARN([Can't find any Libgui headers])
1929 if test x"${ac_cv_c_libguih}" != x ; then
1931 if test x"${ac_cv_c_libguih}" != x"installed" ; then
1932 LIBGUIHDIR="-I${ac_cv_c_libguih}"
1935 AC_MSG_RESULT(${ac_cv_c_libguih})
1936 AC_SUBST(LIBGUIHDIR)
1939 dnl ====================================================================
1940 dnl find the GUI library
1941 AC_DEFUN(CYG_AC_PATH_LIBGUILIB, [
1942 AC_MSG_CHECKING(for GUI library in the build tree)
1943 dirlist=".. ../../ ../../../ ../../../../ ../../../../../ ../../../../../../ ../../../../../../.. ../../../../../../../.. ../../../../../../../../.. ../../../../../../../../../.."
1944 dnl look for the library
1945 AC_MSG_CHECKING(for GUI library)
1946 AC_CACHE_VAL(ac_cv_c_libguilib,[
1947 if test x"${ac_cv_c_libguilib}" = x ; then
1948 for i in $dirlist; do
1949 if test -f "$i/libgui/src/Makefile" ; then
1950 ac_cv_c_libguilib=`(cd $i/libgui/src; pwd)`
1956 if test x"${ac_cv_c_libguilib}" != x ; then
1957 GUILIB="${GUILIB} -L${ac_cv_c_libguilib}"
1959 AC_MSG_RESULT(${ac_cv_c_libguilib})