Index: c/src/lib/librdbg/Makefile.in
===================================================================
--- c/src/lib/librdbg/Makefile.in	(revision b5d8eca1b5b86f46af8acaf9b200b6a84e13eba1)
+++ c/src/lib/librdbg/Makefile.in	(revision e5f4e5aaff76424f6977d9938cb6ffa10e24f354)
@@ -48,6 +48,6 @@
 OBJS=$(C_GEN_O_FILES) $(C_O_FILES) $(ASM_O_FILES)
 
-RPCGEN=rpcgen
-AWK=awk
+RPCGEN=@RPCGEN@
+AWK=@AWK@
 
 include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
Index: c/src/librdbg/src/Makefile.in
===================================================================
--- c/src/librdbg/src/Makefile.in	(revision b5d8eca1b5b86f46af8acaf9b200b6a84e13eba1)
+++ c/src/librdbg/src/Makefile.in	(revision e5f4e5aaff76424f6977d9938cb6ffa10e24f354)
@@ -48,6 +48,6 @@
 OBJS=$(C_GEN_O_FILES) $(C_O_FILES) $(ASM_O_FILES)
 
-RPCGEN=rpcgen
-AWK=awk
+RPCGEN=@RPCGEN@
+AWK=@AWK@
 
 include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
Index: configure
===================================================================
--- configure	(revision b5d8eca1b5b86f46af8acaf9b200b6a84e13eba1)
+++ configure	(revision e5f4e5aaff76424f6977d9938cb6ffa10e24f354)
@@ -3545,7 +3545,87 @@
 
   if test "$RTEMS_HAS_RDBG" = "yes"; then
-    
+    echo $ac_n "checking whether cpu supports rdbg? ""... $ac_c" 1>&6
+echo "configure:3549: checking whether cpu supports rdbg? " >&5
+    test ! -d "$srcdir/c/src/lib/librdbg/$target_cpu" && RTEMS_HAS_RDBG="no" ;
+    echo "$ac_t""$RTEMS_HAS_RDBG" 1>&6
+    if test "$RTEMS_HAS_RDBG" = "yes"; then
+      # Extract the first word of "rpcgen", so it can be a program name with args.
+set dummy rpcgen; ac_word=$2
+echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
+echo "configure:3556: checking for $ac_word" >&5
+if eval "test \"`echo '$''{'ac_cv_path_RPCGEN'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  case "$RPCGEN" in
+  /*)
+  ac_cv_path_RPCGEN="$RPCGEN" # Let the user override the test with a path.
+  ;;
+  ?:/*)			 
+  ac_cv_path_RPCGEN="$RPCGEN" # Let the user override the test with a dos path.
+  ;;
+  *)
+  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
+  ac_dummy="$PATH"
+  for ac_dir in $ac_dummy; do 
+    test -z "$ac_dir" && ac_dir=.
+    if test -f $ac_dir/$ac_word; then
+      ac_cv_path_RPCGEN="$ac_dir/$ac_word"
+      break
+    fi
+  done
+  IFS="$ac_save_ifs"
+  ;;
+esac
+fi
+RPCGEN="$ac_cv_path_RPCGEN"
+if test -n "$RPCGEN"; then
+  echo "$ac_t""$RPCGEN" 1>&6
+else
+  echo "$ac_t""no" 1>&6
+fi
+
+      test -z "$RPCGEN" && RTEMS_HAS_RDBG="no"
+    fi
+    if test "$RTEMS_HAS_RDBG" = "yes"; then
+      for ac_prog in mawk gawk nawk awk
+do
+# Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
+echo "configure:3596: checking for $ac_word" >&5
+if eval "test \"`echo '$''{'ac_cv_prog_AWK'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  if test -n "$AWK"; then
+  ac_cv_prog_AWK="$AWK" # Let the user override the test.
+else
+  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
+  ac_dummy="$PATH"
+  for ac_dir in $ac_dummy; do
+    test -z "$ac_dir" && ac_dir=.
+    if test -f $ac_dir/$ac_word; then
+      ac_cv_prog_AWK="$ac_prog"
+      break
+    fi
+  done
+  IFS="$ac_save_ifs"
+fi
+fi
+AWK="$ac_cv_prog_AWK"
+if test -n "$AWK"; then
+  echo "$ac_t""$AWK" 1>&6
+else
+  echo "$ac_t""no" 1>&6
+fi
+
+test -n "$AWK" && break
+done
+
+      test -z "$AWK" && RTEMS_HAS_RDBG="no"
+    fi
+    if test "$RTEMS_HAS_RDBG" = "yes"; then
+      
 echo $ac_n "checking for Makefile.in in c/src/lib/librdbg""... $ac_c" 1>&6
-echo "configure:3550: checking for Makefile.in in c/src/lib/librdbg" >&5
+echo "configure:3630: checking for Makefile.in in c/src/lib/librdbg" >&5
 if test -d $srcdir/c/src/lib/librdbg; then
   rtems_av_save_dir=`pwd`;
@@ -3560,4 +3640,7 @@
 
 
+    else
+      echo "configure: warning: *** warning disabling --enable-rdbg" 1>&2
+    fi
   fi
 fi
@@ -3571,5 +3654,5 @@
 # If the tests are enabled, then find all the test suite Makefiles
 echo $ac_n "checking if the test suites are enabled? ""... $ac_c" 1>&6
-echo "configure:3574: checking if the test suites are enabled? " >&5
+echo "configure:3657: checking if the test suites are enabled? " >&5
 tests_enabled=yes
 # Check whether --enable-tests or --disable-tests was given.
@@ -3589,5 +3672,5 @@
 
 echo $ac_n "checking for Makefile.in in c/src/tests/tools/$target_cpu""... $ac_c" 1>&6
-echo "configure:3592: checking for Makefile.in in c/src/tests/tools/$target_cpu" >&5
+echo "configure:3675: checking for Makefile.in in c/src/tests/tools/$target_cpu" >&5
 if test -d $srcdir/c/src/tests/tools/$target_cpu; then
   rtems_av_save_dir=`pwd`;
@@ -3606,5 +3689,5 @@
    
 echo $ac_n "checking for Makefile.in in c/src/tests/libtests""... $ac_c" 1>&6
-echo "configure:3609: checking for Makefile.in in c/src/tests/libtests" >&5
+echo "configure:3692: checking for Makefile.in in c/src/tests/libtests" >&5
 if test -d $srcdir/c/src/tests/libtests; then
   rtems_av_save_dir=`pwd`;
@@ -3621,5 +3704,5 @@
    
 echo $ac_n "checking for Makefile.in in c/src/tests/sptests""... $ac_c" 1>&6
-echo "configure:3624: checking for Makefile.in in c/src/tests/sptests" >&5
+echo "configure:3707: checking for Makefile.in in c/src/tests/sptests" >&5
 if test -d $srcdir/c/src/tests/sptests; then
   rtems_av_save_dir=`pwd`;
@@ -3636,5 +3719,5 @@
    
 echo $ac_n "checking for Makefile.in in c/src/tests/tmtests""... $ac_c" 1>&6
-echo "configure:3639: checking for Makefile.in in c/src/tests/tmtests" >&5
+echo "configure:3722: checking for Makefile.in in c/src/tests/tmtests" >&5
 if test -d $srcdir/c/src/tests/tmtests; then
   rtems_av_save_dir=`pwd`;
@@ -3652,5 +3735,5 @@
        
 echo $ac_n "checking for Makefile.in in c/src/tests/mptests""... $ac_c" 1>&6
-echo "configure:3655: checking for Makefile.in in c/src/tests/mptests" >&5
+echo "configure:3738: checking for Makefile.in in c/src/tests/mptests" >&5
 if test -d $srcdir/c/src/tests/mptests; then
   rtems_av_save_dir=`pwd`;
@@ -3669,5 +3752,5 @@
      
 echo $ac_n "checking for Makefile.in in c/src/tests/psxtests""... $ac_c" 1>&6
-echo "configure:3672: checking for Makefile.in in c/src/tests/psxtests" >&5
+echo "configure:3755: checking for Makefile.in in c/src/tests/psxtests" >&5
 if test -d $srcdir/c/src/tests/psxtests; then
   rtems_av_save_dir=`pwd`;
@@ -3703,5 +3786,5 @@
 if test "$RTEMS_HAS_HWAPI" = "yes"; then
   echo $ac_n "checking whether libwapi is present""... $ac_c" 1>&6
-echo "configure:3706: checking whether libwapi is present" >&5
+echo "configure:3789: checking whether libwapi is present" >&5
   if test -f ${srcdir}/c/src/lib/libhwapi/Makefile.in ; then
     echo "$ac_t""yes" 1>&6
@@ -3709,5 +3792,5 @@
     
 echo $ac_n "checking for Makefile.in in c/src/lib/libhwapi/analog""... $ac_c" 1>&6
-echo "configure:3712: checking for Makefile.in in c/src/lib/libhwapi/analog" >&5
+echo "configure:3795: checking for Makefile.in in c/src/lib/libhwapi/analog" >&5
 if test -d $srcdir/c/src/lib/libhwapi/analog; then
   rtems_av_save_dir=`pwd`;
@@ -3724,5 +3807,5 @@
     
 echo $ac_n "checking for Makefile.in in c/src/lib/libhwapi/discrete""... $ac_c" 1>&6
-echo "configure:3727: checking for Makefile.in in c/src/lib/libhwapi/discrete" >&5
+echo "configure:3810: checking for Makefile.in in c/src/lib/libhwapi/discrete" >&5
 if test -d $srcdir/c/src/lib/libhwapi/discrete; then
   rtems_av_save_dir=`pwd`;
@@ -3739,5 +3822,5 @@
     
 echo $ac_n "checking for Makefile.in in c/src/lib/libhwapi/drivers""... $ac_c" 1>&6
-echo "configure:3742: checking for Makefile.in in c/src/lib/libhwapi/drivers" >&5
+echo "configure:3825: checking for Makefile.in in c/src/lib/libhwapi/drivers" >&5
 if test -d $srcdir/c/src/lib/libhwapi/drivers; then
   rtems_av_save_dir=`pwd`;
@@ -3754,5 +3837,5 @@
     
 echo $ac_n "checking for Makefile.in in c/src/lib/libhwapi/non_volatile_memory""... $ac_c" 1>&6
-echo "configure:3757: checking for Makefile.in in c/src/lib/libhwapi/non_volatile_memory" >&5
+echo "configure:3840: checking for Makefile.in in c/src/lib/libhwapi/non_volatile_memory" >&5
 if test -d $srcdir/c/src/lib/libhwapi/non_volatile_memory; then
   rtems_av_save_dir=`pwd`;
@@ -3769,5 +3852,5 @@
     
 echo $ac_n "checking for Makefile.in in c/src/lib/libhwapi/serial""... $ac_c" 1>&6
-echo "configure:3772: checking for Makefile.in in c/src/lib/libhwapi/serial" >&5
+echo "configure:3855: checking for Makefile.in in c/src/lib/libhwapi/serial" >&5
 if test -d $srcdir/c/src/lib/libhwapi/serial; then
   rtems_av_save_dir=`pwd`;
@@ -3784,5 +3867,5 @@
     
 echo $ac_n "checking for Makefile.in in c/src/lib/libhwapi/support""... $ac_c" 1>&6
-echo "configure:3787: checking for Makefile.in in c/src/lib/libhwapi/support" >&5
+echo "configure:3870: checking for Makefile.in in c/src/lib/libhwapi/support" >&5
 if test -d $srcdir/c/src/lib/libhwapi/support; then
   rtems_av_save_dir=`pwd`;
@@ -3799,5 +3882,5 @@
     
 echo $ac_n "checking for Makefile.in in c/src/lib/libhwapi/wrapup""... $ac_c" 1>&6
-echo "configure:3802: checking for Makefile.in in c/src/lib/libhwapi/wrapup" >&5
+echo "configure:3885: checking for Makefile.in in c/src/lib/libhwapi/wrapup" >&5
 if test -d $srcdir/c/src/lib/libhwapi/wrapup; then
   rtems_av_save_dir=`pwd`;
@@ -3843,5 +3926,5 @@
 
 echo $ac_n "checking for Makefile.in in make""... $ac_c" 1>&6
-echo "configure:3846: checking for Makefile.in in make" >&5
+echo "configure:3929: checking for Makefile.in in make" >&5
 if test -d $srcdir/make; then
   rtems_av_save_dir=`pwd`;
@@ -3858,5 +3941,5 @@
 
 echo $ac_n "checking for Makefile.in in c/src/lib/libchip""... $ac_c" 1>&6
-echo "configure:3861: checking for Makefile.in in c/src/lib/libchip" >&5
+echo "configure:3944: checking for Makefile.in in c/src/lib/libchip" >&5
 if test -d $srcdir/c/src/lib/libchip; then
   rtems_av_save_dir=`pwd`;
@@ -3873,5 +3956,5 @@
 
 echo $ac_n "checking for Makefile.in in c/src/lib/libmisc""... $ac_c" 1>&6
-echo "configure:3876: checking for Makefile.in in c/src/lib/libmisc" >&5
+echo "configure:3959: checking for Makefile.in in c/src/lib/libmisc" >&5
 if test -d $srcdir/c/src/lib/libmisc; then
   rtems_av_save_dir=`pwd`;
@@ -3888,5 +3971,5 @@
 
 echo $ac_n "checking for Makefile.in in c/src/tests/samples""... $ac_c" 1>&6
-echo "configure:3891: checking for Makefile.in in c/src/tests/samples" >&5
+echo "configure:3974: checking for Makefile.in in c/src/tests/samples" >&5
 if test -d $srcdir/c/src/tests/samples; then
   rtems_av_save_dir=`pwd`;
@@ -4152,4 +4235,6 @@
 s%@EXEEXT@%$EXEEXT%g
 s%@GCCSED@%$GCCSED%g
+s%@RPCGEN@%$RPCGEN%g
+s%@AWK@%$AWK%g
 s%@subdirs@%$subdirs%g
 s%@RTEMS_HAS_HWAPI@%$RTEMS_HAS_HWAPI%g
Index: configure.in
===================================================================
--- configure.in	(revision b5d8eca1b5b86f46af8acaf9b200b6a84e13eba1)
+++ configure.in	(revision e5f4e5aaff76424f6977d9938cb6ffa10e24f354)
@@ -1,2 +1,3 @@
+
 dnl Process this file with autoconf to produce a configure script.
 dnl
@@ -311,5 +312,20 @@
   RTEMS_CHECK_MAKEFILE(c/src/lib/librpc)
   if test "$RTEMS_HAS_RDBG" = "yes"; then
-    RTEMS_CHECK_MAKEFILE(c/src/lib/librdbg)
+    AC_MSG_CHECKING([whether cpu supports rdbg? ])
+    test ! -d "$srcdir/c/src/lib/librdbg/$target_cpu" && RTEMS_HAS_RDBG="no" ;
+    AC_MSG_RESULT($RTEMS_HAS_RDBG)
+    if test "$RTEMS_HAS_RDBG" = "yes"; then
+      AC_PATH_PROG(RPCGEN,rpcgen)
+      test -z "$RPCGEN" && RTEMS_HAS_RDBG="no"
+    fi
+    if test "$RTEMS_HAS_RDBG" = "yes"; then
+      AC_PROG_AWK
+      test -z "$AWK" && RTEMS_HAS_RDBG="no"
+    fi
+    if test "$RTEMS_HAS_RDBG" = "yes"; then
+      RTEMS_CHECK_MAKEFILE(c/src/lib/librdbg)
+    else
+      AC_MSG_WARN([*** warning disabling --enable-rdbg])
+    fi
   fi
 fi
