summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorruki <[email protected]>2025-11-23 22:18:28 +0800
committerruki <[email protected]>2025-11-23 22:19:48 +0800
commitbfaf74e86fbb99c5a83f95e1fcc484868f7270ff (patch)
treef0d32797de1dfc62e7820a857d761f7d06398973
parent036dde2efaa08e206974c5a483e072c09eff4b47 (diff)
fix configure
-rwxr-xr-xconfigure68
m---------core/src/tbox/tbox0
2 files changed, 17 insertions, 51 deletions
diff --git a/configure b/configure
index 74a45e63b..deba96413 100755
--- a/configure
+++ b/configure
@@ -317,16 +317,28 @@ _os_iorunv() {
}
# find file in the given directory
-# e.g. _os_find . xmake.sh
+# e.g. _os_find . xmake.sh [depth]
_os_find() {
local dir="${1}"
local name="${2}"
local depth="${3}"
if test_nz "${depth}"; then
- # Solaris find doesn't support -maxdepth/-mindepth, use manual search
+ # Solaris doesn't support -maxdepth, use shell to filter depth
if is_host "solaris"; then
_ret=""
- _os_find_recursive "${dir}" "${name}" "${depth}" 0
+ local file=""
+ for file in $(find "${dir}" -type f -name "${name}" | LC_ALL=C sort); do
+ local relpath="${file#${dir}/}"
+ local slash_count=$(echo "${relpath}" | tr -cd '/' | wc -c | tr -d ' ')
+ if test "${slash_count}" = "$((${depth} - 1))"; then
+ if test -z "${_ret}"; then
+ _ret="${file}"
+ else
+ _ret="${_ret}
+${file}"
+ fi
+ fi
+ done
else
_ret=$(find "${dir}" -maxdepth "${depth}" -mindepth "${depth}" -type f -name "${name}" | LC_ALL=C sort)
fi
@@ -335,34 +347,6 @@ _os_find() {
fi
}
-# recursive find with depth limit (for systems without -maxdepth)
-_os_find_recursive() {
- local dir="${1}"
- local name="${2}"
- local target_depth="${3}"
- local current_depth="${4}"
- if test "${current_depth}" -eq "${target_depth}"; then
- # we're at the target depth, search for files
- for file in "${dir}"/*; do
- if test -f "${file}" && test "$(basename "${file}")" = "${name}"; then
- if test_z "${_ret}"; then
- _ret="${file}"
- else
- _ret="${_ret}
-${file}"
- fi
- fi
- done
- elif test "${current_depth}" -lt "${target_depth}"; then
- # we need to go deeper
- for subdir in "${dir}"/*; do
- if test -d "${subdir}"; then
- _os_find_recursive "${subdir}" "${name}" "${target_depth}" $((current_depth + 1))
- fi
- done
- fi
-}
-
# get date, "%Y%m%d%H%M" -> 202212072222
# Use deterministic timestamp from SOURCE_DATE_EPOCH if available
# https://reproducible-builds.org/docs/source-date-epoch/
@@ -2834,26 +2818,8 @@ _load_options_and_toolchains() {
includes "${file}"
else
# include all xmake.sh files in next sub-directories
- local files=""
- # Solaris find doesn't support -maxdepth/-mindepth, use manual search
- if is_host "solaris"; then
- for subdir in ${xmake_sh_projectdir}/*; do
- if test -d "${subdir}"; then
- for file in "${subdir}/xmake.sh"; do
- if test -f "${file}"; then
- if test_z "${files}"; then
- files="${file}"
- else
- files="${files}
-${file}"
- fi
- fi
- done
- fi
- done
- else
- files=`find ${xmake_sh_projectdir} -maxdepth 2 -mindepth 2 -name "xmake.sh"`
- fi
+ _os_find "${xmake_sh_projectdir}" "xmake.sh" "2"
+ local files="${_ret}"
for file in ${files}; do
includes "${file}"
done
diff --git a/core/src/tbox/tbox b/core/src/tbox/tbox
-Subproject 486b29e0d2b587934dcbc897df850753765433b
+Subproject 7e8a34eaddb9e4789c03992d71ad3e0073db679