OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-old/] [gcc-4.2.2/] [config/] [acx.m4] - Blame information for rev 862

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 38 julius
# Autoconf M4 include file defining utility macros for complex Canadian
2
# cross builds.
3
 
4
dnl ####
5
dnl # _GCC_TOPLEV_NONCANONICAL_BUILD
6
dnl # $build_alias or canonical $build if blank.
7
dnl # Used when we would use $build_alias, but empty is not OK.
8
AC_DEFUN([_GCC_TOPLEV_NONCANONICAL_BUILD],
9
[AC_REQUIRE([AC_CANONICAL_BUILD]) []dnl
10
case ${build_alias} in
11
  "") build_noncanonical=${build} ;;
12
  *) build_noncanonical=${build_alias} ;;
13
esac
14
]) []dnl # _GCC_TOPLEV_NONCANONICAL_BUILD
15
 
16
dnl ####
17
dnl # _GCC_TOPLEV_NONCANONICAL_HOST
18
dnl # $host_alias, or $build_noncanonical if blank.
19
dnl # Used when we would use $host_alias, but empty is not OK.
20
AC_DEFUN([_GCC_TOPLEV_NONCANONICAL_HOST],
21
[AC_REQUIRE([_GCC_TOPLEV_NONCANONICAL_BUILD]) []dnl
22
case ${host_alias} in
23
  "") host_noncanonical=${build_noncanonical} ;;
24
  *) host_noncanonical=${host_alias} ;;
25
esac
26
]) []dnl # _GCC_TOPLEV_NONCANONICAL_HOST
27
 
28
dnl ####
29
dnl # _GCC_TOPLEV_NONCANONICAL_TARGET
30
dnl # $target_alias or $host_noncanonical if blank.
31
dnl # Used when we would use $target_alias, but empty is not OK.
32
AC_DEFUN([_GCC_TOPLEV_NONCANONICAL_TARGET],
33
[AC_REQUIRE([_GCC_TOPLEV_NONCANONICAL_HOST]) []dnl
34
case ${target_alias} in
35
  "") target_noncanonical=${host_noncanonical} ;;
36
  *) target_noncanonical=${target_alias} ;;
37
esac
38
]) []dnl # _GCC_TOPLEV_NONCANONICAL_TARGET
39
 
40
dnl ####
41
dnl # ACX_NONCANONICAL_BUILD
42
dnl # Like underscored version, but AC_SUBST's.
43
AC_DEFUN([ACX_NONCANONICAL_BUILD],
44
[AC_REQUIRE([_GCC_TOPLEV_NONCANONICAL_BUILD]) []dnl
45
AC_SUBST(build_noncanonical)
46
]) []dnl # ACX_NONCANONICAL_BUILD
47
 
48
dnl ####
49
dnl # ACX_NONCANONICAL_HOST
50
dnl # Like underscored version, but AC_SUBST's.
51
AC_DEFUN([ACX_NONCANONICAL_HOST],
52
[AC_REQUIRE([_GCC_TOPLEV_NONCANONICAL_HOST]) []dnl
53
AC_SUBST(host_noncanonical)
54
]) []dnl # ACX_NONCANONICAL_HOST
55
 
56
dnl ####
57
dnl # ACX_NONCANONICAL_TARGET
58
dnl # Like underscored version, but AC_SUBST's.
59
AC_DEFUN([ACX_NONCANONICAL_TARGET],
60
[AC_REQUIRE([_GCC_TOPLEV_NONCANONICAL_TARGET]) []dnl
61
AC_SUBST(target_noncanonical)
62
]) []dnl # ACX_NONCANONICAL_TARGET
63
 
64
dnl ####
65
dnl # GCC_TOPLEV_SUBDIRS
66
dnl # GCC & friends build 'build', 'host', and 'target' tools.  These must
67
dnl # be separated into three well-known subdirectories of the build directory:
68
dnl # build_subdir, host_subdir, and target_subdir.  The values are determined
69
dnl # here so that they can (theoretically) be changed in the future.  They
70
dnl # were previously reproduced across many different files.
71
dnl #
72
dnl # This logic really amounts to very little with autoconf 2.13; it will
73
dnl # amount to a lot more with autoconf 2.5x.
74
AC_DEFUN([GCC_TOPLEV_SUBDIRS],
75
[AC_REQUIRE([_GCC_TOPLEV_NONCANONICAL_TARGET]) []dnl
76
AC_REQUIRE([_GCC_TOPLEV_NONCANONICAL_BUILD]) []dnl
77
 
78
# post-stage1 host modules use a different CC_FOR_BUILD so, in order to
79
# have matching libraries, they should use host libraries: Makefile.tpl
80
# arranges to pass --with-build-libsubdir=$(HOST_SUBDIR).
81
# However, they still use the build modules, because the corresponding
82
# host modules (e.g. bison) are only built for the host when bootstrap
83
# finishes. So:
84
# - build_subdir is where we find build modules, and never changes.
85
# - build_libsubdir is where we find build libraries, and can be overridden.
86
 
87
# Prefix 'build-' so this never conflicts with target_subdir.
88
build_subdir="build-${build_noncanonical}"
89
AC_ARG_WITH(build-libsubdir,
90
[  --with-build-libsubdir=[DIR]  Directory where to find libraries for build system],
91
build_libsubdir="$withval",
92
build_libsubdir="$build_subdir")
93
# --srcdir=. covers the toplevel, while "test -d" covers the subdirectories
94
if ( test $srcdir = . && test -d gcc ) \
95
   || test -d $srcdir/../host-${host_noncanonical}; then
96
  host_subdir="host-${host_noncanonical}"
97
else
98
  host_subdir=.
99
fi
100
# No prefix.
101
target_subdir=${target_noncanonical}
102
AC_SUBST([build_libsubdir]) []dnl
103
AC_SUBST([build_subdir]) []dnl
104
AC_SUBST([host_subdir]) []dnl
105
AC_SUBST([target_subdir]) []dnl
106
]) []dnl # GCC_TOPLEV_SUBDIRS
107
 
108
 
109
####
110
# _NCN_TOOL_PREFIXES:  Some stuff that oughtta be done in AC_CANONICAL_SYSTEM
111
# or AC_INIT.
112
# These demand that AC_CANONICAL_SYSTEM be called beforehand.
113
AC_DEFUN([_NCN_TOOL_PREFIXES],
114
[ncn_tool_prefix=
115
test -n "$host_alias" && ncn_tool_prefix=$host_alias-
116
ncn_target_tool_prefix=
117
test -n "$target_alias" && ncn_target_tool_prefix=$target_alias-
118
]) []dnl # _NCN_TOOL_PREFIXES
119
 
120
####
121
# NCN_STRICT_CHECK_TOOLS(variable, progs-to-check-for,[value-if-not-found],[path])
122
# Like plain AC_CHECK_TOOLS, but require prefix if build!=host.
123
 
124
AC_DEFUN([NCN_STRICT_CHECK_TOOLS],
125
[AC_REQUIRE([_NCN_TOOL_PREFIXES]) []dnl
126
for ncn_progname in $2; do
127
  if test -n "$ncn_tool_prefix"; then
128
    AC_CHECK_PROG([$1], [${ncn_tool_prefix}${ncn_progname}],
129
                  [${ncn_tool_prefix}${ncn_progname}], , [$4])
130
  fi
131
  if test -z "$ac_cv_prog_$1" && test $build = $host ; then
132
    AC_CHECK_PROG([$1], [${ncn_progname}], [${ncn_progname}], , [$4])
133
  fi
134
  test -n "$ac_cv_prog_$1" && break
135
done
136
 
137
if test -z "$ac_cv_prog_$1" ; then
138
  ifelse([$3],[], [set dummy $2
139
  if test $build = $host ; then
140
    $1="[$]2"
141
  else
142
    $1="${ncn_tool_prefix}[$]2"
143
  fi], [$1="$3"])
144
fi
145
]) []dnl # NCN_STRICT_CHECK_TOOLS
146
 
147
####
148
# NCN_STRICT_CHECK_TARGET_TOOLS(variable, progs-to-check-for,[value-if-not-found],[path])
149
# Like CVS Autoconf AC_CHECK_TARGET_TOOLS, but require prefix if build!=target.
150
 
151
AC_DEFUN([NCN_STRICT_CHECK_TARGET_TOOLS],
152
[AC_REQUIRE([_NCN_TOOL_PREFIXES]) []dnl
153
if test -n "$with_build_time_tools"; then
154
  for ncn_progname in $2; do
155
    AC_MSG_CHECKING([for ${ncn_progname} in $with_build_time_tools])
156
    if test -x $with_build_time_tools/${ncn_progname}; then
157
      ac_cv_prog_$1=$with_build_time_tools/${ncn_progname}
158
      AC_MSG_RESULT(yes)
159
      break
160
    else
161
      AC_MSG_RESULT(no)
162
    fi
163
  done
164
fi
165
 
166
if test -z "$ac_cv_prog_$1"; then
167
  for ncn_progname in $2; do
168
    if test -n "$ncn_target_tool_prefix"; then
169
      AC_CHECK_PROG([$1], [${ncn_target_tool_prefix}${ncn_progname}],
170
                    [${ncn_target_tool_prefix}${ncn_progname}], , [$4])
171
    fi
172
    if test -z "$ac_cv_prog_$1" && test $build = $target ; then
173
      AC_CHECK_PROG([$1], [${ncn_progname}], [${ncn_progname}], , [$4])
174
    fi
175
    test -n "$ac_cv_prog_$1" && break
176
  done
177
fi
178
 
179
if test -z "$ac_cv_prog_$1" ; then
180
  ifelse([$3],[], [set dummy $2
181
  if test $build = $target ; then
182
    $1="[$]2"
183
  else
184
    $1="${ncn_target_tool_prefix}[$]2"
185
  fi], [$1="$3"])
186
else
187
  $1="$ac_cv_prog_$1"
188
fi
189
]) []dnl # NCN_STRICT_CHECK_TARGET_TOOLS
190
 
191
 
192
# Backported from Autoconf 2.5x; can go away when and if
193
# we switch.  Put the OS path separator in $PATH_SEPARATOR.
194
AC_DEFUN([ACX_PATH_SEP], [
195
# The user is always right.
196
if test "${PATH_SEPARATOR+set}" != set; then
197
  echo "#! /bin/sh" >conf$$.sh
198
  echo  "exit 0"   >>conf$$.sh
199
  chmod +x conf$$.sh
200
  if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then
201
    PATH_SEPARATOR=';'
202
  else
203
    PATH_SEPARATOR=:
204
  fi
205
  rm -f conf$$.sh
206
fi
207
])
208
 
209
 
210
AC_DEFUN([ACX_TOOL_DIRS], [
211
AC_REQUIRE([ACX_PATH_SEP])
212
if test "x$exec_prefix" = xNONE; then
213
        if test "x$prefix" = xNONE; then
214
                gcc_cv_tool_prefix=$ac_default_prefix
215
        else
216
                gcc_cv_tool_prefix=$prefix
217
        fi
218
else
219
        gcc_cv_tool_prefix=$exec_prefix
220
fi
221
 
222
# If there is no compiler in the tree, use the PATH only.  In any
223
# case, if there is no compiler in the tree nobody should use
224
# AS_FOR_TARGET and LD_FOR_TARGET.
225
if test x$host = x$build && test -f $srcdir/gcc/BASE-VER; then
226
    gcc_version=`cat $srcdir/gcc/BASE-VER`
227
    gcc_cv_tool_dirs="$gcc_cv_tool_prefix/libexec/gcc/$target_noncanonical/$gcc_version$PATH_SEPARATOR"
228
    gcc_cv_tool_dirs="$gcc_cv_tool_dirs$gcc_cv_tool_prefix/libexec/gcc/$target_noncanonical$PATH_SEPARATOR"
229
    gcc_cv_tool_dirs="$gcc_cv_tool_dirs/usr/lib/gcc/$target_noncanonical/$gcc_version$PATH_SEPARATOR"
230
    gcc_cv_tool_dirs="$gcc_cv_tool_dirs/usr/lib/gcc/$target_noncanonical$PATH_SEPARATOR"
231
    gcc_cv_tool_dirs="$gcc_cv_tool_dirs$gcc_cv_tool_prefix/$target_noncanonical/bin/$target_noncanonical/$gcc_version$PATH_SEPARATOR"
232
    gcc_cv_tool_dirs="$gcc_cv_tool_dirs$gcc_cv_tool_prefix/$target_noncanonical/bin$PATH_SEPARATOR"
233
else
234
    gcc_cv_tool_dirs=
235
fi
236
 
237
if test x$build = x$target && test -n "$md_exec_prefix"; then
238
        gcc_cv_tool_dirs="$gcc_cv_tool_dirs$md_exec_prefix$PATH_SEPARATOR"
239
fi
240
 
241
]) []dnl # ACX_TOOL_DIRS
242
 
243
# ACX_HAVE_GCC_FOR_TARGET
244
# Check if the variable GCC_FOR_TARGET really points to a GCC binary.
245
AC_DEFUN([ACX_HAVE_GCC_FOR_TARGET], [
246
cat > conftest.c << \EOF
247
#ifdef __GNUC__
248
  gcc_yay;
249
#endif
250
EOF
251
if ($GCC_FOR_TARGET -E conftest.c | grep gcc_yay) > /dev/null 2>&1; then
252
  have_gcc_for_target=yes
253
else
254
  GCC_FOR_TARGET=${ncn_target_tool_prefix}gcc
255
  have_gcc_for_target=no
256
fi
257
rm conftest.c
258
])
259
 
260
# ACX_CHECK_INSTALLED_TARGET_TOOL(VAR, PROG)
261
# Searching for installed target binutils.  We need to take extra care,
262
# else we may find the wrong assembler, linker, etc., and lose.
263
#
264
# First try --with-build-time-tools, if specified.
265
#
266
# For build != host, we ask the installed GCC for the name of the tool it
267
# uses, and accept it if it is an absolute path.  This is because the
268
# only good choice for a compiler is the same GCC version that is being
269
# installed (or we couldn't make target libraries), and we assume that
270
# on the host system we'll have not only the same GCC version, but also
271
# the same binutils version.
272
#
273
# For build == host, search the same directories that the installed
274
# compiler will search.  We used to do this for the assembler, linker,
275
# and nm only; for simplicity of configuration, however, we extend this
276
# criterion to tools (such as ar and ranlib) that are never invoked by
277
# the compiler, to avoid mismatches.
278
#
279
# Also note we have to check MD_EXEC_PREFIX before checking the user's path
280
# if build == target.  This makes the most sense only when bootstrapping,
281
# but we also do so when build != host.  In this case, we hope that the
282
# build and host systems will have similar contents of MD_EXEC_PREFIX.
283
#
284
# If we do not find a suitable binary, then try the user's path.
285
 
286
AC_DEFUN([ACX_CHECK_INSTALLED_TARGET_TOOL], [
287
AC_REQUIRE([ACX_TOOL_DIRS])
288
AC_REQUIRE([ACX_HAVE_GCC_FOR_TARGET])
289
if test -z "$ac_cv_path_$1" ; then
290
  if test -n "$with_build_time_tools"; then
291
    AC_MSG_CHECKING([for $2 in $with_build_time_tools])
292
    if test -x $with_build_time_tools/$2; then
293
      $1=`cd $with_build_time_tools && pwd`/$2
294
      ac_cv_path_$1=[$]$1
295
      AC_MSG_RESULT([$ac_cv_path_$1])
296
    else
297
      AC_MSG_RESULT(no)
298
    fi
299
  elif test $build != $host && test $have_gcc_for_target = yes; then
300
    $1=`$GCC_FOR_TARGET --print-prog-name=$2`
301
    test [$]$1=$2 && $1=
302
    test -n "[$]$1" && ac_cv_path_$1=[$]$1
303
  fi
304
fi
305
if test -z "$ac_cv_path_$1" ; then
306
  AC_PATH_PROG([$1], [$2], [], [$gcc_cv_tool_dirs])
307
fi
308
if test -z "$ac_cv_path_$1" ; then
309
  NCN_STRICT_CHECK_TARGET_TOOLS([$1], [$2])
310
else
311
  $1=$ac_cv_path_$1
312
fi
313
]) []dnl # ACX_CHECK_INSTALLED_TARGET_TOOL
314
 
315
###
316
# AC_PROG_CPP_WERROR
317
# Used for autoconf 2.5x to force AC_PREPROC_IFELSE to reject code which
318
# triggers warnings from the preprocessor.  Will be in autoconf 2.58.
319
# For now, using this also overrides header checks to use only the
320
# preprocessor (matches 2.13 behavior; matching 2.58's behavior is a
321
# bit harder from here).
322
# Eventually autoconf will default to checking headers with the compiler
323
# instead, and we'll have to do this differently.
324
 
325
AC_DEFUN([AC_PROG_CPP_WERROR],
326
[AC_REQUIRE([AC_PROG_CPP])dnl
327
m4_define([AC_CHECK_HEADER],m4_defn([_AC_CHECK_HEADER_OLD]))
328
ac_c_preproc_warn_flag=yes])# AC_PROG_CPP_WERROR
329
 
330
# Test for GNAT.
331
# We require the gnatbind program, and a compiler driver that
332
# understands Ada.  We use the user's CC setting, already found.
333
#
334
# Sets the shell variable have_gnat to yes or no as appropriate, and
335
# substitutes GNATBIND.
336
AC_DEFUN([ACX_PROG_GNAT],
337
[AC_REQUIRE([AC_CHECK_TOOL_PREFIX])
338
AC_REQUIRE([AC_PROG_CC])
339
AC_CHECK_TOOL(GNATBIND, gnatbind, no)
340
AC_CACHE_CHECK([whether compiler driver understands Ada],
341
                 acx_cv_cc_gcc_supports_ada,
342
[cat >conftest.adb <<EOF
343
procedure conftest is begin null; end conftest;
344
EOF
345
acx_cv_cc_gcc_supports_ada=no
346
# There is a bug in old released versions of GCC which causes the
347
# driver to exit successfully when the appropriate language module
348
# has not been installed.  This is fixed in 2.95.4, 3.0.2, and 3.1.
349
# Therefore we must check for the error message as well as an
350
# unsuccessful exit.
351
# Other compilers, like HP Tru64 UNIX cc, exit successfully when
352
# given a .adb file, but produce no object file.  So we must check
353
# if an object file was really produced to guard against this.
354
errors=`(${CC} -c conftest.adb) 2>&1 || echo failure`
355
if test x"$errors" = x && test -f conftest.$ac_objext; then
356
  acx_cv_cc_gcc_supports_ada=yes
357
fi
358
rm -f conftest.*])
359
 
360
if test x$GNATBIND != xno && test x$acx_cv_cc_gcc_supports_ada != xno; then
361
  have_gnat=yes
362
else
363
  have_gnat=no
364
fi
365
])
366
 
367
dnl 'make compare' can be significantly faster, if cmp itself can
368
dnl skip bytes instead of using tail.  The test being performed is
369
dnl "if cmp --ignore-initial=2 t1 t2 && ! cmp --ignore-initial=1 t1 t2"
370
dnl but we need to sink errors and handle broken shells.  We also test
371
dnl for the parameter format "cmp file1 file2 skip1 skip2" which is
372
dnl accepted by cmp on some systems.
373
AC_DEFUN([ACX_PROG_CMP_IGNORE_INITIAL],
374
[AC_CACHE_CHECK([how to compare bootstrapped objects], gcc_cv_prog_cmp_skip,
375
[ echo abfoo >t1
376
  echo cdfoo >t2
377
  gcc_cv_prog_cmp_skip='tail +16c $$f1 > tmp-foo1; tail +16c $$f2 > tmp-foo2; cmp tmp-foo1 tmp-foo2'
378
  if cmp t1 t2 2 2 > /dev/null 2>&1; then
379
    if cmp t1 t2 1 1 > /dev/null 2>&1; then
380
      :
381
    else
382
      gcc_cv_prog_cmp_skip='cmp $$f1 $$f2 16 16'
383
    fi
384
  fi
385
  if cmp --ignore-initial=2 t1 t2 > /dev/null 2>&1; then
386
    if cmp --ignore-initial=1 t1 t2 > /dev/null 2>&1; then
387
      :
388
    else
389
      gcc_cv_prog_cmp_skip='cmp --ignore-initial=16 $$f1 $$f2'
390
    fi
391
  fi
392
  rm t1 t2
393
])
394
do_compare="$gcc_cv_prog_cmp_skip"
395
AC_SUBST(do_compare)
396
])
397
 
398
dnl See whether we can include both string.h and strings.h.
399
AC_DEFUN([ACX_HEADER_STRING],
400
[AC_CACHE_CHECK([whether string.h and strings.h may both be included],
401
  gcc_cv_header_string,
402
[AC_TRY_COMPILE([#include <string.h>
403
#include <strings.h>], , gcc_cv_header_string=yes, gcc_cv_header_string=no)])
404
if test $gcc_cv_header_string = yes; then
405
  AC_DEFINE(STRING_WITH_STRINGS, 1, [Define if you can safely include both <string.h> and <strings.h>.])
406
fi
407
])
408
 
409
dnl See if stdbool.h properly defines bool and true/false.
410
dnl Check whether _Bool is built-in.
411
AC_DEFUN([ACX_HEADER_STDBOOL],
412
[AC_CACHE_CHECK([for working stdbool.h],
413
  ac_cv_header_stdbool_h,
414
[AC_TRY_COMPILE([#include <stdbool.h>],
415
[bool foo = false;],
416
ac_cv_header_stdbool_h=yes, ac_cv_header_stdbool_h=no)])
417
if test $ac_cv_header_stdbool_h = yes; then
418
  AC_DEFINE(HAVE_STDBOOL_H, 1,
419
  [Define if you have a working <stdbool.h> header file.])
420
fi
421
AC_CACHE_CHECK(for built-in _Bool, gcc_cv_c__bool,
422
[AC_TRY_COMPILE(,
423
[_Bool foo;],
424
gcc_cv_c__bool=yes, gcc_cv_c__bool=no)
425
])
426
if test $gcc_cv_c__bool = yes; then
427
  AC_DEFINE(HAVE__BOOL, 1, [Define if the \`_Bool' type is built-in.])
428
fi
429
])
430
 
431
dnl See if hard links work and if not, try to substitute $1 or simple copy.
432
AC_DEFUN([ACX_PROG_LN],
433
[AC_MSG_CHECKING(whether ln works)
434
AC_CACHE_VAL(acx_cv_prog_LN,
435
[rm -f conftestdata_t
436
echo >conftestdata_f
437
if ln conftestdata_f conftestdata_t 2>/dev/null
438
then
439
  acx_cv_prog_LN=ln
440
else
441
  acx_cv_prog_LN=no
442
fi
443
rm -f conftestdata_f conftestdata_t
444
])dnl
445
if test $acx_cv_prog_LN = no; then
446
  LN="ifelse([$1],,cp,[$1])"
447
  AC_MSG_RESULT([no, using $LN])
448
else
449
  LN="$acx_cv_prog_LN"
450
  AC_MSG_RESULT(yes)
451
fi
452
AC_SUBST(LN)dnl
453
])
454
 
455
dnl GCC_TARGET_TOOL(PROGRAM, TARGET-VAR, HOST-VAR, IN-TREE-TOOL, LANGUAGE)
456
AC_DEFUN([GCC_TARGET_TOOL],
457
[AC_MSG_CHECKING(where to find the target $1)
458
if test "x${build}" != "x${host}" ; then
459
  if expr "x[$]$2" : "x/" > /dev/null; then
460
    # We already found the complete path
461
    AC_MSG_RESULT(pre-installed in `dirname [$]$2`)
462
  else
463
    # Canadian cross, just use what we found
464
    AC_MSG_RESULT(pre-installed)
465
  fi
466
else
467
  ifelse([$4],,,
468
  [ok=yes
469
  case " ${configdirs} " in
470
    *" patsubst([$4], [/.*], []) "*) ;;
471
    *) ok=no ;;
472
  esac
473
  ifelse([$5],,,
474
  [case ,${enable_languages}, in
475
    *,$5,*) ;;
476
    *) ok=no ;;
477
  esac])
478
  if test $ok = yes; then
479
    # An in-tree tool is available and we can use it
480
    $2='$$r/$(HOST_SUBDIR)/$4'
481
    AC_MSG_RESULT(just compiled)
482
  el])if expr "x[$]$2" : "x/" > /dev/null; then
483
    # We already found the complete path
484
    AC_MSG_RESULT(pre-installed in `dirname [$]$2`)
485
  elif test "x$target" = "x$host"; then
486
    # We can use an host tool
487
    $2='$($3)'
488
    AC_MSG_RESULT(host tool)
489
  else
490
    # We need a cross tool
491
    AC_MSG_RESULT(pre-installed)
492
  fi
493
fi])
494
 
495
dnl Locate a program and check that its version is acceptable.
496
dnl dnl ACX_PROG_CHECK_VER(var, name, version-switch,
497
dnl dnl                    version-extract-regexp, version-glob)
498
AC_DEFUN([ACX_CHECK_PROG_VER],[
499
  AC_CHECK_PROG([$1], [$2], [$2])
500
  if test -n "[$]$1"; then
501
    # Found it, now check the version.
502
    AC_CACHE_CHECK([for modern $2],
503
                   [gcc_cv_prog_$2_modern],
504
                   [ac_prog_version=`eval [$]$1 $3 2>&1 |
505
                                     sed -n 's/^.*patsubst([[$4]],/,\/).*$/\1/p'`
506
 
507
                    [case $ac_prog_version in
508
                       '')  gcc_cv_prog_$2_modern=no;;
509
                       $5)  gcc_cv_prog_$2_modern=yes;;
510
                       *)   gcc_cv_prog_$2_modern=no;;
511
                     esac]
512
                                                                                                                                                                               if test $gcc_cv_prog_$2_modern = no; then
513
                      $1="${CONFIG_SHELL-/bin/sh} $ac_aux_dir/missing $2"
514
                    fi
515
                   ])
516
  else
517
    gcc_cv_prog_$2_modern=no
518
  fi
519
])
520
 

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.