build: let autoconf detect system extensions
Move to AC_USE_SYSTEM_EXTENSIONS for automation of detecting supported source
extensions, such as:
* -D_DEFAULT_SOURCE
* -D_BSD_SOURCE
* -D_POSIX_SOURCE
Signed-off-by: Alon Bar-Lev <alon.barlev@gmail.com>
diff --git a/configure.ac b/configure.ac
index dc4b540..705be62 100644
--- a/configure.ac
+++ b/configure.ac
@@ -27,6 +27,7 @@
AC_PROG_CXX
AC_PROG_CC
+AC_USE_SYSTEM_EXTENSIONS
LT_INIT()
PKG_INSTALLDIR()
@@ -243,9 +244,6 @@
[enable_defaultflags=yes])
AS_IF([test "x$enable_defaultflags" = "xyes"],
[
- ADD_PREPROC_FLAG([-D_DEFAULT_SOURCE])
- ADD_PREPROC_FLAG([-D_BSD_SOURCE])
- ADD_PREPROC_FLAG([-D_POSIX_SOURCE])
AS_IF([test "x$enable_debug" = "xno"],
[AX_ADD_FORTIFY_SOURCE])
ADD_COMPILER_FLAG([-std=c99])
diff --git a/src/tss2-esys/esys_crypto.c b/src/tss2-esys/esys_crypto.c
index d62366e..aef3e50 100644
--- a/src/tss2-esys/esys_crypto.c
+++ b/src/tss2-esys/esys_crypto.c
@@ -4,8 +4,6 @@
* All rights reserved.
******************************************************************************/
-#define _GNU_SOURCE
-
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
diff --git a/src/tss2-esys/esys_crypto_gcrypt.c b/src/tss2-esys/esys_crypto_gcrypt.c
index 55904a1..0ebe88a 100644
--- a/src/tss2-esys/esys_crypto_gcrypt.c
+++ b/src/tss2-esys/esys_crypto_gcrypt.c
@@ -4,8 +4,6 @@
* All rights reserved.
******************************************************************************/
-#define _GNU_SOURCE
-
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
diff --git a/src/tss2-esys/esys_crypto_ossl.c b/src/tss2-esys/esys_crypto_ossl.c
index a72a4f2..1245019 100644
--- a/src/tss2-esys/esys_crypto_ossl.c
+++ b/src/tss2-esys/esys_crypto_ossl.c
@@ -4,8 +4,6 @@
* All rights reserved.
******************************************************************************/
-#define _GNU_SOURCE
-
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
diff --git a/test/integration/esys-unseal-password-auth.int.c b/test/integration/esys-unseal-password-auth.int.c
index db583dc..dd1647b 100644
--- a/test/integration/esys-unseal-password-auth.int.c
+++ b/test/integration/esys-unseal-password-auth.int.c
@@ -4,8 +4,6 @@
* All rights reserved.
*******************************************************************************/
-#define _GNU_SOURCE
-
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif