[vlc-devel] [PATCH 3/4] configure: add an option to generate PDB files when building

Steve Lhomme robux4 at ycbcr.xyz
Mon May 20 11:23:57 CEST 2019


This will only be enabled when building windows targets and will only work when
compiling with Clang.
---
 bin/Makefile.am   |  3 +++
 configure.ac      | 13 +++++++++++++
 lib/Makefile.am   |  3 +++
 modules/common.am |  5 ++++-
 src/Makefile.am   |  3 +++
 5 files changed, 26 insertions(+), 1 deletion(-)

diff --git a/bin/Makefile.am b/bin/Makefile.am
index 0bfa668806..ab930117c9 100644
--- a/bin/Makefile.am
+++ b/bin/Makefile.am
@@ -32,6 +32,9 @@ else
 vlc_SOURCES = winvlc.c
 vlc_DEPENDENCIES = vlc_win32_rc.$(OBJEXT)
 vlc_LDFLAGS = -mwindows -Wc,-static
+if HAVE_PDB
+vlc_LDFLAGS += -Wl,-pdb=
+endif
 vlc_LDADD += vlc_win32_rc.$(OBJEXT)
 libbreakpad_wrapper_la_SOURCES = breakpad.cpp
 libbreakpad_wrapper_la_LIBADD = $(BREAKPAD_LIBS)
diff --git a/configure.ac b/configure.ac
index a08be619ac..ecb51a4cd6 100644
--- a/configure.ac
+++ b/configure.ac
@@ -349,6 +349,18 @@ AS_IF([test "${SYS}" = "mingw32"],[
   ])
 AC_DEFINE_UNQUOTED(VLC_WINSTORE_APP, ${vlc_winstore_app}, [Define to 1 if you want to build for Windows Store apps])
 
+vlc_build_pdb=0
+AC_ARG_ENABLE([pdb],
+     AS_HELP_STRING([--enable-pdb],
+                    [Build PDB files for windows targets (default off)]))
+AS_IF([test "${SYS}" = "mingw32"],[
+  AS_IF([test "${enable_pdb}" = "yes"], [
+    vlc_build_pdb=1
+    AX_APPEND_FLAG([-g -gcodeview],[CFLAGS])
+    AX_APPEND_FLAG([-g -gcodeview],[CXXFLAGS])
+  ],[])
+])
+
 AM_CONDITIONAL([HAVE_LINUX],   [test "${SYS}" = "linux"])
 AM_CONDITIONAL([HAVE_OS2],     [test "${SYS}" = "os2"])
 
@@ -364,6 +376,7 @@ AM_CONDITIONAL([HAVE_WIN32],   [test "${SYS}" = "mingw32"])
 AM_CONDITIONAL([HAVE_WIN64],   [test "${HAVE_WIN64}" = "1"]) dnl Only used for the packaging
 AM_CONDITIONAL([HAVE_WINSTORE], [test "$vlc_winstore_app" = "1"])
 AM_CONDITIONAL([HAVE_WIN32_DESKTOP], [test "${SYS}" = "mingw32" -a "$vlc_winstore_app" = "0"])
+AM_CONDITIONAL([HAVE_PDB],     [test "$vlc_build_pdb" = "1"])
 
 dnl Use nasm/yasm only on x86
 AC_CHECK_PROGS(X86ASM, [nasm yasm])
diff --git a/lib/Makefile.am b/lib/Makefile.am
index 8dbbaf9d2a..3198b33299 100644
--- a/lib/Makefile.am
+++ b/lib/Makefile.am
@@ -67,6 +67,9 @@ if HAVE_WIN32
 libvlc_la_DEPENDENCIES += ../src/libvlc_win32_rc.$(OBJEXT)
 libvlc_la_LDFLAGS += -Wl,../src/libvlc_win32_rc.$(OBJEXT) -avoid-version -Wc,-static
 endif
+if HAVE_PDB
+libvlc_la_LDFLAGS += -Wl,-pdb=
+endif
 if HAVE_OS2
 libvlc_la_LDFLAGS += -avoid-version
 endif
diff --git a/modules/common.am b/modules/common.am
index b991f6ce2f..f12d51e332 100644
--- a/modules/common.am
+++ b/modules/common.am
@@ -32,10 +32,13 @@ AM_LDFLAGS = \
 	-export-symbols-regex ^vlc_entry \
 	-shrext $(LIBEXT) \
 	-no-undefined \
-	$(top_builddir)/compat/libcompat.la $(LTLIBVLCCORE) 
+	$(top_builddir)/compat/libcompat.la $(LTLIBVLCCORE)
 if HAVE_WIN32
 AM_LDFLAGS += $(top_builddir)/modules/module.rc.lo -Wc,-static
 endif
+if HAVE_PDB
+AM_LDFLAGS  += -Wl,-pdb=
+endif
 AM_YFLAGS = -d -Wno-yacc
 
 SUFFIXES = .l .y .asm
diff --git a/src/Makefile.am b/src/Makefile.am
index bc826dfefe..28e6ed53e7 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -512,6 +512,9 @@ if HAVE_WIN32
 libvlccore_la_DEPENDENCIES += libvlc_win32_rc.$(OBJEXT)
 libvlccore_la_LDFLAGS += -Wl,libvlc_win32_rc.$(OBJEXT) -avoid-version -Wc,-static $(LIBCOM)
 endif
+if HAVE_PDB
+libvlccore_la_LDFLAGS += -Wl,-pdb=
+endif
 if HAVE_OS2
 libvlccore_la_LDFLAGS += -avoid-version
 endif
-- 
2.17.1



More information about the vlc-devel mailing list