mirror of
https://gitlab.com/mbunkus/mkvtoolnix.git
synced 2025-02-04 00:09:31 +00:00
build system: optionally link against Dr. MinGW's crash backtrace library
This commit is contained in:
parent
a21ee36733
commit
7f3d89d9e6
3
Rakefile
3
Rakefile
@ -134,6 +134,7 @@ def setup_globals
|
||||
cflags_common += " -march=i686" if $building_for[:windows] && /i686/.match(c(:host))
|
||||
cflags_common += " -fPIC " if c?(:USE_QT) && !$building_for[:windows]
|
||||
cflags_common += " -DQT_STATICPLUGIN" if c?(:USE_QT) && $building_for[:windows]
|
||||
cflags_common += " -DUSE_DRMINGW -I#{c(:DRMINGW_PATH)}/include" if c?(:USE_DRMINGW) && $building_for[:windows]
|
||||
cflags_common += " -DMTX_APPIMAGE" if c?(:APPIMAGE_BUILD) && !$building_for[:windows]
|
||||
|
||||
cflags = "#{cflags_common} #{c(:USER_CFLAGS)}"
|
||||
@ -148,6 +149,7 @@ def setup_globals
|
||||
ldflags += " -Llib/libebml/src -Llib/libmatroska/src" if c?(:EBML_MATROSKA_INTERNAL)
|
||||
ldflags += " #{c(:EXTRA_LDFLAGS)} #{c(:PROFILING_LIBS)} #{c(:USER_LDFLAGS)} #{c(:LDFLAGS_RPATHS)} #{c(:BOOST_LDFLAGS)}"
|
||||
ldflags += " -Wl,--dynamicbase,--nxcompat" if $building_for[:windows]
|
||||
ldflags += " -L#{c(:DRMINGW_PATH)}/lib" if c?(:USE_DRMINGW) && $building_for[:windows]
|
||||
ldflags += " -fsanitize=undefined" if c?(:UBSAN)
|
||||
ldflags += " -fsanitize=address -fno-omit-frame-pointer" if c?(:ADDRSAN)
|
||||
ldflags += " #{c(:FSTACK_PROTECTOR)}"
|
||||
@ -951,6 +953,7 @@ $common_libs = [
|
||||
]
|
||||
|
||||
$common_libs += [:cmark] if c?(:USE_QT)
|
||||
$common_libs += [:exchndl] if c?(:USE_DRMINGW) && $building_for[:windows]
|
||||
if !$libmtxcommon_as_dll
|
||||
$common_libs += [
|
||||
:matroska,
|
||||
|
29
ac/drmingw.m4
Normal file
29
ac/drmingw.m4
Normal file
@ -0,0 +1,29 @@
|
||||
AC_ARG_WITH(drmingw,
|
||||
AC_HELP_STRING([--with-drmingw=path],[use link against Dr. MinGW's crash reporting library found in path]),
|
||||
[ drmingw_path="$with_drmingw" ],)
|
||||
|
||||
USE_DRMINGW=no
|
||||
|
||||
if ! test -z "$drmingw_path"; then
|
||||
AC_CACHE_CHECK([for Dr. MinGW], [ax_cv_drmingw_found], [
|
||||
save_CFLAGS="$CFLAGS"
|
||||
save_LIBS="$LIBS"
|
||||
CFLAGS="$CFLAGS -I$drmingw_path/include"
|
||||
LIBS="$LIBS -L$drmingw_path/lib -lexchndl"
|
||||
AC_TRY_LINK(
|
||||
[#include "exchndl.h"],
|
||||
[ExcHndlInit();],
|
||||
[ax_cv_drmingw_found=yes],
|
||||
[ax_cv_drmingw_found=no])
|
||||
CFLAGS="$save_CFLAGS"
|
||||
LIBS="$save_LIBS"
|
||||
])
|
||||
|
||||
if test x"$ax_cv_drmingw_found" = xyes; then
|
||||
DRMINGW_PATH="$drmingw_path"
|
||||
USE_DRMINGW=yes
|
||||
fi
|
||||
fi
|
||||
|
||||
AC_SUBST(DRMINGW_PATH)
|
||||
AC_SUBST(USE_DRMINGW)
|
@ -87,6 +87,7 @@ COMPILER_TYPE = @COMPILER_TYPE@
|
||||
COMPILER_VERSION = @COMPILER_VERSION@
|
||||
DEBUG_CFLAGS = @DEBUG_CFLAGS@
|
||||
DOCBOOK_ROOT = @DOCBOOK_ROOT@
|
||||
DRMINGW_PATH = @DRMINGW_PATH@
|
||||
EBML_MATROSKA_INTERNAL = @EBML_MATROSKA_INTERNAL@
|
||||
EBML_CFLAGS = @EBML_CFLAGS@
|
||||
EBML_LIBS = @EBML_LIBS@
|
||||
@ -145,6 +146,7 @@ XSLTPROC_FLAGS = @XSLTPROC_FLAGS@
|
||||
ZLIB_LIBS = @ZLIB_LIBS@
|
||||
|
||||
# Which additional stuff to compile
|
||||
USE_DRMINGW = @USE_DRMINGW@
|
||||
USE_QT = @USE_QT@
|
||||
APPIMAGE_BUILD = @APPIMAGE_BUILD@
|
||||
BUILD_TOOLS = @BUILD_TOOLS@
|
||||
|
@ -17,6 +17,7 @@ m4_include(ac/compiler_flags.m4)
|
||||
m4_include(ac/endianess.m4)
|
||||
m4_include(ac/mingw.m4)
|
||||
m4_include(ac/extra_inc_lib.m4)
|
||||
m4_include(ac/drmingw.m4)
|
||||
m4_include(ac/debugging_profiling.m4)
|
||||
m4_include(ac/precompiled_headers.m4)
|
||||
m4_include(ac/inttypes.m4)
|
||||
|
@ -160,8 +160,10 @@ Section "Program files" SEC01
|
||||
File /r "../locale"
|
||||
File /r "../share"
|
||||
|
||||
; Both if Qt is linked shared and if Dr. MinGW is used:
|
||||
File /nonfatal "../*.dll"
|
||||
|
||||
!if ${MTX_LINK_TYPE} == "shared"
|
||||
File "../*.dll"
|
||||
File "../qt.conf"
|
||||
File /r "../plugins"
|
||||
!endif
|
||||
|
@ -98,6 +98,28 @@ EOF
|
||||
print -- " done"
|
||||
}
|
||||
|
||||
function copy_drmingw_dlls {
|
||||
local drmingw_dir
|
||||
|
||||
cd ${src_dir}
|
||||
|
||||
if [[ -f build-config.local ]]; then
|
||||
drmingw_dir="$(awk -F= '/^DRMINGW_PATH/ { gsub("^ +| +$", "", $2); print $2 }' < build-config.local)"
|
||||
fi
|
||||
|
||||
if [[ -z ${drmingw_dir} ]]; then
|
||||
drmingw_dir="$(awk -F= '/^DRMINGW_PATH/ { gsub("^ +| +$", "", $2); print $2 }' < build-config)"
|
||||
fi
|
||||
|
||||
if [[ -z ${drmingw_dir} ]] return
|
||||
|
||||
print -n -- "Copying Dr. MinGW DLLs…"
|
||||
|
||||
cp ${drmingw_dir}/bin/*.dll ${tgt_dir}/
|
||||
|
||||
echo " done"
|
||||
}
|
||||
|
||||
function copy_files {
|
||||
local qt5trdir lang baseqm mo qm
|
||||
print -n -- "Copying files…"
|
||||
@ -208,6 +230,7 @@ setup_variables
|
||||
create_directories
|
||||
copy_files
|
||||
copy_dlls
|
||||
copy_drmingw_dlls
|
||||
strip_files
|
||||
sign_exes
|
||||
|
||||
|
@ -35,6 +35,12 @@
|
||||
#include "common/strings/editing.h"
|
||||
#include "common/translation.h"
|
||||
|
||||
#if defined(USE_DRMINGW)
|
||||
extern "C" {
|
||||
# include "exchndl.h"
|
||||
}
|
||||
#endif
|
||||
|
||||
#if defined(SYS_WINDOWS)
|
||||
#include "common/fs_sys_helpers.h"
|
||||
|
||||
@ -174,6 +180,10 @@ set_process_priority(int priority) {
|
||||
void
|
||||
mtx_common_init(std::string const &program_name,
|
||||
char const *argv0) {
|
||||
#if defined(USE_DRMINGW)
|
||||
ExcHndlInit();
|
||||
#endif
|
||||
|
||||
random_c::init();
|
||||
|
||||
g_cc_local_utf8 = charset_converter_c::init("");
|
||||
|
Loading…
Reference in New Issue
Block a user