build(profile): select sources per level via AM_CONDITIONAL

Gate the initial string slice per compatibility level: L1 sources compile
everywhere, strlcpy/strlcat only at level >= 2 (PROFILE_GE_2), strcasestr
only at level >= 3 (PROFILE_GE_3). Install the generated
include/vlibc/features.h under $(vlibc_includedir)/vlibc/ via a dedicated
vlibc_featuresdir primary (nodist_nobase is rejected by automake and loses
the vlibc/ subpath). Include stddef.h/string.h in vlibc_include_HEADERS.

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <[email protected]>
This commit is contained in:
2026-08-31 20:54:00 -04:00
co-authored by Sisyphus
parent ace9728565
commit 7d28d7cc9d
3 changed files with 48 additions and 2 deletions
Vendored
+29
View File
@@ -679,6 +679,10 @@ MUSL_CC
vlibc_install_mode
INSTALL_OVERWRITE_FALSE
INSTALL_OVERWRITE_TRUE
PROFILE_GE_3_FALSE
PROFILE_GE_3_TRUE
PROFILE_GE_2_FALSE
PROFILE_GE_2_TRUE
vlibc_level
vlibc_profile
VLIBC_CFLAGS
@@ -5285,6 +5289,23 @@ esac
if test "$vlibc_level" -ge 2; then
PROFILE_GE_2_TRUE=
PROFILE_GE_2_FALSE='#'
else
PROFILE_GE_2_TRUE='#'
PROFILE_GE_2_FALSE=
fi
if test "$vlibc_level" -ge 3; then
PROFILE_GE_3_TRUE=
PROFILE_GE_3_FALSE='#'
else
PROFILE_GE_3_TRUE='#'
PROFILE_GE_3_FALSE=
fi
# ---- Install method ------------------------------------------------------
# "alongside" installs vlibc next to the system libc: headers and libraries go
# under a vlibc-specific tree, used via the vlibc-gcc / vlibc-clang drivers.
@@ -14586,6 +14607,14 @@ if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then
as_fn_error $? "conditional \"am__fastdepCC\" was never defined.
Usually this means the macro was only invoked conditionally." "$LINENO" 5
fi
if test -z "${PROFILE_GE_2_TRUE}" && test -z "${PROFILE_GE_2_FALSE}"; then
as_fn_error $? "conditional \"PROFILE_GE_2\" was never defined.
Usually this means the macro was only invoked conditionally." "$LINENO" 5
fi
if test -z "${PROFILE_GE_3_TRUE}" && test -z "${PROFILE_GE_3_FALSE}"; then
as_fn_error $? "conditional \"PROFILE_GE_3\" was never defined.
Usually this means the macro was only invoked conditionally." "$LINENO" 5
fi
if test -z "${INSTALL_OVERWRITE_TRUE}" && test -z "${INSTALL_OVERWRITE_FALSE}"; then
as_fn_error $? "conditional \"INSTALL_OVERWRITE\" was never defined.
Usually this means the macro was only invoked conditionally." "$LINENO" 5