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; ${PWDCMD-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; ${PWDCMD-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; ${PWDCMD-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; ${PWDCMD-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; ${PWDCMD-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; ${PWDCMD-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; ${PWDCMD-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; ${PWDCMD-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; ${PWDCMD-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 libiberty library.
378 AC_DEFUN([CYG_AC_PATH_LIBIBERTY], [
379 AC_MSG_CHECKING(for the libiberty library in the build tree)
380 dirlist=".. ../../ ../../../ ../../../../ ../../../../../ ../../../../../../ ../../../../../../.. ../../../../../../../.. ../../../../../../../../.. ../../../../../../../../../.."
381 AC_CACHE_VAL(ac_cv_c_libib,[
382 for i in $dirlist; do
383 if test -f "$i/libiberty/Makefile" ; then
384 ac_cv_c_libib=`(cd $i/libiberty/; ${PWDCMD-pwd})`
388 if test x"${ac_cv_c_libib}" != x; then
389 LIBIBERTY="-L${ac_cv_c_libib}"
390 AC_MSG_RESULT(${ac_cv_c_libib})
397 dnl ====================================================================
398 dnl Find all the ILU headers and libraries
399 AC_DEFUN([CYG_AC_PATH_ILU], [
400 AC_MSG_CHECKING(for ILU kernel headers in the source tree)
401 dirlist=".. ../../ ../../../ ../../../../ ../../../../../ ../../../../../../ ../../../../../../.. ../../../../../../../.. ../../../../../../../../.. ../../../../../../../../../.."
402 AC_CACHE_VAL(ac_cv_c_iluh,[
403 for i in $dirlist; do
404 if test -f "${srcdir}/$i/ilu/runtime/kernel/method.h" ; then
405 ac_cv_c_iluh=`(cd ${srcdir}/$i/ilu/runtime/kernel; ${PWDCMD-pwd})`
409 if test x"${ac_cv_c_iluh}" != x; then
410 ILUHDIR="-I${ac_cv_c_iluh}"
411 AC_MSG_RESULT(${ac_cv_c_iluh})
416 AC_MSG_CHECKING(for ILU kernel headers in the build tree)
417 dirlist=".. ../../ ../../../ ../../../../ ../../../../../ ../../../../../../ ../../../../../../.. ../../../../../../../.. ../../../../../../../../.. ../../../../../../../../../.."
418 AC_CACHE_VAL(ac_cv_c_iluh5,[
419 for i in $dirlist; do
420 if test -f "$i/ilu/runtime/kernel/iluconf.h" ; then
421 ac_cv_c_iluh5=`(cd $i/ilu/runtime/kernel; ${PWDCMD-pwd})`
425 if test x"${ac_cv_c_iluh5}" != x; then
426 ILUHDIR="${ILUHDIR} -I${ac_cv_c_iluh5}"
427 AC_MSG_RESULT(${ac_cv_c_iluh5})
432 AC_MSG_CHECKING(for ILU C++ headers in the source tree)
433 AC_CACHE_VAL(ac_cv_c_iluh2,[
434 for i in $dirlist; do
435 if test -f "${srcdir}/$i/ilu/stubbers/cpp/resource.h" ; then
436 ac_cv_c_iluh2=`(cd ${srcdir}/$i/ilu/stubbers/cpp; ${PWDCMD-pwd})`
440 if test x"${ac_cv_c_iluh2}" != x; then
441 ILUHDIR="${ILUHDIR} -I${ac_cv_c_iluh2}"
442 AC_MSG_RESULT(${ac_cv_c_iluh2})
447 AC_MSG_CHECKING(for ILU C headers)
448 AC_CACHE_VAL(ac_cv_c_iluh3,[
449 for i in $dirlist; do
450 if test -f "${srcdir}/$i/ilu/stubbers/c/resource.h" ; then
451 ac_cv_c_iluh3=`(cd ${srcdir}/$i/ilu/stubbers/c ; ${PWDCMD-pwd})`
455 if test x"${ac_cv_c_iluh3}" != x; then
456 ILUHDIR="${ILUHDIR} -I${ac_cv_c_iluh3}"
457 AC_MSG_RESULT(${ac_cv_c_iluh3})
462 AC_MSG_CHECKING(for ILU C runtime headers)
463 AC_CACHE_VAL(ac_cv_c_iluh4,[
464 for i in $dirlist; do
465 if test -f "${srcdir}/$i/ilu/runtime/c/ilucstub.h" ; then
466 ac_cv_c_iluh4=`(cd ${srcdir}/$i/ilu/runtime/c ; ${PWDCMD-pwd})`
470 if test x"${ac_cv_c_iluh4}" != x; then
471 ILUHDIR="${ILUHDIR} -I${ac_cv_c_iluh4}"
472 AC_MSG_RESULT(${ac_cv_c_iluh4})
477 AC_CACHE_VAL(ac_cv_c_ilupath,[
478 for i in $dirlist; do
479 if test -f "$i/ilu/Makefile" ; then
480 ac_cv_c_ilupath=`(cd $i/ilu; ${PWDCMD-pwd})`
485 ILUTOP=${ac_cv_c_ilupath}
487 AC_MSG_CHECKING(for the ILU library in the build tree)
488 AC_CACHE_VAL(ac_cv_c_ilulib,[
489 if test -f "$ac_cv_c_ilupath/runtime/kernel/Makefile" ; then
490 ac_cv_c_ilulib=`(cd $ac_cv_c_ilupath/runtime/kernel; ${PWDCMD-pwd})`
491 AC_MSG_RESULT(found ${ac_cv_c_ilulib}/libilu.a)
496 AC_MSG_CHECKING(for the ILU C++ bindings library in the build tree)
497 AC_CACHE_VAL(ac_cv_c_ilulib2,[
498 if test -f "$ac_cv_c_ilupath/runtime/cpp/Makefile" ; then
499 ac_cv_c_ilulib2=`(cd $ac_cv_c_ilupath/runtime/cpp; ${PWDCMD-pwd})`
500 AC_MSG_RESULT(found ${ac_cv_c_ilulib2}/libilu-c++.a)
505 AC_MSG_CHECKING(for the ILU C bindings library in the build tree)
506 AC_CACHE_VAL(ac_cv_c_ilulib3,[
507 if test -f "$ac_cv_c_ilupath/runtime/c/Makefile" ; then
508 ac_cv_c_ilulib3=`(cd $ac_cv_c_ilupath/runtime/c; ${PWDCMD-pwd})`
509 AC_MSG_RESULT(found ${ac_cv_c_ilulib3}/libilu-c.a)
514 AC_MSG_CHECKING(for the ILU Tk bindings library in the build tree)
515 AC_CACHE_VAL(ac_cv_c_ilulib4,[
516 if test -f "$ac_cv_c_ilupath/runtime/mainloop/Makefile" ; then
517 ac_cv_c_ilulib4=`(cd $ac_cv_c_ilupath/runtime/mainloop; ${PWDCMD-pwd})`
518 AC_MSG_RESULT(found ${ac_cv_c_ilulib4}/libilu-tk.a)
523 if test x"${ac_cv_c_ilulib}" = x -a x"${ac_cv_c_ilulib2}" = x; then
527 if test x"${ac_cv_c_ilulib}" != x -a x"${ac_cv_c_ilulib2}" != x; then
528 ILULIB="-L${ac_cv_c_ilulib} -L${ac_cv_c_ilulib2} -L${ac_cv_c_ilulib3} -L${ac_cv_c_ilulib4}"
533 if test x"${ILULIB}" = x; then
534 AC_MSG_CHECKING(for ILU libraries installed with the compiler)
535 AC_CACHE_VAL(ac_cv_c_ilulib5,[
536 NATIVE_GCC=`echo gcc | sed -e "${program_transform_name}"`
538 dnl Get G++'s full path to it's libraries
539 ac_cv_c_ilulib5=`${NATIVE_GCC} --print-libgcc | sed -e 's:lib/gcc-lib/.*::'`lib
540 if test -f $ac_cv_c_ilulib5/libilu-c.a -o -f $ac_cv_c_ilulib5/libilu-c.so ; then
541 if test x"${ILUHDIR}" = x; then
542 ILUHDIR="-I${ac_cv_c_ilulib5}/../include"
544 ILULIB="-L${ac_cv_c_ilulib5}"
545 AC_MSG_RESULT(${ac_cv_c_ilulib5})
556 dnl ====================================================================
557 dnl This defines the byte order for the host. We can't use
558 dnl AC_C_BIGENDIAN, cause we want to create a config file and
559 dnl substitue the real value, so the header files work right
560 AC_DEFUN([CYG_AC_C_ENDIAN], [
561 AC_MSG_CHECKING(to see if this is a little endian host)
562 AC_CACHE_VAL(ac_cv_c_little_endian, [
563 ac_cv_c_little_endian=unknown
564 # See if sys/param.h defines the BYTE_ORDER macro.
565 AC_TRY_COMPILE([#include <sys/types.h>
566 #include <sys/param.h>], [
567 #if !BYTE_ORDER || !_BIG_ENDIAN || !_LITTLE_ENDIAN
569 #endif], [# It does; now see whether it defined to _LITTLE_ENDIAN or not.
570 AC_TRY_COMPILE([#include <sys/types.h>
571 #include <sys/param.h>], [
572 #if BYTE_ORDER != _LITTLE_ENDIAN
574 #endif], ac_cv_c_little_endian=yes, ac_cv_c_little_endian=no)
576 if test ${ac_cv_c_little_endian} = unknown; then
581 /* Are we little or big endian? From Harbison&Steele. */
585 char c[sizeof (long)];
590 ac_cv_c_little_endian=no,
591 ac_cv_c_little_endian=yes,[
592 dnl Yes, this is ugly, and only used for a canadian cross anyway. This
593 dnl is just to keep configure from stopping here.
596 i[3456789]86-*-*) ac_cv_c_little_endian=yes ;;
597 sparc*-*-*) ac_cv_c_little_endian=no ;;
599 *) AC_MSG_WARN(Can't cross compile this test) ;;
604 if test x"${ac_cv_c_little_endian}" = xyes; then
605 AC_DEFINE(LITTLE_ENDIAN_HOST)
606 ENDIAN="CYG_LSBFIRST";
608 ENDIAN="CYG_MSBFIRST";
610 AC_MSG_RESULT(${ac_cv_c_little_endian})
614 dnl ====================================================================
615 dnl Look for the path to libgcc, so we can use it to directly link
616 dnl in libgcc.a with LD.
617 AC_DEFUN([CYG_AC_PATH_LIBGCC],
618 [AC_MSG_CHECKING([Looking for the path to libgcc.a])
622 dnl Get Gcc's full path to libgcc.a
623 libgccpath=`${CC} --print-libgcc`
625 dnl If we don't have a path with libgcc.a on the end, this isn't G++.
626 if test `echo $libgccpath | sed -e 's:/.*/::'` = libgcc.a ; then
633 if test x"${ac_cv_prog_gcc}" = xyes ; then
634 gccpath=`echo $libgccpath | sed -e 's:/libgcc.a::'`
635 LIBGCC="-L${gccpath}"
636 AC_MSG_RESULT(${gccpath})
639 AC_MSG_ERROR(Not using gcc)