Skip to content

Commit 8999f67

Browse files
committed
Use CFLAGS so we can use in meta-wolfssl
1 parent cf3640f commit 8999f67

File tree

3 files changed

+16
-3
lines changed

3 files changed

+16
-3
lines changed

configure.ac

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -124,12 +124,24 @@ AS_IF([ test "x$ENABLED_SINGLETHREADED" = "xno" ],[
124124
])
125125

126126
# Replace default provider
127+
# Check if -DWOLFPROV_REPLACE_DEFAULT is in CFLAGS/CPPFLAGS first (for Yocto/CFLAGS usage)
128+
ENABLED_REPLACE_DEFAULT=no
129+
case " $CFLAGS $CPPFLAGS " in
130+
*" -DWOLFPROV_REPLACE_DEFAULT "*|*" -DWOLFPROV_REPLACE_DEFAULT="*)
131+
ENABLED_REPLACE_DEFAULT=yes
132+
;;
133+
esac
134+
127135
AC_ARG_ENABLE([replace-default],
128-
[AS_HELP_STRING([--enable-replace-default],[Build real libdefault.so from wp_default_replace.c (default: disabled).])],
136+
[AS_HELP_STRING([--enable-replace-default],[Build real libdefault.so from wp_default_replace.c (default: disabled). Can also be enabled via -DWOLFPROV_REPLACE_DEFAULT in CFLAGS.])],
129137
[ ENABLED_REPLACE_DEFAULT=$enableval ],
130-
[ ENABLED_REPLACE_DEFAULT=no ]
138+
[ ]
131139
)
132140

141+
if test "x$ENABLED_REPLACE_DEFAULT" = "xyes"; then
142+
AM_CFLAGS="$AM_CFLAGS -DWOLFPROV_REPLACE_DEFAULT"
143+
fi
144+
133145
AM_CONDITIONAL([BUILD_REPLACE_DEFAULT], [test "x$ENABLED_REPLACE_DEFAULT" = "xyes"])
134146

135147
# Set OpenSSL lib directory for installing libdefault.so

scripts/utils-wolfprovider.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ install_wolfprov() {
103103
fi
104104

105105
if [ "$WOLFPROV_REPLACE_DEFAULT" = "1" ]; then
106-
WOLFPROV_CONFIG_OPTS+=" --enable-replace-default"
106+
WOLFPROV_CONFIG_CFLAGS="${WOLFPROV_CONFIG_CFLAGS} -DWOLFPROV_REPLACE_DEFAULT"
107107
fi
108108

109109
if [ "${WOLFPROV_LEAVE_SILENT}" = "1" ]; then

test/unit.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -773,6 +773,7 @@ int main(int argc, char* argv[])
773773

774774
osslLibCtx = OSSL_LIB_CTX_new();
775775
#ifdef WOLFPROV_REPLACE_DEFAULT_UNIT_TEST
776+
PRINT_MSG("Testing unit tests in replace default mode");
776777
/* If enabled, directly load the default provider for unit testing
777778
* with default replace. */
778779
osslProv = wp_load_default_provider_direct(osslLibCtx);

0 commit comments

Comments
 (0)