2011-05-26 Pedro Alves <pedro@codesourcery.com>
[deliverable/binutils-gdb.git] / gdb / acinclude.m4
index e3f604ecff6ee7fe40ec6687c1b374055c5e161c..1942ef484fffffdcbd1cd101a99fccad52075d3c 100644 (file)
@@ -403,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
@@ -429,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.024273 seconds and 4 git commands to generate.