Skip to content

configure fails with "Bad substitution" on NetBSD after adding tvOS, visionOS and watchOS support #162923

Backlog

Description

@serhiy-storchaka

./configure on main fails under NetBSD's /bin/sh:

checking MACHDEP... "netbsd10"
checking for --enable-universalsdk... no
checking for --with-universal-archs... no
checking for --with-app-store-compliance... not patching for app store compliance
./configure: 4830: Syntax error: Bad substitution

gh-131999 (#159944) added three bash-only substring expansions to configure.ac:

TVOS_DEPLOYMENT_TARGET=${_host_os:4}
XROS_DEPLOYMENT_TARGET=${_host_os:8}
WATCHOS_DEPLOYMENT_TARGET=${_host_os:7}

${var:offset} is not POSIX, and NetBSD's sh rejects it at parse time, so configure fails even though these branches are never taken there. This is the same problem as gh-123716, which was fixed for IPHONEOS_DEPLOYMENT_TARGET in #123717 by using $(echo ${_host_os} | cut -c4-). The same fix works here (cut -c5-, cut -c9- and cut -c8-); with it, configure and the build succeed on NetBSD 10.2.

Only main is affected; 3.15 and 3.14 do not have these lines.

Linked PRs

Activity

  1. added
    type-bug
    build
    3.16
    on Dec 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    3.16OS-netbsdbuildtype-bug

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions