Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Joel Brobecker <brobecker@adacore.com>
To: gdb-patches@sourceware.org
Cc: Joel Brobecker <brobecker@adacore.com>
Subject: [PATCH 17/18] Configury and Makefile updates for VxWorks
Date: Thu, 24 Feb 2011 17:59:00 -0000	[thread overview]
Message-ID: <1298569763-18784-18-git-send-email-brobecker@adacore.com> (raw)
In-Reply-To: <1298569763-18784-1-git-send-email-brobecker@adacore.com>

This is the last (code) patch! :) Documentation and NEWS entry
will follow.

It contains the changes needed to configure and build the VxWorks
debugger.

gdb/ChangeLog:

        * configure.ac: Add support for vxworks targets.
        * configure: Regenerate.
        * configure.tgt: Add support for vxworks targets.
        * Makefile.in (VXWORKS_CFLAGS): New variable.
        (INTERNAL_CFLAGS_BASE): Use VXWORKS_CFLAGS.
---
 gdb/Makefile.in   |    6 +++-
 gdb/configure     |  101 +++++++++++++++++++++++++++++++++++++++++++++++++++++
 gdb/configure.ac  |   57 ++++++++++++++++++++++++++++++
 gdb/configure.tgt |   41 +++++++++++++++++++++
 4 files changed, 204 insertions(+), 1 deletions(-)

diff --git a/gdb/Makefile.in b/gdb/Makefile.in
index fae43b2..3b2333a 100644
--- a/gdb/Makefile.in
+++ b/gdb/Makefile.in
@@ -440,6 +440,9 @@ CFLAGS = @CFLAGS@
 # a bit the consequences by putting the Python includes last in the list.
 INTERNAL_CPPFLAGS = @CPPFLAGS@ @PYTHON_CPPFLAGS@
 
+# Set by configure for all CFLAGS related to vxWorks targets.
+VXWORKS_CFLAGS= @VXWORKS_CFLAGS@
+
 # Need to pass this to testsuite for "make check".  Probably should be
 # consistent with top-level Makefile.in and gdb/testsuite/Makefile.in
 # so "make check" has the same result no matter where it is run.
@@ -450,7 +453,8 @@ INTERNAL_CFLAGS_BASE = \
 	$(CFLAGS) $(GLOBAL_CFLAGS) $(PROFILE_CFLAGS) \
 	$(GDB_CFLAGS) $(OPCODES_CFLAGS) $(READLINE_CFLAGS) \
 	$(BFD_CFLAGS) $(INCLUDE_CFLAGS) $(LIBDECNUMBER_CFLAGS) \
-	$(INTL_CFLAGS) $(INCGNU) $(ENABLE_CFLAGS) $(INTERNAL_CPPFLAGS)
+	$(INTL_CFLAGS) $(INCGNU) $(ENABLE_CFLAGS) $(INTERNAL_CPPFLAGS) \
+	$(VXWORKS_CFLAGS)
 INTERNAL_WARN_CFLAGS = $(INTERNAL_CFLAGS_BASE) $(GDB_WARN_CFLAGS)
 INTERNAL_CFLAGS = $(INTERNAL_WARN_CFLAGS) $(GDB_WERROR_CFLAGS)
 
diff --git a/gdb/configure b/gdb/configure
index adf4bef..01d4b1d 100755
--- a/gdb/configure
+++ b/gdb/configure
@@ -599,6 +599,7 @@ gl_LTLIBOBJS
 gl_LIBOBJS
 LTLIBOBJS
 LIBOBJS
+VXWORKS_CFLAGS
 GDB_NM_FILE
 frags
 target_subdir
@@ -15921,6 +15922,106 @@ ac_config_links="$ac_config_links $ac_config_links_1"
 $as_echo "#define GDB_DEFAULT_HOST_CHARSET \"UTF-8\"" >>confdefs.h
 
 
+# Support for vxWorks targets.
+
+case ${target} in
+   *-*-vxworks*)
+      { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5
+$as_echo_n "checking for dlopen in -ldl... " >&6; }
+if test "${ac_cv_lib_dl_dlopen+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-ldl  $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char dlopen ();
+int
+main ()
+{
+return dlopen ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_dl_dlopen=yes
+else
+  ac_cv_lib_dl_dlopen=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5
+$as_echo "$ac_cv_lib_dl_dlopen" >&6; }
+if test "x$ac_cv_lib_dl_dlopen" = x""yes; then :
+  cat >>confdefs.h <<_ACEOF
+#define HAVE_LIBDL 1
+_ACEOF
+
+  LIBS="-ldl $LIBS"
+
+fi
+
+      ;;
+esac
+
+VXWORKS_CFLAGS=
+case "${target}" in
+
+  # vxWorks 653 targets.
+  *-vxworks653 | *-vxworksae )
+    if test "${WIND_FOUNDATION_PATH}" != ""; then
+      # vxWorks 653 version PSC 2.x
+      VXWORKS_CFLAGS="-I${WIND_FOUNDATION_PATH}/include"
+      vxworks_libdir="${WIND_FOUNDATION_PATH}/${WIND_HOST_TYPE}/lib"
+    elif test "${WIND_BASE}" != ""; then
+      # vxWorks 653 version PSC 1.x
+      VXWORKS_CFLAGS="-I${WIND_BASE}/host/include"
+      vxworks_libdir="${WIND_BASE}/host/${WIND_HOST_TYPE}/lib"
+    else
+      as_fn_error "cannot find vxWorks base installation from environment" "$LINENO" 5
+    fi
+    ;;
+
+  # vxWorks 6.x targets.
+  *-vxworks6 )
+    if test "${WIND_FOUNDATION_PATH}" = ""; then
+      as_fn_error "cannot find vxWorks base installation from environment" "$LINENO" 5
+    fi
+    VXWORKS_CFLAGS="-I${WIND_FOUNDATION_PATH}/include"
+    vxworks_libdir="${WIND_FOUNDATION_PATH}/${WIND_HOST_TYPE}/lib"
+    ;;
+
+  # vxWorks 5.x targets.
+  *-vxworks )
+    if test "${WIND_BASE}" = ""; then
+      as_fn_error "cannot find vxWorks base installation from environment" "$LINENO" 5
+    fi
+    VXWORKS_CFLAGS="-I${WIND_BASE}/host/include"
+    vxworks_libdir="${WIND_BASE}/host/${WIND_HOST_TYPE}/lib"
+    case "${host_os}" in
+      mingw* | *-cygwin* )
+        LIBS="${LIBS} $vxworks_libdir/tcldll.lib"
+        ;;
+      * )
+        LIBS="${LIBS} -L$vxworks_libdir"
+        LIBS="${LIBS} -ltcl"
+        ;;
+    esac
+    ;;
+esac
+
+
+
 ac_config_files="$ac_config_files Makefile .gdbinit:gdbinit.in doc/Makefile gnulib/Makefile data-directory/Makefile"
 
 ac_config_commands="$ac_config_commands default"
diff --git a/gdb/configure.ac b/gdb/configure.ac
index f31ef2a..4c0759c 100644
--- a/gdb/configure.ac
+++ b/gdb/configure.ac
@@ -2167,6 +2167,63 @@ dnl  At the moment, we just assume it's UTF-8.
 AC_DEFINE(GDB_DEFAULT_HOST_CHARSET, "UTF-8",
           [Define to be a string naming the default host character set.])
 
+# Support for vxWorks targets.
+
+dnl The WTX support requires dlopen to load the WTX libraries.
+case ${target} in
+   *-*-vxworks*)
+      AC_CHECK_LIB(dl, dlopen)
+      ;;
+esac
+
+VXWORKS_CFLAGS=
+case "${target}" in
+
+  # vxWorks 653 targets.
+  *-vxworks653 | *-vxworksae )
+    if test "${WIND_FOUNDATION_PATH}" != ""; then
+      # vxWorks 653 version PSC 2.x
+      VXWORKS_CFLAGS="-I${WIND_FOUNDATION_PATH}/include"
+      vxworks_libdir="${WIND_FOUNDATION_PATH}/${WIND_HOST_TYPE}/lib"
+    elif test "${WIND_BASE}" != ""; then
+      # vxWorks 653 version PSC 1.x
+      VXWORKS_CFLAGS="-I${WIND_BASE}/host/include"
+      vxworks_libdir="${WIND_BASE}/host/${WIND_HOST_TYPE}/lib"
+    else
+      AC_ERROR(cannot find vxWorks base installation from environment)
+    fi
+    ;;
+
+  # vxWorks 6.x targets.
+  *-vxworks6 )
+    if test "${WIND_FOUNDATION_PATH}" = ""; then
+      AC_ERROR(cannot find vxWorks base installation from environment)
+    fi
+    VXWORKS_CFLAGS="-I${WIND_FOUNDATION_PATH}/include"
+    vxworks_libdir="${WIND_FOUNDATION_PATH}/${WIND_HOST_TYPE}/lib"
+    ;;
+
+  # vxWorks 5.x targets.
+  *-vxworks )
+    if test "${WIND_BASE}" = ""; then
+      AC_ERROR(cannot find vxWorks base installation from environment)
+    fi
+    VXWORKS_CFLAGS="-I${WIND_BASE}/host/include"
+    vxworks_libdir="${WIND_BASE}/host/${WIND_HOST_TYPE}/lib"
+    case "${host_os}" in
+      mingw* | *-cygwin* )
+        LIBS="${LIBS} $vxworks_libdir/tcldll.lib"
+        ;;
+      * )
+        LIBS="${LIBS} -L$vxworks_libdir"
+        LIBS="${LIBS} -ltcl"
+        ;;
+    esac
+    ;;
+esac
+
+AC_SUBST(VXWORKS_CFLAGS)
+
 AC_OUTPUT(Makefile .gdbinit:gdbinit.in doc/Makefile gnulib/Makefile data-directory/Makefile,
 [
 case x$CONFIG_HEADERS in
diff --git a/gdb/configure.tgt b/gdb/configure.tgt
index 7d017a9..d395668 100644
--- a/gdb/configure.tgt
+++ b/gdb/configure.tgt
@@ -28,6 +28,14 @@ case $targ in
     ;;
 esac
 
+# The list of common files needed for all vxWorks ports.
+wtx_tdep_files="remote-wtxapi.o remote-wtx-opt.o remote-wtx-pd.o \
+		remote-wtx.o remote-wtx-utils.o remote-wtx-bp.o \
+		remote-wtx-hw.o remote-wtx-tasks.o"
+# The list of common files needed in order to support the DFW protocol
+# in vxWorks 6.x ports.
+dfw_tdep_files="remote-dfwapi.o remote-dfw.o"
+
 # map target info into gdb names.
 
 case "${targ}" in
@@ -239,6 +247,21 @@ i[34567]86-*-mingw32*)
 			solib-target.o corelow.o windows-tdep.o"
 	build_gdbserver=yes
 	;;
+i[34567]86-*-vxworks653 | i[34567]86-*-vxworksae )
+	# Target: Intel 386 running vxWorks 653
+	gdb_target_obs="i386-tdep.o i387-tdep.o i386-vxworks-tdep.o \
+			${wtx_tdep_files} remote-wtx-tcl.o"
+	;;
+i[34567]86-*-vxworks6* )
+	# Target: Intel 386 running vxWorks 6.x
+	gdb_target_obs="i386-tdep.o i387-tdep.o ${dfw_tdep_files} \
+			${wtx_tdep_files} "
+	;;
+i[34567]86-*-vxworks* )
+	# Target: Intel 386 running vxWorks 5.x
+	gdb_target_obs="i386-tdep.o i387-tdep.o i386-vxworks-tdep.o \
+			${wtx_tdep_files} remote-wtx-tcl.o"
+	;;
 i[34567]86-*-*)
 	# Target: i386
 	gdb_target_obs="i386-tdep.o i387-tdep.o"
@@ -417,6 +440,24 @@ powerpc-*-linux* | powerpc64-*-linux*)
 	gdb_sim=../sim/ppc/libsim.a
 	build_gdbserver=yes
 	;;
+powerpc-*-vxworks653 | powerpc-*-vxworksae )
+	# Target: PowerPC running vxWorks 653
+	gdb_target_obs="rs6000-tdep.o rs6000-vxworks-tdep.o ppc-sysv-tdep.o \
+			solib.o solib-svr4.o \
+			${wtx_tdep_files} remote-wtx-tcl.o"
+	;;
+powerpc-*-vxworks6* | e500*-*-vxworks6* )
+	# Target: PowerPC running vxWorks 6.x
+	gdb_target_obs="rs6000-tdep.o rs6000-vxworks-tdep.o ppc-sysv-tdep.o \
+			solib.o solib-svr4.o \
+			${dfw_tdep_files} ${wtx_tdep_files} "
+	;;
+powerpc-*-vxworks* )
+	# Target: PowerPC running vxWorks 5.x
+	gdb_target_obs="rs6000-tdep.o rs6000-vxworks-tdep.o ppc-sysv-tdep.o \
+			solib.o solib-svr4.o \
+			${wtx_tdep_files} remote-wtx-tcl.o"
+	;;
 powerpc*-*-*)
 	# Target: PowerPC running eabi
 	gdb_target_obs="rs6000-tdep.o monitor.o dsrec.o ppcbug-rom.o \
-- 
1.7.0.4


  parent reply	other threads:[~2011-02-24 17:59 UTC|newest]

Thread overview: 54+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-02-24 17:49 Add support for VxWorks 5.x, 6.x and 653 Joel Brobecker
2011-02-24 17:49 ` [PATCH 01/18] Some ada-lang/ada-tasks routines needed by the VxWorks target Joel Brobecker
2011-02-24 17:50 ` [PATCH 03/18] New general purpose routines in utils.c Joel Brobecker
2011-02-24 19:06   ` Tom Tromey
2011-02-24 17:50 ` [PATCH 04/18] add new "unload" command (symetry of existing "load" command) Joel Brobecker
2011-02-24 19:22   ` Eli Zaretskii
2011-02-24 17:50 ` [PATCH 02/18] New command_post observer Joel Brobecker
2011-02-24 18:58   ` Tom Tromey
2011-02-24 17:51 ` [PATCH 05/18] new struct bp_target_info target_private_data field Joel Brobecker
2011-02-24 17:54 ` [PATCH 09/18] VxWorks breakpoint-handling module Joel Brobecker
2011-02-24 17:54 ` [PATCH 06/18] New module remote-wtx-utils Joel Brobecker
2011-02-24 19:26   ` Tom Tromey
2011-02-24 17:54 ` [PATCH 08/18] Add options to control Vxworks related settings Joel Brobecker
2011-02-24 17:55 ` [PATCH 10/18] "multi-tasks-mode" support Joel Brobecker
2011-02-24 17:56 ` [PATCH 07/18] remote-wtxapi: The WTX API abstraction layer Joel Brobecker
2011-02-24 19:44   ` Tom Tromey
2011-02-24 17:56 ` [PATCH 11/18] Add partition support Joel Brobecker
2011-02-25 16:17   ` Tom Tromey
2011-02-24 17:57 ` [PATCH 13/18] Add new "wtx" target Joel Brobecker
2011-02-25 16:15   ` Tom Tromey
2011-02-25 17:38     ` Joel Brobecker
2011-02-24 17:57 ` [PATCH 12/18] remote-wtx-hw: register fetch/store support Joel Brobecker
2011-02-24 17:57 ` [PATCH 14/18] WTX-TCL support module Joel Brobecker
2011-02-25 15:59   ` Tom Tromey
2011-02-25 18:58     ` Joel Brobecker
2011-02-28 15:37       ` Tom Tromey
2011-02-24 17:58 ` [PATCH 15/18] Add support for VxWorks 6 Joel Brobecker
2011-02-24 17:59 ` [PATCH 16/18] Add tdep files for x86 and powerpc Joel Brobecker
2011-02-24 18:58   ` Mark Kettenis
2011-02-25  8:29     ` Joel Brobecker
2011-02-24 17:59 ` Joel Brobecker [this message]
2011-02-24 18:04 ` [PATCH 18/18] document the new VxWorks port Joel Brobecker
2011-02-24 20:27   ` Eli Zaretskii
2011-02-25 11:12     ` Jerome Guitton
2011-02-25 11:27       ` Eli Zaretskii
2011-02-25 11:38         ` Jerome Guitton
2011-02-25 11:38           ` Joel Brobecker
2011-02-25 12:08             ` Eli Zaretskii
2011-02-25 13:26               ` Jerome Guitton
2011-02-25 11:44           ` Eli Zaretskii
2011-02-25 11:49             ` Joel Brobecker
2011-02-25 11:55               ` Jerome Guitton
2011-02-25 11:56                 ` Joel Brobecker
2011-02-25 12:01                   ` Pedro Alves
2011-02-25 14:21                     ` Joel Brobecker
2011-02-25 14:44                       ` Pedro Alves
2011-02-25 15:15                         ` Joel Brobecker
2011-02-25 12:05                   ` Jerome Guitton
2011-02-25 12:15                     ` Eli Zaretskii
2011-02-25 12:56                       ` Joel Brobecker
2011-02-25 13:20                         ` Eli Zaretskii
2011-02-25 14:11                           ` Jerome Guitton
2011-03-03 12:16     ` Joel Brobecker
2011-03-03 13:44       ` Eli Zaretskii

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1298569763-18784-18-git-send-email-brobecker@adacore.com \
    --to=brobecker@adacore.com \
    --cc=gdb-patches@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox