Skip to content

Why is giflib built before pkg-config (and other build tools)? #261

@Aleksid1

Description

@Aleksid1

giflib is a graphics library (GIF), so it seems out of place at the top of the build order before build tools like pkg-config, yasm, and nasm. I checked the latest v1.5.9.

When giflib is removed from the script, pkg-config 0.29.2 fails to configure on macOS 26.4 (Tahoe) on Apple M1 with:

configure: error: cannot compute sizeof (size_t)
configure: error: ./configure failed for glib

Claude Code explanation:

Root cause: The script only creates the workspace/ directory at startup (mkdir -p "$WORKSPACE"), but not its subdirectories. giflib happens to be the first package installed, and its make install creates workspace/lib/ and workspace/include/. Without giflib, these directories do not exist when pkg-config's bundled glib runs its autoconf tests.

On macOS 26, the Apple linker (ld) is stricter — passing -L$WORKSPACE/lib (from LDFLAGS) where the path does not yet exist causes the glib configure test to fail. autoconf then falls back to cross-compile mode, where the old AC_CHECK_SIZEOF macro cannot compute sizeof(size_t).

Suggested fix: Create the workspace subdirectories explicitly at startup:

mkdir -p "$WORKSPACE" "$WORKSPACE/lib" "$WORKSPACE/include" "$WORKSPACE/bin"

This makes the build order independent of giflib and fixes the issue on macOS 26.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions