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
Notes: sideshowbarker 2024-07-16 23:08:48 +09:00
6 changed files with 15 additions and 15 deletions

View file

@ -247,14 +247,20 @@ popd
# === COPY HEADERS ===
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
mkdir -p "$BUILD/${arch}clang"
pushd "$BUILD/${arch}clang"
mkdir -p Root/usr/include/
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"
done
popd

View file

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

View file

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

View file

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

View file

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