LibC+LibRegex: Move regex_defs.h from LibC to LibRegex

This is needed to avoid including LibC headers in Lagom builds.
This commit is contained in:
implicitfield 2023-04-30 00:50:54 +04:00 committed by Andreas Kling
parent ec636a404b
commit 7d19abda7a
6 changed files with 15 additions and 15 deletions

View file

@ -247,14 +247,20 @@ popd
# === COPY HEADERS === # === COPY HEADERS ===
SRC_ROOT=$($REALPATH "$DIR"/..) SRC_ROOT=$($REALPATH "$DIR"/..)
FILES=$(find "$SRC_ROOT"/Kernel/API "$SRC_ROOT"/Userland/Libraries/LibC -name '*.h' -print) FILES=$(find \
"$SRC_ROOT"/Kernel/API \
"$SRC_ROOT"/Userland/Libraries/LibC \
"$SRC_ROOT"/Userland/Libraries/LibRegex/RegexDefs.h \
-name '*.h' -print)
for arch in $ARCHS; do for arch in $ARCHS; do
mkdir -p "$BUILD/${arch}clang" mkdir -p "$BUILD/${arch}clang"
pushd "$BUILD/${arch}clang" pushd "$BUILD/${arch}clang"
mkdir -p Root/usr/include/ mkdir -p Root/usr/include/
for header in $FILES; do for header in $FILES; do
target=$(echo "$header" | "$SED" -e "s|$SRC_ROOT/Userland/Libraries/LibC||" -e "s|$SRC_ROOT/Kernel/|Kernel/|") target=$(echo "$header" | "$SED" \
-e "s|$SRC_ROOT/Userland/Libraries/LibC||" \
-e "s|$SRC_ROOT/Kernel/|Kernel/|" \
-e "s|$SRC_ROOT/Userland/Libraries/LibRegex/|LibRegex/|")
buildstep "system_headers" "$INSTALL" -D "$header" "Root/usr/include/$target" buildstep "system_headers" "$INSTALL" -D "$header" "Root/usr/include/$target"
done done
popd popd

View file

@ -270,12 +270,14 @@ pushd "$DIR/Build/$ARCH"
"$SRC_ROOT"/Kernel/API \ "$SRC_ROOT"/Kernel/API \
"$SRC_ROOT"/Kernel/Arch \ "$SRC_ROOT"/Kernel/Arch \
"$SRC_ROOT"/Userland/Libraries/LibC \ "$SRC_ROOT"/Userland/Libraries/LibC \
"$SRC_ROOT"/Userland/Libraries/LibRegex/RegexDefs.h \
-name '*.h' -print) -name '*.h' -print)
for header in $FILES; do for header in $FILES; do
target=$(echo "$header" | sed \ target=$(echo "$header" | sed \
-e "s|$SRC_ROOT/AK/|AK/|" \ -e "s|$SRC_ROOT/AK/|AK/|" \
-e "s|$SRC_ROOT/Userland/Libraries/LibC||" \ -e "s|$SRC_ROOT/Userland/Libraries/LibC||" \
-e "s|$SRC_ROOT/Kernel/|Kernel/|") -e "s|$SRC_ROOT/Kernel/|Kernel/|" \
-e "s|$SRC_ROOT/Userland/Libraries/LibRegex/|LibRegex/|")
buildstep "system_headers" mkdir -p "$(dirname "Root/usr/include/$target")" buildstep "system_headers" mkdir -p "$(dirname "Root/usr/include/$target")"
buildstep "system_headers" $INSTALL "$header" "Root/usr/include/$target" buildstep "system_headers" $INSTALL "$header" "Root/usr/include/$target"
done done

View file

@ -6,7 +6,7 @@
#pragma once #pragma once
#include "bits/regex_defs.h" #include <LibRegex/RegexDefs.h>
#include <stddef.h> #include <stddef.h>
#include <sys/cdefs.h> #include <sys/cdefs.h>
#include <sys/types.h> #include <sys/types.h>

View file

@ -6,13 +6,9 @@
#pragma once #pragma once
#include "RegexDefs.h"
#include <AK/StringView.h> #include <AK/StringView.h>
#include <AK/Types.h> #include <AK/Types.h>
#ifdef AK_OS_SERENITY
# include <bits/regex_defs.h>
#else
# include <LibC/bits/regex_defs.h>
#endif
namespace regex { namespace regex {

View file

@ -6,13 +6,9 @@
#pragma once #pragma once
#include "RegexDefs.h"
#include <AK/Types.h> #include <AK/Types.h>
#include <stdio.h> #include <stdio.h>
#ifdef AK_OS_SERENITY
# include <bits/regex_defs.h>
#else
# include <LibC/bits/regex_defs.h>
#endif
namespace regex { namespace regex {