* configure.in (TARGET_SYSTEM_ROOT): Set default to
[deliverable/binutils-gdb.git] / gdb / configure.in
index 309ca79b0ad326d701556c9262fa41efdad5c4e0..63f2daa2cb62282472093b97123fc81ff7e9184c 100644 (file)
@@ -38,7 +38,7 @@ AC_CANONICAL_SYSTEM
 # doesn't support cross-compilation, but the one from Autoconf 2.5x
 # does.  Override RANLIB here (i.e. before running AC_PROG_RANLIB) to
 # deal with the lossage.  Note that CY_GNU_GETTEXT currently calls
-# AC_PROG_RANLIB.  This can be removed when we switch to Autoconf
+# AC_PROG_RANLIB.  This can be removed when we switch to Autoconf
 # 2.5x.
 AC_CHECK_TOOL(RANLIB, ranlib, :)
 
@@ -47,6 +47,15 @@ ALL_LINGUAS=
 CY_GNU_GETTEXT
 AC_DEFINE(PACKAGE, "gdb", [Name of this package. ])
 
+debugdir=${libdir}/debug
+        
+AC_ARG_WITH(separate-debug-dir,
+[  --with-separate-debug-dir=path   Look for global separate debug info in this path [LIBDIR/debug]],
+[debugdir="${withval}"])
+       
+AC_DEFINE_DIR(DEBUGDIR, debugdir,
+              [Global directory for separate debug files. ])
+#AC_DEFINE_UNQUOTED(DEBUGDIR, "$debugdir"),
 
 dnl List of object files added by configure.
 
@@ -194,16 +203,32 @@ AC_ARG_ENABLE(profiling,
   esac],
  [enable_profiling=no])
 
+AC_CHECK_FUNCS(monstartup _mcleanup)
+AC_CACHE_CHECK([for _etext], ac_cv_var__etext,
+[AC_TRY_LINK(
+[#include <stdlib.h>
+extern char _etext;
+],
+[free (&_etext);], ac_cv_var__etext=yes, ac_cv_var__etext=no)])
+if test $ac_cv_var__etext = yes; then
+  AC_DEFINE(HAVE__ETEXT, 1,
+            [Define to 1 if your system has the _etext variable. ])
+fi
 if test "$enable_profiling" = yes ; then
+  if test $ac_cv_func_monstartup = no || test $ac_cv_func__mcleanup = no; then
+    AC_MSG_ERROR(--enable-profiling requires monstartup and _mcleanup)
+  fi
   PROFILE_CFLAGS=-pg
   OLD_CFLAGS="$CFLAGS"
   CFLAGS="$CFLAGS $PROFILE_CFLAGS"
 
-  AC_CHECK_FUNC(monstartup, [],
-    AC_MSG_ERROR(monstartup necessary to use --enable-profiling.))
+  AC_CACHE_CHECK([whether $CC supports -pg], ac_cv_cc_supports_pg,
+    [AC_TRY_COMPILE([], [int x;], ac_cv_cc_supports_pg=yes,
+     ac_cv_cc_supports_pg=no)])
 
-  AC_CHECK_FUNC(_mcleanup, [],
-    AC_MSG_ERROR(_mcleanup necessary to use --enable-profiling.))
+  if test $ac_cv_cc_supports_pg = no; then
+    AC_MSG_ERROR(--enable-profiling requires a compiler which supports -pg)
+  fi
 
   CFLAGS="$OLD_CFLAGS"
 fi
@@ -880,7 +905,7 @@ AC_ARG_WITH(sysroot,
 [  --with-sysroot[=DIR] Search for usr/lib et al within DIR.],
 [
  case ${with_sysroot} in
- yes) AC_ERROR(with-sysroot must specify path) ;;
+ yes) TARGET_SYSTEM_ROOT='${exec_prefix}/${target_alias}/sys-root' ;;
  *) TARGET_SYSTEM_ROOT=$with_sysroot ;;
  esac
 
@@ -896,7 +921,8 @@ AC_ARG_WITH(sysroot,
   test_prefix=$exec_prefix
  fi
  case ${TARGET_SYSTEM_ROOT} in
- ${test_prefix}*)
+ "${test_prefix}"|"${test_prefix}/"*|\
+ '${exec_prefix}'|'${exec_prefix}/'*)
    t="$TARGET_SYSTEM_ROOT_DEFINE -DTARGET_SYSTEM_ROOT_RELOCATABLE"
    TARGET_SYSTEM_ROOT_DEFINE="$t"
    ;;
This page took 0.024165 seconds and 4 git commands to generate.