diff --git a/examples/client/client.c b/examples/client/client.c index 88795ac0d..acbbe732f 100644 --- a/examples/client/client.c +++ b/examples/client/client.c @@ -1655,7 +1655,8 @@ THREAD_RETURN WOLFSSL_THREAD client_test(void* args) while ((ch = mygetopt(argc, argv, "?:" "ab:c:defgh:i;jk:l:mnop:q:rstuv:wxyz" "A:B:CDE:F:GH:IJKL:M:NO:PQRS:TUVW:XYZ:" - "01:23:458")) != -1) { + "01:23:458" + "@#")) != -1) { switch (ch) { case '?' : if(myoptarg!=NULL) { @@ -2122,6 +2123,20 @@ THREAD_RETURN WOLFSSL_THREAD client_test(void* args) #endif break; + case '@' : + { + const char *conf_args = libwolfssl_configure_args(); + printf("%s\n", conf_args ? conf_args : "configure args not compiled in"); + XEXIT_T(EXIT_SUCCESS); + } + + case '#' : + { + const char *cflags = libwolfssl_global_cflags(); + printf("%s\n", cflags ? cflags : "CFLAGS not compiled in"); + XEXIT_T(EXIT_SUCCESS); + } + default: Usage(); XEXIT_T(MY_EX_USAGE); diff --git a/examples/server/server.c b/examples/server/server.c index 09eb86025..26162927b 100644 --- a/examples/server/server.c +++ b/examples/server/server.c @@ -1152,7 +1152,8 @@ THREAD_RETURN WOLFSSL_THREAD server_test(void* args) while ((ch = mygetopt(argc, argv, "?:" "abc:defgijk:l:mnop:q:rstuv:wxy" "A:B:C:D:E:FGH:IJKL:MNO:PQR:S:TUVYZ:" - "01:23:4:58")) != -1) { + "01:23:4:58" + "@#")) != -1) { switch (ch) { case '?' : if(myoptarg!=NULL) { @@ -1552,6 +1553,20 @@ THREAD_RETURN WOLFSSL_THREAD server_test(void* args) #endif break; + case '@' : + { + const char *conf_args = libwolfssl_configure_args(); + printf("%s\n", conf_args ? conf_args : "configure args not compiled in"); + XEXIT_T(EXIT_SUCCESS); + } + + case '#' : + { + const char *cflags = libwolfssl_global_cflags(); + printf("%s\n", cflags ? cflags : "CFLAGS not compiled in"); + XEXIT_T(EXIT_SUCCESS); + } + default: Usage(); XEXIT_T(MY_EX_USAGE); diff --git a/wolfcrypt/src/debug.c b/wolfcrypt/src/debug.c index 30cca8669..d8e113198 100644 --- a/wolfcrypt/src/debug.c +++ b/wolfcrypt/src/debug.c @@ -31,6 +31,7 @@ WOLFSSL_API const char *libwolfssl_configure_args(void) { #ifdef LIBWOLFSSL_CONFIGURE_ARGS + /* the spaces on either side are to make matching simple and efficient. */ return " " LIBWOLFSSL_CONFIGURE_ARGS " "; #else return NULL; @@ -39,6 +40,7 @@ WOLFSSL_API const char *libwolfssl_configure_args(void) { WOLFSSL_API const char *libwolfssl_global_cflags(void) { #ifdef LIBWOLFSSL_GLOBAL_CFLAGS + /* the spaces on either side are to make matching simple and efficient. */ return " " LIBWOLFSSL_GLOBAL_CFLAGS " "; #else return NULL;