Skip to content

Commit c63cf8c

Browse files
committed
Introduce LIBC detection for when it is build in Alpine
1 parent 0f3ae7b commit c63cf8c

2 files changed

Lines changed: 30 additions & 4 deletions

File tree

gpl-release/Makefile.top

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,23 @@ ifeq ($(UNAME_S),NetBSD)
7676
PLATFORM_LIBS = -lcrypt
7777
endif
7878

79+
# ================================================================
80+
# LIBC DETECTION (for Alpine/musl compatibility)
81+
# ================================================================
82+
83+
IS_ALPINE := $(shell test -f /etc/alpine-release && echo yes || echo no)
84+
85+
ifeq ($(UNAME_S),Linux)
86+
PLATFORM = linux
87+
PLATFORM_FLAGS = -DPLATFORM_LINUX -DPLATFORM_UNIX
88+
PLATFORM_LIBS = -lcrypt
89+
# Add BSD function compatibility for Alpine Linux (musl libc)
90+
ifeq ($(IS_ALPINE),yes)
91+
PLATFORM_FLAGS += -D_DEFAULT_SOURCE -D_BSD_SOURCE
92+
endif
93+
endif
94+
95+
7996
# ================================================================
8097
# COMPILER DETECTION
8198
# ================================================================

packaging/melange/melange.yaml

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -47,11 +47,20 @@ pipeline:
4747
echo "=== ConquerV5 Build Process (in gpl-release/) ==="
4848
4949
echo "=== Checking sub-Makefiles for /bin/make ==="
50-
grep -R "/bin/make" Src Auxil Docs Include || echo "No /bin/make found"
50+
#grep -R "/bin/make" Src Auxil Docs Include || echo "No /bin/make found"
5151
# Create symlink for legacy /bin/make references
52-
if [ ! -f /bin/make ] && [ -f /usr/bin/make ]; then
53-
ln -sf /usr/bin/make /bin/make 2>/dev/null || true
54-
fi
52+
#if [ ! -f /bin/make ] && [ -f /usr/bin/make ]; then
53+
# ln -sf /usr/bin/make /bin/make 2>/dev/null || true
54+
#fi
55+
56+
57+
# Debug libc detection
58+
echo "=== Debugging libc detection ==="
59+
ldd --version 2>&1 || echo "ldd not available"
60+
ldd --version 2>&1 | grep -q musl && echo "musl detected" || echo "musl NOT detected"
61+
echo "LIBC would be: $(ldd --version 2>&1 | grep -q musl && echo musl || echo glibc)"
62+
63+
5564
5665
# Set system login for package installation
5766
export PATH="/usr/bin:$PATH"

0 commit comments

Comments
 (0)