mirror of
https://github.com/crystalidea/qt6windows7.git
synced 2025-07-05 00:35:27 +08:00
qt 6.5.1 original
This commit is contained in:
31
mkspecs/features/data/configure.json
Normal file
31
mkspecs/features/data/configure.json
Normal file
@ -0,0 +1,31 @@
|
||||
{
|
||||
"files": {
|
||||
},
|
||||
|
||||
"commandline": {
|
||||
"options": {
|
||||
"v": { "type": "enum", "name": "verbose", "values": { "yes": "true", "no": "false" } },
|
||||
"verbose": { "type": "enum", "values": { "yes": "true", "no": "false" } },
|
||||
|
||||
"continue": "void",
|
||||
|
||||
"recheck": { "type": "optionalString", "name": "cache_recheck" },
|
||||
"recheck-all": { "type": "void", "name": "cache_use", "value": "none" },
|
||||
|
||||
"redo": { "type": "redo" },
|
||||
|
||||
"list-features": "void",
|
||||
"list-libraries": "void"
|
||||
}
|
||||
},
|
||||
|
||||
"testTypeDependencies": {
|
||||
"library": [ "library-paths" ]
|
||||
},
|
||||
|
||||
"features": {
|
||||
"library-paths": {
|
||||
"output": [ "libraryPaths" ]
|
||||
}
|
||||
}
|
||||
}
|
2
mkspecs/features/data/dummy.cpp
Normal file
2
mkspecs/features/data/dummy.cpp
Normal file
@ -0,0 +1,2 @@
|
||||
// Used when we need to compile with no source code
|
||||
// (controls are in the command-line)
|
19
mkspecs/features/data/dumpvcvars.bat
Normal file
19
mkspecs/features/data/dumpvcvars.bat
Normal file
@ -0,0 +1,19 @@
|
||||
:: Copyright (C) 2018 The Qt Company Ltd.
|
||||
:: SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
|
||||
|
||||
@echo off
|
||||
|
||||
REM We clear INCLUDE and LIB, because we want to obtain pristine values.
|
||||
REM PATH cannot be cleared, because then the script does not even run,
|
||||
REM and it would be counterproductive anyway (see toolchain.prf).
|
||||
set INCLUDE=
|
||||
set LIB=
|
||||
|
||||
call %* || exit 1
|
||||
REM VS2015 does not set errorlevel in case of failure.
|
||||
if "%INCLUDE%" == "" exit 1
|
||||
|
||||
echo =+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=
|
||||
echo %INCLUDE%
|
||||
echo %LIB%
|
||||
echo %PATH%
|
227
mkspecs/features/data/mac/objc_namespace.sh
Normal file
227
mkspecs/features/data/mac/objc_namespace.sh
Normal file
@ -0,0 +1,227 @@
|
||||
#!/bin/bash
|
||||
# Copyright (C) 2017 The Qt Company Ltd.
|
||||
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
|
||||
|
||||
script_argument_prefix="-Wobjc_namespace,--"
|
||||
|
||||
required_arguments="target suffix original_ld"
|
||||
optional_arguments="exclude_list exclude_regex silent"
|
||||
|
||||
for argument in $required_arguments $optional_arguments; do
|
||||
declare "$argument="
|
||||
done
|
||||
|
||||
declare -i silent=0
|
||||
declare -a linker_arguments
|
||||
|
||||
for i in "$@"; do
|
||||
case $1 in
|
||||
$script_argument_prefix*)
|
||||
declare "${1#$script_argument_prefix}"
|
||||
;;
|
||||
-o)
|
||||
if [ -n "$2" ]; then
|
||||
target="$2"
|
||||
fi
|
||||
linker_arguments+=("$1")
|
||||
;;
|
||||
*)
|
||||
linker_arguments+=("$1")
|
||||
;;
|
||||
esac
|
||||
shift
|
||||
done
|
||||
|
||||
get_entry() {
|
||||
local map=$1 key=$2
|
||||
local i="${map}_map_${2}"
|
||||
printf '%s' "${!i}"
|
||||
}
|
||||
|
||||
error() {
|
||||
echo "$0: error: $*" >&2
|
||||
exit 1
|
||||
}
|
||||
|
||||
for argument in $required_arguments; do
|
||||
if [ -z "${!argument}" ]; then
|
||||
error "missing argument --${argument}"
|
||||
fi
|
||||
done
|
||||
|
||||
# Normalize suffix so we can use it as a bash variable
|
||||
suffix=${suffix//[-. ]/_}
|
||||
|
||||
link_binary() {
|
||||
(PS4=; test $silent -ne 1 && set -x; $original_ld "${linker_arguments[@]}" "$@") 2>&1 || exit 1
|
||||
}
|
||||
|
||||
sanitize_address() {
|
||||
local address="$1"
|
||||
address=${address#0x} # Remove hex prefix
|
||||
address=${address: ${#address} < 8 ? 0 : -8} # Limit to 32-bit
|
||||
echo "0x$address"
|
||||
}
|
||||
|
||||
arch_offset=0
|
||||
read_binary() {
|
||||
local address=$1
|
||||
local length=$2
|
||||
|
||||
seek=$(($address + $arch_offset))
|
||||
dd if="$target" bs=1 iseek=$seek count=$length 2>|/dev/null
|
||||
}
|
||||
|
||||
read_32bit_value() {
|
||||
local address=$1
|
||||
read_binary $address 4 | xxd -p | dd conv=swab 2>/dev/null | rev
|
||||
}
|
||||
|
||||
otool_args=
|
||||
otool() {
|
||||
command otool $otool_args "$@"
|
||||
}
|
||||
|
||||
declare -a extra_classnames_files
|
||||
|
||||
inspect_binary() {
|
||||
inspect_mode="$1"
|
||||
|
||||
classnames_section="__objc_classname"
|
||||
classnames=$(otool -v -s __TEXT $classnames_section "$target" | tail -n +3)
|
||||
if [ -z "$classnames" ]; then
|
||||
echo " ℹ️ No Objective-C classes found in binary"
|
||||
return 1
|
||||
fi
|
||||
|
||||
while read -a classname; do
|
||||
address=$(sanitize_address ${classname[0]})
|
||||
name=${classname[1]}
|
||||
|
||||
declare "address_to_classname_map_$address=$name"
|
||||
declare "classname_to_address_map_$name=$address"
|
||||
done <<< "$classnames"
|
||||
|
||||
extra_classnames_file="$(mktemp -t ${classnames_section}_additions).S"
|
||||
extra_classnames_files+=("$extra_classnames_file")
|
||||
|
||||
if [ "$inspect_mode" == "inject_classnames" ]; then
|
||||
echo " ℹ️ Class names have not been namespaced, adding suffix '$suffix'..."
|
||||
printf ".section __TEXT,$classnames_section,cstring_literals,no_dead_strip\n" > $extra_classnames_file
|
||||
elif [ "$inspect_mode" == "patch_classes" ]; then
|
||||
echo " ℹ️ Found namespaced class names, updating class entries..."
|
||||
fi
|
||||
|
||||
classes=$(otool -o -v "$target" | grep "OBJC_CLASS_RO\|OBJC_METACLASS_RO")
|
||||
if [ -z "$classes" ]; then
|
||||
echo " 💥 Failed to read class entries from binary"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
while read -a class; do
|
||||
address="$(sanitize_address ${class[1]})"
|
||||
class_flags="0x$(read_32bit_value $address)"
|
||||
if [ -z "$class_flags" ]; then
|
||||
echo " 💥 Failed to read class flags for class at $address"
|
||||
continue
|
||||
fi
|
||||
|
||||
is_metaclass=$(($class_flags & 0x1))
|
||||
|
||||
name_offset=$(($address + 24))
|
||||
classname_address="0x$(read_32bit_value $name_offset)"
|
||||
if [ -z "$classname_address" ]; then
|
||||
echo " 💥 Failed to read class name address for class at $address"
|
||||
continue
|
||||
fi
|
||||
|
||||
classname=$(get_entry address_to_classname $classname_address)
|
||||
if [ -z "$classname" ]; then
|
||||
echo " 💥 Failed to resolve class name for address '$classname_address'"
|
||||
continue
|
||||
fi
|
||||
|
||||
if [[ $exclude_list =~ $classname || $classname =~ $exclude_regex ]]; then
|
||||
if [ $is_metaclass -eq 1 ]; then
|
||||
class_type="meta class"
|
||||
else
|
||||
class_type="class"
|
||||
fi
|
||||
echo " 🚽 Skipping excluded $class_type '$classname'"
|
||||
continue
|
||||
fi
|
||||
|
||||
newclassname="${classname}_${suffix}"
|
||||
|
||||
if [ "$inspect_mode" == "inject_classnames" ]; then
|
||||
if [ $is_metaclass -eq 1 ]; then
|
||||
continue
|
||||
fi
|
||||
|
||||
echo " 💉 Injecting $classnames_section entry '$newclassname' for '$classname'"
|
||||
printf ".asciz \"$newclassname\"\n" >> $extra_classnames_file
|
||||
|
||||
elif [ "$inspect_mode" == "patch_classes" ]; then
|
||||
newclassname_address=$(get_entry classname_to_address ${newclassname})
|
||||
if [ -z "$newclassname_address" ]; then
|
||||
echo " 💥 Failed to resolve class name address for class '$newclassname'"
|
||||
continue
|
||||
fi
|
||||
|
||||
if [ $is_metaclass -eq 1 ]; then
|
||||
class_type="meta"
|
||||
else
|
||||
class_type="class"
|
||||
fi
|
||||
|
||||
name_offset=$(($name_offset + $arch_offset))
|
||||
|
||||
echo " 🔨 Patching class_ro_t at $address ($class_type) from $classname_address ($classname) to $newclassname_address ($newclassname)"
|
||||
echo ${newclassname_address: -8} | rev | dd conv=swab 2>/dev/null | xxd -p -r -seek $name_offset -l 4 - "$target"
|
||||
fi
|
||||
done <<< "$classes"
|
||||
}
|
||||
|
||||
echo "🔩 Linking binary using '$original_ld'..."
|
||||
link_binary
|
||||
|
||||
echo "🔎 Inspecting binary '$target'..."
|
||||
if [ ! -f "$target" ]; then
|
||||
echo " 💥 Target does not exist!"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
read -a mach_header <<< "$(otool -h "$target" -v | tail -n 1)"
|
||||
if [ "${mach_header[0]}" != "MH_MAGIC_64" ]; then
|
||||
echo " 💥 Binary is not 64-bit, only 64-bit binaries are supported!"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
architectures=$(otool -f -v "$target" | grep architecture)
|
||||
|
||||
setup_arch() {
|
||||
arch="$1"
|
||||
if [ ! -z "$arch" ]; then
|
||||
otool_args="-arch $arch"
|
||||
offset=$(otool -f -v "$target" | grep -A 6 "architecture $arch" | grep offset)
|
||||
offset="${offset##*( )}"
|
||||
arch_offset="$(echo $offset | cut -d ' ' -f 2)"
|
||||
echo "🤖 Processing architecture '$arch' at offset $arch_offset..."
|
||||
fi
|
||||
}
|
||||
|
||||
while read -a arch; do
|
||||
setup_arch "${arch[1]}"
|
||||
inspect_binary inject_classnames
|
||||
if [ $? -ne 0 ]; then
|
||||
exit
|
||||
fi
|
||||
done <<< "$architectures"
|
||||
|
||||
echo "🔩 Re-linking binary with extra __objc_classname section(s)..."
|
||||
link_binary "${extra_classnames_files[@]}"
|
||||
|
||||
while read -a arch; do
|
||||
setup_arch "${arch[1]}"
|
||||
inspect_binary patch_classes
|
||||
done <<< "$architectures"
|
32
mkspecs/features/data/macros.cpp
Normal file
32
mkspecs/features/data/macros.cpp
Normal file
@ -0,0 +1,32 @@
|
||||
// Keep this file small. The pre-processed contents are eval'd by qmake.
|
||||
QT_COMPILER_STDCXX = __cplusplus
|
||||
#ifdef _MSC_VER
|
||||
QMAKE_MSC_VER = _MSC_VER
|
||||
QMAKE_MSC_FULL_VER = _MSC_FULL_VER
|
||||
#endif
|
||||
#ifdef __INTEL_COMPILER
|
||||
QMAKE_ICC_VER = __INTEL_COMPILER
|
||||
QMAKE_ICC_UPDATE_VER = __INTEL_COMPILER_UPDATE
|
||||
#endif
|
||||
#ifdef __APPLE_CC__
|
||||
QMAKE_APPLE_CC = __APPLE_CC__
|
||||
#endif
|
||||
#ifdef __clang__
|
||||
#ifdef __APPLE_CC__
|
||||
QMAKE_APPLE_CLANG_MAJOR_VERSION = __clang_major__
|
||||
QMAKE_APPLE_CLANG_MINOR_VERSION = __clang_minor__
|
||||
QMAKE_APPLE_CLANG_PATCH_VERSION = __clang_patchlevel__
|
||||
#else
|
||||
QMAKE_CLANG_MAJOR_VERSION = __clang_major__
|
||||
QMAKE_CLANG_MINOR_VERSION = __clang_minor__
|
||||
QMAKE_CLANG_PATCH_VERSION = __clang_patchlevel__
|
||||
#endif
|
||||
#endif
|
||||
#ifdef __GNUC__
|
||||
QMAKE_GCC_MAJOR_VERSION = __GNUC__
|
||||
QMAKE_GCC_MINOR_VERSION = __GNUC_MINOR__
|
||||
QMAKE_GCC_PATCH_VERSION = __GNUC_PATCHLEVEL__
|
||||
#endif
|
||||
#ifdef __ghs__
|
||||
QMAKE_GHS_VERSION = __GHS_VERSION_NUMBER
|
||||
#endif
|
29
mkspecs/features/data/testserver/Dockerfile
Normal file
29
mkspecs/features/data/testserver/Dockerfile
Normal file
@ -0,0 +1,29 @@
|
||||
# This Dockerfile is used to provision the shared scripts (e.g. startup.sh) and configurations. It
|
||||
# relies on the arguments passed by docker-compose file to build additional images for each service.
|
||||
# To lean more how it works, please check the topic "Use multi-stage builds".
|
||||
# https://docs.docker.com/develop/develop-images/multistage-build/
|
||||
|
||||
ARG provisioningImage
|
||||
FROM $provisioningImage as testserver_tier2
|
||||
|
||||
# Add and merge the testdata into service folder
|
||||
ARG serviceDir
|
||||
ARG shareDir=$serviceDir
|
||||
COPY $serviceDir $shareDir service/
|
||||
|
||||
# create the shared script of testserver
|
||||
RUN echo "#!/usr/bin/env bash\n" \
|
||||
"set -ex\n" \
|
||||
"for RUN_CMD; do \$RUN_CMD; done\n" \
|
||||
"service dbus restart\n" \
|
||||
"service avahi-daemon restart\n" \
|
||||
"sleep infinity\n" > startup.sh
|
||||
RUN chmod +x startup.sh
|
||||
|
||||
# rewrite the default configurations of avahi-daemon
|
||||
# Disable IPv6 of avahi-daemon to resolve the unstable connections on Windows
|
||||
ARG test_domain
|
||||
RUN sed -i -e "s,#domain-name=local,domain-name=${test_domain:-test-net.qt.local}," \
|
||||
-e "s,#publish-aaaa-on-ipv4=yes,publish-aaaa-on-ipv4=no," \
|
||||
-e "s,use-ipv6=yes,use-ipv6=no," \
|
||||
/etc/avahi/avahi-daemon.conf
|
38
mkspecs/features/data/testserver/docker-compose-common.yml
Normal file
38
mkspecs/features/data/testserver/docker-compose-common.yml
Normal file
@ -0,0 +1,38 @@
|
||||
version: '2.1'
|
||||
|
||||
# This is a template docker-compose file shared with all modules. It is based
|
||||
# on 'extending services' feature of compose file version 2.1.
|
||||
# See https://docs.docker.com/compose/extends/#extending-services for details.
|
||||
#
|
||||
# Example: testserver/docker-compose.yml
|
||||
# services:
|
||||
# foo:
|
||||
# extends:
|
||||
# file: ${SHARED_DATA}/docker-compose-common.yml
|
||||
# service: ${SHARED_SERVICE}
|
||||
# container_name: qt-test-server-foo
|
||||
# hostname: ${HOST_NAME:-foo}
|
||||
# build:
|
||||
# context: .
|
||||
# args:
|
||||
# provisioningImage: qt-test-server-foo:537fe302f61851d1663...
|
||||
# serviceDir: ./foo
|
||||
# command: service/foo.sh
|
||||
|
||||
x-services:
|
||||
&default-service
|
||||
domainname: ${TEST_DOMAIN}
|
||||
build:
|
||||
context: .
|
||||
dockerfile: ${SHARED_DATA}/Dockerfile
|
||||
args:
|
||||
test_domain: ${TEST_DOMAIN}
|
||||
entrypoint: ./startup.sh
|
||||
|
||||
services:
|
||||
bridge-network: *default-service
|
||||
host-network:
|
||||
<< : *default-service
|
||||
network_mode: "host"
|
||||
extra_hosts:
|
||||
- "qt-test-server.${TEST_DOMAIN}:${MACHINE_IP}"
|
Reference in New Issue
Block a user