Revision | f9d94481299d8ba45cb85eaf076232adff6aa45d (tree) |
---|---|
Time | 2023-01-07 15:58:00 |
Author | Fs <Fsu0413@vip....> |
Commiter | Fs |
always use GNU sed
GNU sed has different cli than BSD sed
Signed-off-by: Fs <Fsu0413@vip.qq.com>
@@ -59,25 +59,44 @@ chmod +x "${PATH_TO_TARGET}/bin/qmake" | ||
59 | 59 | echo "\$script_dir_path/../host/bin/qtpaths -qtconf \"\$script_dir_path/target_qt.conf\" \$*" |
60 | 60 | ) > "${PATH_TO_TARGET}/bin/qtpaths" |
61 | 61 | |
62 | +# judge if sed / gsed is GNU sed | |
63 | +GNU_SED= | |
64 | + | |
65 | +for SED_PROGRAM in gsed sed; do | |
66 | + GSED_OUTPUT="`LANG=C $SED_PROGRAM --help 2> /dev/null`" | |
67 | + if [ $? -eq 0 ] ; then | |
68 | + if echo "$GSED_OUTPUT" | grep -q -F "GNU sed"; then | |
69 | + echo "Found GNU sed: $SED_PROGRAM" | |
70 | + GNU_SED=$SED_PROGRAM | |
71 | + break | |
72 | + fi | |
73 | + fi | |
74 | +done | |
75 | + | |
76 | +# we have no idea but use default sed program | |
77 | +if [ x"$GNU_SED" = x ]; then | |
78 | + GNU_SED=sed | |
79 | +fi | |
80 | + | |
62 | 81 | chmod +x "${PATH_TO_TARGET}/bin/qtpaths" |
63 | 82 | |
64 | -sed -i '' -e 's,^HostPrefix=.*$,HostPrefix=../host,g' "${PATH_TO_TARGET}/bin/target_qt.conf" | |
65 | -sed -i '' -e 's,^HostData=.*$,HostData=..,g' "${PATH_TO_TARGET}/bin/target_qt.conf" | |
83 | +$GNU_SED -i -e 's,^HostPrefix=.*$,HostPrefix=../host,g' "${PATH_TO_TARGET}/bin/target_qt.conf" | |
84 | +$GNU_SED -i -e 's,^HostData=.*$,HostData=..,g' "${PATH_TO_TARGET}/bin/target_qt.conf" | |
66 | 85 | |
67 | 86 | # CMake tweak / Qt 6.4.1 + |
68 | 87 | |
69 | -sed -i '' -e 's,^set(__qt_platform_initial_qt_host_path[[:space:]].*$,set(__qt_platform_initial_qt_host_path "${Qt6_DIR}/../../../host"),' "${PATH_TO_TARGET}/lib/cmake/Qt6/Qt6Dependencies.cmake" | |
70 | -sed -i '' -e 's,^set(__qt_platform_initial_qt_host_path_cmake_dir[[:space:]].*$,set(__qt_platform_initial_qt_host_path_cmake_dir "${Qt6_DIR}/../../../host/lib/cmake"),' "${PATH_TO_TARGET}/lib/cmake/Qt6/Qt6Dependencies.cmake" | |
88 | +$GNU_SED -i -e 's,^set(__qt_platform_initial_qt_host_path[[:space:]].*$,set(__qt_platform_initial_qt_host_path "${Qt6_DIR}/../../../host"),' "${PATH_TO_TARGET}/lib/cmake/Qt6/Qt6Dependencies.cmake" | |
89 | +$GNU_SED -i -e 's,^set(__qt_platform_initial_qt_host_path_cmake_dir[[:space:]].*$,set(__qt_platform_initial_qt_host_path_cmake_dir "${Qt6_DIR}/../../../host/lib/cmake"),' "${PATH_TO_TARGET}/lib/cmake/Qt6/Qt6Dependencies.cmake" | |
71 | 90 | |
72 | 91 | # CMake tweak / Qt 6.2.4 |
73 | 92 | |
74 | -sed -i '' -e '/^set(__qt_toolchain_initial_qt_host_path[[:space:]]*$/{N | |
93 | +$GNU_SED -i -e '/^set(__qt_toolchain_initial_qt_host_path[[:space:]]*$/{N | |
75 | 94 | c\ |
76 | 95 | set(__qt_toolchain_initial_qt_host_path "${CMAKE_CURRENT_LIST_DIR}/../../../host") |
77 | 96 | d |
78 | 97 | }' "${PATH_TO_TARGET}/lib/cmake/Qt6/qt.toolchain.cmake" |
79 | 98 | |
80 | -sed -i '' -e '/^set(__qt_toolchain_initial_qt_host_path_cmake_dir[[:space:]]*$/{N | |
99 | +$GNU_SED -i -e '/^set(__qt_toolchain_initial_qt_host_path_cmake_dir[[:space:]]*$/{N | |
81 | 100 | c\ |
82 | 101 | set(__qt_toolchain_initial_qt_host_path_cmake_dir "${CMAKE_CURRENT_LIST_DIR}/../../../host/lib/cmake") |
83 | 102 | d |