*** empty log message ***
[deliverable/binutils-gdb.git] / gdb / acinclude.m4
index 84a908476ed38b7380e5553366b29ccb543894ba..1942ef484fffffdcbd1cd101a99fccad52075d3c 100644 (file)
@@ -192,6 +192,7 @@ AC_DEFUN([AM_ICONV],
     am_cv_func_iconv="no, consider installing GNU libiconv"
     am_cv_lib_iconv=no
     am_cv_use_build_libiconv=no
+    am_cv_build_libiconv_path=
 
     # If libiconv is part of the build tree, then try using it over
     # any system iconv.
@@ -207,12 +208,12 @@ AC_DEFUN([AM_ICONV],
            iconv(cd,NULL,NULL,NULL,NULL);
            iconv_close(cd);],
           am_cv_use_build_libiconv=yes
+          am_cv_build_libiconv_path=$lib_dir/libiconv.a
           am_cv_lib_iconv=yes
           am_cv_func_iconv=yes)
         LIBS="$am_save_LIBS"
         CPPFLAGS="$am_save_CPPFLAGS"
         if test "$am_cv_use_build_libiconv" = "yes"; then
-          BUILD_LIBICONV_LIBDIR=$lib_dir
           break
         fi
       done
@@ -260,7 +261,7 @@ AC_DEFUN([AM_ICONV],
     LIBICONV_INCLUDE=
   fi
   if test "$am_cv_use_build_libiconv" = yes; then
-    LIBICONV="$BUILD_LIBICONV_LIBDIR/libiconv.a"
+    LIBICONV="$am_cv_build_libiconv_path"
     LIBICONV_LIBDIR=""
     LIBICONV_INCLUDE="$BUILD_LIBICONV_INCLUDE"
   fi
@@ -402,22 +403,12 @@ AC_DEFUN([CY_AC_TK_PRIVATE_HEADERS], [
   fi
 ])
 
-dnl GDB_AC_WITH_DIR([VARIABLE], [ARG-NAME], [HELP], [DEFAULT])
-dnl Add a new --with option that defines a directory.
-dnl The result is stored in VARIABLE.  AC_DEFINE_DIR is called
-dnl on this variable, as is AC_SUBST.
-dnl ARG-NAME is the base name of the argument (without "--with").
-dnl HELP is the help text to use.
-dnl If the user's choice is relative to the prefix, then the
+dnl GDB_AC_DEFINE_RELOCATABLE([VARIABLE], [ARG-NAME], [SHELL-VARIABLE])
+dnl For use in processing directory values for --with-foo.
+dnl If the path in SHELL_VARIABLE is relative to the prefix, then the
 dnl result is relocatable, then this will define the C macro
 dnl VARIABLE_RELOCATABLE to 1; otherwise it is defined as 0.
-dnl DEFAULT is the default value, which is used if the user
-dnl does not specify the argument.
-AC_DEFUN([GDB_AC_WITH_DIR], [
-  AC_ARG_WITH([$2], AS_HELP_STRING([--with-][$2][=PATH], [$3]), [
-    [$1]=$withval], [[$1]=[$4]])
-  AC_DEFINE_DIR([$1], [$1], [$3])
-  AC_SUBST([$1])
+AC_DEFUN([GDB_AC_DEFINE_RELOCATABLE], [
   if test "x$exec_prefix" = xNONE || test "x$exec_prefix" = 'x${prefix}'; then
      if test "x$prefix" = xNONE; then
        test_prefix=/usr/local
@@ -428,11 +419,30 @@ AC_DEFUN([GDB_AC_WITH_DIR], [
      test_prefix=$exec_prefix
   fi
   value=0
-  case ${ac_define_dir} in
+  case [$3] in
      "${test_prefix}"|"${test_prefix}/"*|\
        '${exec_prefix}'|'${exec_prefix}/'*)
      value=1
      ;;
   esac
   AC_DEFINE_UNQUOTED([$1]_RELOCATABLE, $value, [Define if the $2 directory should be relocated when GDB is moved.])
+])
+
+dnl GDB_AC_WITH_DIR([VARIABLE], [ARG-NAME], [HELP], [DEFAULT])
+dnl Add a new --with option that defines a directory.
+dnl The result is stored in VARIABLE.  AC_DEFINE_DIR is called
+dnl on this variable, as is AC_SUBST.
+dnl ARG-NAME is the base name of the argument (without "--with").
+dnl HELP is the help text to use.
+dnl If the user's choice is relative to the prefix, then the
+dnl result is relocatable, then this will define the C macro
+dnl VARIABLE_RELOCATABLE to 1; otherwise it is defined as 0.
+dnl DEFAULT is the default value, which is used if the user
+dnl does not specify the argument.
+AC_DEFUN([GDB_AC_WITH_DIR], [
+  AC_ARG_WITH([$2], AS_HELP_STRING([--with-][$2][=PATH], [$3]), [
+    [$1]=$withval], [[$1]=[$4]])
+  AC_DEFINE_DIR([$1], [$1], [$3])
+  AC_SUBST([$1])
+  GDB_AC_DEFINE_RELOCATABLE([$1], [$2], ${ac_define_dir})
   ])
This page took 0.026227 seconds and 4 git commands to generate.