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

Steve Lhomme robux4 at ycbcr.xyz
Thu May 16 17:17:46 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 |  3 +++
 src/Makefile.am   |  3 +++
 5 files changed, 25 insertions(+)

diff --git a/bin/Makefile.am b/bin/Makefile.am
index 0bfa668806..2ace669339 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,vlc.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..d610caf58e 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,libvlc.pdb
+endif
 if HAVE_OS2
 libvlc_la_LDFLAGS += -avoid-version
 endif
diff --git a/modules/common.am b/modules/common.am
index b991f6ce2f..d5be9f3d82 100644
--- a/modules/common.am
+++ b/modules/common.am
@@ -36,6 +36,9 @@ AM_LDFLAGS = \
 if HAVE_WIN32
 AM_LDFLAGS += $(top_builddir)/modules/module.rc.lo -Wc,-static
 endif
+if HAVE_PDB
+AM_LDFLAGS  += -Wl,-pdb,lib$(MODULE_STRING)_plugin.pdb
+endif
 AM_YFLAGS = -d -Wno-yacc
 
 SUFFIXES = .l .y .asm
diff --git a/src/Makefile.am b/src/Makefile.am
index bc826dfefe..94821ed661 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,libvlccore.pdb
+endif
 if HAVE_OS2
 libvlccore_la_LDFLAGS += -avoid-version
 endif
-- 
2.17.1



More information about the vlc-devel mailing list