From patchwork Sat Apr 15 01:27:34 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Aaron Levinson X-Patchwork-Id: 3415 Delivered-To: ffmpegpatchwork@gmail.com Received: by 10.103.3.129 with SMTP id 123csp444158vsd; Fri, 14 Apr 2017 18:27:47 -0700 (PDT) X-Received: by 10.223.142.172 with SMTP id q41mr9035104wrb.25.1492219667894; Fri, 14 Apr 2017 18:27:47 -0700 (PDT) Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id a2si764130wmc.86.2017.04.14.18.27.47; Fri, 14 Apr 2017 18:27:47 -0700 (PDT) Received-SPF: pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) client-ip=79.124.17.100; Authentication-Results: mx.google.com; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 604D068831E; Sat, 15 Apr 2017 04:27:37 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from white.spiritone.com (white.spiritone.com [216.99.193.38]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 3B8B7680AAF for ; Sat, 15 Apr 2017 04:27:31 +0300 (EEST) Received: from [192.168.3.100] (184-100-162-109.ptld.qwest.net [184.100.162.109]) by white.spiritone.com (Postfix) with ESMTPSA id 3E060734035C for ; Fri, 14 Apr 2017 18:27:36 -0700 (PDT) To: FFmpeg development discussions and patches From: Aaron Levinson Message-ID: Date: Fri, 14 Apr 2017 18:27:34 -0700 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0 MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH] Enhanced configure and Makefile to copy .pdb files to bindir for MSVC builds for make install X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: FFmpeg development discussions and patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: FFmpeg development discussions and patches Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" From 1059473c449c3079f03461bb42c2d3cc21d1b2c1 Mon Sep 17 00:00:00 2001 From: Aaron Levinson Date: Fri, 14 Apr 2017 18:14:21 -0700 Subject: [PATCH] Enhanced configure and Makefile to copy .pdb files to bindir for MSVC builds for make install Purpose: Enhanced configure and Makefile to copy .pdb files to bindir for MSVC builds for make install. Files are also uninstalled appropriately when make uninstall is exercised. Placing the PDB files in the same directory as other binaries can make it easier to debug, especially if the files are copied to another system. Note: General idea for how to properly handle the copying of PDB files associated with programs suggested by Hendrik Leppkes. Comments: -- configure: a) Leveraged already existing SLIB_INSTALL_EXTRA_SHLIB facility (which is already pretty specific to Windows) to add .pdb files, in addition to .lib files, for shared libraries to bindir during make install. b) Added PROG_INSTALL_EXTRA_BIN variable for MSVC builds and also added it to the section that causes it to be added to config.mak. This is used in Makefile to copy any additional files associated with programs. For MSVC, it is used to copy the pdb files associated with any executables that are built. Note that such executables are build with _g in the file name and are later copied to a filename without _g in the file name. As such, the PDB files have _g in the file name. -- Makefile: Enhanced install-progs and uninstall-progs targets to handle PROG_INSTALL_EXTRA_BIN if defined. It uses a similar procedure as already in place for SLIB_INSTALL_EXTRA_SHLIB in library.mak. --- Makefile | 2 ++ configure | 4 +++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index d5b51de..45c42c6 100644 --- a/Makefile +++ b/Makefile @@ -165,6 +165,7 @@ install-progs-$(CONFIG_SHARED): install-libs install-progs: install-progs-yes $(AVPROGS) $(Q)mkdir -p "$(BINDIR)" $(INSTALL) -c -m 755 $(INSTPROGS) "$(BINDIR)" + $(if $(PROG_INSTALL_EXTRA_BIN), $(INSTALL) -m 644 $(PROG_INSTALL_EXTRA_BIN) "$(BINDIR)") install-data: $(DATA_FILES) $(EXAMPLES_FILES) $(Q)mkdir -p "$(DATADIR)/examples" @@ -175,6 +176,7 @@ uninstall: uninstall-libs uninstall-headers uninstall-progs uninstall-data uninstall-progs: $(RM) $(addprefix "$(BINDIR)/", $(ALLAVPROGS)) + $(if $(PROG_INSTALL_EXTRA_BIN), $(RM) $(addprefix "$(BINDIR)/", $(PROG_INSTALL_EXTRA_BIN))) uninstall-data: $(RM) -r "$(DATADIR)" diff --git a/configure b/configure index 18d79ab..88206e3 100755 --- a/configure +++ b/configure @@ -4947,9 +4947,10 @@ case $target_os in SLIB_CREATE_DEF_CMD='$(SRC_PATH)/compat/windows/makedef $(SUBDIR)lib$(NAME).ver $(OBJS) > $$(@:$(SLIBSUF)=.def)' SLIB_INSTALL_NAME='$(SLIBNAME_WITH_MAJOR)' SLIB_INSTALL_LINKS= - SLIB_INSTALL_EXTRA_SHLIB='$(SLIBNAME:$(SLIBSUF)=.lib)' + SLIB_INSTALL_EXTRA_SHLIB='$(SLIBNAME:$(SLIBSUF)=.lib) $(SLIBNAME_WITH_MAJOR:$(SLIBSUF)=.pdb)' SLIB_INSTALL_EXTRA_LIB='$(SLIBNAME_WITH_MAJOR:$(SLIBSUF)=.def)' SHFLAGS='-dll -def:$$(@:$(SLIBSUF)=.def) -implib:$(SUBDIR)$(SLIBNAME:$(SLIBSUF)=.lib)' + PROG_INSTALL_EXTRA_BIN='$(AVPROGS-yes:%=%$(PROGSSUF)_g.pdb)' objformat="win32" ranlib=: enable dos_paths @@ -6796,6 +6797,7 @@ SLIB_INSTALL_NAME=${SLIB_INSTALL_NAME} SLIB_INSTALL_LINKS=${SLIB_INSTALL_LINKS} SLIB_INSTALL_EXTRA_LIB=${SLIB_INSTALL_EXTRA_LIB} SLIB_INSTALL_EXTRA_SHLIB=${SLIB_INSTALL_EXTRA_SHLIB} +PROG_INSTALL_EXTRA_BIN=${PROG_INSTALL_EXTRA_BIN} VERSION_SCRIPT_POSTPROCESS_CMD=${VERSION_SCRIPT_POSTPROCESS_CMD} SAMPLES:=${samples:-\$(FATE_SAMPLES)} NOREDZONE_FLAGS=$noredzone_flags