Skip to content

Commit

Permalink
Mk/Uses: Fix feature checks after my previous {WITH,WITHOUT}_*_PORTS …
Browse files Browse the repository at this point in the history
…change

Test Plan:
Take cmake.mk for example. Choosing a port with USES=cmake and running
`make -V CMAKE_BUILD_TYPE` gives "Release" and
`make -V CMAKE_BUILD_TYPE WITH_DEBUG=yes` gives "Debug". However,
`make -V CMAKE_BUILD_TYPE WITH_DEBUG_PORTS=this/port` still gives "Release"
unless this change is applied.

Differential Revision: https://reviews.freebsd.org/D44748

Fixes:	d697653

Approved by:	bapt
  • Loading branch information
arrowd committed Apr 11, 2024
1 parent a032af2 commit 665b021
Show file tree
Hide file tree
Showing 8 changed files with 17 additions and 17 deletions.
2 changes: 1 addition & 1 deletion Mk/Uses/cargo.mk
Expand Up @@ -194,7 +194,7 @@ CARGO_INSTALL_ARGS+= --features='${CARGO_FEATURES:N--no-default-features}'
CARGO_TEST_ARGS+= --features='${CARGO_FEATURES:N--no-default-features}'
. endif

. if !defined(WITH_DEBUG)
. if !defined(_WITH_DEBUG)
CARGO_BUILD_ARGS+= --release
CARGO_TEST_ARGS+= --release
. else
Expand Down
8 changes: 4 additions & 4 deletions Mk/Uses/cmake.mk
Expand Up @@ -83,13 +83,13 @@ BUILD_DEPENDS+= ${CMAKE_BIN}:devel/cmake-core
RUN_DEPENDS+= ${CMAKE_BIN}:devel/cmake-core
. endif

. if defined(WITH_DEBUG)
. if defined(_WITH_DEBUG)
CMAKE_BUILD_TYPE?= Debug
. elif defined(WITH_DEBUGINFO)
. elif defined(_WITH_DEBUGINFO)
CMAKE_BUILD_TYPE?= RelWithDebInfo
. else
CMAKE_BUILD_TYPE?= Release
. endif #defined(WITH_DEBUG)
. endif #defined(_WITH_DEBUG)

CMAKE_ARGS+= -DCMAKE_C_COMPILER:STRING="${CC}" \
-DCMAKE_CXX_COMPILER:STRING="${CXX}" \
Expand Down Expand Up @@ -128,7 +128,7 @@ CMAKE_ARGS+= -DCMAKE_COLOR_MAKEFILE:BOOL=OFF
. endif

. if empty(cmake_ARGS:Mindirect)
. if defined(STRIP) && ${STRIP} != "" && !defined(WITH_DEBUG) && !defined(WITH_DEBUGINFO)
. if defined(STRIP) && ${STRIP} != "" && !defined(_WITH_DEBUG) && !defined(_WITH_DEBUGINFO)
INSTALL_TARGET?= install/strip
. endif
. endif
Expand Down
4 changes: 2 additions & 2 deletions Mk/Uses/go.mk
Expand Up @@ -90,13 +90,13 @@ GO_PKGNAME= ${PORTNAME}
GO_TARGET?= ${GO_PKGNAME}
GO_TESTTARGET?= ./...

. if !defined(PIE_UNSAFE) && defined(WITH_PIE) && ${ARCH} == amd64
. if !defined(PIE_UNSAFE) && defined(_WITH_PIE) && ${ARCH} == amd64
GO_BUILDFLAGS+= -buildmode=pie
. else
GO_BUILDFLAGS+= -buildmode=exe
. endif
GO_BUILDFLAGS+= -v -trimpath
. if !defined(WITH_DEBUG) && empty(GO_BUILDFLAGS:M-ldflags*)
. if !defined(_WITH_DEBUG) && empty(GO_BUILDFLAGS:M-ldflags*)
GO_BUILDFLAGS+= -ldflags=-s
. endif
GO_TESTFLAGS+= -v
Expand Down
2 changes: 1 addition & 1 deletion Mk/Uses/grantlee.mk
Expand Up @@ -65,7 +65,7 @@ PLIST_SUB+= GRANTLEE_VERSION_FULL=${GRANTLEE_VERSION} \
# GrantleeMacros.cmake provides grantlee_adjust_plugin_name() which appends a
# letter 'd' to the library name in Debug mode. Provide a PLIST_SUB which can be
# appended in the plist.
. if defined(WITH_DEBUG)
. if defined(_WITH_DEBUG)
PLIST_SUB+= GRANTLEE_DEBUG_SUFFIX=d
. else
PLIST_SUB+= GRANTLEE_DEBUG_SUFFIX=""
Expand Down
4 changes: 2 additions & 2 deletions Mk/Uses/meson.mk
Expand Up @@ -51,9 +51,9 @@ CONFIGURE_ARGS+= -Db_colorout=never
INSTALL_TARGET= install

# should we have strip separate from WITH_DEBUG?
. if defined(WITH_DEBUG)
. if defined(_WITH_DEBUG)
CONFIGURE_ARGS+= --buildtype debug
. elif defined(WITH_DEBUGINFO)
. elif defined(_WITH_DEBUGINFO)
CONFIGURE_ARGS+= --buildtype debugoptimized
. else
CONFIGURE_ARGS+= --buildtype release \
Expand Down
2 changes: 1 addition & 1 deletion Mk/Uses/php.mk
Expand Up @@ -208,7 +208,7 @@ PHP_EXT_DIR:= ${PHP_EXT_DIR}-zts
PHP_EXT_DIR:= ${PHP_EXT_DIR}-zts
. endif

. if defined(WITH_DEBUG)
. if defined(_WITH_DEBUG)
PHP_EXT_DIR:= ${PHP_EXT_DIR}-debug
. endif
PHP_SAPI?= ""
Expand Down
6 changes: 3 additions & 3 deletions Mk/Uses/qmake.mk
Expand Up @@ -16,7 +16,7 @@
# norecursive Don't pass -recursive argument to qmake binary
# outsource Perform an out-of-source build
# no_env Suppress modification of configure and make environment.
# no_configure Don't add the configure target -- this is implied by
# no_configure Don't add the configure target -- this is implied by
# HAS_CONFIGURE=yes and GNU_CONFIGURE=yes
#
#
Expand Down Expand Up @@ -75,15 +75,15 @@ QMAKE_ARGS+= -spec ${QMAKESPEC} \
QMAKE_CXXFLAGS_RELEASE="" \
PREFIX="${PREFIX}"

. if defined(WITH_DEBUG)
. if defined(_WITH_DEBUG)
PLIST_SUB+= DEBUG=""
QMAKE_ARGS+= CONFIG+="debug separate_debug_info" \
CONFIG-="release"
. else
PLIST_SUB+= DEBUG="@comment "
QMAKE_ARGS+= CONFIG+="release" \
CONFIG-="debug separate_debug_info"
. endif # defined(WITH_DEBUG)
. endif # defined(_WITH_DEBUG)

# We set -recursive by default to keep qmake from running in the build stage.
. if ! ${qmake_ARGS:Mnorecursive}
Expand Down
6 changes: 3 additions & 3 deletions Mk/Uses/qt-dist.mk
Expand Up @@ -239,7 +239,7 @@ CONFIGURE_ARGS+= -no-use-gold-linker
CONFIGURE_ARGS+= -recheck-all
. endif # ${_QT_VER:M5}

. if defined(WANT_QT_DEBUG) || defined(WITH_DEBUG)
. if defined(WANT_QT_DEBUG) || defined(_WITH_DEBUG)
WITH_DEBUG= yes
STRIP= # It's done prior to bsd.qt.mk inclusion.
CONFIGURE_ARGS+= -debug -separate-debug-info
Expand All @@ -250,7 +250,7 @@ QMAKE_ARGS+= QT_CONFIG+="debug separate_debug_info" \
CONFIGURE_ARGS+= -release -no-separate-debug-info
QMAKE_ARGS+= QT_CONFIG+="release" \
QT_CONFIG-="debug separate_debug_info"
. endif # defined(WANT_QT_DEBUG) || defined(WITH_DEBUG)
. endif # defined(WANT_QT_DEBUG) || defined(_WITH_DEBUG)

. if defined(WANT_QT_VERBOSE_CONFIGURE)
CONFIGURE_ARGS+= -verbose
Expand Down Expand Up @@ -302,7 +302,7 @@ QMAKE_ARGS+= QT_CONFIG-="${QT_CONFIG:M-*:O:u:C/^-//}"

PLIST_SUB+= SHORTVER=${_QT_VERSION:R} \
FULLVER=${_QT_VERSION:C/-.*//}
. if defined(WITH_DEBUG)
. if defined(_WITH_DEBUG)
PLIST_SUB+= DEBUG="" \
NO_DEBUG="@comment "
. else
Expand Down

0 comments on commit 665b021

Please sign in to comment.