--- libiberty/aclocal.m4	31 Dec 2001 23:23:49 -0000	1.5
+++ libiberty/aclocal.m4	31 Dec 2002 01:47:43 -0000
@@ -69,7 +69,7 @@
   ac_cv_func_strncmp_works=no)
 rm -f core core.* *.core])
 if test $ac_cv_func_strncmp_works = no ; then
-  LIBOBJS="$LIBOBJS strncmp.o"
+  AC_LIBOBJ(strncmp)
 fi
 ])
 
@@ -96,15 +96,17 @@
 AC_DEFUN(LIB_AC_PROG_CC,
 [AC_BEFORE([$0], [AC_PROG_CPP])dnl
 AC_PROVIDE([AC_PROG_CC])
+AC_LANG_PUSH(C++)
 AC_CHECK_PROG(CC, gcc, gcc)
 if test -z "$CC"; then
   AC_CHECK_PROG(CC, cc, cc, , , /usr/ucb/cc)
   test -z "$CC" && AC_MSG_ERROR([no acceptable cc found in \$PATH])
 fi
 
-AC_PROG_CC_GNU
+_AC_COMPILER_OBJEXT
+_AC_LANG_COMPILER_GNU
 
-if test $ac_cv_prog_gcc = yes; then
+if test $ac_cv_cxx_compiler_gnu = yes; then
   GCC=yes
   ac_libiberty_warn_cflags='-W -Wall -Wtraditional -pedantic'
 dnl Check whether -g works, even if CFLAGS is set, in case the package
@@ -113,7 +115,7 @@
   ac_test_CFLAGS="${CFLAGS+set}"
   ac_save_CFLAGS="$CFLAGS"
   CFLAGS=
-  AC_PROG_CC_G
+  _AC_PROG_CC_G
   if test "$ac_test_CFLAGS" = set; then
     CFLAGS="$ac_save_CFLAGS"
   elif test $ac_cv_prog_cc_g = yes; then
@@ -127,6 +129,7 @@
   test "${CFLAGS+set}" = set || CFLAGS="-g"
 fi
 AC_SUBST(ac_libiberty_warn_cflags)
+AC_LANG_POP(C++)
 ])
 
 # Work around a bug in autoheader.  This can go away when we switch to
--- libiberty/configure.in	2002-12-04 12:17:23.000000000 -0500
+++ libiberty/configure.in	2002-12-04 23:18:08.000000000 -0500
@@ -240,7 +240,12 @@
   # newlib provide and which ones we will be expected to provide.
 
   if test "x${with_newlib}" = "xyes"; then
-    LIBOBJS="asprintf.o basename.o insque.o random.o strdup.o vasprintf.o"
+    AC_LIBOBJ(asprintf)
+    AC_LIBOBJ(basename)
+    AC_LIBOBJ(insque)
+    AC_LIBOBJ(random)
+    AC_LIBOBJ(strdup)
+    AC_LIBOBJ(vasprintf)
 
     for f in $funcs; do
       case "$f" in
@@ -308,8 +313,16 @@
     # Handle VxWorks configuration specially, since on VxWorks the
     # libraries are actually on the target board, not in the file
     # system.
-    LIBOBJS="basename.o getpagesize.o insque.o random.o strcasecmp.o"
-    LIBOBJS="$LIBOBJS strncasecmp.o strdup.o vfork.o waitpid.o vasprintf.o"
+    AC_LIBOBJ(basename)
+    AC_LIBOBJ(getpagesize)
+    AC_LIBOBJ(insque)
+    AC_LIBOBJ(random)
+    AC_LIBOBJ(strcasecmp)
+    AC_LIBOBJ(strncasecmp)
+    AC_LIBOBJ(strdup)
+    AC_LIBOBJ(vfork)
+    AC_LIBOBJ(waitpid)
+    AC_LIBOBJ(vasprintf)
     for f in $funcs; do
       case "$f" in
 	basename | getpagesize | insque | random | strcasecmp)
@@ -356,7 +369,7 @@
     if test -n "${with_target_subdir}"
     then
       funcs="`echo $funcs | sed -e 's/random//'`"
-      LIBOBJS="$LIBOBJS random.o"
+      AC_LIBOBJ(random)
       vars="`echo $vars | sed -e 's/sys_siglist//'`"
       checkfuncs="`echo $checkfuncs | sed -e 's/strsignal//' -e 's/psignal//'`"
     fi
@@ -392,12 +405,12 @@
 
   # We haven't set the list of objects yet.  Use the standard autoconf
   # tests.  This will only work if the compiler works.
-  AC_PROG_CC_WORKS
+  AC_PROG_CC
   AC_REPLACE_FUNCS($funcs)
   libiberty_AC_FUNC_C_ALLOCA
   AC_FUNC_VFORK
   if test $ac_cv_func_vfork_works = no; then
-    LIBOBJS="$LIBOBJS vfork.o"
+    AC_LIBOBJ(vfork)
   fi
   # We only need _doprnt if we might use it to implement v*printf.
   if test $ac_cv_func_vprintf != yes \
