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

Steve Lhomme robux4 at ycbcr.xyz
Thu May 16 10:03:24 CEST 2019


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

diff --git a/bin/Makefile.am b/bin/Makefile.am
index 0bfa668806..d3e9144efe 100644
--- a/bin/Makefile.am
+++ b/bin/Makefile.am
@@ -25,6 +25,7 @@ endif
 #
 vlc_LDADD = ../lib/libvlc.la
 vlc_CPPFLAGS = $(AM_CPPFLAGS)
+vlc_CFLAGS = $(AM_CFLAGS)
 if !HAVE_WIN32
 vlc_SOURCES = vlc.c override.c
 vlc_LDADD += $(LIBDL)
@@ -32,6 +33,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/compat/Makefile.am b/compat/Makefile.am
index d709d565c5..785721c0aa 100644
--- a/compat/Makefile.am
+++ b/compat/Makefile.am
@@ -2,6 +2,9 @@ pkglib_LTLIBRARIES = libcompat.la
 libcompat_la_SOURCES = dummy.c
 libcompat_la_LIBADD = $(LTLIBOBJS) $(LIBRT) $(LIBM)
 libcompat_la_LDFLAGS = -no-undefined -static
+if HAVE_PDB
+libcompat_la_LDFLAGS += -Wl,-pdb,libcompat.pdb
+endif
 
 BUILT_SOURCES = dummy.c
 CLEANFILES = dummy.c
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..d7ce6ebe38 100644
--- a/lib/Makefile.am
+++ b/lib/Makefile.am
@@ -63,10 +63,14 @@ libvlc_la_LDFLAGS = \
 	-version-info 12:0:0 \
 	-export-symbols $(srcdir)/libvlc.sym
 libvlc_la_DEPENDENCIES = libvlc.sym
+libvlc_la_CFLAGS = $(AM_CFLAGS)
 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..f59ad45381 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -508,10 +508,14 @@ libvlccore_la_LDFLAGS = \
 	-export-symbols $(srcdir)/libvlccore.sym \
 	-version-info 9:0:0
 libvlccore_la_DEPENDENCIES = libvlccore.sym
+libvlccore_la_CFLAGS = $(AM_CFLAGS)
 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