Marge Bot pushed to branch master at Glasgow Haskell Compiler / GHC Commits: 1480872a by Vladislav Zavialov at 2025-09-19T13:12:54-04:00 Fix PREP_MAYBE_LIBRARY in prep_target_file.m4 This change fixes a configure error introduced in: commit 8235dd8c4945db9cb03e3be3c388d729d576ed1e ghc-toolchain: Move UseLibdw to per-Target file Now the build no longer fails with: acghc-toolchain: Failed to read a valid Target value from hadrian/cfg/default.target - - - - - 1 changed file: - m4/prep_target_file.m4 Changes: ===================================== m4/prep_target_file.m4 ===================================== @@ -78,22 +78,6 @@ AC_DEFUN([PREP_MAYBE_PROGRAM],[ AC_SUBST([$1MaybeProg]) ]) -# PREP_MAYBE_LIBRARY -# ========================= -# -# Introduce a substitution [$1MaybeProg] with -# * Nothing, if $$1 is empty or "NO" -# * Just the library otherwise -AC_DEFUN([PREP_MAYBE_LIBRARY],[ - if test -z "$$1" || test "$$1" = "NO"; then - $1MaybeLibrary=Nothing - else - PREP_LIST([$2]) - $1MaybeLibrary="Just (Library { libName = \"$2\", includePath = \"$3\", libraryPath = \"$4\" })" - fi - AC_SUBST([$1MaybeLibrary]) -]) - # PREP_MAYBE_STRING # ========================= # @@ -111,6 +95,24 @@ AC_DEFUN([PREP_MAYBE_STRING],[ AC_SUBST([$1MaybeStr]) ]) +# PREP_MAYBE_LIBRARY +# ========================= +# +# Introduce a substitution [$1MaybeProg] with +# * Nothing, if $$1 is empty or "NO" +# * Just the library otherwise +AC_DEFUN([PREP_MAYBE_LIBRARY],[ + if test -z "$$1" || test "$$1" = "NO"; then + $1MaybeLibrary=Nothing + else + PREP_LIST([$2]) + PREP_MAYBE_STRING([$3]) + PREP_MAYBE_STRING([$4]) + $1MaybeLibrary="Just Library { libName = \"$2\", includePath = $$3MaybeStr, libraryPath = $$4MaybeStr }" + fi + AC_SUBST([$1MaybeLibrary]) +]) + # PREP_BOOLEAN # ============ # @@ -195,10 +197,7 @@ AC_DEFUN([PREP_TARGET_FILE],[ PREP_LIST([CONF_CPP_OPTS_STAGE2]) PREP_LIST([CONF_CXX_OPTS_STAGE2]) PREP_LIST([CONF_CC_OPTS_STAGE2]) - - PREP_MAYBE_STRING([LibdwIncludeDir]) - PREP_MAYBE_STRING([LibdwLibDir]) - PREP_MAYBE_LIBRARY([UseLibdw], [dw], [$LibdwIncludeDirMaybeStr], [$LibdwLibDirMaybeStr]) + PREP_MAYBE_LIBRARY([UseLibdw], [dw], [LibdwIncludeDir], [LibdwLibDir]) dnl Host target PREP_BOOLEAN([ArSupportsAtFile_STAGE0]) View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/1480872af6b80db1b035a44409188416... -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/1480872af6b80db1b035a44409188416... You're receiving this email because of your account on gitlab.haskell.org.