[vlc-devel] commit: Win32: generate gdb symbol files for every dll (Geoffroy Couprie )

git version control git at videolan.org
Mon Feb 2 13:34:32 CET 2009


vlc | branch: master | Geoffroy Couprie <geo.couprie at gmail.com> | Mon Feb  2 13:29:32 2009 +0100| [82bc4a310683688843c8b361a1c767260f522ecc] | committer: Geoffroy Couprie 

Win32: generate gdb symbol files for every dll

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=82bc4a310683688843c8b361a1c767260f522ecc
---

 Makefile.am  |   34 ++++++++++++++++++++++++++++++----
 configure.ac |    1 +
 2 files changed, 31 insertions(+), 4 deletions(-)

diff --git a/Makefile.am b/Makefile.am
index 33dc7ef..b60031d 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -683,6 +683,9 @@ VLC.app: vlc $(top_builddir)/src/.libs/libvlccore.dylib $(top_builddir)/src/.lib
 ## Win                                                                    ##
 ############################################################################
 win32_destdir=$(top_builddir)/vlc-$(VERSION)
+win32_debugdir=$(top_builddir)/symbols-$(VERSION)
+npvlc=vlc-$(VERSION)/mozilla/npvlc$(LIBEXT)
+axvlc=vlc-$(VERSION)/activex/axvlc$(LIBEXT)
 win32_lua_destdir=$(win32_destdir)/lua
 win32_http_destdir=$(win32_destdir)/http
 
@@ -896,19 +899,42 @@ endif
 
 #strip exe and main dll
 package-win-common-strip: package-win32-base-debug
+	@if test -e "$(win32_debugdir)"; then \
+	  echo "Error: please remove $(win32_debugdir), it is in the way"; \
+	  false; \
+	else \
+	  echo "OK."; mkdir -p "$(win32_debugdir)"; \
+	fi
 	for i in "" vlc-$(VERSION)/*$(LIBEXT) ; \
-	  do if test -n "$$i" ; then $(STRIP) "$$i" ; fi; done
+      do if test -n "$$i" ; then \
+      $(OBJCOPY) --only-keep-debug "$$i" "$$i.dbg"; \
+      $(OBJCOPY) --strip-debug "$$i" ; \
+      $(OBJCOPY) --add-gnu-debuglink="$$i.dbg" "$$i" ; \
+	  mv "$$i.dbg" "$(win32_debugdir)"; \
+    fi; done
+
 if BUILD_MOZILLA
-	$(STRIP) "vlc-$(VERSION)/mozilla/npvlc$(LIBEXT)"
+	$(OBJCOPY) --only-keep-debug "$(npvlc)" "$(npvlc).dbg"
+	$(OBJCOPY) --strip-debug "$(npvlc)"
+	$(OBJCOPY) --add-gnu-debuglink="$(npvlc).dbg" "$(npvlc)"
+	mv "$(npvlc).dbg" "$(win32_debugdir)"
 endif
 if BUILD_ACTIVEX
-	$(STRIP) "vlc-$(VERSION)/activex/axvlc$(LIBEXT)"
+	$(OBJCOPY) --only-keep-debug "$(axvlc)" "$(axvlc).dbg"
+	$(OBJCOPY) --strip-debug "$(axvlc)"
+	$(OBJCOPY) --add-gnu-debuglink="$(axvlc).dbg" "$(axvlc)"
+	mv "$(axvlc).dbg" "$(win32_debugdir)"
 endif
 
 #strip all plugins dll
 package-win32-base: package-win-common-strip
 	for i in "" $(win32_destdir)/plugins/*$(LIBEXT) ; \
-	  do if test -n "$$i" ; then $(STRIP) "$$i" ; fi ; done
+	  do if test -n "$$i" ; then \
+	  $(OBJCOPY) --only-keep-debug "$$i" "$$i.dbg"; \
+	  $(OBJCOPY) --strip-debug "$$i" ; \
+	  $(OBJCOPY) --add-gnu-debuglink="$$i.dbg" "$$i" ; \
+	  mv "$$i.dbg" "$(win32_debugdir)"; \
+	fi ; done
 
 package-win32-base-exe: package-win32-base
 # Create package
diff --git a/configure.ac b/configure.ac
index 20d92bc..5f9e09b 100644
--- a/configure.ac
+++ b/configure.ac
@@ -311,6 +311,7 @@ case "${host_os}" in
     ;;
   *mingw32* | *cygwin* | *wince* | *mingwce* | *pe*)
     AC_CHECK_TOOL(WINDRES, windres, :)
+    AC_CHECK_TOOL(OBJCOPY, objcopy, :)
 
     case "${host_os}" in
       *wince* | *mingwce* | *mingw32ce* | *pe*)




More information about the vlc-devel mailing list