forked from wolfSSL/wolfssl
add --enable-memory, build, disable runtime memory cbs, check leanpsk
This commit is contained in:
23
configure.ac
23
configure.ac
@ -539,6 +539,28 @@ then
|
||||
fi
|
||||
|
||||
|
||||
# MEMORY
|
||||
AC_ARG_ENABLE([memory],
|
||||
[ --enable-memory Enable memory callbacks (default: enabled)],
|
||||
[ ENABLED_MEMORY=$enableval ],
|
||||
[ ENABLED_MEMORY=yes ]
|
||||
)
|
||||
|
||||
if test "$ENABLED_MEMORY" = "no"
|
||||
then
|
||||
AM_CFLAGS="$AM_CFLAGS -DNO_CYASSL_MEMORY"
|
||||
else
|
||||
# turn off memory cb if leanpsk on
|
||||
if test "$ENABLED_LEANPSK" = "yes"
|
||||
then
|
||||
# but don't turn on NO_CYASSL_MEMORY because using own
|
||||
ENABLED_MEMORY=no
|
||||
fi
|
||||
fi
|
||||
|
||||
AM_CONDITIONAL([BUILD_MEMORY], [test "x$ENABLED_MEMORY" = "xyes"])
|
||||
|
||||
|
||||
# RSA
|
||||
AC_ARG_ENABLE([rsa],
|
||||
[ --enable-rsa Enable RSA (default: enabled)],
|
||||
@ -1169,6 +1191,7 @@ echo " * DH: $ENABLED_DH"
|
||||
echo " * ECC: $ENABLED_ECC"
|
||||
echo " * ASN: $ENABLED_ASN"
|
||||
echo " * CODING: $ENABLED_CODING"
|
||||
echo " * MEMORY: $ENABLED_MEMORY"
|
||||
echo " * OCSP: $ENABLED_OCSP"
|
||||
echo " * CRL: $ENABLED_CRL"
|
||||
echo " * CRL-MONITOR: $ENABLED_CRL_MONITOR"
|
||||
|
@ -457,7 +457,7 @@
|
||||
|
||||
|
||||
#if !defined(XMALLOC_USER) && !defined(MICRIUM_MALLOC) && \
|
||||
!defined(CYASSL_LEANPSK)
|
||||
!defined(CYASSL_LEANPSK) && !defined(NO_CYASSL_MEMORY)
|
||||
#define USE_CYASSL_MEMORY
|
||||
#endif
|
||||
|
||||
|
@ -149,16 +149,22 @@ enum {
|
||||
/* default to libc stuff */
|
||||
/* XREALLOC is used once in normal math lib, not in fast math lib */
|
||||
/* XFREE on some embeded systems doesn't like free(0) so test */
|
||||
#ifdef XMALLOC_USER
|
||||
#if defined(XMALLOC_USER)
|
||||
/* prototypes for user heap override functions */
|
||||
#include <stddef.h> /* for size_t */
|
||||
extern void *XMALLOC(size_t n, void* heap, int type);
|
||||
extern void *XREALLOC(void *p, size_t n, void* heap, int type);
|
||||
extern void XFREE(void *p, void* heap, int type);
|
||||
#elif defined(NO_CYASSL_MEMORY)
|
||||
/* just use plain C stdlib stuff if desired */
|
||||
#include <stdlib.h>
|
||||
#define XMALLOC(s, h, t) ((void)h, (void)t, malloc((s)))
|
||||
#define XFREE(p, h, t) {void* xp = (p); if((xp)) free((xp));}
|
||||
#define XREALLOC(p, n, h, t) realloc((p), (n))
|
||||
#elif !defined(MICRIUM_MALLOC) && !defined(EBSNET) \
|
||||
&& !defined(CYASSL_SAFERTOS) && !defined(FREESCALE_MQX) \
|
||||
&& !defined(CYASSL_LEANPSK)
|
||||
/* default C runtime, can install different routines at runtime */
|
||||
/* default C runtime, can install different routines at runtime via cbs */
|
||||
#include <cyassl/ctaocrypt/memory.h>
|
||||
#define XMALLOC(s, h, t) ((void)h, (void)t, CyaSSL_Malloc((s)))
|
||||
#define XFREE(p, h, t) {void* xp = (p); if((xp)) CyaSSL_Free((xp));}
|
||||
|
@ -19,7 +19,7 @@ src_libcyassl_la_LIBADD = $(LIBM)
|
||||
src_libcyassl_la_CFLAGS = -DBUILDING_CYASSL $(AM_CFLAGS)
|
||||
src_libcyassl_la_CPPFLAGS = -DBUILDING_CYASSL $(AM_CPPFLAGS)
|
||||
|
||||
if !BUILD_LEANPSK
|
||||
if BUILD_MEMORY
|
||||
src_libcyassl_la_SOURCES += ctaocrypt/src/memory.c
|
||||
endif
|
||||
|
||||
|
Reference in New Issue
Block a user