]> git.ipfire.org Git - thirdparty/HylaFAX.git/commitdiff
Detect whether compiler supports the C++ tyype bool in configure
authorRobert Colquhoun <rjc@trump.net.au>
Wed, 14 Jul 1999 12:36:03 +0000 (12:36 +0000)
committerRobert Colquhoun <rjc@trump.net.au>
Wed, 14 Jul 1999 12:36:03 +0000 (12:36 +0000)
and compensate otherwise.

configure

index 7eaeae71522a9fe089c71ea87015345a6db889e7..4cefbc23717445b167befd61c12005f91f969dfc 100755 (executable)
--- a/configure
+++ b/configure
@@ -1063,6 +1063,24 @@ else
     }
 fi
 
+#
+# Check to see if the C++ compiler has an inbuilt 'bool' type
+#
+cat>dummy.C<<EOF
+int main()
+{
+    bool success = false;
+    return 0;
+}
+EOF
+capture cat dummy.C
+if capture "$CXXCOMPILER $ENVOPTS dummy.C"; then
+    CONFIG_NEEDBOOL=no
+else
+    Note "Looks like will need to define the 'bool' type."
+    CONFIG_NEEDBOOL=yes
+fi
+
 #
 # Verify that $MAKE is accessible
 #
@@ -1626,6 +1644,17 @@ releaseAtLeast()
 #
 EmitConfigurationDefinitions()
 {
+    #
+    # Do bool stuff
+    #
+    if [ "$CONFIG_NEEDBOOL" = "yes" ]; then
+        Note "... adding definition for C++ bool type"
+        echo
+        echo "typedef int bool;"
+        echo "const bool false = 0;"
+        echo "const bool true = 1;"
+        echo
+    fi
     #
     # Select the mode to use when opening FIFO files
     # in a server process.  One should be able to open