home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / lzo100.zip / lzo-1.00 / aclocal.m4 < prev    next >
M4 Source File  |  1997-07-13  |  15KB  |  544 lines

  1. dnl aclocal.m4 generated automatically by aclocal 1.2
  2.  
  3. # Local additions to Autoconf 2.12 macros.
  4. #
  5. #
  6. # Copyright (C) 1997 Markus Franz Xaver Johannes Oberhumer
  7. # Copyright (C) 1996 Markus Franz Xaver Johannes Oberhumer
  8. #
  9.  
  10.  
  11. dnl mfx_CHECK_SIZEOF(TYPE [, CROSS-SIZE])
  12. AC_DEFUN(mfx_CHECK_SIZEOF,
  13. [changequote(<<, >>)dnl
  14. dnl The name to #define.
  15. define(<<AC_TYPE_NAME>>, translit(sizeof_$1, [a-z *], [A-Z_P]))dnl
  16. dnl The cache variable name.
  17. define(<<AC_CV_NAME>>, translit(ac_cv_sizeof_$1, [ *], [_p]))dnl
  18. changequote([, ])dnl
  19. AC_MSG_CHECKING(size of $1)
  20. AC_CACHE_VAL(AC_CV_NAME,
  21. [AC_TRY_RUN([#include <stdio.h>
  22. #if STDC_HEADERS
  23. #include <stdlib.h>
  24. #include <stddef.h>
  25. #endif
  26. main()
  27. {
  28.   FILE *f=fopen("conftestval", "w");
  29.   if (!f) exit(1);
  30.   fprintf(f, "%d\n", sizeof($1));
  31.   exit(0);
  32. }], AC_CV_NAME=`cat conftestval`, AC_CV_NAME=0, ifelse([$2], , , AC_CV_NAME=$2))])dnl
  33. AC_MSG_RESULT($AC_CV_NAME)
  34. AC_DEFINE_UNQUOTED(AC_TYPE_NAME, $AC_CV_NAME)
  35. undefine([AC_TYPE_NAME])dnl
  36. undefine([AC_CV_NAME])dnl
  37. ])
  38.  
  39.  
  40.  
  41. AC_DEFUN(mfx_PROG_GCC_PIPE,
  42. [AC_REQUIRE([AC_PROG_CC])dnl
  43. AC_REQUIRE([AC_PROG_CPP])dnl
  44. if test $ac_cv_prog_gcc = yes; then
  45. AC_CACHE_CHECK(whether ${CC-cc} accepts -pipe, mfx_cv_prog_gcc_pipe,
  46. [echo 'main() { return 0; }' > conftest.c
  47. if test -z "`${CC-cc} -pipe -c conftest.c 2>&1`"; then
  48.   mfx_cv_prog_gcc_pipe=yes
  49. else
  50.   mfx_cv_prog_gcc_pipe=no
  51. fi
  52. rm -f conftest*
  53. ])
  54.   if test $mfx_cv_prog_gcc_pipe = yes; then
  55.     CC="$CC -pipe"
  56.   fi
  57. fi
  58. ])
  59.  
  60.  
  61.  
  62. AC_DEFUN(mfx_PROG_GCC_BUG_STRENGTH_REDUCE,
  63. [AC_REQUIRE([AC_PROG_CC])dnl
  64. AC_REQUIRE([AC_PROG_CPP])dnl
  65. if test $ac_cv_prog_gcc = yes; then
  66. mfx_save_cflags=$CFLAGS
  67. CFLAGS="$CFLAGS -O2 -fstrength-reduce"
  68. AC_CACHE_CHECK(whether ${CC-cc} suffers the -fstrength-reduce bug,
  69. mfx_cv_prog_gcc_bug_strength_reduce,
  70. [AC_TRY_RUN([
  71. /* gcc strength-reduce optimization bug on Intel platforms.
  72.  * Adapted from bug-report by John E. Davis <davis@space.mit.edu>
  73.  * Compile and run it using gcc -O2 -fno-strength-reduce and
  74.  * gcc -O2 -fstrength-reduce.
  75.  */
  76. int a[3];
  77. unsigned an = 3;
  78. int strength_reduce_bug();
  79. main()
  80. {
  81.   unsigned j;
  82.   for (j = 0; j < an; j++)
  83.     a[j] = (int)j - 3;
  84.   exit(strength_reduce_bug() ? 1 : 0);
  85. }
  86. int strength_reduce_bug()
  87. {
  88.   return a[0] != -3 || a[1] != -2 || a[2] != -1;
  89. }], mfx_cv_prog_gcc_bug_strength_reduce=no, mfx_cv_prog_gcc_bug_strength_reduce=yes)])
  90. CFLAGS=$mfx_save_cflags
  91. fi
  92. MFX_PROG_GCC_BUG_STRENGTH_REDUCE=$mfx_cv_prog_gcc_bug_strength_reduce
  93. AC_SUBST(MFX_PROG_GCC_BUG_STRENGTH_REDUCE)dnl
  94. ])
  95.  
  96.  
  97.  
  98. AC_DEFUN(mfx_PROG_GCC_BUG_SCHEDULE_INSNS,
  99. [AC_REQUIRE([AC_PROG_CC])dnl
  100. AC_REQUIRE([AC_PROG_CPP])dnl
  101. if test $ac_cv_prog_gcc = yes; then
  102. mfx_save_cflags=$CFLAGS
  103. CFLAGS="$CFLAGS -O2 -fschedule-insns -fschedule-insns2"
  104. AC_CACHE_CHECK(whether ${CC-cc} suffers the -fschedule-insns bug,
  105. mfx_cv_prog_gcc_bug_schedule_insns,
  106. [AC_TRY_RUN([
  107. /* gcc schedule-insns optimization bug on RS6000 platforms.
  108.  * Adapted from bug-report by Assar Westerlund <assar@sics.se>
  109.  * Compile and run it using gcc -O2 -fno-schedule-insns and
  110.  * gcc -O2 -fschedule-insns.
  111.  */
  112. main()
  113. {
  114.   const int clone[] = {1, 2, 0};
  115.   const int *q;
  116.   q = clone;
  117.   if (*q) {
  118.     return 0;
  119.   }
  120.   return 1;
  121. }], mfx_cv_prog_gcc_bug_schedule_insns=no, mfx_cv_prog_gcc_bug_schedule_insns=yes)])
  122. CFLAGS=$mfx_save_cflags
  123. fi
  124. MFX_PROG_GCC_BUG_SCHEDULE_INSNS=$mfx_cv_prog_gcc_bug_schedule_insns
  125. AC_SUBST(MFX_PROG_GCC_BUG_SCHEDULE_INSNS)dnl
  126. ])
  127.  
  128.  
  129.  
  130. dnl  Checking if compiler correctly cast signed to unsigned.
  131. AC_DEFUN(mfx_PROG_CC_BUG_SIGNED_TO_UNSIGNED_CASTING,
  132. [AC_REQUIRE([AC_PROG_CC])dnl
  133. AC_REQUIRE([AC_PROG_CPP])dnl
  134. AC_CACHE_CHECK(whether signed to unsigned casting is broken,
  135. mfx_cv_prog_cc_bug_signed_to_unsigned_casting,
  136. [AC_TRY_RUN([main(){return((int)(unsigned char)((char) -1) != 255);}],
  137.   mfx_cv_prog_cc_bug_signed_to_unsigned_casting=no,
  138.   mfx_cv_prog_cc_bug_signed_to_unsigned_casting=yes)])
  139. MFX_PROC_CC_BUG_SIGNED_TO_UNSIGNED_CASTING=$mfx_cv_prog_cc_bug_signed_to_unsigned_casting
  140. AC_SUBST(MFX_PROC_CC_BUG_SIGNED_TO_UNSIGNED_CASTING)dnl
  141. if test "$mfx_cv_prog_cc_bug_signed_to_unsigned_casting" = yes; then
  142.   AC_DEFINE(MFX_PROG_CC_BUG_SIGNED_TO_UNSIGNED_CASTING)
  143. fi
  144. ])
  145.  
  146.  
  147.  
  148. AC_DEFUN(mfx_FUNC_MEMCMP,
  149. [AC_CACHE_CHECK(for 8-bit clean memcmp, mfx_cv_func_memcmp,
  150. [AC_TRY_RUN([
  151. main()
  152. {
  153.   char c0 = 0x40, c1 = 0x80, c2 = 0x81;
  154.   exit(memcmp(&c0, &c2, 1) < 0 && memcmp(&c1, &c2, 1) < 0 ? 0 : 1);
  155. }
  156. ], mfx_cv_func_memcmp=yes, mfx_cv_func_memcmp=no, mfx_cv_func_memcmp=no)])
  157. if test "$mfx_cv_func_memcmp" = no; then
  158.   AC_DEFINE(MFX_MEMCMP_BROKEN)
  159. fi
  160. ])
  161.  
  162.  
  163.  
  164. AC_DEFUN(mfx_C_BYTE_ORDER,
  165. [AC_CACHE_CHECK(the byte order, mfx_cv_c_byte_order,
  166. [mfx_cv_c_byte_order=unknown
  167. AC_TRY_RUN([main () {
  168.   /* Are we little or big endian?  From Harbison&Steele.  */
  169.   union
  170.   {
  171.     long l;
  172.     char c[sizeof (long)];
  173.   } u;
  174.   u.l = 1;
  175.   exit (u.c[sizeof (long) - 1] == 1);
  176. }], mfx_cv_c_byte_order=1234, mfx_cv_c_byte_order=4321)
  177. ])
  178. if test $mfx_cv_c_byte_order = 1234; then
  179.   AC_DEFINE_UNQUOTED(MFX_BYTE_ORDER,1234)
  180. fi
  181. if test $mfx_cv_c_byte_order = 4321; then
  182.   AC_DEFINE_UNQUOTED(MFX_BYTE_ORDER,4321)
  183. fi
  184. ])
  185.  
  186.  
  187.  
  188. AC_DEFUN(mfx_ASM_ALIGN,
  189. [AC_CACHE_CHECK(the alignment of the assembler, mfx_cv_asm_align,
  190. [AC_TRY_RUN([#include <stdio.h>
  191. main()
  192. {
  193. #if defined(__GNUC__)
  194.   extern char mfx_a1 __asm__("mfx_a1");
  195.   extern char mfx_a2 __asm__("mfx_a2");
  196.   long l = &mfx_a2 - &mfx_a1;
  197.   FILE *f = fopen("conftestval", "w");
  198.   if (!f) exit(1);
  199.   fprintf(f, "%ld\n", l);
  200.   exit(0);
  201.   __asm__ __volatile__ ("
  202.   .align 4
  203. mfx_a1:
  204.   .byte 0
  205.   .align 4
  206. mfx_a2:
  207.   ");
  208. #else
  209.   exit(2);
  210. #endif
  211. }], mfx_cv_asm_align=`cat conftestval`, mfx_cv_asm_align=0)
  212. ])
  213. if test $mfx_cv_asm_align = 16; then
  214.   AC_DEFINE(MFX_ASM_ALIGN_PTWO)
  215. else
  216.   AC_DEFINE(MFX_ASM_ALIGN_BYTES)
  217. fi
  218. ])
  219.  
  220.  
  221. # Do all the work for Automake.  This macro actually does too much --
  222. # some checks are only needed if your package does certain things.
  223. # But this isn't really a big deal.
  224.  
  225. # serial 1
  226.  
  227. dnl Usage:
  228. dnl AM_INIT_AUTOMAKE(package,version, [no-define])
  229.  
  230. AC_DEFUN(AM_INIT_AUTOMAKE,
  231. [AC_REQUIRE([AM_PROG_INSTALL])
  232. PACKAGE=[$1]
  233. AC_SUBST(PACKAGE)
  234. VERSION=[$2]
  235. AC_SUBST(VERSION)
  236. dnl test to see if srcdir already configured
  237. if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then
  238.   AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
  239. fi
  240. ifelse([$3],,
  241. AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE")
  242. AC_DEFINE_UNQUOTED(VERSION, "$VERSION"))
  243. AM_SANITY_CHECK
  244. AC_ARG_PROGRAM
  245. dnl FIXME This is truly gross.
  246. missing_dir=`cd $ac_aux_dir && pwd`
  247. AM_MISSING_PROG(ACLOCAL, aclocal, $missing_dir)
  248. AM_MISSING_PROG(AUTOCONF, autoconf, $missing_dir)
  249. AM_MISSING_PROG(AUTOMAKE, automake, $missing_dir)
  250. AM_MISSING_PROG(AUTOHEADER, autoheader, $missing_dir)
  251. AM_MISSING_PROG(MAKEINFO, makeinfo, $missing_dir)
  252. AC_PROG_MAKE_SET])
  253.  
  254.  
  255. # serial 1
  256.  
  257. AC_DEFUN(AM_PROG_INSTALL,
  258. [AC_REQUIRE([AC_PROG_INSTALL])
  259. test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}'
  260. AC_SUBST(INSTALL_SCRIPT)dnl
  261. ])
  262.  
  263. #
  264. # Check to make sure that the build environment is sane.
  265. #
  266.  
  267. AC_DEFUN(AM_SANITY_CHECK,
  268. [AC_MSG_CHECKING([whether build environment is sane])
  269. # Just in case
  270. sleep 1
  271. echo timestamp > conftestfile
  272. # Do `set' in a subshell so we don't clobber the current shell's
  273. # arguments.  Must try -L first in case configure is actually a
  274. # symlink; some systems play weird games with the mod time of symlinks
  275. # (eg FreeBSD returns the mod time of the symlink's containing
  276. # directory).
  277. if (
  278.    set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null`
  279.    if test "$@" = "X"; then
  280.       # -L didn't work.
  281.       set X `ls -t $srcdir/configure conftestfile`
  282.    fi
  283.    test "[$]2" = conftestfile
  284.    )
  285. then
  286.    # Ok.
  287.    :
  288. else
  289.    AC_MSG_ERROR([newly created file is older than distributed files!
  290. Check your system clock])
  291. fi
  292. rm -f conftest*
  293. AC_MSG_RESULT(yes)])
  294.  
  295. dnl AM_MISSING_PROG(NAME, PROGRAM, DIRECTORY)
  296. dnl The program must properly implement --version.
  297. AC_DEFUN(AM_MISSING_PROG,
  298. [AC_MSG_CHECKING(for working $2)
  299. # Run test in a subshell; some versions of sh will print an error if
  300. # an executable is not found, even if stderr is redirected.
  301. # Redirect stdin to placate older versions of autoconf.  Sigh.
  302. if ($2 --version) < /dev/null > /dev/null 2>&1; then
  303.    $1=$2
  304.    AC_MSG_RESULT(found)
  305. else
  306.    $1="$3/missing $2"
  307.    AC_MSG_RESULT(missing)
  308. fi
  309. AC_SUBST($1)])
  310.  
  311. # Like AC_CONFIG_HEADER, but automatically create stamp file.
  312.  
  313. AC_DEFUN(AM_CONFIG_HEADER,
  314. [AC_PREREQ([2.12])
  315. AC_CONFIG_HEADER([$1])
  316. dnl When config.status generates a header, we must update the stamp-h file.
  317. dnl This file resides in the same directory as the config header
  318. dnl that is generated.  We must strip everything past the first ":",
  319. dnl and everything past the last "/".
  320. AC_OUTPUT_COMMANDS(changequote(<<,>>)dnl
  321. ifelse(patsubst(<<$1>>, <<[^ ]>>, <<>>), <<>>,
  322. <<test -z "<<$>>CONFIG_HEADERS" || echo timestamp > patsubst(<<$1>>, <<^\([^:]*/\)?.*>>, <<\1>>)stamp-h<<>>dnl>>,
  323. <<am_indx=1
  324. for am_file in <<$1>>; do
  325.   case " <<$>>CONFIG_HEADERS " in
  326.   *" <<$>>am_file "*<<)>>
  327.     echo timestamp > `echo <<$>>am_file | sed -e 's%:.*%%' -e 's%[^/]*$%%'`stamp-h$am_indx
  328.     ;;
  329.   esac
  330.   am_indx=`expr "<<$>>am_indx" + 1`
  331. done<<>>dnl>>)
  332. changequote([,]))])
  333.  
  334. # Add --enable-maintainer-mode option to configure.
  335. # From Jim Meyering
  336.  
  337. # serial 1
  338.  
  339. AC_DEFUN(AM_MAINTAINER_MODE,
  340. [AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles])
  341.   dnl maintainer-mode is disabled by default
  342.   AC_ARG_ENABLE(maintainer-mode,
  343. [  --enable-maintainer-mode enable make rules and dependencies not useful
  344.                           (and sometimes confusing) to the casual installer],
  345.       USE_MAINTAINER_MODE=$enableval,
  346.       USE_MAINTAINER_MODE=no)
  347.   AC_MSG_RESULT($USE_MAINTAINER_MODE)
  348.   if test $USE_MAINTAINER_MODE = yes; then
  349.     MAINT=
  350.   else
  351.     MAINT='#M#'
  352.   fi
  353.   AC_SUBST(MAINT)dnl
  354. ]
  355. )
  356.  
  357. # Define a conditional.
  358.  
  359. AC_DEFUN(AM_CONDITIONAL,
  360. [AC_SUBST($1_TRUE)
  361. AC_SUBST($1_FALSE)
  362. if $2; then
  363.   $1_TRUE=
  364.   $1_FALSE='#'
  365. else
  366.   $1_TRUE='#'
  367.   $1_FALSE=
  368. fi])
  369.  
  370.  
  371. # serial 1
  372.  
  373. # @defmac AC_PROG_CC_STDC
  374. # @maindex PROG_CC_STDC
  375. # @ovindex CC
  376. # If the C compiler in not in ANSI C mode by default, try to add an option
  377. # to output variable @code{CC} to make it so.  This macro tries various
  378. # options that select ANSI C on some system or another.  It considers the
  379. # compiler to be in ANSI C mode if it defines @code{__STDC__} to 1 and
  380. # handles function prototypes correctly.
  381. #
  382. # If you use this macro, you should check after calling it whether the C
  383. # compiler has been set to accept ANSI C; if not, the shell variable
  384. # @code{am_cv_prog_cc_stdc} is set to @samp{no}.  If you wrote your source
  385. # code in ANSI C, you can make an un-ANSIfied copy of it by using the
  386. # program @code{ansi2knr}, which comes with Ghostscript.
  387. # @end defmac
  388.  
  389. AC_DEFUN(AM_PROG_CC_STDC,
  390. [AC_REQUIRE([AC_PROG_CC])
  391. AC_BEFORE([$0], [AC_C_INLINE])
  392. AC_BEFORE([$0], [AC_C_CONST])
  393. AC_MSG_CHECKING(for ${CC-cc} option to accept ANSI C)
  394. AC_CACHE_VAL(am_cv_prog_cc_stdc,
  395. [am_cv_prog_cc_stdc=no
  396. ac_save_CC="$CC"
  397. # Don't try gcc -ansi; that turns off useful extensions and
  398. # breaks some systems' header files.
  399. # AIX            -qlanglvl=ansi
  400. # Ultrix and OSF/1    -std1
  401. # HP-UX            -Aa -D_HPUX_SOURCE
  402. # SVR4            -Xc -D__EXTENSIONS__
  403. for ac_arg in "" -qlanglvl=ansi -std1 "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
  404. do
  405.   CC="$ac_save_CC $ac_arg"
  406.   AC_TRY_COMPILE(
  407. [#if !defined(__STDC__) || __STDC__ != 1
  408. choke me
  409. #endif
  410. /* DYNIX/ptx V4.1.3 can't compile sys/stat.h with -Xc -D__EXTENSIONS__. */
  411. #ifdef _SEQUENT_
  412. # include <sys/types.h>
  413. # include <sys/stat.h>
  414. #endif
  415. ], [
  416. int test (int i, double x);
  417. struct s1 {int (*f) (int a);};
  418. struct s2 {int (*f) (double a);};],
  419. [am_cv_prog_cc_stdc="$ac_arg"; break])
  420. done
  421. CC="$ac_save_CC"
  422. ])
  423. if test -z "$am_cv_prog_cc_stdc"; then
  424.   AC_MSG_RESULT([none needed])
  425. else
  426.   AC_MSG_RESULT($am_cv_prog_cc_stdc)
  427. fi
  428. case "x$am_cv_prog_cc_stdc" in
  429.   x|xno) ;;
  430.   *) CC="$CC $am_cv_prog_cc_stdc" ;;
  431. esac
  432. ])
  433.  
  434.  
  435. # serial 9 AM_PROG_LIBTOOL
  436. AC_DEFUN(AM_PROG_LIBTOOL,
  437. [AC_REQUIRE([AC_CANONICAL_HOST])
  438. AC_REQUIRE([AC_PROG_CC])
  439. AC_REQUIRE([AC_PROG_RANLIB])
  440. AC_REQUIRE([AM_PROG_LD])
  441. AC_REQUIRE([AC_PROG_LN_S])
  442.  
  443. # Always use our own libtool.
  444. LIBTOOL='$(top_builddir)/libtool'
  445. AC_SUBST(LIBTOOL)
  446.  
  447. dnl Allow the --disable-shared flag to stop us from building shared libs.
  448. AC_ARG_ENABLE(shared,
  449. [  --enable-shared         build shared libraries [default=yes]],
  450. test "$enableval" = no && libtool_shared=" --disable-shared",
  451. libtool_shared=)
  452.  
  453. dnl Allow the --disable-static flag to stop us from building static libs.
  454. AC_ARG_ENABLE(static,
  455. [  --enable-static         build static libraries [default=yes]],
  456. test "$enableval" = no && libtool_static=" --disable-static",
  457. libtool_static=)
  458.  
  459. libtool_flags="$libtool_shared$libtool_static"
  460. test "$silent" = yes && libtool_flags="$libtool_flags --silent"
  461. test "$ac_cv_prog_gcc" = yes && libtool_flags="$libtool_flags --with-gcc"
  462. test "$ac_cv_prog_gnu_ld" = yes && libtool_flags="$libtool_flags --with-gnu-ld"
  463.  
  464. # Some flags need to be propagated to the compiler or linker for good
  465. # libtool support.
  466. [case "$host" in
  467. *-*-irix6*)
  468.   for f in '-32' '-64' '-cckr' '-n32' '-mips1' '-mips2' '-mips3' '-mips4'; do
  469.     if echo " $CC $CFLAGS " | egrep -e "[     ]$f[     ]" > /dev/null; then
  470.       LD="${LD-ld} $f"
  471.     fi
  472.   done
  473.   ;;
  474.  
  475. *-*-sco3.2v5*)
  476.   # On SCO OpenServer 5, we need -belf to get full-featured binaries.
  477.   CFLAGS="$CFLAGS -belf"
  478.   ;;
  479. esac]
  480.  
  481. # Actually configure libtool.  ac_aux_dir is where install-sh is found.
  482. CC="$CC" CFLAGS="$CFLAGS" CPPFLAGS="$CPPFLAGS" \
  483. LD="$LD" RANLIB="$RANLIB" LN_S="$LN_S" \
  484. ${CONFIG_SHELL-/bin/sh} $ac_aux_dir/ltconfig \
  485. $libtool_flags --no-verify $ac_aux_dir/ltmain.sh $host \
  486. || AC_MSG_ERROR([libtool configure failed])
  487. ])
  488.  
  489. # AM_PROG_LD - find the path to the GNU or non-GNU linker
  490. AC_DEFUN(AM_PROG_LD,
  491. [AC_ARG_WITH(gnu-ld,
  492. [  --with-gnu-ld           assume the C compiler uses GNU ld [default=no]],
  493. test "$withval" = no || with_gnu_ld=yes, with_gnu_ld=no)
  494. if test "$with_gnu_ld" = yes; then
  495.   AC_MSG_CHECKING([for GNU ld])
  496. else
  497.   AC_MSG_CHECKING([for non-GNU ld])
  498. fi
  499. AC_CACHE_VAL(ac_cv_path_LD,
  500. [case "$LD" in
  501.   /*)
  502.   ac_cv_path_LD="$LD" # Let the user override the test with a path.
  503.   ;;
  504.   *)
  505.   IFS="${IFS=     }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
  506.   for ac_dir in $PATH; do
  507.     test -z "$ac_dir" && ac_dir=.
  508.     if test -f "$ac_dir/ld"; then
  509.       ac_cv_path_LD="$ac_dir/ld"
  510.       # Check to see if the program is GNU ld.  I'd rather use --version,
  511.       # but apparently some GNU ld's only accept -v.
  512.       # Break only if it was the GNU/non-GNU ld that we prefer.
  513.       if "$ac_cv_path_LD" -v 2>&1 < /dev/null | egrep '(GNU ld|with BFD)' > /dev/null; then
  514.     test "$with_gnu_ld" = yes && break
  515.       else
  516.         test "$with_gnu_ld" != yes && break
  517.       fi
  518.     fi
  519.   done
  520.   IFS="$ac_save_ifs"
  521.   ;;
  522. esac])
  523. LD="$ac_cv_path_LD"
  524. if test -n "$LD"; then
  525.   AC_MSG_RESULT($LD)
  526. else
  527.   AC_MSG_RESULT(no)
  528. fi
  529. test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
  530. AC_SUBST(LD)
  531. AM_PROG_LD_GNU
  532. ])
  533.  
  534. AC_DEFUN(AM_PROG_LD_GNU,
  535. [AC_CACHE_CHECK([whether we are using GNU ld], ac_cv_prog_gnu_ld,
  536. [# I'd rather use --version here, but apparently some GNU ld's only accept -v.
  537. if $LD -v 2>&1 </dev/null | egrep '(GNU ld|with BFD)' > /dev/null; then
  538.   ac_cv_prog_gnu_ld=yes
  539. else
  540.   ac_cv_prog_gnu_ld=no
  541. fi])
  542. ])
  543.  
  544.