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 BFD library in the build tree. This is used to access and
201 dnl manipulate object or executable files.
202 AC_DEFUN(CYG_AC_PATH_BFD, [
203 AC_MSG_CHECKING(for the bfd header in the build tree)
204 dirlist=".. ../../ ../../../ ../../../../ ../../../../../ ../../../../../../ ../../../../../../.. ../../../../../../../.. ../../../../../../../../.. ../../../../../../../../../.."
205 dnl Look for the header file
206 AC_CACHE_VAL(ac_cv_c_bfdh,[
207 for i in $dirlist; do
208 if test -f "$i/bfd/bfd.h" ; then
209 ac_cv_c_bfdh=`(cd $i/bfd; pwd)`
214 if test x"${ac_cv_c_bfdh}" != x; then
215 BFDHDIR="-I${ac_cv_c_bfdh}"
216 AC_MSG_RESULT(${ac_cv_c_bfdh})
222 dnl Look for the library
223 AC_MSG_CHECKING(for the bfd library in the build tree)
224 AC_CACHE_VAL(ac_cv_c_bfdlib,[
225 for i in $dirlist; do
226 if test -f "$i/bfd/Makefile" ; then
227 ac_cv_c_bfdlib=`(cd $i/bfd; pwd)`
231 dnl We list two directories cause bfd now uses libtool
232 if test x"${ac_cv_c_bfdlib}" != x; then
233 BFDLIB="-L${ac_cv_c_bfdlib} -L${ac_cv_c_bfdlib}/.libs"
234 AC_MSG_RESULT(${ac_cv_c_bfdlib})
241 dnl ====================================================================
242 dnl Find the libiberty library. This defines many commonly used C
243 dnl functions that exists in various states based on the underlying OS.
244 AC_DEFUN(CYG_AC_PATH_LIBERTY, [
245 AC_MSG_CHECKING(for the liberty library in the build tree)
246 dirlist=".. ../../ ../../../ ../../../../ ../../../../../ ../../../../../../ ../../../../../../.. ../../../../../../../.. ../../../../../../../../.. ../../../../../../../../../.."
247 AC_CACHE_VAL(ac_cv_c_liberty,[
248 for i in $dirlist; do
249 if test -f "$i/libiberty/Makefile" ; then
250 ac_cv_c_liberty=`(cd $i/libiberty; pwd)`
254 if test x"${ac_cv_c_liberty}" != x; then
255 LIBERTY="-L${ac_cv_c_liberty}"
256 AC_MSG_RESULT(${ac_cv_c_liberty})
263 dnl ====================================================================
264 dnl Find the opcodes library. This is used to do dissasemblies.
265 AC_DEFUN(CYG_AC_PATH_OPCODES, [
266 AC_MSG_CHECKING(for the opcodes library in the build tree)
267 dirlist=".. ../../ ../../../ ../../../../ ../../../../../ ../../../../../../ ../../../../../../.. ../../../../../../../.. ../../../../../../../../.. ../../../../../../../../../.."
268 AC_CACHE_VAL(ac_cv_c_opc,[
269 for i in $dirlist; do
270 if test -f "$i/opcodes/Makefile" ; then
271 ac_cv_c_opc=`(cd $i/opcodes; pwd)`
275 if test x"${ac_cv_c_opc}" != x; then
276 OPCODESLIB="-L${ac_cv_c_opc}"
277 AC_MSG_RESULT(${ac_cv_c_opc})
284 dnl ====================================================================
285 dnl Look for the DejaGnu header file in the source tree. This file
286 dnl defines the functions used to testing support.
287 AC_DEFUN(CYG_AC_PATH_DEJAGNU, [
288 AC_MSG_CHECKING(for the testing support files in the source tree)
289 dirlist=".. ../../ ../../../ ../../../../ ../../../../../ ../../../../../../ ../../../../../../.. ../../../../../../../.. ../../../../../../../../.. ../../../../../../../../../.."
290 AC_CACHE_VAL(ac_cv_c_dejagnu,[
291 for i in $dirlist; do
292 if test -f "$srcdir/$i/ecc/ecc/infra/testlib/current/include/dejagnu.h" ; then
293 ac_cv_c_dejagnu=`(cd $srcdir/$i/ecc/ecc/infra/testlib/current/include; pwd)`
297 if test x"${ac_cv_c_dejagnu}" != x; then
298 DEJAGNUHDIR="-I${ac_cv_c_dejagnu}"
299 AC_MSG_RESULT(${ac_cv_c_dejagnu})
303 AC_CACHE_VAL(ac_cv_c_dejagnulib,[
304 for i in $dirlist; do
305 if test -f "$srcdir/$i/infra/testlib/current/lib/hostutil.exp" ; then
306 ac_cv_c_dejagnulib=`(cd $srcdir/$i/infra/testlib/current/lib; pwd)`
310 if test x"${ac_cv_c_dejagnulib}" != x; then
311 DEJAGNULIB="${ac_cv_c_dejagnulib}"
315 AC_MSG_CHECKING(for runtest in the source tree)
316 AC_CACHE_VAL(ac_cv_c_runtest,[
317 for i in $dirlist; do
318 if test -f "$srcdir/$i/dejagnu/runtest" ; then
319 ac_cv_c_runtest=`(cd $srcdir/$i/dejagnu; pwd)`
323 if test x"${ac_cv_c_runtest}" != x; then
324 RUNTESTDIR="${ac_cv_c_runtest}"
325 AC_MSG_RESULT(${ac_cv_c_runtest})
332 AC_SUBST(DEJAGNUHDIR)
335 dnl ====================================================================
336 dnl Find the libintl library in the build tree. This is for
337 dnl internationalization support.
338 AC_DEFUN(CYG_AC_PATH_INTL, [
339 AC_MSG_CHECKING(for the intl header in the build tree)
340 dirlist=".. ../../ ../../../ ../../../../ ../../../../../ ../../../../../../ ../../../../../../.. ../../../../../../../.. ../../../../../../../../.. ../../../../../../../../../.."
341 dnl Look for the header file
342 AC_CACHE_VAL(ac_cv_c_intlh,[
343 for i in $dirlist; do
344 if test -f "$i/intl/libintl.h" ; then
345 ac_cv_c_intlh=`(cd $i/intl; pwd)`
350 if test x"${ac_cv_c_intlh}" != x; then
351 INTLHDIR="-I${ac_cv_c_intlh}"
352 AC_MSG_RESULT(${ac_cv_c_intlh})
358 dnl Look for the library
359 AC_MSG_CHECKING(for the libintl library in the build tree)
360 AC_CACHE_VAL(ac_cv_c_intllib,[
361 for i in $dirlist; do
362 if test -f "$i/intl/Makefile" ; then
363 ac_cv_c_intllib=`(cd $i/intl; pwd)`
367 if test x"${ac_cv_c_intllib}" != x; then
368 INTLLIB="-L${ac_cv_c_intllib} -lintl"
369 AC_MSG_RESULT(${ac_cv_c_intllib})
376 dnl ====================================================================
377 dnl Find the simulator library.
378 AC_DEFUN(CYG_AC_PATH_SIM, [
379 dirlist=".. ../../ ../../../ ../../../../ ../../../../../ ../../../../../../ ../../../../../../.. ../../../../../../../.. ../../../../../../../../.. ../../../../../../../../../.. ../../../../../../../../../.."
380 case "$target_cpu" in
381 powerpc) target_dir=ppc ;;
382 sparc*) target_dir=erc32 ;;
383 mips*) target_dir=mips ;;
384 *) target_dir=$target_cpu ;;
386 dnl First look for the header file
387 AC_MSG_CHECKING(for the simulator header file)
388 AC_CACHE_VAL(ac_cv_c_simh,[
389 for i in $dirlist; do
390 if test -f "${srcdir}/$i/include/remote-sim.h" ; then
391 ac_cv_c_simh=`(cd ${srcdir}/$i/include; pwd)`
396 if test x"${ac_cv_c_simh}" != x; then
397 SIMHDIR="-I${ac_cv_c_simh}"
398 AC_MSG_RESULT(${ac_cv_c_simh})
404 dnl See whether it's a devo or Foundry branch simulator
405 AC_MSG_CHECKING(Whether this is a devo simulator )
406 AC_CACHE_VAL(ac_cv_c_simdevo,[
407 CPPFLAGS="$CPPFLAGS $SIMHDIR"
408 AC_EGREP_HEADER([SIM_DESC sim_open.*struct _bfd], remote-sim.h,
412 if test x"$ac_cv_c_simdevo" = x"yes" ; then
413 AC_DEFINE(HAVE_DEVO_SIM)
415 AC_MSG_RESULT(${ac_cv_c_simdevo})
416 AC_SUBST(HAVE_DEVO_SIM)
418 dnl Next look for the library
419 AC_MSG_CHECKING(for the simulator library)
420 AC_CACHE_VAL(ac_cv_c_simlib,[
421 for i in $dirlist; do
422 if test -f "$i/sim/$target_dir/Makefile" ; then
423 ac_cv_c_simlib=`(cd $i/sim/$target_dir; pwd)`
427 if test x"${ac_cv_c_simlib}" != x; then
428 SIMLIB="-L${ac_cv_c_simlib}"
431 dnl FIXME: this is kinda bogus, cause umtimately the TM will build
432 dnl all the libraries for several architectures. But for now, this
433 dnl will work till then.
434 dnl AC_MSG_CHECKING(for the simulator installed with the compiler libraries)
435 dnl Transform the name of the compiler to it's cross variant, unless
436 dnl CXX is set. This is also what CXX gets set to in the generated
438 CROSS_GCC=`echo gcc | sed -e "s/^/$target/"`
440 dnl Get G++'s full path to libgcc.a
442 gccpath=`${CROSS_GCC} --print-libgcc | sed -e 's:[a-z0-9A-Z\.\-]*/libgcc.a::' -e 's:lib/gcc-lib/::'`lib
444 if test -f $gccpath/libsim.a -o -f $gccpath/libsim.so ; then
445 ac_cv_c_simlib="$gccpath/"
446 SIMLIB="-L${ac_cv_c_simlib}"
447 AC_MSG_RESULT(${ac_cv_c_simlib})
449 AM_CONDITIONAL(PSIM, test x$psim = xno)
452 dnl ac_cv_c_simlib=none
458 dnl ====================================================================
459 dnl Find the libiberty library.
460 AC_DEFUN(CYG_AC_PATH_LIBIBERTY, [
461 AC_MSG_CHECKING(for the libiberty library in the build tree)
462 dirlist=".. ../../ ../../../ ../../../../ ../../../../../ ../../../../../../ ../../../../../../.. ../../../../../../../.. ../../../../../../../../.. ../../../../../../../../../.."
463 AC_CACHE_VAL(ac_cv_c_libib,[
464 for i in $dirlist; do
465 if test -f "$i/libiberty/Makefile" ; then
466 ac_cv_c_libib=`(cd $i/libiberty/; pwd)`
470 if test x"${ac_cv_c_libib}" != x; then
471 LIBIBERTY="-L${ac_cv_c_libib}"
472 AC_MSG_RESULT(${ac_cv_c_libib})
479 dnl ====================================================================
480 AC_DEFUN(CYG_AC_PATH_DEVO, [
481 AC_MSG_CHECKING(for devo headers in the source tree)
482 dirlist=".. ../../ ../../../ ../../../../ ../../../../../ ../../../../../../ ../../../../../../.. ../../../../../../../.. ../../../../../../../../.. ../../../../../../../../../.."
483 AC_CACHE_VAL(ac_cv_c_devoh,[
484 for i in $dirlist; do
485 if test -f "${srcdir}/$i/include/remote-sim.h" ; then
486 ac_cv_c_devoh=`(cd ${srcdir}/$i/include; pwd)`
490 if test x"${ac_cv_c_devoh}" != x; then
491 DEVOHDIR="-I${ac_cv_c_devoh}"
492 AC_MSG_RESULT(${ac_cv_c_devoh})
499 dnl ====================================================================
500 dnl find the IDE library and headers.
501 AC_DEFUN(CYG_AC_PATH_IDE, [
502 AC_MSG_CHECKING(for IDE headers in the source tree)
503 dirlist=".. ../../ ../../../ ../../../../ ../../../../../ ../../../../../../ ../../../../../../.. ../../../../../../../.. ../../../../../../../../.. ../../../../../../../../../.."
506 AC_CACHE_VAL(ac_cv_c_ideh,[
507 for i in $dirlist; do
508 if test -f "${srcdir}/$i/libide/src/event.h" ; then
509 ac_cv_c_ideh=`(cd ${srcdir}/$i/libide/src; pwd)`;
513 if test x"${ac_cv_c_ideh}" != x; then
514 IDEHDIR="-I${ac_cv_c_ideh}"
515 AC_MSG_RESULT(${ac_cv_c_ideh})
520 AC_MSG_CHECKING(for LIBIDE TCL headers in the source tree)
521 AC_CACHE_VAL(ac_cv_c_idetclh,[
522 for i in $dirlist; do
523 if test -f "${srcdir}/$i/libidetcl/src/idetcl.h" ; then
524 ac_cv_c_idetclh=`(cd ${srcdir}/$i/libidetcl/src; pwd)`;
528 if test x"${ac_cv_c_idetclh}" != x; then
529 IDEHDIR="${IDEHDIR} -I${ac_cv_c_idetclh}"
530 AC_MSG_RESULT(${ac_cv_c_idetclh})
535 AC_MSG_CHECKING(for IDE headers in the build tree)
536 AC_CACHE_VAL(ac_cv_c_ideh2,[
537 for i in $dirlist; do
538 if test -f "$i/libide/src/Makefile" ; then
539 ac_cv_c_ideh2=`(cd $i/libide/src; pwd)`;
543 if test x"${ac_cv_c_ideh2}" != x; then
544 IDEHDIR="${IDEHDIR} -I${ac_cv_c_ideh2}"
545 AC_MSG_RESULT(${ac_cv_c_ideh2})
550 dnl look for the library
551 AC_MSG_CHECKING(for IDE library)
552 AC_CACHE_VAL(ac_cv_c_idelib,[
553 if test x"${ac_cv_c_idelib}" = x ; then
554 for i in $dirlist; do
555 if test -f "$i/libide/src/Makefile" ; then
556 ac_cv_c_idelib=`(cd $i/libide/src; pwd)`
561 if test x"${ac_cv_c_idelib}" != x ; then
562 IDELIB="-L${ac_cv_c_idelib}"
563 AC_MSG_RESULT(${ac_cv_c_idelib})
568 dnl find libiddetcl.a if it exists
569 AC_MSG_CHECKING(for IDE TCL library)
570 AC_CACHE_VAL(ac_cv_c_idetcllib,[
571 if test x"${ac_cv_c_idetcllib}" = x ; then
572 for i in $dirlist; do
573 if test -f "$i/libidetcl/src/Makefile" ; then
574 ac_cv_c_idetcllib=`(cd $i/libidetcl/src; pwd)`
580 if test x"${ac_cv_c_idetcllib}" != x ; then
581 IDELIB="${IDELIB} -L${ac_cv_c_idetcllib}"
583 AC_MSG_RESULT(${ac_cv_c_idetcllib})
592 dnl ====================================================================
593 dnl Find all the ILU headers and libraries
594 AC_DEFUN(CYG_AC_PATH_ILU, [
595 AC_MSG_CHECKING(for ILU kernel headers in the source tree)
596 dirlist=".. ../../ ../../../ ../../../../ ../../../../../ ../../../../../../ ../../../../../../.. ../../../../../../../.. ../../../../../../../../.. ../../../../../../../../../.."
597 AC_CACHE_VAL(ac_cv_c_iluh,[
598 for i in $dirlist; do
599 if test -f "${srcdir}/$i/ilu/runtime/kernel/method.h" ; then
600 ac_cv_c_iluh=`(cd ${srcdir}/$i/ilu/runtime/kernel; pwd)`
604 if test x"${ac_cv_c_iluh}" != x; then
605 ILUHDIR="-I${ac_cv_c_iluh}"
606 AC_MSG_RESULT(${ac_cv_c_iluh})
611 AC_MSG_CHECKING(for ILU kernel headers in the build tree)
612 dirlist=".. ../../ ../../../ ../../../../ ../../../../../ ../../../../../../ ../../../../../../.. ../../../../../../../.. ../../../../../../../../.. ../../../../../../../../../.."
613 AC_CACHE_VAL(ac_cv_c_iluh5,[
614 for i in $dirlist; do
615 if test -f "$i/ilu/runtime/kernel/iluconf.h" ; then
616 ac_cv_c_iluh5=`(cd $i/ilu/runtime/kernel; pwd)`
620 if test x"${ac_cv_c_iluh5}" != x; then
621 ILUHDIR="${ILUHDIR} -I${ac_cv_c_iluh5}"
622 AC_MSG_RESULT(${ac_cv_c_iluh5})
627 AC_MSG_CHECKING(for ILU C++ headers in the source tree)
628 AC_CACHE_VAL(ac_cv_c_iluh2,[
629 for i in $dirlist; do
630 if test -f "${srcdir}/$i/ilu/stubbers/cpp/resource.h" ; then
631 ac_cv_c_iluh2=`(cd ${srcdir}/$i/ilu/stubbers/cpp; pwd)`
635 if test x"${ac_cv_c_iluh2}" != x; then
636 ILUHDIR="${ILUHDIR} -I${ac_cv_c_iluh2}"
637 AC_MSG_RESULT(${ac_cv_c_iluh2})
642 AC_MSG_CHECKING(for ILU C headers)
643 AC_CACHE_VAL(ac_cv_c_iluh3,[
644 for i in $dirlist; do
645 if test -f "${srcdir}/$i/ilu/stubbers/c/resource.h" ; then
646 ac_cv_c_iluh3=`(cd ${srcdir}/$i/ilu/stubbers/c ; pwd)`
650 if test x"${ac_cv_c_iluh3}" != x; then
651 ILUHDIR="${ILUHDIR} -I${ac_cv_c_iluh3}"
652 AC_MSG_RESULT(${ac_cv_c_iluh3})
657 AC_MSG_CHECKING(for ILU C runtime headers)
658 AC_CACHE_VAL(ac_cv_c_iluh4,[
659 for i in $dirlist; do
660 if test -f "${srcdir}/$i/ilu/runtime/c/ilucstub.h" ; then
661 ac_cv_c_iluh4=`(cd ${srcdir}/$i/ilu/runtime/c ; pwd)`
665 if test x"${ac_cv_c_iluh4}" != x; then
666 ILUHDIR="${ILUHDIR} -I${ac_cv_c_iluh4}"
667 AC_MSG_RESULT(${ac_cv_c_iluh4})
672 AC_CACHE_VAL(ac_cv_c_ilupath,[
673 for i in $dirlist; do
674 if test -f "$i/ilu/Makefile" ; then
675 ac_cv_c_ilupath=`(cd $i/ilu; pwd)`
680 ILUTOP=${ac_cv_c_ilupath}
682 AC_MSG_CHECKING(for the ILU library in the build tree)
683 AC_CACHE_VAL(ac_cv_c_ilulib,[
684 if test -f "$ac_cv_c_ilupath/runtime/kernel/Makefile" ; then
685 ac_cv_c_ilulib=`(cd $ac_cv_c_ilupath/runtime/kernel; pwd)`
686 AC_MSG_RESULT(found ${ac_cv_c_ilulib}/libilu.a)
691 AC_MSG_CHECKING(for the ILU C++ bindings library in the build tree)
692 AC_CACHE_VAL(ac_cv_c_ilulib2,[
693 if test -f "$ac_cv_c_ilupath/runtime/cpp/Makefile" ; then
694 ac_cv_c_ilulib2=`(cd $ac_cv_c_ilupath/runtime/cpp; pwd)`
695 AC_MSG_RESULT(found ${ac_cv_c_ilulib2}/libilu-c++.a)
700 AC_MSG_CHECKING(for the ILU C bindings library in the build tree)
701 AC_CACHE_VAL(ac_cv_c_ilulib3,[
702 if test -f "$ac_cv_c_ilupath/runtime/c/Makefile" ; then
703 ac_cv_c_ilulib3=`(cd $ac_cv_c_ilupath/runtime/c; pwd)`
704 AC_MSG_RESULT(found ${ac_cv_c_ilulib3}/libilu-c.a)
709 AC_MSG_CHECKING(for the ILU Tk bindings library in the build tree)
710 AC_CACHE_VAL(ac_cv_c_ilulib4,[
711 if test -f "$ac_cv_c_ilupath/runtime/mainloop/Makefile" ; then
712 ac_cv_c_ilulib4=`(cd $ac_cv_c_ilupath/runtime/mainloop; pwd)`
713 AC_MSG_RESULT(found ${ac_cv_c_ilulib4}/libilu-tk.a)
718 if test x"${ac_cv_c_ilulib}" = x -a x"${ac_cv_c_ilulib2}" = x; then
722 if test x"${ac_cv_c_ilulib}" != x -a x"${ac_cv_c_ilulib2}" != x; then
723 ILULIB="-L${ac_cv_c_ilulib} -L${ac_cv_c_ilulib2} -L${ac_cv_c_ilulib3} -L${ac_cv_c_ilulib4}"
728 if test x"${ILULIB}" = x; then
729 AC_MSG_CHECKING(for ILU libraries installed with the compiler)
730 AC_CACHE_VAL(ac_cv_c_ilulib5,[
731 NATIVE_GCC=`echo gcc | sed -e "${program_transform_name}"`
733 dnl Get G++'s full path to it's libraries
734 ac_cv_c_ilulib5=`${NATIVE_GCC} --print-libgcc | sed -e 's:lib/gcc-lib/.*::'`lib
735 if test -f $ac_cv_c_ilulib5/libilu-c.a -o -f $ac_cv_c_ilulib5/libilu-c.so ; then
736 if test x"${ILUHDIR}" = x; then
737 ILUHDIR="-I${ac_cv_c_ilulib5}/../include"
739 ILULIB="-L${ac_cv_c_ilulib5}"
740 AC_MSG_RESULT(${ac_cv_c_ilulib5})
751 dnl ====================================================================
752 dnl This defines the byte order for the host. We can't use
753 dnl AC_C_BIGENDIAN, cause we want to create a config file and
754 dnl substitue the real value, so the header files work right
755 AC_DEFUN(CYG_AC_C_ENDIAN, [
756 AC_MSG_CHECKING(to see if this is a little endian host)
757 AC_CACHE_VAL(ac_cv_c_little_endian, [
758 ac_cv_c_little_endian=unknown
759 # See if sys/param.h defines the BYTE_ORDER macro.
760 AC_TRY_COMPILE([#include <sys/types.h>
761 #include <sys/param.h>], [
762 #if !BYTE_ORDER || !_BIG_ENDIAN || !_LITTLE_ENDIAN
764 #endif], [# It does; now see whether it defined to _LITTLE_ENDIAN or not.
765 AC_TRY_COMPILE([#include <sys/types.h>
766 #include <sys/param.h>], [
767 #if BYTE_ORDER != _LITTLE_ENDIAN
769 #endif], ac_cv_c_little_endian=yes, ac_cv_c_little_endian=no)
771 if test ${ac_cv_c_little_endian} = unknown; then
776 /* Are we little or big endian? From Harbison&Steele. */
780 char c[sizeof (long)];
785 ac_cv_c_little_endian=no,
786 ac_cv_c_little_endian=yes,[
787 dnl Yes, this is ugly, and only used for a canadian cross anyway. This
788 dnl is just to keep configure from stopping here.
791 i[3456]86-*-*) ac_cv_c_little_endian=yes ;;
792 sparc*-*-*) ac_cv_c_little_endian=no ;;
794 *) AC_MSG_WARN(Can't cross compile this test) ;;
799 if test x"${ac_cv_c_little_endian}" = xyes; then
800 AC_DEFINE(LITTLE_ENDIAN_HOST)
801 ENDIAN="CYG_LSBFIRST";
803 ENDIAN="CYG_MSBFIRST";
805 AC_MSG_RESULT(${ac_cv_c_little_endian})
809 dnl ====================================================================
810 dnl Look for the path to libgcc, so we can use it to directly link
811 dnl in libgcc.a with LD.
812 AC_DEFUN(CYG_AC_PATH_LIBGCC,
813 [AC_MSG_CHECKING([Looking for the path to libgcc.a])
817 dnl Get Gcc's full path to libgcc.a
818 libgccpath=`${CC} --print-libgcc`
820 dnl If we don't have a path with libgcc.a on the end, this isn't G++.
821 if test `echo $libgccpath | sed -e 's:/.*/::'` = libgcc.a ; then
828 if test x"${ac_cv_prog_gcc}" = xyes ; then
829 gccpath=`echo $libgccpath | sed -e 's:/libgcc.a::'`
830 LIBGCC="-L${gccpath}"
831 AC_MSG_RESULT(${gccpath})
834 AC_MSG_ERROR(Not using gcc)
841 dnl ====================================================================
842 dnl Ok, lets find the tcl source trees so we can use the headers
843 dnl Warning: transition of version 9 to 10 will break this algorithm
844 dnl because 10 sorts before 9. We also look for just tcl. We have to
845 dnl be careful that we don't match stuff like tclX by accident.
846 dnl the alternative search directory is involked by --with-tclinclude
847 AC_DEFUN(CYG_AC_PATH_TCL, [
849 CYG_AC_PATH_TCLCONFIG
850 CYG_AC_LOAD_TCLCONFIG
852 AC_DEFUN(CYG_AC_PATH_TCLH, [
853 dirlist=".. ../../ ../../../ ../../../../ ../../../../../ ../../../../../../ ../../../../../../.. ../../../../../../../.. ../../../../../../../../.. ../../../../../../../../../.."
855 AC_MSG_CHECKING(for Tcl headers in the source tree)
856 AC_ARG_WITH(tclinclude, [ --with-tclinclude directory where tcl headers are], with_tclinclude=${withval})
857 AC_CACHE_VAL(ac_cv_c_tclh,[
858 dnl first check to see if --with-tclinclude was specified
859 if test x"${with_tclinclude}" != x ; then
860 if test -f ${with_tclinclude}/tcl.h ; then
861 ac_cv_c_tclh=`(cd ${with_tclinclude}; pwd)`
862 elif test -f ${with_tclinclude}/generic/tcl.h ; then
863 ac_cv_c_tclh=`(cd ${with_tclinclude}/generic; pwd)`
865 AC_MSG_ERROR([${with_tclinclude} directory doesn't contain headers])
869 dnl next check if it came with Tcl configuration file
870 if test x"${ac_cv_c_tclconfig}" != x ; then
871 for i in $dirlist; do
872 if test -f $ac_cv_c_tclconfig/$i/generic/tcl.h ; then
873 ac_cv_c_tclh=`(cd $ac_cv_c_tclconfig/$i/generic; pwd)`
879 dnl next check in private source directory
880 dnl since ls returns lowest version numbers first, reverse its output
881 if test x"${ac_cv_c_tclh}" = x ; then
882 dnl find the top level Tcl source directory
883 for i in $dirlist; do
884 if test -n "`ls -dr $srcdir/$i/tcl* 2>/dev/null`" ; then
890 dnl find the exact Tcl source dir. We do it this way, cause there
891 dnl might be multiple version of Tcl, and we want the most recent one.
892 for i in `ls -dr $tclpath/tcl* 2>/dev/null ` ; do
893 if test -f $i/generic/tcl.h ; then
894 ac_cv_c_tclh=`(cd $i/generic; pwd)`
900 dnl check if its installed with the compiler
901 if test x"${ac_cv_c_tclh}" = x ; then
902 dnl Get the path to the compiler
903 ccpath=`which ${CC} | sed -e 's:/bin/.*::'`/include
904 if test -f $ccpath/tcl.h; then
909 dnl see if one is installed
910 if test x"${ac_cv_c_tclh}" = x ; then
912 AC_CHECK_HEADER(tcl.h, ac_cv_c_tclh=installed, ac_cv_c_tclh="")
914 AC_MSG_RESULT(${ac_cv_c_tclh})
918 if test x"${ac_cv_c_tclh}" = x ; then
919 AC_MSG_ERROR([Can't find any Tcl headers])
921 if test x"${ac_cv_c_tclh}" != x ; then
923 if test x"${ac_cv_c_tclh}" != x"installed" ; then
924 if test x"${CC}" = xcl ; then
925 tmp="`cygpath --windows ${ac_cv_c_tclh}`"
926 ac_cv_c_tclh="`echo $tmp | sed -e s#\\\\\\\\#/#g`"
928 AC_MSG_RESULT(${ac_cv_c_tclh})
929 TCLHDIR="-I${ac_cv_c_tclh}"
936 dnl ====================================================================
937 dnl Ok, lets find the tcl configuration
938 AC_DEFUN(CYG_AC_PATH_TCLCONFIG, [
939 dirlist=".. ../../ ../../../ ../../../../ ../../../../../ ../../../../../../ ../../../../../../.. ../../../../../../../.. ../../../../../../../../.. ../../../../../../../../../.."
940 dnl First, look for one uninstalled.
941 dnl the alternative search directory is invoked by --with-tclconfig
942 if test x"${no_tcl}" = x ; then
943 dnl we reset no_tcl in case something fails here
945 AC_ARG_WITH(tclconfig, [ --with-tclconfig directory containing tcl configuration (tclConfig.sh)],
946 with_tclconfig=${withval})
947 AC_MSG_CHECKING([for Tcl configuration script])
948 AC_CACHE_VAL(ac_cv_c_tclconfig,[
950 dnl First check to see if --with-tclconfig was specified.
951 if test x"${with_tclconfig}" != x ; then
952 if test -f "${with_tclconfig}/tclConfig.sh" ; then
953 ac_cv_c_tclconfig=`(cd ${with_tclconfig}; pwd)`
955 AC_MSG_ERROR([${with_tclconfig} directory doesn't contain tclConfig.sh])
959 dnl next check if it came with Tcl configuration file in the source tree
960 if test x"${ac_cv_c_tclconfig}" = x ; then
961 for i in $dirlist; do
962 if test -f $srcdir/$i/unix/tclConfig.sh ; then
963 ac_cv_c_tclconfig=`(cd $srcdir/$i/unix; pwd)`
968 dnl check in a few other locations
969 if test x"${ac_cv_c_tclconfig}" = x ; then
970 dnl find the top level Tcl source directory
971 for i in $dirlist; do
972 if test -n "`ls -dr $i/tcl* 2>/dev/null`" ; then
978 dnl find the exact Tcl dir. We do it this way, cause there
979 dnl might be multiple version of Tcl, and we want the most recent one.
980 for i in `ls -dr $tclconfpath/tcl* 2>/dev/null ` ; do
981 if test -f $i/unix/tclConfig.sh ; then
982 ac_cv_c_tclconfig=`(cd $i/unix; pwd)`
988 dnl Check to see if it's installed. We have to look in the $CC path
989 dnl to find it, cause our $prefix may not match the compilers.
990 if test x"${ac_cv_c_tclconfig}" = x ; then
991 dnl Get the path to the compiler
992 ccpath=`which ${CC} | sed -e 's:/bin/.*::'`/lib
993 if test -f $ccpath/tclConfig.sh; then
994 ac_cv_c_tclconfig=$ccpath
997 ]) dnl end of cache_val
999 if test x"${ac_cv_c_tclconfig}" = x ; then
1001 AC_MSG_WARN(Can't find Tcl configuration definitions)
1004 TCLCONFIG=${ac_cv_c_tclconfig}/tclConfig.sh
1005 AC_MSG_RESULT(${TCLCONFIG})
1011 dnl Defined as a separate macro so we don't have to cache the values
1012 dnl from PATH_TCLCONFIG (because this can also be cached).
1013 AC_DEFUN(CYG_AC_LOAD_TCLCONFIG, [
1016 dnl AC_SUBST(TCL_VERSION)
1017 dnl AC_SUBST(TCL_MAJOR_VERSION)
1018 dnl AC_SUBST(TCL_MINOR_VERSION)
1019 dnl AC_SUBST(TCL_CC)
1022 dnl not used, don't export to save symbols
1023 AC_SUBST(TCL_LIB_FILE)
1024 AC_SUBST(TCL_LIB_FULL_PATH)
1026 dnl not used, don't export to save symbols
1027 dnl AC_SUBST(TCL_PREFIX)
1029 AC_SUBST(TCL_CFLAGS)
1031 dnl not used, don't export to save symbols
1032 dnl AC_SUBST(TCL_EXEC_PREFIX)
1034 AC_SUBST(TCL_SHLIB_CFLAGS)
1035 AC_SUBST(TCL_SHLIB_LD)
1036 dnl don't export, not used outside of configure
1037 dnl AC_SUBST(TCL_SHLIB_LD_LIBS)
1038 dnl AC_SUBST(TCL_SHLIB_SUFFIX)
1039 dnl not used, don't export to save symbols
1040 dnl AC_SUBST(TCL_DL_LIBS)
1041 AC_SUBST(TCL_LD_FLAGS)
1042 AC_SUBST(TCL_LD_SEARCH_FLAGS)
1043 dnl don't export, not used outside of configure
1044 dnl AC_SUBST(TCL_COMPAT_OBJS)
1045 AC_SUBST(TCL_RANLIB)
1046 AC_SUBST(TCL_BUILD_LIB_SPEC)
1047 AC_SUBST(TCL_LIB_SPEC)
1048 dnl AC_SUBST(TCL_LIB_VERSIONS_OK)
1050 dnl not used, don't export to save symbols
1051 dnl AC_SUBST(TCL_SHARED_LIB_SUFFIX)
1053 dnl not used, don't export to save symbols
1054 dnl AC_SUBST(TCL_UNSHARED_LIB_SUFFIX)
1057 dnl ====================================================================
1058 AC_DEFUN(CYG_AC_PATH_TK, [
1060 CYG_AC_PATH_TKCONFIG
1061 CYG_AC_LOAD_TKCONFIG
1063 AC_DEFUN(CYG_AC_PATH_TKH, [
1065 # Ok, lets find the tk source trees so we can use the headers
1066 # If the directory (presumably symlink) named "tk" exists, use that one
1067 # in preference to any others. Same logic is used when choosing library
1068 # and again with Tcl. The search order is the best place to look first, then in
1069 # decreasing significance. The loop breaks if the trigger file is found.
1070 # Note the gross little conversion here of srcdir by cd'ing to the found
1071 # directory. This converts the path from a relative to an absolute, so
1072 # recursive cache variables for the path will work right. We check all
1073 # the possible paths in one loop rather than many seperate loops to speed
1075 # the alternative search directory is involked by --with-tkinclude
1077 dirlist=".. ../../ ../../../ ../../../../ ../../../../../ ../../../../../../ ../../../../../../.. ../../../../../../../.. ../../../../../../../../.. ../../../../../../../../../.."
1079 AC_MSG_CHECKING(for Tk headers in the source tree)
1080 AC_ARG_WITH(tkinclude, [ --with-tkinclude directory where tk headers are], with_tkinclude=${withval})
1081 AC_CACHE_VAL(ac_cv_c_tkh,[
1082 dnl first check to see if --with-tkinclude was specified
1083 if test x"${with_tkinclude}" != x ; then
1084 if test -f ${with_tkinclude}/tk.h ; then
1085 ac_cv_c_tkh=`(cd ${with_tkinclude}; pwd)`
1086 elif test -f ${with_tkinclude}/generic/tk.h ; then
1087 ac_cv_c_tkh=`(cd ${with_tkinclude}/generic; pwd)`
1089 AC_MSG_ERROR([${with_tkinclude} directory doesn't contain headers])
1093 dnl next check if it came with Tk configuration file
1094 if test x"${ac_cv_c_tkconfig}" != x ; then
1095 for i in $dirlist; do
1096 if test -f $ac_cv_c_tkconfig/$i/generic/tk.h ; then
1097 ac_cv_c_tkh=`(cd $ac_cv_c_tkconfig/$i/generic; pwd)`
1103 dnl next check in private source directory
1104 dnl since ls returns lowest version numbers first, reverse its output
1105 if test x"${ac_cv_c_tkh}" = x ; then
1106 dnl find the top level Tk source directory
1107 for i in $dirlist; do
1108 if test -n "`ls -dr $srcdir/$i/tk* 2>/dev/null`" ; then
1114 dnl find the exact Tk source dir. We do it this way, cause there
1115 dnl might be multiple version of Tk, and we want the most recent one.
1116 for i in `ls -dr $tkpath/tk* 2>/dev/null ` ; do
1117 if test -f $i/generic/tk.h ; then
1118 ac_cv_c_tkh=`(cd $i/generic; pwd)`
1124 dnl see if one is installed
1125 if test x"${ac_cv_c_tkh}" = x ; then
1127 dnl Get the path to the compiler. We do it this way instead of using
1128 dnl AC_CHECK_HEADER, cause this doesn't depend in having X configured.
1129 ccpath=`which ${CC} | sed -e 's:/bin/.*::'`/include
1130 if test -f $ccpath/tk.h; then
1134 AC_MSG_RESULT(${ac_cv_c_tkh})
1138 if test x"${ac_cv_c_tkh}" = x ; then
1139 AC_MSG_ERROR([Can't find any Tk headers])
1141 if test x"${ac_cv_c_tkh}" != x ; then
1143 if test x"${ac_cv_c_tkh}" != x"installed" ; then
1144 if test x"${CC}" = xcl ; then
1145 tmp="`cygpath --windows ${ac_cv_c_tkh}`"
1146 ac_cv_c_tkh="`echo $tmp | sed -e s#\\\\\\\\#/#g`"
1148 AC_MSG_RESULT([found in ${ac_cv_c_tkh}])
1149 TKHDIR="-I${ac_cv_c_tkh}"
1156 AC_DEFUN(CYG_AC_PATH_TKCONFIG, [
1157 dirlist=".. ../../ ../../../ ../../../../ ../../../../../ ../../../../../../ ../../../../../../.. ../../../../../../../.. ../../../../../../../../.. ../../../../../../../../../.."
1158 dnl First, look for one uninstalled.
1159 dnl the alternative search directory is invoked by --with-tkconfig
1160 if test x"${no_tk}" = x ; then
1161 dnl we reset no_tk in case something fails here
1163 AC_ARG_WITH(tkconfig, [ --with-tkconfig directory containing tk configuration (tkConfig.sh)],
1164 with_tkconfig=${withval})
1165 AC_MSG_CHECKING([for Tk configuration script])
1166 AC_CACHE_VAL(ac_cv_c_tkconfig,[
1168 dnl First check to see if --with-tkconfig was specified.
1169 if test x"${with_tkconfig}" != x ; then
1170 if test -f "${with_tkconfig}/tkConfig.sh" ; then
1171 ac_cv_c_tkconfig=`(cd ${with_tkconfig}; pwd)`
1173 AC_MSG_ERROR([${with_tkconfig} directory doesn't contain tkConfig.sh])
1177 dnl next check if it came with Tk configuration file in the source tree
1178 if test x"${ac_cv_c_tkconfig}" = x ; then
1179 for i in $dirlist; do
1180 if test -f $srcdir/$i/unix/tkConfig.sh ; then
1181 ac_cv_c_tkconfig=`(cd $srcdir/$i/unix; pwd)`
1186 dnl check in a few other locations
1187 if test x"${ac_cv_c_tkconfig}" = x ; then
1188 dnl find the top level Tk source directory
1189 for i in $dirlist; do
1190 if test -n "`ls -dr $i/tk* 2>/dev/null`" ; then
1196 dnl find the exact Tk dir. We do it this way, cause there
1197 dnl might be multiple version of Tk, and we want the most recent one.
1198 for i in `ls -dr $tkconfpath/tk* 2>/dev/null ` ; do
1199 if test -f $i/unix/tkConfig.sh ; then
1200 ac_cv_c_tkconfig=`(cd $i/unix; pwd)`
1206 dnl Check to see if it's installed. We have to look in the $CC path
1207 dnl to find it, cause our $prefix may not match the compilers.
1208 if test x"${ac_cv_c_tkconfig}" = x ; then
1209 dnl Get the path to the compiler
1210 ccpath=`which ${CC} | sed -e 's:/bin/.*::'`/lib
1211 if test -f $ccpath/tkConfig.sh; then
1212 ac_cv_c_tkconfig=$ccpath
1215 ]) dnl end of cache_val
1217 if test x"${ac_cv_c_tkconfig}" = x ; then
1219 AC_MSG_WARN(Can't find Tk configuration definitions)
1222 TKCONFIG=${ac_cv_c_tkconfig}/tkConfig.sh
1223 AC_MSG_RESULT(${TKCONFIG})
1229 dnl Defined as a separate macro so we don't have to cache the values
1230 dnl from PATH_TKCONFIG (because this can also be cached).
1231 AC_DEFUN(CYG_AC_LOAD_TKCONFIG, [
1232 if test -f "$TKCONFIG" ; then
1236 AC_SUBST(TK_VERSION)
1237 dnl not actually used, don't export to save symbols
1238 dnl AC_SUBST(TK_MAJOR_VERSION)
1239 dnl AC_SUBST(TK_MINOR_VERSION)
1242 dnl not used, don't export to save symbols
1243 AC_SUBST(TK_LIB_FILE)
1244 AC_SUBST(TK_LIB_FULL_PATH)
1246 dnl not used, don't export to save symbols
1247 dnl AC_SUBST(TK_PREFIX)
1249 dnl not used, don't export to save symbols
1250 dnl AC_SUBST(TK_EXEC_PREFIX)
1251 AC_SUBST(TK_BUILD_INCLUDES)
1252 AC_SUBST(TK_XINCLUDES)
1254 AC_SUBST(TK_BUILD_LIB_SPEC)
1255 AC_SUBST(TK_LIB_SPEC)
1258 dnl ====================================================================
1259 dnl Ok, lets find the itcl source trees so we can use the headers
1260 dnl the alternative search directory is involked by --with-itclinclude
1261 AC_DEFUN(CYG_AC_PATH_ITCL, [
1265 CYG_AC_PATH_ITCLMKIDX
1267 AC_DEFUN(CYG_AC_PATH_ITCLH, [
1268 dirlist=".. ../../ ../../../ ../../../../ ../../../../../ ../../../../../../ ../../../../../../.. ../../../../../../../.. ../../../../../../../../.. ../../../../../../../../../.."
1270 AC_MSG_CHECKING(for Itcl headers in the source tree)
1271 AC_ARG_WITH(itclinclude, [ --with-itclinclude directory where itcl headers are], with_itclinclude=${withval})
1272 AC_CACHE_VAL(ac_cv_c_itclh,[
1273 dnl first check to see if --with-itclinclude was specified
1274 if test x"${with_itclinclude}" != x ; then
1275 if test -f ${with_itclinclude}/itcl.h ; then
1276 ac_cv_c_itclh=`(cd ${with_itclinclude}; pwd)`
1277 elif test -f ${with_itclinclude}/src/itcl.h ; then
1278 ac_cv_c_itclh=`(cd ${with_itclinclude}/src; pwd)`
1280 AC_MSG_ERROR([${with_itclinclude} directory doesn't contain headers])
1284 dnl next check if it came with Itcl configuration file
1285 if test x"${ac_cv_c_itclconfig}" != x ; then
1286 for i in $dirlist; do
1287 if test -f $ac_cv_c_itclconfig/$i/src/itcl.h ; then
1288 ac_cv_c_itclh=`(cd $ac_cv_c_itclconfig/$i/src; pwd)`
1294 dnl next check in private source directory
1295 dnl since ls returns lowest version numbers first, reverse its output
1296 if test x"${ac_cv_c_itclh}" = x ; then
1297 dnl find the top level Itcl source directory
1298 for i in $dirlist; do
1299 if test -n "`ls -dr $srcdir/$i/itcl* 2>/dev/null`" ; then
1305 dnl find the exact Itcl source dir. We do it this way, cause there
1306 dnl might be multiple version of Itcl, and we want the most recent one.
1307 for i in `ls -dr $itclpath/itcl* 2>/dev/null ` ; do
1308 if test -f $i/src/itcl.h ; then
1309 ac_cv_c_itclh=`(cd $i/src; pwd)`
1315 dnl see if one is installed
1316 if test x"${ac_cv_c_itclh}" = x ; then
1318 AC_CHECK_HEADER(itcl.h, ac_cv_c_itclh=installed, ac_cv_c_itclh="")
1320 AC_MSG_RESULT(${ac_cv_c_itclh})
1324 if test x"${ac_cv_c_itclh}" = x ; then
1325 AC_MSG_ERROR([Can't find any Itcl headers])
1327 if test x"${ac_cv_c_itclh}" != x ; then
1329 if test x"${ac_cv_c_itclh}" != x"installed" ; then
1330 AC_MSG_RESULT(${ac_cv_c_itclh})
1331 ITCLHDIR="-I${ac_cv_c_itclh}"
1338 dnl Ok, lets find the itcl library
1339 dnl First, look for one uninstalled.
1340 dnl the alternative search directory is invoked by --with-itcllib
1341 AC_DEFUN(CYG_AC_PATH_ITCLLIB, [
1342 dirlist=".. ../../ ../../../ ../../../../ ../../../../../ ../../../../../../ ../../../../../../.. ../../../../../../../.. ../../../../../../../../.. ../../../../../../../../../.."
1343 if test x"${no_itcl}" = x ; then
1344 dnl we reset no_itcl incase something fails here
1346 AC_ARG_WITH(itcllib,
1347 [ --with-itcllib directory where the itcl library is],
1348 with_itcllib=${withval})
1349 AC_MSG_CHECKING([for Itcl library])
1350 AC_CACHE_VAL(ac_cv_c_itcllib,[
1351 dnl First check to see if --with-itcllib was specified.
1352 if test x"${with_itcllib}" != x ; then
1353 if test -f "${with_itcllib}/libitcl$TCL_SHARED_LIB_SUFFIX" ; then
1354 ac_cv_c_itcllib=`(cd ${with_itcllib}; pwd)`/libitcl$TCL_SHARED_LIB_SUFFIX
1356 if test -f "${with_itcllib}/libitcl$TCL_UNSHARED_LIB_SUFFIX"; then
1357 ac_cv_c_itcllib=`(cd ${with_itcllib}; pwd)`/libitcl$TCL_UNSHARED_LIB_SUFFIX
1361 dnl then check for a Itcl library. Since these are uninstalled,
1362 dnl use the simple lib name root.
1363 if test x"${ac_cv_c_itcllib}" = x ; then
1364 dnl find the top level Itcl build directory
1365 for i in $dirlist; do
1366 if test -n "`ls -dr $i/itcl* 2>/dev/null`" ; then
1371 dnl Itcl 7.5 and greater puts library in subdir. Look there first.
1372 if test -f "$itclpath/src/libitcl.$TCL_SHLIB_SUFFIX" ; then
1373 ac_cv_c_itcllib=`(cd $itclpath/src; pwd)`
1374 elif test -f "$itclpath/src/libitcl.a"; then
1375 ac_cv_c_itcllib=`(cd $itclpath/src; pwd)`
1378 dnl check in a few other private locations
1379 if test x"${ac_cv_c_itcllib}" = x ; then
1380 for i in ${dirlist}; do
1381 if test -n "`ls -dr ${srcdir}/$i/itcl* 2>/dev/null`" ; then
1382 itclpath=${srcdir}/$i
1386 for i in `ls -dr ${itclpath}/itcl* 2>/dev/null` ; do
1387 dnl Itcl 7.5 and greater puts library in subdir. Look there first.
1388 if test -f "$i/src/libitcl$TCL_SHLIB_SUFFIX" ; then
1389 ac_cv_c_itcllib=`(cd $i/src; pwd)`
1391 elif test -f "$i/src/libitcl.a"; then
1392 ac_cv_c_itcllib=`(cd $i/src; pwd)`
1398 dnl see if one is conveniently installed with the compiler
1399 if test x"${ac_cv_c_itcllib}" = x ; then
1400 dnl Get the path to the compiler
1401 ccpath=`which ${CC} | sed -e 's:/bin/.*::'`/lib
1402 dnl Itcl 7.5 and greater puts library in subdir. Look there first.
1403 if test -f "${ccpath}/libitcl$TCL_SHLIB_SUFFIX" ; then
1404 ac_cv_c_itcllib=`(cd ${ccpath}; pwd)`
1405 elif test -f "${ccpath}/libitcl.a"; then
1406 ac_cv_c_itcllib=`(cd ${ccpath}; pwd)`
1410 if test x"${ac_cv_c_itcllib}" = x ; then
1412 AC_MSG_WARN(Can't find Itcl library)
1414 ITCLLIB="-L${ac_cv_c_itcllib}"
1415 AC_MSG_RESULT(${ac_cv_c_itcllib})
1425 dnl ====================================================================
1426 dnl Ok, lets find the itcl source trees so we can use the itcl_sh script
1427 dnl the alternative search directory is involked by --with-itclinclude
1428 AC_DEFUN(CYG_AC_PATH_ITCLSH, [
1429 dirlist=".. ../../ ../../../ ../../../../ ../../../../../ ../../../../../../ ../../../../../../.. ../../../../../../../.. ../../../../../../../../.. ../../../../../../../../../.."
1431 AC_MSG_CHECKING(for the itcl_sh script)
1432 AC_ARG_WITH(itclinclude, [ --with-itclinclude directory where itcl headers are], with_itclinclude=${withval})
1433 AC_CACHE_VAL(ac_cv_c_itclsh,[
1434 dnl first check to see if --with-itclinclude was specified
1435 if test x"${with_itclinclude}" != x ; then
1436 if test -f ${with_itclinclude}/itcl_sh ; then
1437 ac_cv_c_itclsh=`(cd ${with_itclinclude}; pwd)`
1438 elif test -f ${with_itclinclude}/src/itcl_sh ; then
1439 ac_cv_c_itclsh=`(cd ${with_itclinclude}/src; pwd)`
1441 AC_MSG_ERROR([${with_itclinclude} directory doesn't contain itcl_sh])
1445 dnl next check in private source directory
1446 dnl since ls returns lowest version numbers first, reverse its output
1447 if test x"${ac_cv_c_itclsh}" = x ; then
1448 dnl find the top level Itcl source directory
1449 for i in $dirlist; do
1450 if test -n "`ls -dr $srcdir/$i/itcl* 2>/dev/null`" ; then
1456 dnl find the exact Itcl source dir. We do it this way, cause there
1457 dnl might be multiple version of Itcl, and we want the most recent one.
1458 for i in `ls -dr $itclpath/itcl* 2>/dev/null ` ; do
1459 if test -f $i/src/itcl_sh ; then
1460 ac_cv_c_itclsh=`(cd $i/src; pwd)`/itcl_sh
1466 dnl see if one is installed
1467 if test x"${ac_cv_c_itclsh}" = x ; then
1469 AC_PATH_PROG(ac_cv_c_itclsh, itcl_sh)
1471 AC_MSG_RESULT(${ac_cv_c_itclsh})
1475 if test x"${ac_cv_c_itclsh}" = x ; then
1476 AC_MSG_ERROR([Can't find the itcl_sh script])
1478 if test x"${ac_cv_c_itclsh}" != x ; then
1480 AC_MSG_RESULT(${ac_cv_c_itclsh})
1481 ITCLSH="${ac_cv_c_itclsh}"
1487 dnl ====================================================================
1488 dnl Ok, lets find the itcl source trees so we can use the itcl_sh script
1489 dnl the alternative search directory is involked by --with-itclinclude
1490 AC_DEFUN(CYG_AC_PATH_ITCLMKIDX, [
1491 dirlist=".. ../../ ../../../ ../../../../ ../../../../../ ../../../../../../ ../../../../../../.. ../../../../../../../.. ../../../../../../../../.. ../../../../../../../../../.."
1493 AC_MSG_CHECKING(for itcl_mkindex.tcl script)
1494 AC_ARG_WITH(itclinclude, [ --with-itclinclude directory where itcl headers are], with_itclinclude=${withval})
1495 AC_CACHE_VAL(ac_cv_c_itclmkidx,[
1496 dnl first check to see if --with-itclinclude was specified
1497 if test x"${with_itclinclude}" != x ; then
1498 if test -f ${with_itclinclude}/itcl_sh ; then
1499 ac_cv_c_itclmkidx=`(cd ${with_itclinclude}; pwd)`
1500 elif test -f ${with_itclinclude}/src/itcl_sh ; then
1501 ac_cv_c_itclmkidx=`(cd ${with_itclinclude}/src; pwd)`
1503 AC_MSG_ERROR([${with_itclinclude} directory doesn't contain itcl_sh])
1507 dnl next check in private source directory
1508 dnl since ls returns lowest version numbers first, reverse its output
1509 if test x"${ac_cv_c_itclmkidx}" = x ; then
1510 dnl find the top level Itcl source directory
1511 for i in $dirlist; do
1512 if test -n "`ls -dr $srcdir/$i/itcl* 2>/dev/null`" ; then
1518 dnl find the exact Itcl source dir. We do it this way, cause there
1519 dnl might be multiple version of Itcl, and we want the most recent one.
1520 for i in `ls -dr $itclpath/itcl* 2>/dev/null ` ; do
1521 if test -f $i/library/itcl_mkindex.tcl ; then
1522 ac_cv_c_itclmkidx=`(cd $i/library; pwd)`/itcl_mkindex.tcl
1527 if test x"${ac_cv_c_itclmkidx}" = x ; then
1528 dnl Get the path to the compiler
1529 ccpath=`which ${CC} | sed -e 's:/bin/.*::'`/share
1530 dnl Itcl 7.5 and greater puts library in subdir. Look there first.
1531 for i in `ls -dr $ccpath/itcl* 2>/dev/null ` ; do
1532 if test -f $i/itcl_mkindex.tcl ; then
1533 ac_cv_c_itclmkidx=`(cd $i; pwd)`/itcl_mkindex.tcl
1540 if test x"${ac_cv_c_itclmkidx}" = x ; then
1541 AC_MSG_ERROR([Can't find the itcl_mkindex.tcl script])
1543 if test x"${ac_cv_c_itclmkidx}" != x ; then
1545 AC_MSG_RESULT(${ac_cv_c_itclmkidx})
1546 ITCLMKIDX="${ac_cv_c_itclmkidx}"
1553 dnl ====================================================================
1554 dnl Ok, lets find the tix source trees so we can use the headers
1555 dnl the alternative search directory is involked by --with-tixinclude
1556 AC_DEFUN(CYG_AC_PATH_TIX, [
1560 AC_DEFUN(CYG_AC_PATH_TIXH, [
1561 dirlist=".. ../../ ../../../ ../../../../ ../../../../../ ../../../../../../ ../../../../../../.. ../../../../../../../.. ../../../../../../../../.. ../../../../../../../../../.."
1563 AC_MSG_CHECKING(for Tix headers in the source tree)
1564 AC_ARG_WITH(tixinclude, [ --with-tixinclude directory where tix headers are], with_tixinclude=${withval})
1565 AC_CACHE_VAL(ac_cv_c_tixh,[
1566 dnl first check to see if --with-tixinclude was specified
1567 if test x"${with_tixinclude}" != x ; then
1568 if test -f ${with_tixinclude}/tix.h ; then
1569 ac_cv_c_tixh=`(cd ${with_tixinclude}; pwd)`
1570 elif test -f ${with_tixinclude}/generic/tix.h ; then
1571 ac_cv_c_tixh=`(cd ${with_tixinclude}/generic; pwd)`
1573 AC_MSG_ERROR([${with_tixinclude} directory doesn't contain headers])
1577 dnl next check if it came with Tix configuration file
1578 if test x"${ac_cv_c_tixconfig}" != x ; then
1579 for i in $dirlist; do
1580 if test -f $ac_cv_c_tixconfig/$i/generic/tix.h ; then
1581 ac_cv_c_tixh=`(cd $ac_cv_c_tixconfig/$i/generic; pwd)`
1587 dnl next check in private source directory
1588 dnl since ls returns lowest version numbers first, reverse its output
1589 if test x"${ac_cv_c_tixh}" = x ; then
1590 dnl find the top level Tix source directory
1591 for i in $dirlist; do
1592 if test -n "`ls -dr $srcdir/$i/tix* 2>/dev/null`" ; then
1598 dnl find the exact Tix source dir. We do it this way, cause there
1599 dnl might be multiple version of Tix, and we want the most recent one.
1600 for i in `ls -dr $tixpath/tix* 2>/dev/null ` ; do
1601 if test -f $i/generic/tix.h ; then
1602 ac_cv_c_tixh=`(cd $i/generic; pwd)`
1608 dnl see if one is installed
1609 if test x"${ac_cv_c_tixh}" = x ; then
1611 dnl Get the path to the compiler
1613 dnl Get the path to the compiler. We do it this way instead of using
1614 dnl AC_CHECK_HEADER, cause this doesn't depend in having X configured.
1615 ccpath=`which ${CC} | sed -e 's:/bin/.*::'`/include
1616 if test -f $ccpath/tix.h; then
1617 ac_cv_c_tixh=installed
1620 AC_MSG_RESULT(${ac_cv_c_tixh})
1623 if test x"${ac_cv_c_tixh}" = x ; then
1624 AC_MSG_ERROR([Can't find any Tix headers])
1626 if test x"${ac_cv_c_tixh}" != x ; then
1628 AC_MSG_RESULT(${ac_cv_c_tixh})
1629 if test x"${ac_cv_c_tixh}" != x"installed" ; then
1630 TIXHDIR="-I${ac_cv_c_tixh}"
1637 AC_DEFUN(CYG_AC_PATH_TIXCONFIG, [
1639 # Ok, lets find the tix configuration
1640 # First, look for one uninstalled.
1641 # the alternative search directory is invoked by --with-tixconfig
1644 if test x"${no_tix}" = x ; then
1645 # we reset no_tix in case something fails here
1647 AC_ARG_WITH(tixconfig, [ --with-tixconfig directory containing tix configuration (tixConfig.sh)],
1648 with_tixconfig=${withval})
1649 AC_MSG_CHECKING([for Tix configuration])
1650 AC_CACHE_VAL(ac_cv_c_tixconfig,[
1652 # First check to see if --with-tixconfig was specified.
1653 if test x"${with_tixconfig}" != x ; then
1654 if test -f "${with_tixconfig}/tixConfig.sh" ; then
1655 ac_cv_c_tixconfig=`(cd ${with_tixconfig}; pwd)`
1657 AC_MSG_ERROR([${with_tixconfig} directory doesn't contain tixConfig.sh])
1661 # then check for a private Tix library
1662 if test x"${ac_cv_c_tixconfig}" = x ; then
1665 `ls -dr ../tix[[4]]* 2>/dev/null` \
1667 `ls -dr ../../tix[[4]]* 2>/dev/null` \
1669 `ls -dr ../../../tix[[4]]* 2>/dev/null` ; do
1670 if test -f "$i/tixConfig.sh" ; then
1671 ac_cv_c_tixconfig=`(cd $i; pwd)`
1676 # check in a few common install locations
1677 if test x"${ac_cv_c_tixconfig}" = x ; then
1678 for i in `ls -d ${prefix}/lib /usr/local/lib 2>/dev/null` ; do
1679 if test -f "$i/tixConfig.sh" ; then
1680 ac_cv_c_tkconfig=`(cd $i; pwd)`
1685 # check in a few other private locations
1686 if test x"${ac_cv_c_tixconfig}" = x ; then
1689 `ls -dr ${srcdir}/../tix[[4-9]]* 2>/dev/null` ; do
1690 if test -f "$i/tixConfig.sh" ; then
1691 ac_cv_c_tixconfig=`(cd $i; pwd)`
1697 if test x"${ac_cv_c_tixconfig}" = x ; then
1698 TIXCONFIG="# no Tix configs found"
1699 AC_MSG_WARN(Can't find Tix configuration definitions)
1702 TIXCONFIG=${ac_cv_c_tixconfig}/tixConfig.sh
1703 AC_MSG_RESULT(found $TIXCONFIG)
1709 # Defined as a separate macro so we don't have to cache the values
1710 # from PATH_TIXCONFIG (because this can also be cached).
1711 AC_DEFUN(CYG_AC_LOAD_TIXCONFIG, [
1712 if test -f "$TIXCONFIG" ; then
1716 AC_SUBST(TIX_BUILD_LIB_SPEC)
1717 AC_SUBST(TIX_LIB_FULL_PATH)
1720 AC_DEFUN(CYG_AC_PATH_ITCLCONFIG, [
1722 # Ok, lets find the itcl configuration
1723 # First, look for one uninstalled.
1724 # the alternative search directory is invoked by --with-itclconfig
1727 if test x"${no_itcl}" = x ; then
1728 # we reset no_itcl in case something fails here
1730 AC_ARG_WITH(itclconfig, [ --with-itclconfig directory containing itcl configuration (itclConfig.sh)],
1731 with_itclconfig=${withval})
1732 AC_MSG_CHECKING([for Itcl configuration])
1733 AC_CACHE_VAL(ac_cv_c_itclconfig,[
1735 # First check to see if --with-itclconfig was specified.
1736 if test x"${with_itclconfig}" != x ; then
1737 if test -f "${with_itclconfig}/itclConfig.sh" ; then
1738 ac_cv_c_itclconfig=`(cd ${with_itclconfig}; pwd)`
1740 AC_MSG_ERROR([${with_itclconfig} directory doesn't contain itclConfig.sh])
1744 # then check for a private itcl library
1745 if test x"${ac_cv_c_itclconfig}" = x ; then
1748 `ls -dr ../itcl/itcl[[3]]* 2>/dev/null` \
1750 `ls -dr ../../itcl/itcl[[3]]* 2>/dev/null` \
1751 ../../../itcl/itcl \
1752 `ls -dr ../../../itcl/itcl[[3]]* 2>/dev/null` ; do
1753 if test -f "$i/itclConfig.sh" ; then
1754 ac_cv_c_itclconfig=`(cd $i; pwd)`
1759 # check in a few common install locations
1760 if test x"${ac_cv_c_itclconfig}" = x ; then
1761 for i in `ls -d ${prefix}/lib /usr/local/lib 2>/dev/null` ; do
1762 if test -f "$i/itclConfig.sh" ; then
1763 ac_cv_c_itclconfig=`(cd $i; pwd)`
1768 # check in a few other private locations
1769 if test x"${ac_cv_c_itclconfig}" = x ; then
1771 ${srcdir}/../itcl/itcl \
1772 `ls -dr ${srcdir}/../itcl/itcl[[3]]* 2>/dev/null` ; do
1773 if test -f "$i/itcl/itclConfig.sh" ; then
1774 ac_cv_c_itclconfig=`(cd $i; pwd)`
1780 if test x"${ac_cv_c_itclconfig}" = x ; then
1781 ITCLCONFIG="# no itcl configs found"
1782 AC_MSG_WARN(Can't find itcl configuration definitions)
1785 ITCLCONFIG=${ac_cv_c_itclconfig}/itclConfig.sh
1786 AC_MSG_RESULT(found $ITCLCONFIG)
1792 # Defined as a separate macro so we don't have to cache the values
1793 # from PATH_ITCLCONFIG (because this can also be cached).
1794 AC_DEFUN(CYG_AC_LOAD_ITCLCONFIG, [
1795 if test -f "$ITCLCONFIG" ; then
1799 AC_SUBST(ITCL_BUILD_LIB_SPEC)
1801 AC_SUBST(ITCL_LIB_FILE)
1802 AC_SUBST(ITCL_LIB_FULL_PATH)
1807 AC_DEFUN(CYG_AC_PATH_ITKCONFIG, [
1809 # Ok, lets find the itk configuration
1810 # First, look for one uninstalled.
1811 # the alternative search directory is invoked by --with-itkconfig
1814 if test x"${no_itk}" = x ; then
1815 # we reset no_itk in case something fails here
1817 AC_ARG_WITH(itkconfig, [ --with-itkconfig directory containing itk configuration (itkConfig.sh)],
1818 with_itkconfig=${withval})
1819 AC_MSG_CHECKING([for Itk configuration])
1820 AC_CACHE_VAL(ac_cv_c_itkconfig,[
1822 # First check to see if --with-itkconfig was specified.
1823 if test x"${with_itkconfig}" != x ; then
1824 if test -f "${with_itkconfig}/itkConfig.sh" ; then
1825 ac_cv_c_itkconfig=`(cd ${with_itkconfig}; pwd)`
1827 AC_MSG_ERROR([${with_itkconfig} directory doesn't contain itkConfig.sh])
1831 # then check for a private itk library
1832 if test x"${ac_cv_c_itkconfig}" = x ; then
1835 `ls -dr ../itcl/itk[[3]]* 2>/dev/null` \
1837 `ls -dr ../../itcl/itk[[3]]* 2>/dev/null` \
1839 `ls -dr ../../../itcl/itk[[3]]* 2>/dev/null` ; do
1840 if test -f "$i/itkConfig.sh" ; then
1841 ac_cv_c_itkconfig=`(cd $i; pwd)`
1846 # check in a few common install locations
1847 if test x"${ac_cv_c_itkconfig}" = x ; then
1848 for i in `ls -d ${prefix}/lib /usr/local/lib 2>/dev/null` ; do
1849 if test -f "$i/itcl/itkConfig.sh" ; then
1850 ac_cv_c_itkconfig=`(cd $i; pwd)`
1855 # check in a few other private locations
1856 if test x"${ac_cv_c_itkconfig}" = x ; then
1858 ${srcdir}/../itcl/itk \
1859 `ls -dr ${srcdir}/../itcl/itk[[3]]* 2>/dev/null` ; do
1860 if test -f "$i/itkConfig.sh" ; then
1861 ac_cv_c_itkconfig=`(cd $i; pwd)`
1867 if test x"${ac_cv_c_itkconfig}" = x ; then
1868 ITCLCONFIG="# no itk configs found"
1869 AC_MSG_WARN(Can't find itk configuration definitions)
1872 ITKCONFIG=${ac_cv_c_itkconfig}/itkConfig.sh
1873 AC_MSG_RESULT(found $ITKCONFIG)
1879 # Defined as a separate macro so we don't have to cache the values
1880 # from PATH_ITKCONFIG (because this can also be cached).
1881 AC_DEFUN(CYG_AC_LOAD_ITKCONFIG, [
1882 if test -f "$ITKCONFIG" ; then
1886 AC_SUBST(ITK_BUILD_LIB_SPEC)
1887 AC_SUBST(ITK_LIB_FILE)
1888 AC_SUBST(ITK_LIB_FULL_PATH)
1892 dnl ====================================================================
1893 dnl Ok, lets find the libgui source trees so we can use the headers
1894 dnl the alternative search directory is involked by --with-libguiinclude
1895 AC_DEFUN(CYG_AC_PATH_LIBGUI, [
1897 CYG_AC_PATH_LIBGUILIB
1899 AC_DEFUN(CYG_AC_PATH_LIBGUIH, [
1900 dirlist=".. ../../ ../../../ ../../../../ ../../../../../ ../../../../../../ ../../../../../../.. ../../../../../../../.. ../../../../../../../../.. ../../../../../../../../../..../../../../../../../../../../.."
1902 AC_MSG_CHECKING(for Libgui headers in the source tree)
1903 AC_ARG_WITH(libguiinclude, [ --with-libguiinclude directory where libgui headers are], with_libguiinclude=${withval})
1904 AC_CACHE_VAL(ac_cv_c_libguih,[
1905 dnl first check to see if --with-libguiinclude was specified
1906 if test x"${with_libguiinclude}" != x ; then
1907 if test -f ${with_libguiinclude}/guitcl.h ; then
1908 ac_cv_c_libguih=`(cd ${with_libguiinclude}; pwd)`
1909 elif test -f ${with_libguiinclude}/src/guitcl.h ; then
1910 ac_cv_c_libguih=`(cd ${with_libguiinclude}/src; pwd)`
1912 AC_MSG_ERROR([${with_libguiinclude} directory doesn't contain headers])
1916 dnl next check if it came with Libgui configuration file
1917 if test x"${ac_cv_c_libguiconfig}" != x ; then
1918 for i in $dirlist; do
1919 if test -f $ac_cv_c_libguiconfig/$i/src/guitcl.h ; then
1920 ac_cv_c_libguih=`(cd $ac_cv_c_libguiconfig/$i/src; pwd)`
1926 dnl next check in private source directory
1927 dnl since ls returns lowest version numbers first, reverse its output
1928 if test x"${ac_cv_c_libguih}" = x ; then
1929 dnl find the top level Libgui source directory
1930 for i in $dirlist; do
1931 if test -n "`ls -dr $srcdir/$i/libgui* 2>/dev/null`" ; then
1932 libguipath=$srcdir/$i
1937 dnl find the exact Libgui source dir. We do it this way, cause there
1938 dnl might be multiple version of Libgui, and we want the most recent one.
1939 for i in `ls -dr $libguipath/libgui* 2>/dev/null ` ; do
1940 if test -f $i/src/guitcl.h ; then
1941 ac_cv_c_libguih=`(cd $i/src; pwd)`
1947 dnl see if one is installed
1948 if test x"${ac_cv_c_libguih}" = x ; then
1950 AC_CHECK_HEADER(guitcl.h, ac_cv_c_libguih=installed, ac_cv_c_libguih="")
1954 if test x"${ac_cv_c_libguih}" = x ; then
1955 AC_MSG_WARN([Can't find any Libgui headers])
1957 if test x"${ac_cv_c_libguih}" != x ; then
1959 if test x"${ac_cv_c_libguih}" != x"installed" ; then
1960 LIBGUIHDIR="-I${ac_cv_c_libguih}"
1963 AC_MSG_RESULT(${ac_cv_c_libguih})
1964 AC_SUBST(LIBGUIHDIR)
1967 dnl ====================================================================
1968 dnl find the GUI library
1969 AC_DEFUN(CYG_AC_PATH_LIBGUILIB, [
1970 AC_MSG_CHECKING(for GUI library in the build tree)
1971 dirlist=".. ../../ ../../../ ../../../../ ../../../../../ ../../../../../../ ../../../../../../.. ../../../../../../../.. ../../../../../../../../.. ../../../../../../../../../.."
1972 dnl look for the library
1973 AC_MSG_CHECKING(for GUI library)
1974 AC_CACHE_VAL(ac_cv_c_libguilib,[
1975 if test x"${ac_cv_c_libguilib}" = x ; then
1976 for i in $dirlist; do
1977 if test -f "$i/libgui/src/Makefile" ; then
1978 ac_cv_c_libguilib=`(cd $i/libgui/src; pwd)`
1984 if test x"${ac_cv_c_libguilib}" != x ; then
1985 GUILIB="${GUILIB} -L${ac_cv_c_libguilib}"
1987 AC_MSG_RESULT(${ac_cv_c_libguilib})