Author: vedge
Date: 2008-10-27 08:48:44 -0300 (Mon, 27 Oct 2008)
New Revision: 761

Added:
   trunk/BSDBuild/agar-opengl.pm
   trunk/BSDBuild/agar-threads.pm
Modified:
   trunk/BSDBuild/Makefile
   trunk/BSDBuild/agar-network.pm
Log:
test for threads, GL and network support in Agar.


Modified: trunk/BSDBuild/Makefile
===================================================================
--- trunk/BSDBuild/Makefile     2008-10-26 10:40:56 UTC (rev 760)
+++ trunk/BSDBuild/Makefile     2008-10-27 11:48:44 UTC (rev 761)
@@ -44,11 +44,13 @@
        free_null.pm \
        agar.pm \
        agar-core.pm \
-       agar-network.pm \
        agar-rg.pm \
        agar-vg.pm \
        agar-map.pm \
        agar-dev.pm \
+       agar-opengl.pm \
+       agar-threads.pm \
+       agar-network.pm \
        cg.pm \
        cracklib.pm \
        db4.pm \

Modified: trunk/BSDBuild/agar-network.pm
===================================================================
--- trunk/BSDBuild/agar-network.pm      2008-10-26 10:40:56 UTC (rev 760)
+++ trunk/BSDBuild/agar-network.pm      2008-10-27 11:48:44 UTC (rev 761)
@@ -1,8 +1,6 @@
-# $Csoft: libqnet.pm,v 1.2 2004/10/24 23:43:06 vedge Exp $
 # vim:ts=4
 #
-# Copyright (c) 2005 CubeSoft Communications, Inc.
-# <http://www.csoft.org>
+# Copyright (c) 2008 Hypertriton, Inc. <http://hypertriton.com/>
 # All rights reserved.
 #
 # Redistribution and use in source and binary forms, with or without
@@ -29,28 +27,15 @@
 {
        my ($ver) = @_;
        
-       MkExecOutputUnique('agar-config', '--version', 'AGAR_VERSION');
-       MkIf('"${AGAR_VERSION}" != ""');
+       MkExecOutputUnique('agar-config', '--network', 'AGAR_HAVE_NETWORK');
+       MkIf('"${AGAR_HAVE_NETWORK}" = "yes"');
                MkPrint('yes');
-               MkExecOutput('agar-config', '--cflags', 'AGAR_CFLAGS');
-               MkExecOutput('agar-config', '--libs', 'AGAR_LIBS');
-               MkPrintN('checking for network support in ag_core...');
-               MkCompileC('HAVE_AGAR_NETWORK',
-                   '${AGAR_CFLAGS}',
-                       '${AGAR_LIBS}', << 'EOF');
-#include <agar/core.h>
-#include <agar/core/net.h>
-
-int main(int argc, char *argv[]) {
-       NC_Session sess;
-       NC_Init(&sess, "foo", "bar");
-       NC_Destroy(&sess);
-       return (0);
-}
-EOF
+               MkSaveMK('AGAR_HAVE_NETWORK');
+               MkSaveDefine('AGAR_HAVE_NETWORK');
        MkElse;
-               MkPrint('no');
-               MkSaveUndef('HAVE_AGAR_NETWORK');
+           MkPrint('no');
+               MkSaveMK('AGAR_HAVE_NETWORK');
+               MkSaveUndef('AGAR_HAVE_NETWORK');
        MkEndif;
        return (0);
 }
@@ -59,29 +44,24 @@
 {
        my ($os, $osrel, $machine) = @_;
 
-       if ($os eq 'windows') {
-               MkDefine('HAVE_AGAR_NETWORK', 'no');
-       } elsif ($os eq 'linux' || $os eq 'darwin' ||
-                $os =~ /^(open|net|free)bsd$/) {
-               MkDefine('HAVE_AGAR_NETWORK', 'yes');
-       } else {
-               goto UNAVAIL;
-       }
-       MkDefine('HAVE_AGAR_NETWORK', 'yes');
-       MkSaveDefine('HAVE_AGAR_NETWORK');
+       MkDefine('AGAR_HAVE_NETWORK', 'yes');
+       MkSaveMK('AGAR_HAVE_NETWORK');
+       MkSaveDefine('AGAR_HAVE_NETWORK');
        return (1);
-UNAVAIL:
-       MkDefine('HAVE_AGAR_NETWORK', 'no');
-       MkSaveUndef('HAVE_AGAR_NETWORK');
-       return (1);
 }
 
+sub Link
+{
+       return (0);
+}
+
 BEGIN
 {
-       $DESCR{'agar-network'} = 'ag_core';
-       $DEPS{'agar-network'} = 'cc,agar';
        $TESTS{'agar-network'} = \&Test;
+       $DEPS{'agar-network'} = 'agar';
+       $LINK{'agar-network'} = \&Link;
        $EMUL{'agar-network'} = \&Emul;
+       $DESCR{'agar-network'} = 'network support in Agar';
 }
 
 ;1

Added: trunk/BSDBuild/agar-opengl.pm
===================================================================
--- trunk/BSDBuild/agar-opengl.pm                               (rev 0)
+++ trunk/BSDBuild/agar-opengl.pm       2008-10-27 11:48:44 UTC (rev 761)
@@ -0,0 +1,67 @@
+# vim:ts=4
+#
+# Copyright (c) 2008 Hypertriton, Inc. <http://hypertriton.com/>
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+# 1. Redistributions of source code must retain the above copyright
+#    notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+#    notice, this list of conditions and the following disclaimer in the
+#    documentation and/or other materials provided with the distribution..
+# 
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR
+# ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+# DAMAGES (INCLUDING BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
+# USE OF THIS SOFTWARE EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE..
+
+sub Test
+{
+       my ($ver) = @_;
+       
+       MkExecOutputUnique('agar-config', '--opengl', 'AGAR_HAVE_OPENGL');
+       MkIf('"${AGAR_HAVE_OPENGL}" = "yes"');
+               MkPrint('yes');
+               MkSaveMK('AGAR_HAVE_OPENGL');
+               MkSaveDefine('AGAR_HAVE_OPENGL');
+       MkElse;
+           MkPrint('no');
+               MkSaveMK('AGAR_HAVE_OPENGL');
+               MkSaveUndef('AGAR_HAVE_OPENGL');
+       MkEndif;
+       return (0);
+}
+
+sub Emul
+{
+       my ($os, $osrel, $machine) = @_;
+
+       MkDefine('AGAR_HAVE_OPENGL', 'yes');
+       MkSaveMK('AGAR_HAVE_OPENGL');
+       MkSaveDefine('AGAR_HAVE_OPENGL');
+       return (1);
+}
+
+sub Link
+{
+       return (0);
+}
+
+BEGIN
+{
+       $TESTS{'agar-opengl'} = \&Test;
+       $DEPS{'agar-opengl'} = 'agar,opengl';
+       $LINK{'agar-opengl'} = \&Link;
+       $EMUL{'agar-opengl'} = \&Emul;
+       $DESCR{'agar-opengl'} = 'OpenGL support in Agar';
+}
+
+;1

Added: trunk/BSDBuild/agar-threads.pm
===================================================================
--- trunk/BSDBuild/agar-threads.pm                              (rev 0)
+++ trunk/BSDBuild/agar-threads.pm      2008-10-27 11:48:44 UTC (rev 761)
@@ -0,0 +1,67 @@
+# vim:ts=4
+#
+# Copyright (c) 2008 Hypertriton, Inc. <http://hypertriton.com/>
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+# 1. Redistributions of source code must retain the above copyright
+#    notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+#    notice, this list of conditions and the following disclaimer in the
+#    documentation and/or other materials provided with the distribution..
+# 
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR
+# ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+# DAMAGES (INCLUDING BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
+# USE OF THIS SOFTWARE EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE..
+
+sub Test
+{
+       my ($ver) = @_;
+       
+       MkExecOutputUnique('agar-config', '--threads', 'AGAR_HAVE_THREADS');
+       MkIf('"${AGAR_HAVE_THREADS}" = "yes"');
+               MkPrint('yes');
+               MkSaveMK('AGAR_HAVE_THREADS');
+               MkSaveDefine('AGAR_HAVE_THREADS');
+       MkElse;
+           MkPrint('no');
+               MkSaveMK('AGAR_HAVE_THREADS');
+               MkSaveUndef('AGAR_HAVE_THREADS');
+       MkEndif;
+       return (0);
+}
+
+sub Emul
+{
+       my ($os, $osrel, $machine) = @_;
+
+       MkDefine('AGAR_HAVE_THREADS', 'yes');
+       MkSaveMK('AGAR_HAVE_THREADS');
+       MkSaveDefine('AGAR_HAVE_THREADS');
+       return (1);
+}
+
+sub Link
+{
+       return (0);
+}
+
+BEGIN
+{
+       $TESTS{'agar-threads'} = \&Test;
+       $DEPS{'agar-threads'} = 'agar';
+       $LINK{'agar-threads'} = \&Link;
+       $EMUL{'agar-threads'} = \&Emul;
+       $DESCR{'agar-threads'} = 'threads support in Agar';
+}
+
+;1

_______________________________________________
BSDBuild-Commits mailing list
[email protected]
http://mail231.csoft.net/mailman/listinfo/bsdbuild-commits

Reply via email to