X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=config%2Facx.m4;h=87c1b5e29322142b35e791d1e3ad4495ecf6ef53;hb=126b2985ce48d879c9d829b2245e4f00d05a6a74;hp=826f6ba3ccc9588e0550b3c31748bf2ba2acc54e;hpb=9b134994af00aa5ea49f4af20b3f35f2d935c2a8;p=external%2Fbinutils.git diff --git a/config/acx.m4 b/config/acx.m4 index 826f6ba..87c1b5e 100644 --- a/config/acx.m4 +++ b/config/acx.m4 @@ -123,6 +123,20 @@ test -n "$target_alias" && ncn_target_tool_prefix=$target_alias- AC_DEFUN([NCN_STRICT_CHECK_TOOLS], [AC_REQUIRE([_NCN_TOOL_PREFIXES]) []dnl +AC_ARG_VAR([$1], [$1 for the host]) + +if test -n "[$]$1"; then + ac_cv_prog_$1=[$]$1 +elif test -n "$ac_cv_prog_$1"; then + $1=$ac_cv_prog_$1 +fi + +if test -n "$ac_cv_prog_$1"; then + for ncn_progname in $2; do + AC_CHECK_PROG([$1], [${ncn_progname}], [${ncn_progname}], , [$4]) + done +fi + for ncn_progname in $2; do if test -n "$ncn_tool_prefix"; then AC_CHECK_PROG([$1], [${ncn_tool_prefix}${ncn_progname}], @@ -150,7 +164,21 @@ fi AC_DEFUN([NCN_STRICT_CHECK_TARGET_TOOLS], [AC_REQUIRE([_NCN_TOOL_PREFIXES]) []dnl -if test -n "$with_build_time_tools"; then +AC_ARG_VAR([$1], patsubst([$1], [_FOR_TARGET$], [])[ for the target]) + +if test -n "[$]$1"; then + ac_cv_prog_$1=[$]$1 +elif test -n "$ac_cv_prog_$1"; then + $1=$ac_cv_prog_$1 +fi + +if test -n "$ac_cv_prog_$1"; then + for ncn_progname in $2; do + AC_CHECK_PROG([$1], [${ncn_progname}], [${ncn_progname}], , [$4]) + done +fi + +if test -z "$ac_cv_prog_$1" && test -n "$with_build_time_tools"; then for ncn_progname in $2; do AC_MSG_CHECKING([for ${ncn_progname} in $with_build_time_tools]) if test -x $with_build_time_tools/${ncn_progname}; then @@ -183,6 +211,8 @@ if test -z "$ac_cv_prog_$1" ; then else $1="${ncn_target_tool_prefix}[$]2" fi], [$1="$3"]) +else + $1="$ac_cv_prog_$1" fi ]) []dnl # NCN_STRICT_CHECK_TARGET_TOOLS @@ -205,8 +235,28 @@ fi ]) +dnl #### +dnl # GCC_BASE_VER +dnl # Determine GCC version number to use in compiler directories. + +AC_DEFUN([GCC_BASE_VER], +[ + get_gcc_base_ver="cat" + AC_ARG_WITH(gcc-major-version-only, + [AS_HELP_STRING([--with-gcc-major-version-only], [use only GCC major number in filesystem paths])], + [if test x$with_gcc_major_version_only = xyes ; then + changequote(,)dnl + get_gcc_base_ver="sed -e 's/^\([0-9]*\).*/\1/'" + changequote([,])dnl + fi + ]) + AC_SUBST(get_gcc_base_ver) +]) + + AC_DEFUN([ACX_TOOL_DIRS], [ AC_REQUIRE([ACX_PATH_SEP]) +AC_REQUIRE([GCC_BASE_VER]) if test "x$exec_prefix" = xNONE; then if test "x$prefix" = xNONE; then gcc_cv_tool_prefix=$ac_default_prefix @@ -221,7 +271,13 @@ fi # case, if there is no compiler in the tree nobody should use # AS_FOR_TARGET and LD_FOR_TARGET. if test x$host = x$build && test -f $srcdir/gcc/BASE-VER; then - gcc_version=`cat $srcdir/gcc/BASE-VER` + if test x$with_gcc_major_version_only = xyes ; then + changequote(,)dnl + gcc_version=`sed -e 's/^\([0-9]*\).*$/\1/' $srcdir/gcc/BASE-VER` + changequote([,])dnl + else + gcc_version=`cat $srcdir/gcc/BASE-VER` + fi gcc_cv_tool_dirs="$gcc_cv_tool_prefix/libexec/gcc/$target_noncanonical/$gcc_version$PATH_SEPARATOR" gcc_cv_tool_dirs="$gcc_cv_tool_dirs$gcc_cv_tool_prefix/libexec/gcc/$target_noncanonical$PATH_SEPARATOR" gcc_cv_tool_dirs="$gcc_cv_tool_dirs/usr/lib/gcc/$target_noncanonical/$gcc_version$PATH_SEPARATOR" @@ -296,11 +352,11 @@ if test -z "$ac_cv_path_$1" ; then fi elif test $build != $host && test $have_gcc_for_target = yes; then $1=`$GCC_FOR_TARGET --print-prog-name=$2` - test [$]$1=$2 && $1= - ac_cv_path_$1=[$]$1 + test [$]$1 = $2 && $1= + test -n "[$]$1" && ac_cv_path_$1=[$]$1 fi fi -if test -z "$ac_cv_path_$1" ; then +if test -z "$ac_cv_path_$1" && test -n "$gcc_cv_tool_dirs"; then AC_PATH_PROG([$1], [$2], [], [$gcc_cv_tool_dirs]) fi if test -z "$ac_cv_path_$1" ; then @@ -326,15 +382,17 @@ m4_define([AC_CHECK_HEADER],m4_defn([_AC_CHECK_HEADER_OLD])) ac_c_preproc_warn_flag=yes])# AC_PROG_CPP_WERROR # Test for GNAT. -# We require the gnatbind program, and a compiler driver that -# understands Ada. We use the user's CC setting, already found. +# We require the gnatbind & gnatmake programs, as well as a compiler driver +# that understands Ada. We use the user's CC setting, already found, and +# possibly add $1 to the command-line parameters. # # Sets the shell variable have_gnat to yes or no as appropriate, and -# substitutes GNATBIND. +# substitutes GNATBIND and GNATMAKE. AC_DEFUN([ACX_PROG_GNAT], [AC_REQUIRE([AC_CHECK_TOOL_PREFIX]) AC_REQUIRE([AC_PROG_CC]) AC_CHECK_TOOL(GNATBIND, gnatbind, no) +AC_CHECK_TOOL(GNATMAKE, gnatmake, no) AC_CACHE_CHECK([whether compiler driver understands Ada], acx_cv_cc_gcc_supports_ada, [cat >conftest.adb <&1 || echo failure` +errors=`(${CC} $1[]m4_ifval([$1], [ ])-c conftest.adb) 2>&1 || echo failure` if test x"$errors" = x && test -f conftest.$ac_objext; then acx_cv_cc_gcc_supports_ada=yes fi rm -f conftest.*]) -if test x$GNATBIND != xno && test x$acx_cv_cc_gcc_supports_ada != xno; then +if test "x$GNATBIND" != xno && test "x$GNATMAKE" != xno && test x$acx_cv_cc_gcc_supports_ada != xno; then have_gnat=yes else have_gnat=no @@ -372,7 +430,7 @@ AC_DEFUN([ACX_PROG_CMP_IGNORE_INITIAL], [AC_CACHE_CHECK([how to compare bootstrapped objects], gcc_cv_prog_cmp_skip, [ echo abfoo >t1 echo cdfoo >t2 - gcc_cv_prog_cmp_skip='tail +16c $$f1 > tmp-foo1; tail +16c $$f2 > tmp-foo2; cmp tmp-foo1 tmp-foo2' + gcc_cv_prog_cmp_skip='tail -c +17 $$f1 > tmp-foo1; tail -c +17 $$f2 > tmp-foo2; cmp tmp-foo1 tmp-foo2' if cmp t1 t2 2 2 > /dev/null 2>&1; then if cmp t1 t2 1 1 > /dev/null 2>&1; then : @@ -456,7 +514,8 @@ AC_DEFUN([GCC_TARGET_TOOL], if test "x${build}" != "x${host}" ; then if expr "x[$]$2" : "x/" > /dev/null; then # We already found the complete path - AC_MSG_RESULT(pre-installed in `dirname [$]$2`) + ac_dir=`dirname [$]$2` + AC_MSG_RESULT(pre-installed in $ac_dir) else # Canadian cross, just use what we found AC_MSG_RESULT(pre-installed) @@ -479,7 +538,8 @@ else AC_MSG_RESULT(just compiled) el])if expr "x[$]$2" : "x/" > /dev/null; then # We already found the complete path - AC_MSG_RESULT(pre-installed in `dirname [$]$2`) + ac_dir=`dirname [$]$2` + AC_MSG_RESULT(pre-installed in $ac_dir) elif test "x$target" = "x$host"; then # We can use an host tool $2='$($3)' @@ -490,3 +550,98 @@ else fi fi AC_SUBST($2)]) + + +dnl Locate a program and check that its version is acceptable. +dnl ACX_PROG_CHECK_VER(var, name, version-switch, +dnl version-extract-regexp, version-glob) +AC_DEFUN([ACX_CHECK_PROG_VER],[ + AC_CHECK_PROG([$1], [$2], [$2]) + if test -n "[$]$1"; then + # Found it, now check the version. + AC_CACHE_CHECK([for modern $2], + [gcc_cv_prog_$2_modern], + [ac_prog_version=`eval [$]$1 $3 2>&1 | + sed -n 's/^.*patsubst([[$4]],/,\/).*$/\1/p'` + + [case $ac_prog_version in + '') gcc_cv_prog_$2_modern=no;; + $5) gcc_cv_prog_$2_modern=yes;; + *) gcc_cv_prog_$2_modern=no;; + esac] + ]) + else + gcc_cv_prog_$2_modern=no + fi + if test $gcc_cv_prog_$2_modern = no; then + $1="${CONFIG_SHELL-/bin/sh} $ac_aux_dir/missing $2" + fi +]) + +dnl Support the --with-pkgversion configure option. +dnl ACX_PKGVERSION(default-pkgversion) +AC_DEFUN([ACX_PKGVERSION],[ + AC_ARG_WITH(pkgversion, + AS_HELP_STRING([--with-pkgversion=PKG], + [Use PKG in the version string in place of "$1"]), + [case "$withval" in + yes) AC_MSG_ERROR([package version not specified]) ;; + no) PKGVERSION= ;; + *) PKGVERSION="($withval) " ;; + esac], + PKGVERSION="($1) " + ) + AC_SUBST(PKGVERSION) +]) + +dnl Support the --with-bugurl configure option. +dnl ACX_BUGURL(default-bugurl) +AC_DEFUN([ACX_BUGURL],[ + AC_ARG_WITH(bugurl, + AS_HELP_STRING([--with-bugurl=URL], + [Direct users to URL to report a bug]), + [case "$withval" in + yes) AC_MSG_ERROR([bug URL not specified]) ;; + no) BUGURL= + ;; + *) BUGURL="$withval" + ;; + esac], + BUGURL="$1" + ) + case ${BUGURL} in + "") + REPORT_BUGS_TO= + REPORT_BUGS_TEXI= + ;; + *) + REPORT_BUGS_TO="<$BUGURL>" + REPORT_BUGS_TEXI=@uref{`echo "$BUGURL" | sed 's/@/@@/g'`} + ;; + esac; + AC_SUBST(REPORT_BUGS_TO) + AC_SUBST(REPORT_BUGS_TEXI) +]) + +dnl #### +dnl # ACX_CHECK_CYGWIN_CAT_WORKS +dnl # On Cygwin hosts, check that the cat command ignores +dnl # carriage returns as otherwise builds will not work. +dnl # See binutils PR 4334 for more details. +AC_DEFUN([ACX_CHECK_CYGWIN_CAT_WORKS],[ +AC_MSG_CHECKING([to see if cat works as expected]) +echo a >cygwin-cat-check +if test `cat cygwin-cat-check` = a ; then + rm cygwin-cat-check + AC_MSG_RESULT(yes) +else + rm cygwin-cat-check + AC_MSG_RESULT(no) + AC_MSG_ERROR([The cat command does not ignore carriage return characters. + Please either mount the build directory in binary mode or run the following + commands before running any configure script: +set -o igncr +export SHELLOPTS + ]) +fi +])