Author: loonycyborg
Date: Tue Apr 29 11:34:09 2008
New Revision: 26226

URL: http://svn.gna.org/viewcvs/wesnoth?rev=26226&view=rev
Log:
Added check for C++ compiler to scons recipe.

Modified:
    trunk/INSTALL
    trunk/SConstruct

Modified: trunk/INSTALL
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/INSTALL?rev=26226&r1=26225&r2=26226&view=diff
==============================================================================
--- trunk/INSTALL (original)
+++ trunk/INSTALL Tue Apr 29 11:34:09 2008
@@ -130,8 +130,8 @@
   --datadir=DIR          datadir=DIR [PREFIX/share]
   --infodir=DIR          N/A
   --localedir=DIR        localedir=DIR [PREFIX/share/locale]
-  --mandir=DIR           mandir=DIR
-  --docdir=DIR           docdir=DIR
+  --mandir=DIR           mandir=DIR [PREFIX/share/man]
+  --docdir=DIR           docdir=DIR [PREFIX/share/doc/wesnoth]
   --htmldir=DIR          N/A
   --dvidir=DIR           N/A
   --pdfdir=DIR           N/A
@@ -201,7 +201,7 @@
   --with-x                        N/A
   --with-freetype-prefix=PFX      N/A
   --with-freetype-exec-prefix=PFX N/A
-  --with-boost=DIR                boostdir=DIR boostlibdir=DIR boost_suffix=DIR
+  --with-boost=DIR                boostdir=DIR boostlibdir=DIR 
boost_suffix=suffix
 
 Notes on the deprecated autotools build:
 

Modified: trunk/SConstruct
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/SConstruct?rev=26226&r1=26225&r2=26226&view=diff
==============================================================================
--- trunk/SConstruct (original)
+++ trunk/SConstruct Tue Apr 29 11:34:09 2008
@@ -155,6 +155,22 @@
 def restore_env(env, backup):
     for var in backup.keys():
         env[var] = backup[var]
+
+def CheckCPlusPlus(context):
+    context.Message("Checking whether C++ compiler works... ")
+    test_program = """
+    #include <iostream>
+    int main()
+    {
+    std::cout << "Hello, world\\n";
+    }
+    """
+    if context.TryBuild(context.env.Program, test_program, ".cpp") == 1:
+        context.Result("yes")
+        return True
+    else:
+        context.Result("no")
+        return False
 
 def CheckBoostLib(context, boost_lib, require_version = None):
     env = context.env
@@ -330,7 +346,8 @@
     print message
     return False
 
-conf = Configure(env, custom_tests = { 'CheckPKGConfig' : CheckPKGConfig,
+conf = Configure(env, custom_tests = { 'CheckCPlusPlus' : CheckCPlusPlus,
+                                       'CheckPKGConfig' : CheckPKGConfig,
                                        'CheckPKG' : CheckPKG,
                                        'CheckSDL' : CheckSDL,
                                        'CheckOgg' : CheckOgg,
@@ -341,6 +358,7 @@
 #    conf.CheckPKGConfig('0.15.0') or Die("Base prerequisites are not met.")
 
 if env["prereqs"]:
+    conf.CheckCPlusPlus() and \
     conf.CheckBoost("iostreams", require_version = "1.33.0") and \
     conf.CheckSDL(require_version = '1.2.7') or Die("Base prerequisites are 
not met.")
 


_______________________________________________
Wesnoth-commits mailing list
[email protected]
https://mail.gna.org/listinfo/wesnoth-commits

Reply via email to