AC_CONFIG_AUX_DIR(`cd $srcdir;pwd`/..)
AC_CANONICAL_SYSTEM
-# FIXME: kettenis/20030102: The AC_PROG_RANLIB from Autoconf 2.13
-# 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
-# 2.5x.
-AC_CHECK_TOOL(RANLIB, ranlib, :)
-
dnl List of object files and targets accumulated by configure.
CONFIG_OBS=
*)
AC_MSG_ERROR([bad value $enableval for --enable-gdbtk]) ;;
esac],
- [if test -d $srcdir/gdbtk; then
+ [if test -d $srcdir/gdbtk -a -d $srcdir/../itcl; then
enable_gdbtk=yes
else
enable_gdbtk=no
fi ;;
esac
AC_CHECK_HEADERS(curses.h cursesX.h ncurses.h ncurses/ncurses.h)
-AC_CHECK_HEADERS(ncurses/term.h term.h)
+AC_CHECK_HEADERS(ncurses/term.h)
+AC_CHECK_HEADERS(term.h, [], [],
+[#if HAVE_CURSES_H
+# include <curses.h>
+#endif
+])
# FIXME: kettenis/20030102: In most cases we include these
# unconditionally, so what's the point in checking these?
AC_CHECK_HEADERS(ctype.h time.h)
-dnl Check for struct stat with an st_blocks member
-AC_MSG_CHECKING(for member st_blocks in struct stat)
-AC_CACHE_VAL(gdb_cv_have_struct_stat_with_st_blocks_member,
- [AC_TRY_COMPILE([#include <sys/types.h>
-#include <sys/stat.h>],
- [struct stat st; (void) st.st_blocks;],
- gdb_cv_have_struct_stat_with_st_blocks_member=yes,
- gdb_cv_have_struct_stat_with_st_blocks_member=no)])
-AC_MSG_RESULT($gdb_cv_have_struct_stat_with_st_blocks_member)
-if test $gdb_cv_have_struct_stat_with_st_blocks_member = yes; then
- AC_DEFINE(HAVE_STRUCT_STAT_ST_BLOCKS)
-fi
-
# ------------------------- #
# Checks for declarations. #
# ------------------------- #
-gcc_AC_CHECK_DECLS(getopt)
+AC_CHECK_DECLS([free, malloc, realloc])
+AC_CHECK_DECLS([strerror, strstr])
+AC_CHECK_DECLS(getopt)
+
+# ----------------------- #
+# Checks for structures. #
+# ----------------------- #
+
+AC_CHECK_MEMBERS([struct stat.st_blocks])
+AC_CHECK_MEMBERS([struct stat.st_blksize])
# ------------------ #
# Checks for types. #
AC_FUNC_MMAP
AC_FUNC_VFORK
AC_CHECK_FUNCS(canonicalize_file_name realpath)
+AC_CHECK_FUNCS(getuid getgid)
AC_CHECK_FUNCS(poll)
AC_CHECK_FUNCS(pread64)
AC_CHECK_FUNCS(sbrk)
#endif
'
# There is no point in checking if we don't have a prototype.
-gcc_AC_CHECK_DECLS(ptrace, , [
+AC_CHECK_DECLS(ptrace, [], [
: ${gdb_cv_func_ptrace_ret='int'}
: ${gdb_cv_func_ptrace_args='int,int,long,long'}
], $gdb_ptrace_headers)
[Define to 1 if the regex included in libiberty should be used.])
fi
-# See if <sys/proc.h> defines `struct thread' with a td_pcb member.
-AC_CACHE_CHECK([for td_pcb in struct thread], gdb_cv_struct_thread_td_pcb,
-[AC_TRY_COMPILE([#include <sys/param.h>
-#include <sys/proc.h>], [struct thread td; td.td_pcb;],
-gdb_cv_struct_thread_td_pcb=yes, gdb_cv_struct_thread_td_pcb=no)])
-if test $gdb_cv_struct_thread_td_pcb = yes; then
- AC_DEFINE(HAVE_STRUCT_THREAD_TD_PCB, 1,
- [Define to 1 if your system has td_pcb in struct thread.])
-fi
+# Check if <sys/proc.h> defines `struct thread' with a td_pcb member.
+AC_CHECK_MEMBERS([struct thread.td_pcb], [], [],
+[#include <sys/param.h>
+#include <sys/proc.h>
+])
# See if <sys/lwp.h> defines `struct lwp`.
AC_CACHE_CHECK([for struct lwp], gdb_cv_struct_lwp,
# See if <machine/reg.h> supports the %fs and %gs i386 segment registers.
# Older i386 BSD's don't have the r_fs and r_gs members of `struct reg'.
-AC_CACHE_CHECK([for r_fs in struct reg], gdb_cv_struct_reg_r_fs,
-[AC_TRY_COMPILE([#include <machine/reg.h>], [struct reg r; r.r_fs;],
-gdb_cv_struct_reg_r_fs=yes, gdb_cv_struct_reg_r_fs=no)])
-if test $gdb_cv_struct_reg_r_fs = yes; then
- AC_DEFINE(HAVE_STRUCT_REG_R_FS)
-fi
-AC_CACHE_CHECK([for r_gs in struct reg], gdb_cv_struct_reg_r_gs,
-[AC_TRY_COMPILE([#include <machine/reg.h>], [struct reg r; r.r_gs;],
-gdb_cv_struct_reg_r_gs=yes, gdb_cv_struct_reg_r_gs=no)])
-if test $gdb_cv_struct_reg_r_gs = yes; then
- AC_DEFINE(HAVE_STRUCT_REG_R_GS)
-fi
+AC_CHECK_MEMBERS([struct reg.r_fs, struct reg.r_gs], [], [],
+ [#include <machine/reg.h>])
# See if <sys/ptrace.h> provides the PTRACE_GETREGS request.
AC_MSG_CHECKING(for PTRACE_GETREGS)
AC_DEFINE(HAVE_UINTPTR_T, 1, [Define if <stdint.h> provides the uintptr_t type.])
fi
-BFD_NEED_DECLARATION(malloc)
-BFD_NEED_DECLARATION(realloc)
-BFD_NEED_DECLARATION(free)
-BFD_NEED_DECLARATION(strerror)
-BFD_NEED_DECLARATION(strdup)
-BFD_NEED_DECLARATION(strstr)
-BFD_NEED_DECLARATION(canonicalize_file_name)
-
-# The following save_state_t checkery is only necessary for HPUX
-# versions earlier than 10.20. When those fade from memory, this
-# could be expunged. --jsm 1999-03-22
-
-AC_MSG_CHECKING(for HPUX save_state structure)
-AC_EGREP_HEADER(save_state_t, machine/save_state.h,
- gdb_cv_hpux_savestate=yes, gdb_cv_hpux_savestate=no)
-AC_EGREP_HEADER(ss_wide, machine/save_state.h, gdb_cv_hpux_sswide=yes,
- gdb_cv_hpux_sswide=no)
-if test $gdb_cv_hpux_savestate = yes
-then
- AC_DEFINE(HAVE_STRUCT_SAVE_STATE_T, 1)
-fi
-if test $gdb_cv_hpux_sswide = yes
-then
- AC_DEFINE(HAVE_STRUCT_MEMBER_SS_WIDE, 1)
-fi
-AC_MSG_RESULT($gdb_cv_hpux_sswide)
-
-
# If we are configured native on GNU/Linux, work around problems with
# sys/procfs.h
# Also detect which type of /proc is in use, such as for Unixware or Solaris.
AC_DEFINE(START_INFERIOR_TRAPS_EXPECTED,2)
AC_DEFINE(sys_quotactl)
;;
- ia64-*-aix*)
- AC_DEFINE(NEW_PROC_API)
- ;;
*-*-unixware* | *-*-sysv4.2* | *-*-sysv5* | *-*-interix* )
AC_DEFINE(NEW_PROC_API)
;;
fi
fi
-dnl See if compiler supports "long long" type.
+# Check if the compiler supports the `long long' type.
-AC_MSG_CHECKING(for long long support in compiler)
-AC_CACHE_VAL(gdb_cv_c_long_long,
-[AC_TRY_COMPILE(, [
- extern long long foo;
- switch (foo & 2) { case 0: return 1; }
-],
-gdb_cv_c_long_long=yes, gdb_cv_c_long_long=no)])
-AC_MSG_RESULT($gdb_cv_c_long_long)
+AC_CACHE_CHECK([for long long support in compiler], gdb_cv_c_long_long,
+ [AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
+[[extern long long foo;]],
+[[switch (foo & 2) { case 0: return 1; }]])],
+ gdb_cv_c_long_long=yes,
+ gdb_cv_c_long_long=no)])
if test $gdb_cv_c_long_long = yes; then
- AC_DEFINE(CC_HAS_LONG_LONG)
+ AC_DEFINE(CC_HAS_LONG_LONG, 1,
+ [Define to 1 if the compiler supports long long.])
fi
-dnl See if the compiler and runtime support printing long long
+# Check if the compiler and runtime support printing long longs.
-AC_MSG_CHECKING(for long long support in printf)
-AC_CACHE_VAL(gdb_cv_printf_has_long_long,
-[AC_TRY_RUN([
-int main () {
- char buf[32];
+AC_CACHE_CHECK([for long long support in printf],
+ gdb_cv_printf_has_long_long,
+ [AC_RUN_IFELSE([AC_LANG_PROGRAM([AC_INCLUDES_DEFAULT],
+[[char buf[32];
long long l = 0;
l = (l << 16) + 0x0123;
l = (l << 16) + 0x4567;
l = (l << 16) + 0x89ab;
l = (l << 16) + 0xcdef;
sprintf (buf, "0x%016llx", l);
- return (strcmp ("0x0123456789abcdef", buf));
-}],
-gdb_cv_printf_has_long_long=yes,
-gdb_cv_printf_has_long_long=no,
-gdb_cv_printf_has_long_long=no)])
+ return (strcmp ("0x0123456789abcdef", buf));]])],
+ gdb_cv_printf_has_long_long=yes,
+ gdb_cv_printf_has_long_long=no,
+ gdb_cv_printf_has_long_long=no)])
if test $gdb_cv_printf_has_long_long = yes; then
- AC_DEFINE(PRINTF_HAS_LONG_LONG)
+ AC_DEFINE(PRINTF_HAS_LONG_LONG, 1,
+ [Define to 1 if the "%ll" format works to print long longs.])
fi
-AC_MSG_RESULT($gdb_cv_printf_has_long_long)
-
-dnl See if compiler supports "long double" type. Can't use AC_C_LONG_DOUBLE
-dnl because autoconf complains about cross-compilation issues. However, this
-dnl code uses the same variables as the macro for compatibility.
-
-AC_MSG_CHECKING(for long double support in compiler)
-AC_CACHE_VAL(ac_cv_c_long_double,
-[AC_TRY_COMPILE(, [long double foo;],
-ac_cv_c_long_double=yes, ac_cv_c_long_double=no)])
-AC_MSG_RESULT($ac_cv_c_long_double)
-if test $ac_cv_c_long_double = yes; then
- AC_DEFINE(HAVE_LONG_DOUBLE)
+
+# Check if the compiler supports the `long double' type. We can't use
+# AC_C_LONG_DOUBLE because that one does additional checks on the
+# constants defined in <float.h> that fail on some systems,
+# e.g. FreeBSD/i386 4.7 and OpenBSD/i386 3.6.
+
+AC_CACHE_CHECK([for long double support in compiler], gdb_cv_c_long_double,
+ [AC_COMPILE_IFELSE([AC_LANG_SOURCE([[long double foo;]])],
+ gdb_cv_c_long_double=yes,
+ gdb_cv_c_long_double=no)])
+if test $gdb_cv_c_long_double = yes; then
+ AC_DEFINE(HAVE_LONG_DOUBLE, 1,
+ [Define to 1 if the compiler supports long double.])
fi
-dnl See if the compiler and runtime support printing long doubles
+# Check if the compiler and runtime support printing long doubles.
-AC_MSG_CHECKING(for long double support in printf)
-AC_CACHE_VAL(gdb_cv_printf_has_long_double,
-[AC_TRY_RUN([
-int main () {
- char buf[16];
+AC_CACHE_CHECK([for long double support in printf],
+ gdb_cv_printf_has_long_double,
+ [AC_RUN_IFELSE([AC_LANG_PROGRAM([AC_INCLUDES_DEFAULT],
+[[char buf[16];
long double f = 3.141592653;
sprintf (buf, "%Lg", f);
- return (strncmp ("3.14159", buf, 7));
-}],
-gdb_cv_printf_has_long_double=yes,
-gdb_cv_printf_has_long_double=no,
-gdb_cv_printf_has_long_double=no)])
+ return (strncmp ("3.14159", buf, 7));]])],
+ gdb_cv_printf_has_long_double=yes,
+ gdb_cv_printf_has_long_double=no,
+ gdb_cv_printf_has_long_double=no)])
if test $gdb_cv_printf_has_long_double = yes; then
- AC_DEFINE(PRINTF_HAS_LONG_DOUBLE)
+ AC_DEFINE(PRINTF_HAS_LONG_DOUBLE, 1,
+ [Define to 1 if the "%Lg" format works to print long doubles.])
fi
-AC_MSG_RESULT($gdb_cv_printf_has_long_double)
-dnl See if the compiler and runtime support scanning long doubles
+# Check if the compiler and runtime support scanning long doubles.
-AC_MSG_CHECKING(for long double support in scanf)
-AC_CACHE_VAL(gdb_cv_scanf_has_long_double,
-[AC_TRY_RUN([
-int main () {
- char *buf = "3.141592653";
+AC_CACHE_CHECK([for long double support in scanf],
+ gdb_cv_scanf_has_long_double,
+ [AC_RUN_IFELSE([AC_LANG_PROGRAM(
+[[#include <stdio.h>]],
+[[char *buf = "3.141592653";
long double f = 0;
sscanf (buf, "%Lg", &f);
- return !(f > 3.14159 && f < 3.14160);
-}],
-gdb_cv_scanf_has_long_double=yes,
-gdb_cv_scanf_has_long_double=no,
-gdb_cv_scanf_has_long_double=no)])
+ return !(f > 3.14159 && f < 3.14160);]])],
+ gdb_cv_scanf_has_long_double=yes,
+ gdb_cv_scanf_has_long_double=no,
+ gdb_cv_scanf_has_long_double=no)])
if test $gdb_cv_scanf_has_long_double = yes; then
- AC_DEFINE(SCANF_HAS_LONG_DOUBLE)
+ AC_DEFINE(SCANF_HAS_LONG_DOUBLE, 1,
+ [Define to 1 if the "%Lg" format works to scan long doubles.])
fi
-AC_MSG_RESULT($gdb_cv_scanf_has_long_double)
case ${host_os} in
aix*)
# NOTE: If you add to this list, remember to update
# gdb/doc/gdbint.texinfo.
build_warnings="-Wimplicit -Wreturn-type -Wcomment -Wtrigraphs \
--Wformat -Wparentheses -Wpointer-arith -Wuninitialized -Wformat-nonliteral \
+-Wformat -Wparentheses -Wpointer-arith -Wformat-nonliteral \
-Wunused-label -Wunused-function"
+
+# GCC supports -Wuninitialized only with -O or -On, n != 0.
+if test x${CFLAGS+set} = xset; then
+ case "${CFLAGS}" in
+ *"-O0"* ) ;;
+ *"-O"* )
+ build_warnings="${build_warnings} -Wuninitialized"
+ ;;
+ esac
+else
+ build_warnings="${build_warnings} -Wuninitialized"
+fi
+
# Up for debate: -Wswitch -Wcomment -trigraphs -Wtrigraphs
# -Wunused-function -Wunused-variable -Wunused-value
# -Wchar-subscripts -Wtraditional -Wshadow -Wcast-qual
dnl Figure out which of the many generic ser-*.c files the _host_ supports.
-SER_HARDWIRE="ser-unix.o ser-pipe.o ser-tcp.o"
+SER_HARDWIRE="ser-base.o ser-unix.o ser-pipe.o ser-tcp.o"
case ${host} in
*go32* ) SER_HARDWIRE=ser-go32.o ;;
*djgpp* ) SER_HARDWIRE=ser-go32.o ;;
+ *mingw32*) SER_HARDWIRE="ser-base.o ser-tcp.o" ;;
esac
AC_SUBST(SER_HARDWIRE)
fi
ENABLE_CFLAGS="${ENABLE_CFLAGS} \$(SUBDIR_GDBTK_CFLAGS)"
- # Tcl/Tk 8.1 require -fwritable strings. I don't
- # know whether 8.2 will or not, but I bet it will.
- # I don't have to worry about 7.x since we don't support it.
- GDBTK_CFLAGS=""
- if test "$GCC" = "yes"; then
- if test "$TCL_VERSION" != "8.0" ; then
- GDBTK_CFLAGS="-fwritable-strings"
- fi
- fi
# Include some libraries that Tcl and Tk want.
TCL_LIBS='$(LIBGUI) $(ITCL) $(ITK) $(TK) $(TCL) $(X11_LDFLAGS) $(X11_LIBS)'
fi
fi
+# We build rdi-share on ARM-based targets, as instructed by configure.tgt.
+if test "x$build_rdi_share" = xyes; then
+ AC_CONFIG_SUBDIRS(rdi-share)
+fi
+
+# We configure the nlm subdirectory on netware targets, as instructed
+# by configure.tgt.
+if test "x$build_nlm" = xyes; then
+ AC_CONFIG_SUBDIRS(nlm)
+fi
+
# If hostfile (XM_FILE) and/or targetfile (DEPRECATED_TM_FILE) and/or
# nativefile (NAT_FILE) is not set in config/*/*.m[ht] files, we link
# to an empty version.