This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[vxworks 14/14] Configury and Makefile updates for VxWorks.


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]