commit d1d22a1433e503c3f36aa982c2a7ec9d1f79273d
Author: Stephan Witt <sw...@lyx.org>
Date:   Sun Dec 5 11:10:11 2021 +0100

    introduce LSMinimumSystemVersion for Mac package with automatic Qt-version 
based detection plus configure option to choose it manually
---
 config/lyxinclude.m4                  |   25 +++++++++++++++++++++++++
 configure.ac                          |    2 ++
 development/LyX-Mac-binary-release.sh |    8 ++++----
 development/MacOSX/Info.plist.in      |    2 ++
 4 files changed, 33 insertions(+), 4 deletions(-)

diff --git a/config/lyxinclude.m4 b/config/lyxinclude.m4
index afad2bd..e4acd7b 100644
--- a/config/lyxinclude.m4
+++ b/config/lyxinclude.m4
@@ -674,6 +674,31 @@ AC_DEFUN([LYX_USE_INCLUDED_MYTHES],[
 ])
 
 
+dnl Usage: LYX_CHECK_MACOS_DEPLOYMENT_TARGET : select the macos deployment 
target
+dnl                       [default-auto-value])
+dnl  Assign the macosx-version-min value for compiler, linker and Info.plist.
+dnl  Default is dynamic - depends on used Qt library version.
+AC_DEFUN([LYX_CHECK_MACOS_DEPLOYMENT_TARGET],[
+  AC_ARG_WITH(macos-deployment-target,
+    [AS_HELP_STRING([--with-macos-deployment-target], [force the macos 
deployment target for LyX])],
+    [macos_deployment_target=$withval],
+    [macos_deployment_target=auto])
+  if test "${macos_deployment_target}" = "auto" ; then
+    macos_deployment_target="10.10"
+    case "$QTLIB_VERSION" in
+    6.*)
+      macos_deployment_target="10.14"
+      ;;
+    esac
+  fi
+  AM_CXXFLAGS="-mmacosx-version-min=$macos_deployment_target $AM_CXXFLAGS"
+  AM_LDFLAGS="-mmacosx-version-min=$macos_deployment_target $AM_LDFLAGS"
+  AC_SUBST(macos_deployment_target,"${macos_deployment_target}")
+  AC_MSG_CHECKING([the macos deployment target for LyX])
+  AC_MSG_RESULT([$macos_deployment_target])
+])
+
+
 dnl Usage: LYX_WITH_DIR(dir-name,desc,dir-var-name,default-value,
 dnl                       [default-yes-value])
 dnl  Adds a --with-'dir-name' option (described by 'desc') and puts the
diff --git a/configure.ac b/configure.ac
index 785d5c9..02a89a8 100644
--- a/configure.ac
+++ b/configure.ac
@@ -193,6 +193,8 @@ AC_CHECK_FUNCS(chmod close _close fork getpid _getpid lockf 
lstat mkfifo open _o
 AC_FUNC_MKDIR
 AC_FUNC_SELECT_ARGTYPES
 
+LYX_CHECK_MACOS_DEPLOYMENT_TARGET
+
 LYX_CHECK_SPELL_ENGINES
 LYX_USE_INCLUDED_MYTHES
 
diff --git a/development/LyX-Mac-binary-release.sh 
b/development/LyX-Mac-binary-release.sh
index 30233cc..04da1f3 100644
--- a/development/LyX-Mac-binary-release.sh
+++ b/development/LyX-Mac-binary-release.sh
@@ -146,7 +146,6 @@ usage() {
        echo " --aspell-deployment=yes|no ." default yes
        echo " --with-qt-frameworks=yes|no." default no
        echo " --qt-deployment=yes|no ....." default yes
-       echo " --with-macosx-target=TARGET " default 10.4 "(Tiger)"
        echo " --with-sdkroot=SDKROOT ....." default 10.5 "(Leopard)"
        echo " --with-arch=ARCH ..........." default ppc,i386
        echo " --with-build-path=PATH ....." default 
\${lyx-src-dir}/../lyx-build
@@ -190,8 +189,9 @@ while [ $# -gt 0 ]; do
                QTDIR=$(echo ${1}|cut -d= -f2)
                shift
                ;;
-       --with-macosx-target=*)
+       --with-macos-deployment-target=*)
                MACOSX_DEPLOYMENT_TARGET=$(echo ${1}|cut -d= -f2)
+               LyXConfigureOptions="${LyXConfigureOptions} ${1}"
                shift
                ;;
        --with-sdkroot=*)
@@ -690,8 +690,8 @@ build_lyx() {
                if [ -d "${LyxBuildDir}" ];  then rm -r "${LyxBuildDir}"; fi
                mkdir -p "${LyxBuildDir}" && cd "${LyxBuildDir}"
 
-               CPPFLAGS="${SDKROOT:+-isysroot ${SDKROOT}} -arch ${arch} 
${MYCFLAGS}"
-               LDFLAGS="${SDKROOT:+-isysroot ${SDKROOT}} -arch ${arch} 
${MYLDFLAGS}"
+               CPPFLAGS="${SDKROOT:+-isysroot ${SDKROOT}} -arch ${arch}"
+               LDFLAGS="${SDKROOT:+-isysroot ${SDKROOT}} -arch ${arch}"
 
                if [ "$configure_qt_frameworks" = "yes" ]; then
                        export QT_CORE_CFLAGS="-FQtCore"
diff --git a/development/MacOSX/Info.plist.in b/development/MacOSX/Info.plist.in
index 64f12ae..e8d3b09 100644
--- a/development/MacOSX/Info.plist.in
+++ b/development/MacOSX/Info.plist.in
@@ -41,6 +41,8 @@
        <string>YES</string>
        <key>OSAScriptingDefinition</key>
        <string>LyX.sdef</string>
+       <key>LSMinimumSystemVersion</key>
+       <string>@macos_deployment_target@</string>
        <key>NSHighResolutionCapable</key>
        <true/>
        <key>NSPrincipalClass</key>
-- 
lyx-cvs mailing list
lyx-cvs@lists.lyx.org
http://lists.lyx.org/mailman/listinfo/lyx-cvs

Reply via email to