1*4882a593SmuzhiyunFrom 521c3cc506b18c5c84d86e1e90d1daee39849b0c Mon Sep 17 00:00:00 2001 2*4882a593SmuzhiyunFrom: William Roberts <william.c.roberts@intel.com> 3*4882a593SmuzhiyunDate: Mon, 8 Feb 2021 11:57:28 -0600 4*4882a593SmuzhiyunSubject: [PATCH] configure: make build gnu99 5*4882a593Smuzhiyun 6*4882a593SmuzhiyunSigned-off-by: William Roberts <william.c.roberts@intel.com> 7*4882a593Smuzhiyun 8*4882a593Smuzhiyun[Retrieved from: 9*4882a593Smuzhiyunhttps://github.com/tpm2-software/tpm2-tools/commit/521c3cc506b18c5c84d86e1e90d1daee39849b0c 10*4882a593Smuzhiyunand updated to set gnu99 instead of c99 as done by 11*4882a593Smuzhiyunhttps://github.com/tpm2-software/tpm2-tools/commit/5d0267428e96989afce406d096994ec5091ee107] 12*4882a593SmuzhiyunSigned-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com> 13*4882a593Smuzhiyun--- 14*4882a593Smuzhiyun configure.ac | 3 +++ 15*4882a593Smuzhiyun 1 file changed, 3 insertions(+) 16*4882a593Smuzhiyun 17*4882a593Smuzhiyundiff --git a/configure.ac b/configure.ac 18*4882a593Smuzhiyunindex dc15b5595..25039a0d9 100644 19*4882a593Smuzhiyun--- a/configure.ac 20*4882a593Smuzhiyun+++ b/configure.ac 21*4882a593Smuzhiyun@@ -287,6 +287,9 @@ AC_DEFUN([add_c_flag], [ 22*4882a593Smuzhiyun # -D_GNU_SOURCE is required for execvpe() in options.c 23*4882a593Smuzhiyun add_c_flag([-D_GNU_SOURCE], [AC_MSG_ERROR([Cannot enable -D_GNU_SOURCE])]) 24*4882a593Smuzhiyun 25*4882a593Smuzhiyun+# Enable gnu99 mode, since we use some of these features. 26*4882a593Smuzhiyun+add_c_flag([-std=gnu99], [AC_MSG_ERROR([Cannot enable -std=gnu99])]) 27*4882a593Smuzhiyun+ 28*4882a593Smuzhiyun # Best attempt compiler options that are on newer versions of GCC that 29*4882a593Smuzhiyun # we can't widely enforce without killing other peoples builds. 30*4882a593Smuzhiyun # Works with gcc only. Needs to be disabled on BSD and clang 31