public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Joel Brobecker <brobecker@adacore.com>
To: gdb-patches@sourceware.org
Subject: [vxworks 14/14] Configury and Makefile updates for VxWorks.
Date: Sun, 25 Apr 2010 15:48:00 -0000	[thread overview]
Message-ID: <1272210447-13895-15-git-send-email-brobecker@adacore.com> (raw)
In-Reply-To: <1272210447-13895-1-git-send-email-brobecker@adacore.com>

This is the last patch! :)

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

2010-04-24  Joel Brobecker  <brobecker@adacore.com>

        * 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     |  119 +++++++++++++++++++++++++++++++++++++++++++++++++++++
 gdb/configure.ac  |   75 +++++++++++++++++++++++++++++++++
 gdb/configure.tgt |   41 ++++++++++++++++++
 4 files changed, 240 insertions(+), 1 deletions(-)

diff --git a/gdb/Makefile.in b/gdb/Makefile.in
index d62dc63..da1514b 100644
--- a/gdb/Makefile.in
+++ b/gdb/Makefile.in
@@ -402,6 +402,9 @@ CFLAGS = @CFLAGS@
 # Set by configure, for e.g. expat.
 INTERNAL_CPPFLAGS = @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.
@@ -412,7 +415,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 301394f..2345e30 100755
--- a/gdb/configure
+++ b/gdb/configure
@@ -598,6 +598,7 @@ gl_LTLIBOBJS
 gl_LIBOBJS
 LTLIBOBJS
 LIBOBJS
+VXWORKS_CFLAGS
 GDB_NM_FILE
 frags
 target_subdir
@@ -14513,6 +14514,124 @@ 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"
+      case "${host_os}" in
+        mingw* | *-cygwin* )
+	  LIBS="${LIBS} $vxworks_libdir/tcl84.lib"
+	  ;;
+        * )
+	  LIBS="${LIBS} -L$vxworks_libdir"
+	  LIBS="${LIBS} -ltcl"
+	  ;;
+      esac
+    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"
+      case "${host_os}" in
+        mingw* | *-cygwin* )
+	  LIBS="${LIBS} $vxworks_libdir/tcldll.lib"
+	  ;;
+        * )
+	  LIBS="${LIBS} -L$vxworks_libdir"
+	  LIBS="${LIBS} -ltcl"
+	  ;;
+      esac
+    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 gnulib/Makefile"
 
 ac_config_commands="$ac_config_commands default"
diff --git a/gdb/configure.ac b/gdb/configure.ac
index 4704a53..84cf1e5 100644
--- a/gdb/configure.ac
+++ b/gdb/configure.ac
@@ -1939,6 +1939,81 @@ 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"
+      case "${host_os}" in
+        mingw* | *-cygwin* )
+	  LIBS="${LIBS} $vxworks_libdir/tcl84.lib"
+	  ;;
+        * )
+	  LIBS="${LIBS} -L$vxworks_libdir"
+	  LIBS="${LIBS} -ltcl"
+	  ;;
+      esac
+    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"
+      case "${host_os}" in
+        mingw* | *-cygwin* )
+	  LIBS="${LIBS} $vxworks_libdir/tcldll.lib"
+	  ;;
+        * )
+	  LIBS="${LIBS} -L$vxworks_libdir"
+	  LIBS="${LIBS} -ltcl"
+	  ;;
+      esac
+    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 gnulib/Makefile,
 [
 case x$CONFIG_HEADERS in
diff --git a/gdb/configure.tgt b/gdb/configure.tgt
index ce063ef..a1e4be7 100644
--- a/gdb/configure.tgt
+++ b/gdb/configure.tgt
@@ -29,6 +29,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
@@ -230,6 +238,21 @@ i[34567]86-*-mingw32*)
 			solib-target.o corelow.o windows-tdep.o"
 	build_gdbserver=yes
 	;;
+i[34567]86-*-vxworks653 | [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"
@@ -397,6 +420,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.6.3.3

  parent reply	other threads:[~2010-04-25 15:48 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-04-25 15:47 Adding support for VxWorks target Joel Brobecker
2010-04-25 15:47 ` [vxworks 01/14] Some ada-lang/ada-tasks routines needed by the " Joel Brobecker
2010-04-25 15:48 ` [vxworks 03/14] New module remote-wtx-utils Joel Brobecker
2010-04-26 18:55   ` Tom Tromey
2010-04-27 16:27     ` Joel Brobecker
2010-04-25 15:48 ` [vxworks 02/14] New command_post observer Joel Brobecker
2010-04-26 18:51   ` Tom Tromey
2010-04-27 14:22     ` Joel Brobecker
2010-04-27 17:16       ` Tom Tromey
2010-04-25 15:48 ` Joel Brobecker [this message]
2010-04-25 15:48 ` [vxworks 10/14] Add new "wtx" target Joel Brobecker
2010-04-25 15:48 ` [vxworks 09/14] remote-wtx-hw / register fetch/store support Joel Brobecker
2010-04-25 15:48 ` [vxworks 13/14] Add tdep files for x86 and powerpc Joel Brobecker
2010-04-25 20:45   ` Mark Kettenis
2010-04-26 16:41     ` Joel Brobecker
2010-04-25 15:48 ` [vxworks 11/14] WTX-TCL support module Joel Brobecker
2010-04-25 15:48 ` [vxworks 08/14] Partition support Joel Brobecker
2010-04-25 15:56 ` [vxworks 07/14] "multi-tasks-mode" support Joel Brobecker
2010-04-25 15:56 ` [vxworks 06/14] VxWorks breakpoint-handling module Joel Brobecker
2010-04-25 15:56 ` [vxworks 05/14] Add options to control Vxworks related settings Joel Brobecker
2010-05-04 15:25   ` Joel Brobecker
2010-04-25 15:56 ` [vxworks 12/14] Add support for VxWorks 6 Joel Brobecker
2010-04-25 16:01 ` [vxworks 04/14] remote-wtxapi: The WTX API abstraction layer Joel Brobecker
2010-05-04 14:58 ` Adding support for VxWorks target Joel Brobecker
2010-05-04 15:43   ` Stan Shebs
2010-05-04 18:30     ` one big unit or several smaller units? (was: "Re: Adding support for VxWorks target") Joel Brobecker
2010-11-25  0:53 ` Adding support for VxWorks target Joel Brobecker

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=1272210447-13895-15-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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).