OSDN Git Service

2005-06-28 Andrew Pinski <pinskia@physics.uc.edu>
[pf3gnuchains/gcc-fork.git] / gcc / aclocal.m4
index 38c10c8..8961f6c 100644 (file)
@@ -1,7 +1,5 @@
-m4_include([../config/accross.m4])
 m4_include([../config/acx.m4])
 m4_include([../config/gettext-sister.m4])
-m4_include([../config/gcc-lib-path.m4])
 m4_include([../config/iconv.m4])
 m4_include([../config/lcmessage.m4])
 m4_include([../config/lib-ld.m4])
@@ -126,7 +124,12 @@ else
   then
     gcc_cv_prog_LN_S=ln
   else
-    gcc_cv_prog_LN_S=cp
+    if cp -p conftestdata_f conftestdata_t 2>/dev/null
+    then
+      gcc_cv_prog_LN_S="cp -p"
+    else
+      gcc_cv_prog_LN_S=cp
+    fi
   fi
 fi
 rm -f conftestdata_f conftestdata_t
@@ -138,7 +141,7 @@ else
   if test "$gcc_cv_prog_LN_S" = "ln"; then
     AC_MSG_RESULT([no, using ln])
   else
-    AC_MSG_RESULT([no, and neither does ln, so using cp])
+    AC_MSG_RESULT([no, and neither does ln, so using $gcc_cv_prog_LN_S])
   fi
 fi
 AC_SUBST(LN_S)dnl
@@ -326,7 +329,8 @@ dnl Locate a program and check that its version is acceptable.
 dnl AC_PROG_CHECK_VER(var, name, version-switch,
 dnl                  version-extract-regexp, version-glob)
 AC_DEFUN([gcc_AC_CHECK_PROG_VER],
-[AC_CHECK_PROG([$1], [$2], [$2])
+[AC_REQUIRE([gcc_AC_BUILD_EXEEXT])
+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,
@@ -405,26 +409,19 @@ else
 fi
 fi])
 
-dnl Checking for long long.
-dnl By Caolan McNamara <caolan@skynet.ie>
-dnl Added check for __int64, Zack Weinberg <zackw@stanford.edu>
-dnl
-AC_DEFUN([gcc_AC_C_LONG_LONG],
-[AC_CACHE_CHECK(for long long int, ac_cv_c_long_long,
-  [AC_TRY_COMPILE(,[long long int i;],
-         ac_cv_c_long_long=yes,
-         ac_cv_c_long_long=no)])
-  if test $ac_cv_c_long_long = yes; then
-    AC_DEFINE(HAVE_LONG_LONG, 1,
-      [Define if your compiler supports the \`long long' type.])
-  fi
-AC_CACHE_CHECK(for __int64, ac_cv_c___int64,
-  [AC_TRY_COMPILE(,[__int64 i;],
-       ac_cv_c___int64=yes,
-       ac_cv_c___int64=no)])
-  if test $ac_cv_c___int64 = yes; then
-    AC_DEFINE(HAVE___INT64, 1,
-      [Define if your compiler supports the \`__int64' type.])
+dnl From Bruno Haible.
+
+AC_DEFUN([AM_LANGINFO_CODESET],
+[
+  AC_CACHE_CHECK([for nl_langinfo and CODESET], am_cv_langinfo_codeset,
+    [AC_TRY_LINK([#include <langinfo.h>],
+      [char* cs = nl_langinfo(CODESET);],
+      am_cv_langinfo_codeset=yes,
+      am_cv_langinfo_codeset=no)
+    ])
+  if test $am_cv_langinfo_codeset = yes; then
+    AC_DEFINE(HAVE_LANGINFO_CODESET, 1,
+      [Define if you have <langinfo.h> and nl_langinfo(CODESET).])
   fi
 ])
 
@@ -552,8 +549,8 @@ fi])])
 
 # You should have received a copy of the GNU General Public License
 # along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
-# 02111-1307, USA.
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+# 02110-1301, USA.
 
 AC_DEFUN([AM_PROG_CC_C_O],
 [AC_REQUIRE([AC_PROG_CC_C_O])dnl
@@ -588,8 +585,8 @@ fi
 
 # You should have received a copy of the GNU General Public License
 # along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
-# 02111-1307, USA.
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+# 02110-1301, USA.
 
 # For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets
 # $ac_aux_dir to `$srcdir/foo'.  In other projects, it is set to
@@ -635,3 +632,102 @@ AC_PREREQ([2.50])dnl
 # expand $ac_aux_dir to an absolute path
 am_aux_dir=`cd $ac_aux_dir && pwd`
 ])
+
+
+dnl GCC_TARGET_TEMPLATE(KEY)
+dnl ------------------------
+dnl Define KEY as a valid configure key on the target machine.
+
+m4_define([GCC_TARGET_TEMPLATE],
+[m4_define([GCC_TARGET_TEMPLATE($1)],[])])
+
+dnl AH_TEMPLATE(KEY, DESCRIPTION)
+dnl -----------------------------
+dnl Issue an autoheader template for KEY, i.e., a comment composed of
+dnl DESCRIPTION (properly wrapped), and then #undef KEY.  Redefinition
+dnl of the macro in autoheader.m4, to support definition of only a few
+dnl keys while compiling target libraries.
+
+m4_define([AH_TEMPLATE],
+[AH_VERBATIM([$1],m4_text_wrap([$2 */], [   ], [/* ])
+m4_ifdef([GCC_TARGET_TEMPLATE($1)],[],[#ifndef USED_FOR_TARGET
+])[#undef $1]m4_ifdef([GCC_TARGET_TEMPLATE($1)],[],[
+#endif
+]))])
+
+AC_DEFUN([gcc_AC_TOOL_DIRS], [
+# When searching for the assembler or linker, search the same directories
+# that the installed compiler will search.  Else we may find the wrong
+# assembler or linker and lose.  If we do not find a suitable binary,
+# then try the user's path.
+#
+# Also note we have to check MD_EXEC_PREFIX before checking the user's path.
+if test "x$exec_prefix" = xNONE; then
+       if test "x$prefix" = xNONE; then
+               gcc_cv_tool_prefix=/usr/local
+       else
+               gcc_cv_tool_prefix=$prefix
+       fi
+else
+       gcc_cv_tool_prefix=$exec_prefix
+fi
+
+if test x$host = x$build; then
+    gcc_cv_tool_dirs="$gcc_cv_tool_prefix/libexec/gcc/$target_noncanonical/$gcc_version"
+    gcc_cv_tool_dirs="$gcc_cv_tool_dirs$PATH_SEPARATOR$gcc_cv_tool_prefix/libexec/gcc/$target_noncanonical"
+    gcc_cv_tool_dirs="$gcc_cv_tool_dirs$PATH_SEPARATOR/usr/lib/gcc/$target_noncanonical/$gcc_version"
+    gcc_cv_tool_dirs="$gcc_cv_tool_dirs$PATH_SEPARATOR/usr/lib/gcc/$target_noncanonical"
+    gcc_cv_tool_dirs="$gcc_cv_tool_dirs$PATH_SEPARATOR$gcc_cv_tool_prefix/$target_noncanonical/bin/$target_noncanonical/$gcc_version"
+    gcc_cv_tool_dirs="$gcc_cv_tool_dirs$PATH_SEPARATOR$gcc_cv_tool_prefix/$target_noncanonical/bin"
+else
+    gcc_cv_tool_dirs=
+fi
+
+if test x$build = x$target; then
+    # Rummage through tm_files looking for MD_EXEC_PREFIX
+    md_dirs=
+    for f in ${tm_file_list}; do
+       if test -f $f; then
+           if grep '^#[        ]*undef[        ]*MD_EXEC_PREFIX' $f > /dev/null; then
+               md_dirs=
+           fi
+           md_dirs="$md_dirs "`sed -n -e 's@^#[        ]*define[       ]*MD_EXEC_PREFIX[       ]*"\(.*\)/"@\1@p' < $f`
+       fi
+    done
+    for f in ${md_dirs}; do
+        gcc_cv_tool_dirs="$gcc_cv_tool_dirs$PATH_SEPARATOR$f"
+    done
+fi])
+
+dnl Make sure that build_exeext is looked for
+AC_DEFUN([gcc_AC_BUILD_EXEEXT], [
+ac_executable_extensions="$build_exeext"])
+
+AC_DEFUN([gcc_AC_CHECK_TOOL], [
+AC_REQUIRE([gcc_AC_TOOL_DIRS])
+AC_REQUIRE([gcc_AC_BUILD_EXEEXT])
+
+dnl shut up useless "checking for..." messages
+dnl we can still read them in config.log
+exec AS_MESSAGE_FD([])>/dev/null
+if test "x[$]$1" = x; then
+       AC_PATH_PROGS($1, $2, , $gcc_cv_tool_dirs)
+fi
+if test "x[$]$1" = x; then
+       # If the loop above did not find a tool, then use whatever
+       # one we can find in the users's path.  We are looking for a
+       # ${build} -> ${target} tool.
+       if test "x$program_prefix" != xNONE; then
+               default_tool_name=${program_prefix}$2
+       elif test x$build != x$host && test x$build != x$target; then
+               default_tool_name=${target_noncanonical}-$2
+       else
+               default_tool_name=`echo $2 | sed "${program_transform_name}"`
+       fi
+       AC_PATH_PROGS($1, $default_tool_name,
+               $gcc_cv_tool_prefix/$default_tool_name$build_exeext)
+fi
+test "$silent" != yes && exec AS_MESSAGE_FD([])>&1
+
+$3="[$]$1"
+AC_SUBST($3)])