aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gdb/ChangeLog16
-rw-r--r--gdb/aclocal.m41
-rwxr-xr-xgdb/configure83
-rw-r--r--gdb/configure.in32
-rw-r--r--gdb/gdbtk.c8
5 files changed, 110 insertions, 30 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 5686fff..b2f3eb4 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,19 @@
+Fri Aug 1 15:21:44 1997 Ian Lance Taylor <ian@cygnus.com>
+
+ * gdbtk.c (Tcl_Alloc): Don't provide our own version of this if
+ _WIN32.
+ (Tcl_Realloc, Tcl_Free): Likewise.
+ * configure.in: Check for cygwin32 environment. Define and
+ substitute WIN32LIBS and WIN32LDAPP. Always set configdir to
+ unix; setting it to win was for an old Tcl/Tk configuration
+ scheme.
+ * aclocal.m4 (CY_AC_LOAD_TKCONFIG): Substitute TK_BUILD_INCLUDES.
+ * Makefile.in (TK_CFLAGS): Add @TK_BUILD_INCLUDES@.
+ (WIN32LDAPP, WIN32LIBS): Define.
+ (CLIBS): Add $(WIN32LIBS).
+ (gdb): Use $(WIN32LDAPP).
+ * configure: Rebuild.
+
Thu Jul 31 15:40:19 1997 Per Bothner <bothner@cygnus.com>
* symtab.h (SYMBOL_INIT_LANGUAGE_SPECIFIC, SYMBOL_INIT_DEMANGLED_NAME,
diff --git a/gdb/aclocal.m4 b/gdb/aclocal.m4
index e962886..0c00e52 100644
--- a/gdb/aclocal.m4
+++ b/gdb/aclocal.m4
@@ -473,6 +473,7 @@ dnl AC_SUBST(TK_PREFIX)
dnl not used, don't export to save symbols
dnl AC_SUBST(TK_EXEC_PREFIX)
+ AC_SUBST(TK_BUILD_INCLUDES)
AC_SUBST(TK_XINCLUDES)
AC_SUBST(TK_XLIBSW)
AC_SUBST(TK_BUILD_LIB_SPEC)
diff --git a/gdb/configure b/gdb/configure
index aa00d75..0e08faf 100755
--- a/gdb/configure
+++ b/gdb/configure
@@ -2478,14 +2478,46 @@ case "$host" in
fi
-case "${target}" in
-*-cygwin32)
- configdir="win"
- ;;
-*)
- configdir="unix"
- ;;
-esac
+# In the cygwin32 environment, we need some additional flags.
+echo $ac_n "checking for cygwin32""... $ac_c" 1>&6
+echo "configure:2484: checking for cygwin32" >&5
+if eval "test \"`echo '$''{'gdb_cv_os_cygwin32'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ cat > conftest.$ac_ext <<EOF
+#line 2489 "configure"
+#include "confdefs.h"
+
+#ifdef __CYGWIN32__
+lose
+#endif
+EOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+ egrep "lose" >/dev/null 2>&1; then
+ rm -rf conftest*
+ gdb_cv_os_cygwin32=yes
+else
+ rm -rf conftest*
+ gdb_cv_os_cygwin32=no
+fi
+rm -f conftest*
+
+fi
+
+echo "$ac_t""$gdb_cv_os_cygwin32" 1>&6
+
+WIN32LIBS=
+WIN32LDAPP=
+
+
+
+if test x$gdb_cv_os_cygwin32 = xyes; then
+ if test x$enable_ide = xyes; then
+ WIN32LIBS="-ladvapi32"
+ fi
+fi
+
+configdir="unix"
if test "${enable_gdbtk}" = "yes"; then
@@ -2506,7 +2538,7 @@ if test "${with_tclconfig+set}" = set; then
fi
echo $ac_n "checking for Tcl configuration""... $ac_c" 1>&6
-echo "configure:2510: checking for Tcl configuration" >&5
+echo "configure:2542: checking for Tcl configuration" >&5
if eval "test \"`echo '$''{'ac_cv_c_tclconfig'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -2614,7 +2646,7 @@ if test "${with_tkconfig+set}" = set; then
fi
echo $ac_n "checking for Tk configuration""... $ac_c" 1>&6
-echo "configure:2618: checking for Tk configuration" >&5
+echo "configure:2650: checking for Tk configuration" >&5
if eval "test \"`echo '$''{'ac_cv_c_tkconfig'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -2697,6 +2729,7 @@ fi
+
#
@@ -2709,7 +2742,7 @@ fi
no_tcl=true
echo $ac_n "checking for Tcl private headers. dir=${configdir}""... $ac_c" 1>&6
-echo "configure:2713: checking for Tcl private headers. dir=${configdir}" >&5
+echo "configure:2746: checking for Tcl private headers. dir=${configdir}" >&5
# Check whether --with-tclinclude or --without-tclinclude was given.
if test "${with_tclinclude+set}" = set; then
withval="$with_tclinclude"
@@ -2775,17 +2808,17 @@ fi
if test x"${ac_cv_c_tclh}" = x ; then
ac_safe=`echo "tclInt.h" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for tclInt.h""... $ac_c" 1>&6
-echo "configure:2779: checking for tclInt.h" >&5
+echo "configure:2812: checking for tclInt.h" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 2784 "configure"
+#line 2817 "configure"
#include "confdefs.h"
#include <tclInt.h>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:2789: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:2822: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out`
if test -z "$ac_err"; then
rm -rf conftest*
@@ -2845,7 +2878,7 @@ fi
#
no_tk=true
echo $ac_n "checking for Tk private headers""... $ac_c" 1>&6
-echo "configure:2849: checking for Tk private headers" >&5
+echo "configure:2882: checking for Tk private headers" >&5
# Check whether --with-tkinclude or --without-tkinclude was given.
if test "${with_tkinclude+set}" = set; then
withval="$with_tkinclude"
@@ -2911,17 +2944,17 @@ fi
if test x"${ac_cv_c_tkh}" = x ; then
ac_safe=`echo "tk.h" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for tk.h""... $ac_c" 1>&6
-echo "configure:2915: checking for tk.h" >&5
+echo "configure:2948: checking for tk.h" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 2920 "configure"
+#line 2953 "configure"
#include "confdefs.h"
#include <tk.h>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:2925: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:2958: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out`
if test -z "$ac_err"; then
rm -rf conftest*
@@ -2967,7 +3000,7 @@ fi
echo $ac_n "checking for Itcl private headers. srcdir=${srcdir}""... $ac_c" 1>&6
-echo "configure:2971: checking for Itcl private headers. srcdir=${srcdir}" >&5
+echo "configure:3004: checking for Itcl private headers. srcdir=${srcdir}" >&5
if test x"${ac_cv_c_itclh}" = x ; then
for i in ${srcdir}/../itcl ${srcdir}/../../itcl ${srcdir}/../../../itcl ; do
if test -f $i/src/itcl.h ; then
@@ -2990,7 +3023,7 @@ fi
echo $ac_n "checking for Tix private headers. srcdir=${srcdir}""... $ac_c" 1>&6
-echo "configure:2994: checking for Tix private headers. srcdir=${srcdir}" >&5
+echo "configure:3027: checking for Tix private headers. srcdir=${srcdir}" >&5
if test x"${ac_cv_c_tixh}" = x ; then
for i in ${srcdir}/../tix ${srcdir}/../../tix ${srcdir}/../../../tix ; do
if test -f $i/generic/tix.h ; then
@@ -3039,6 +3072,11 @@ fi
# after Tcl/Tk.
LIBS="${LIBS} ${TCL_LIBS} ${TK_LIBS}"
CONFIG_OBS="${CONFIG_OBS} gdbtk.o"
+
+ if test x$gdb_cv_os_cygwin32 = xyes; then
+ WIN32LIBS="${WIN32LIBS} -luser32"
+ WIN32LDAPP="-Wl,--subsystem,windows"
+ fi
fi
fi
fi
@@ -3191,7 +3229,7 @@ links="${links} nm.h"
fi
# start-sanitize-gdbtk
echo $ac_n "checking whether ln -s works""... $ac_c" 1>&6
-echo "configure:3195: checking whether ln -s works" >&5
+echo "configure:3233: checking whether ln -s works" >&5
if eval "test \"`echo '$''{'ac_cv_prog_LN_S'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -3383,6 +3421,8 @@ s%@YACC@%$YACC%g
s%@AWK@%$AWK%g
s%@CONFIG_LDFLAGS@%$CONFIG_LDFLAGS%g
s%@ENABLE_IDE@%$ENABLE_IDE%g
+s%@WIN32LIBS@%$WIN32LIBS%g
+s%@WIN32LDAPP@%$WIN32LDAPP%g
s%@TCL_VERSION@%$TCL_VERSION%g
s%@TCL_MAJOR_VERSION@%$TCL_MAJOR_VERSION%g
s%@TCL_MINOR_VERSION@%$TCL_MINOR_VERSION%g
@@ -3402,6 +3442,7 @@ s%@TCL_LIB_SPEC@%$TCL_LIB_SPEC%g
s%@TCL_LIB_VERSIONS_OK@%$TCL_LIB_VERSIONS_OK%g
s%@TK_VERSION@%$TK_VERSION%g
s%@TK_DEFS@%$TK_DEFS%g
+s%@TK_BUILD_INCLUDES@%$TK_BUILD_INCLUDES%g
s%@TK_XINCLUDES@%$TK_XINCLUDES%g
s%@TK_XLIBSW@%$TK_XLIBSW%g
s%@TK_BUILD_LIB_SPEC@%$TK_BUILD_LIB_SPEC%g
diff --git a/gdb/configure.in b/gdb/configure.in
index d17a640..d9fe00a 100644
--- a/gdb/configure.in
+++ b/gdb/configure.in
@@ -280,14 +280,25 @@ case "$host" in
esac
])
-case "${target}" in
-*-cygwin32)
- configdir="win"
- ;;
-*)
- configdir="unix"
- ;;
-esac
+# In the cygwin32 environment, we need some additional flags.
+AC_CACHE_CHECK([for cygwin32], gdb_cv_os_cygwin32,
+[AC_EGREP_CPP(lose, [
+#ifdef __CYGWIN32__
+lose
+#endif],[gdb_cv_os_cygwin32=yes],[gdb_cv_os_cygwin32=no])])
+
+WIN32LIBS=
+WIN32LDAPP=
+AC_SUBST(WIN32LIBS)
+AC_SUBST(WIN32LDAPP)
+
+if test x$gdb_cv_os_cygwin32 = xyes; then
+ if test x$enable_ide = xyes; then
+ WIN32LIBS="-ladvapi32"
+ fi
+fi
+
+configdir="unix"
if test "${enable_gdbtk}" = "yes"; then
@@ -335,6 +346,11 @@ if test "${enable_gdbtk}" = "yes"; then
# after Tcl/Tk.
LIBS="${LIBS} ${TCL_LIBS} ${TK_LIBS}"
CONFIG_OBS="${CONFIG_OBS} gdbtk.o"
+
+ if test x$gdb_cv_os_cygwin32 = xyes; then
+ WIN32LIBS="${WIN32LIBS} -luser32"
+ WIN32LDAPP="-Wl,--subsystem,windows"
+ fi
fi
fi
fi
diff --git a/gdb/gdbtk.c b/gdb/gdbtk.c
index 051cdfc..13e8959 100644
--- a/gdb/gdbtk.c
+++ b/gdb/gdbtk.c
@@ -134,7 +134,11 @@ static int running_now;
static int disassemble_from_exec = -1;
-/* Supply malloc calls for tcl/tk. */
+#ifndef _WIN32
+
+/* Supply malloc calls for tcl/tk. We do not want to do this on
+ Windows, because Tcl_Alloc is probably in a DLL which will not call
+ the mmalloc routines. */
char *
Tcl_Alloc (size)
@@ -158,6 +162,8 @@ Tcl_Free(ptr)
free (ptr);
}
+#endif /* _WIN32 */
+
static void
null_routine(arg)
int arg;