summaryrefslogtreecommitdiff
path: root/Configure
diff options
context:
space:
mode:
authorH.Merijn Brand <h.m.brand@xs4all.nl>2011-09-22 17:26:34 +0200
committerH.Merijn Brand <h.m.brand@xs4all.nl>2011-09-22 17:26:34 +0200
commit0dcb3d887131a644381d6660eb13e2436e609eb9 (patch)
tree2980b834ea5bcd94b280f8047547a3b138fc3173 /Configure
parent204c23833e7aa6efc02cbe7e7e42dc93be0d64b1 (diff)
downloadperl-0dcb3d887131a644381d6660eb13e2436e609eb9.tar.gz
Use a real compile to test for stdbool.h
On some Solaris systems, <stdbool.h> is present, but will give an error if used by a compiler that is not sufficiently c99-compliant. Check for this by including <stdbool.h> and trying to compile a short program that uses bool. Signed-off-by: H.Merijn Brand <h.m.brand@xs4all.nl>
Diffstat (limited to 'Configure')
-rwxr-xr-xConfigure31
1 files changed, 28 insertions, 3 deletions
diff --git a/Configure b/Configure
index e22860de3e..42a0a19ee8 100755
--- a/Configure
+++ b/Configure
@@ -28,7 +28,7 @@
# See Porting/pumpkin.pod for more information on metaconfig.
#
-# Generated on Fri Sep 16 13:09:14 CEST 2011 [metaconfig 3.5 PL0]
+# Generated on Thu Sep 22 17:10:35 CEST 2011 [metaconfig 3.5 PL0]
# (with additional metaconfig patches by perlbug@perl.org)
cat >c1$$ <<EOF
@@ -21766,8 +21766,33 @@ val=$val2; set i_sgtty; eval $setvar
val=$val3; set i_termios; eval $setvar
: see if stdbool is available
-set stdbool.h i_stdbool
-eval $inhdr
+: we want a real compile instead of Inhdr because some Solaris systems
+: have stdbool.h, but it can only be used if the compiler indicates it
+: is sufficiently c99-compliant.
+echo " "
+$cat >try.c <<EOCP
+#include <stdio.h>
+#include <stdbool.h>
+int func(bool x)
+{
+ return x ? 1 : 0;
+}
+int main(int argc, char **argv)
+{
+ return func(0);
+}
+EOCP
+set try
+if eval $compile; then
+ echo "<stdbool.h> found." >&4
+ val="$define"
+else
+ echo "<stdbool.h> NOT found." >&4
+ val="$undef"
+fi
+$rm_try
+set i_stdbool
+eval $setvar
: see if stddef is available
set stddef.h i_stddef