Linux compilation

View: New views
2 Messages — Rating Filter:   Alert me  

Linux compilation

by Marco Antonio Gómez :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

    Hello!

    I have been compiling nebula2tools target (revision 3218) in
GNU/Linux (Ubuntu, kernel 2.6.17). I have detected some errors in the
current SVN state, that I  have changed locally. Just in case main
developers want to commit them to SVN, I am going to detail what I have
found (and changed), attaching the associated patch files. I also
include some explanations about the changes to ease the task of
considering whether commit them or not.

SVN IGNORE
----------

Please add the svn:ignore properties to nebula2/bin/linux directory.


SSE SUPPORT
-----------

Patch file: sse_support_patch

Nowadays, g++ is not invoked using the correct flags to support MMX and
SSE extensions. I have changed nebula2/buildsys3/config.mak to do that.
Unfortunately, SSE code is Win32 specific, so it do not compile in
Linux. With this patch, source code use the __USE_SSE macro to determine
whether the SSE code must be compiled or not.

Modified files:
nebula2/buildsys3/config.mak
nebula2/code/nebula2/src/mathlib/_vector3_sse.cc
nebula2/code/nebula2/src/mathlib/_vector4_sse.cc
nebula2/code/nebula2/src/mathlib/_matrix33_sse.cc
nebula2/code/nebula2/src/mathlib/_matrix44_sse.cc
nebula2/code/nebula2/inc/mathlib/_vector3_sse.h
nebula2/code/nebula2/inc/mathlib/_vector4_sse.h
nebula2/code/nebula2/inc/mathlib/_matrix33_sse.h
nebula2/code/nebula2/inc/mathlib/_matrix44_sse.h

UPPERCASE INCLUDE ERRORS
------------------------

Patch file: include_errors_patch

Such as use #include "nString.h" instead of #include "nstring.h".

Modified files:

nebula2/code/nebula2/inc/util/nmd5.h
nebula2/code/nebula2/src/particle/nparticle2emitter_main.cc
nebula2/code/nebula2/src/network/naddbuddy.cc

COMPILER DIFFERENCES
--------------------

Patch file: compiler_differences_patch

C++ errors that Visual C++ overcomes but g++ does not.

- nebula2/code/nebula2/inc/util/narray.h: it used std::sort, but it did
not include algorithm file.

- nebula2/code/nebula2/inc/mathlib/nmath.h: it uses n_error but it did
not include its declaration.

- nebula2/code/nebula2/src/character/ncharacter2.cc: .cc file had inline
methods.

- nebula2/code/nebula2/inc/input/nkeycodes.h: it had a variable without
extern keyword.

- nebula2/code/nebula2/inc/tools/nmeshbuilder.h: it included the class
qualifier in an internal attribute (class nMeshBuilder { ...; static
nMeshBuilder* nMeshBuilder::qsortData; }; )

Modified files:

nebula2/code/nebula2/inc/util/narray.h
nebula2/code/nebula2/inc/mathlib/nmath.h
nebula2/code/nebula2/src/character/ncharacter2.cc
nebula2/code/nebula2/inc/input/nkeycodes.h
nebula2/code/nebula2/inc/tools/nmeshbuilder.h

LIBS DIFFERENCES (related to both include and binary files)
----------------

Patch file: libs_differences_patch

When installing libraries using apt-get (libvorbis-dev, libtheora-dev,
libsqlite3-dev), header files are copied to different directories than
in Windows. Conditional compilation have been added.
I have also added linux library to nsqlite3database module in sql.bld.

Modified files:

nebula2/code/nebula2/inc/sql/nsqlite3database.h
nebula2/code/nebula2/inc/sql/nsqlite3query.h
nebula2/code/nebula2/inc/video/noggtheoraplayer.h
nebula2/code/nebula2/bldfiles/nnebula/sql.bld

NETWORK
-------

Patch file: network_patch

I do not know in detail network modules and targets. I have learnt
that some of the modules make use of windows specific functions and
defines, such as nbuddyclient, that uses WinBase.h.

For that reason, my first attempt was to configure all network related
modules for compiling only in Windows (I wanted to have nebula compiled!
:) ). However, it seems to be an error in the build tool, because when a
target has all its modules specific for another platform, generated make
files do not compile even the pkg file, leading to a linker error. When
I had all nnetwork modules for win32, generated makefile did not compile
pkg_nnetwork.cc, and therefore, I did not have nnetwork function and
kernelServer.AddPackage(nnetwork) did not link.

For that reason, I finally changed network.bld, adding "setplatform
win32" to all its modules except for nnetserver. However, someone should
try to reduced the number of win32 modules to the minimum...

I have modified also two kernel files related to network:

- nebula2/code/nebula2/src/kernel/nipcclient.cc: it made use of
WSAGetLastError() instead of the N_SOCKET_LAST_ERROR macro (platform
independent).

- nebula2/code/nebula2/inc/kernel/nsocketdefs.h: it do not define the
macro N_ECONNRESET for Linux platform. I have defined it with ENOTCONN
value, but a network expert should ensure that this is equivalent to
WSAECONNRESET (http://msdn2.microsoft.com/en-us/library/ms740668.aspx)

Modified files:

nebula2/code/nebula2/src/kernel/nipcclient.cc
nebula2/code/nebula2/inc/kernel/nsocketdefs.h
nebula2/code/nebula2/bldfiles/nnetwork/network.bld

WIN32 SPECIFICS CODE
--------------------

Patch file: win32_specific_code_patch

Added #define's to code created for Win32 platform.

Modified files:

nebula2/code/nebula2/src/kernel/nwin32stacktrace.cc
nebula2/code/nebula2/src/kernel/nwin32wrapper.cc
nebula2/code/nebula2/inc/misc/nwin32prefserver.h
nebula2/code/nebula2/src/misc/nwin32prefserver_main.cc
nebula2/code/nebula2/src/misc/niniprefserver_main.cc
nebula2/code/nebula2/inc/kernel/nwin32stacktrace.h
nebula2/code/nebula2/inc/kernel/nwin32wrapper.h
nebula2/code/nebula2/inc/misc/niniprefserver.h
nebula2/code/nebula2/src/tools/nanalyzeexport.cc

WIN32 SPECIFICS MODULES AND TARGETS
-----------------------------------

Patch file: win32_specific_modules_patch

Added "setplatform win32" to:

- tools.bld: module nsetpath. Also to ncliensth and nmasterserversh
because of the network changes that make impossible to use network on Linux.

- gfx2.bld: DirectX modules.

- input.bld: ndinputerror (Direct Input specific)

- audio3.bld: direct sound modules. I have seen that naudiofile is
windows dependent, because it make use of WAVEFORMATEX type. That forced
me to remove this module from Linux compilation.

- misc.bld: niniprefserver and nwin32prefserver

Modified files:

nebula2/code/nebula2/bldfiles/ntoollib/tools.bld
nebula2/code/nebula2/bldfiles/nnebula/gfx2.bld
nebula2/code/nebula2/bldfiles/nnebula/input.bld
nebula2/code/nebula2/bldfiles/nnebula/audio3.bld
nebula2/code/nebula2/bldfiles/nnebula/misc.bld

WARNINGS
--------

Patch file: warnings_patch

G++ generates a great amount of warnings. I have just resolve two of them.

Modified files:

nebula2/code/nebula2/src/util/nmd5.cc
nebula2/code/nebula2/inc/kernel/nobject.h


        That's all!!

                Marco


Index: nebula2/code/nebula2/inc/util/narray.h
===================================================================
--- nebula2/code/nebula2/inc/util/narray.h (revisión: 3218)
+++ nebula2/code/nebula2/inc/util/narray.h (copia de trabajo)
@@ -17,6 +17,8 @@
 */
 #include "kernel/ntypes.h"
 
+#include <algorithm> // std::sort
+
 //------------------------------------------------------------------------------
 template<class TYPE> class nArray
 {
Index: nebula2/code/nebula2/inc/mathlib/nmath.h
===================================================================
--- nebula2/code/nebula2/inc/mathlib/nmath.h (revisión: 3218)
+++ nebula2/code/nebula2/inc/mathlib/nmath.h (copia de trabajo)
@@ -12,6 +12,8 @@
 #include <math.h>
 #include <stdlib.h>
 
+#include "kernel/ntypes.h"
+
 #ifdef _MSC_VER
 #define isnan _isnan
 #define isinf _isinf
Index: nebula2/code/nebula2/src/character/ncharacter2.cc
===================================================================
--- nebula2/code/nebula2/src/character/ncharacter2.cc (revisión: 3218)
+++ nebula2/code/nebula2/src/character/ncharacter2.cc (copia de trabajo)
@@ -46,7 +46,6 @@
 //------------------------------------------------------------------------------
 /**
 */
-inline
 void
 nCharacter2::SetSkinAnimator(nSkinAnimator* animator)
 {
@@ -65,7 +64,6 @@
 //------------------------------------------------------------------------------
 /**
 */
-inline
 void
 nCharacter2::SetAnimEventHandler(nAnimEventHandler* handler)
 {
Index: nebula2/code/nebula2/inc/input/nkeycodes.h
===================================================================
--- nebula2/code/nebula2/inc/input/nkeycodes.h (revisión: 3218)
+++ nebula2/code/nebula2/inc/input/nkeycodes.h (copia de trabajo)
@@ -150,7 +150,7 @@
     nKey key;
 };
 
-nStrToKey key_remaptable[];
+extern nStrToKey key_remaptable[];
 #endif
 
 //------------------------------------------------------------------------------
Index: nebula2/code/nebula2/inc/tools/nmeshbuilder.h
===================================================================
--- nebula2/code/nebula2/inc/tools/nmeshbuilder.h (revisión: 3218)
+++ nebula2/code/nebula2/inc/tools/nmeshbuilder.h (copia de trabajo)
@@ -375,7 +375,7 @@
     };
 
     /// static user data pointer for qsort hook
-    static nMeshBuilder* nMeshBuilder::qsortData;
+    static nMeshBuilder* qsortData;
     /// a qsort() hook for generating a sorted index array
     static int __cdecl VertexSorter(const void* elm0, const void* elm1);
     /// qsort hook for sorting triangles by their group index

Index: nebula2/code/nebula2/inc/util/nmd5.h
===================================================================
--- nebula2/code/nebula2/inc/util/nmd5.h (revisión: 3218)
+++ nebula2/code/nebula2/inc/util/nmd5.h (copia de trabajo)
@@ -35,7 +35,7 @@
 
 
 
-#include "nString.h"
+#include "nstring.h"
 
 typedef unsigned       int uint4;
 typedef unsigned short int uint2;
@@ -96,4 +96,4 @@
  uchar m_Digest[16];
  uchar m_Finalized;
 
-};
\ Sin fin-de-línea al final del archivo
+};
Index: nebula2/code/nebula2/src/particle/nparticle2emitter_main.cc
===================================================================
--- nebula2/code/nebula2/src/particle/nparticle2emitter_main.cc (revisión: 3218)
+++ nebula2/code/nebula2/src/particle/nparticle2emitter_main.cc (copia de trabajo)
@@ -2,7 +2,7 @@
 //  nparticle_main.cc
 //  (C) 2003 RadonLabs GmbH
 //------------------------------------------------------------------------------
-#include "particle/nParticle2Emitter.h"
+#include "particle/nparticle2emitter.h"
 #include "particle/nparticle2.h"
 #include "mathlib/vector.h"
 
Index: nebula2/code/nebula2/src/network/naddbuddy.cc
===================================================================
--- nebula2/code/nebula2/src/network/naddbuddy.cc (revisión: 3218)
+++ nebula2/code/nebula2/src/network/naddbuddy.cc (copia de trabajo)
@@ -2,7 +2,7 @@
 //  nAddBuddy.cc
 //  (C) 2006 RadonLabs GmbH
 //------------------------------------------------------------------------------
-#include "network/nAddBuddy.h"
+#include "network/naddbuddy.h"
 #include "network/nbuddyclient.h"
 
 
@@ -79,4 +79,4 @@
              }
          }
      }
-}
\ Sin fin-de-línea al final del archivo
+}

Index: nebula2/code/nebula2/inc/sql/nsqlite3database.h
===================================================================
--- nebula2/code/nebula2/inc/sql/nsqlite3database.h (revisión: 3218)
+++ nebula2/code/nebula2/inc/sql/nsqlite3database.h (copia de trabajo)
@@ -9,7 +9,11 @@
     (C) 2005 Radon Labs GmbH
 */
 #include "sql/nsqldatabase.h"
+#ifdef __WIN32__
 #include "sqlite/sqlite3.h"
+#else
+#include <sqlite3.h>
+#endif
 
 //------------------------------------------------------------------------------
 class nSQLite3Database : nSqlDatabase
Index: nebula2/code/nebula2/inc/sql/nsqlite3query.h
===================================================================
--- nebula2/code/nebula2/inc/sql/nsqlite3query.h (revisión: 3218)
+++ nebula2/code/nebula2/inc/sql/nsqlite3query.h (copia de trabajo)
@@ -8,7 +8,12 @@
 
     (C) 2005 Radon Labs GmbH
 */
+#ifdef __WIN32__
 #include "sqlite/sqlite3.h"
+#else
+#include <sqlite3.h>
+#endif
+
 #include "sql/nsqlquery.h"
 #include "kernel/nref.h"
 
Index: nebula2/code/nebula2/inc/video/noggtheoraplayer.h
===================================================================
--- nebula2/code/nebula2/inc/video/noggtheoraplayer.h (revisión: 3218)
+++ nebula2/code/nebula2/inc/video/noggtheoraplayer.h (copia de trabajo)
@@ -12,7 +12,11 @@
     (C) 2005 RadonLabs GmbH
 */
 #include "video/nvideoplayer.h"
+#ifdef __WIN32__
 #include "ogg/theora.h"
+#else
+#include <theora/theora.h>
+#endif
 #include "kernel/nfileserver2.h"
 
 //------------------------------------------------------------------------------
Index: nebula2/code/nebula2/bldfiles/nnebula/sql.bld
===================================================================
--- nebula2/code/nebula2/bldfiles/nnebula/sql.bld (revisión: 3218)
+++ nebula2/code/nebula2/bldfiles/nnebula/sql.bld (copia de trabajo)
@@ -39,6 +39,9 @@
     setlibs_win32_debug {
         sqlite_d.lib
     }
+    setlibs_linux {
+ sqlite3
+    }
 endmodule
 
 beginmodule nsqlite3query

Index: nebula2/code/nebula2/src/kernel/nipcclient.cc
===================================================================
--- nebula2/code/nebula2/src/kernel/nipcclient.cc (revisión: 3218)
+++ nebula2/code/nebula2/src/kernel/nipcclient.cc (copia de trabajo)
@@ -238,7 +238,7 @@
     }
     else
     {
-        int a= WSAGetLastError();
+        int a= N_SOCKET_LAST_ERROR;
         // either an error occured, or the method would block
         if (N_SOCKET_LAST_ERROR == N_EWOULDBLOCK)
         {
Index: nebula2/code/nebula2/inc/kernel/nsocketdefs.h
===================================================================
--- nebula2/code/nebula2/inc/kernel/nsocketdefs.h (revisión: 3218)
+++ nebula2/code/nebula2/inc/kernel/nsocketdefs.h (copia de trabajo)
@@ -42,6 +42,7 @@
 #define SOCKET_ERROR           (-1)
 #define N_SOCKET_LAST_ERROR    errno
 #define N_EWOULDBLOCK          EWOULDBLOCK
+#define N_ECONNRESET           ENOTCONN
 #endif
 
 #define N_SOCKET_MIN_PORTNUM   (12000)
Index: nebula2/code/nebula2/bldfiles/nnetwork/network.bld
===================================================================
--- nebula2/code/nebula2/bldfiles/nnetwork/network.bld (revisión: 3218)
+++ nebula2/code/nebula2/bldfiles/nnetwork/network.bld (copia de trabajo)
@@ -36,6 +36,7 @@
 
 beginmodule naddbuddy
     setdir network
+    setplatform win32
     setheaders {
         naddbuddy
     }
@@ -46,6 +47,7 @@
 
 beginmodule nbuddyclient
     setdir network
+    setplatform win32
     setheaders {
         nbuddyclient
     }
@@ -57,6 +59,7 @@
 
 beginmodule nbuddycommandhandler
     setdir network
+    setplatform win32
     setheaders {
         nbuddycommandhandler
     }
@@ -67,6 +70,7 @@
 
 beginmodule nbuddycommandinterpreter
     setdir network
+    setplatform win32
     setheaders {
         nbuddycommandinterpreter
     }
@@ -77,6 +81,7 @@
 
 beginmodule nbuddydatabase
     setdir network
+    setplatform win32
     setheaders {
         nbuddydatabase
     }
@@ -87,6 +92,7 @@
 
 beginmodule nbuddyserver
     setdir network
+    setplatform win32
     setheaders {
         nbuddyserver
     }
@@ -97,6 +103,7 @@
 
 beginmodule nbuddysession
     setdir network
+    setplatform win32
     setheaders {
         nbuddysession
     }
@@ -107,6 +114,7 @@
 
 beginmodule nbuddysessioncontroller
     setdir network
+    setplatform win32
     setheaders {
         nbuddysessioncontroller
     }
@@ -117,6 +125,7 @@
 
 beginmodule ncommand
     setdir network
+    setplatform win32
     setheaders {
         ncommand
     }
@@ -127,6 +136,7 @@
 
 beginmodule ncreateuser
     setdir network
+    setplatform win32
     setheaders {
         ncreateuser
     }
@@ -137,6 +147,7 @@
 
 beginmodule ngetbuddylist
     setdir network
+    setplatform win32
     setheaders {
         ngetbuddylist
     }
@@ -147,6 +158,7 @@
 
 beginmodule ngetprofileattr
     setdir network
+    setplatform win32
     setheaders {
         ngetprofileattr
     }
@@ -157,6 +169,7 @@
 
 beginmodule nhttpserver
     setdir network
+    setplatform win32
     setheaders {
         nhttpserver
     }
@@ -172,6 +185,7 @@
 
 beginmodule nlogin
     setdir network
+    setplatform win32
     setheaders {
         nlogin
     }
@@ -182,6 +196,7 @@
 
 beginmodule nmessage
     setdir network
+    setplatform win32
     setheaders {
         nmessage
     }
@@ -192,6 +207,7 @@
 
 beginmodule nnetclient
     setdir network
+    setplatform win32
     setheaders {
         nnetclient
     }
@@ -214,6 +230,7 @@
 
 beginmodule nsendmessage
     setdir network
+    setplatform win32
     setheaders {
         nsendmessage
     }
@@ -224,6 +241,7 @@
 
 beginmodule nservermessageinterpreter
     setdir network
+    setplatform win32
     setheaders {
         nservermessageinterpreter
     }
@@ -234,6 +252,7 @@
 
 beginmodule nsessionclient
     setdir network
+    setplatform win32
     setheaders {
         nsessionattrpool
         nsessionclient
@@ -246,6 +265,7 @@
 
 beginmodule nsessionclientcontext
     setdir network
+    setplatform win32
     setheaders {
         nsessionclientcontext
     }
@@ -257,6 +277,7 @@
 
 beginmodule nsessionserver
     setdir network
+    setplatform win32
     setheaders {
         nsessionattrpool
         nsessionserver
@@ -269,6 +290,7 @@
 
 beginmodule nsessionservercontext
     setdir network
+    setplatform win32
     setheaders {
         nsessionservercontext
     }
@@ -280,6 +302,7 @@
 
 beginmodule nsetprofileattr
     setdir network
+    setplatform win32
     setheaders {
         nsetprofileattr
     }
@@ -290,6 +313,7 @@
 
 beginmodule nupdate
     setdir network
+    setplatform win32
     setheaders {
         nupdate
     }
@@ -300,6 +324,7 @@
 
 beginmodule nusercontext
     setdir network
+    setplatform win32
     setheaders {
         nusercontext
     }
@@ -310,6 +335,7 @@
 
 beginmodule nusercontroller
     setdir network
+    setplatform win32
     setheaders {
         nusercontroller
     }

Index: nebula2/buildsys3/config.mak
===================================================================
--- nebula2/buildsys3/config.mak (revisión: 3218)
+++ nebula2/buildsys3/config.mak (copia de trabajo)
@@ -188,7 +188,7 @@
     CXX       = c++
     CC        = c++ -x c
   else
-    CXX       = g++
+    CXX       = g++ -mmmx -msse
     CC        = gcc -x c
   endif
   RC          =
Index: nebula2/code/nebula2/src/mathlib/_vector3_sse.cc
===================================================================
--- nebula2/code/nebula2/src/mathlib/_vector3_sse.cc (revisión: 3218)
+++ nebula2/code/nebula2/src/mathlib/_vector3_sse.cc (copia de trabajo)
@@ -1,3 +1,5 @@
+#if defined(__USE_SSE) || defined(DOXYGEN)
 #include "mathlib/_vector3_sse.h"
 
 const _vector3_sse _vector3_sse::zero = _vector3_sse();
+#endif
Index: nebula2/code/nebula2/src/mathlib/_vector4_sse.cc
===================================================================
--- nebula2/code/nebula2/src/mathlib/_vector4_sse.cc (revisión: 3218)
+++ nebula2/code/nebula2/src/mathlib/_vector4_sse.cc (copia de trabajo)
@@ -1,3 +1,5 @@
+#if defined(__USE_SSE) || defined(DOXYGEN)
 #include "mathlib/_vector4_sse.h"
 
 const _vector4_sse _vector4_sse::zero = _vector4_sse();
+#endif
Index: nebula2/code/nebula2/src/mathlib/_matrix33_sse.cc
===================================================================
--- nebula2/code/nebula2/src/mathlib/_matrix33_sse.cc (revisión: 3218)
+++ nebula2/code/nebula2/src/mathlib/_matrix33_sse.cc (copia de trabajo)
@@ -1,3 +1,5 @@
+#if defined(__USE_SSE) || defined(DOXYGEN)
 #include "mathlib/_matrix33_sse.h"
 
 const _matrix33_sse _matrix33_sse::identity = _matrix33_sse();
+#endif
Index: nebula2/code/nebula2/src/mathlib/_matrix44_sse.cc
===================================================================
--- nebula2/code/nebula2/src/mathlib/_matrix44_sse.cc (revisión: 3218)
+++ nebula2/code/nebula2/src/mathlib/_matrix44_sse.cc (copia de trabajo)
@@ -1,3 +1,4 @@
+#if defined(__USE_SSE) || defined(DOXYGEN)
 #include "mathlib/_matrix44_sse.h"
 
 const _matrix44_sse _matrix44_sse::identity = _matrix44_sse();
@@ -6,3 +7,4 @@
                                                          0.0f, 0.6667f, 0.0f, 0.0f,
                                                          0.0f, 0.0f,   -0.5f, 0.0f,
                                                          0.0f, 0.0f,    0.5f, 1.0f);
+#endif
Index: nebula2/code/nebula2/inc/mathlib/_vector3_sse.h
===================================================================
--- nebula2/code/nebula2/inc/mathlib/_vector3_sse.h (revisión: 3218)
+++ nebula2/code/nebula2/inc/mathlib/_vector3_sse.h (copia de trabajo)
@@ -1,3 +1,4 @@
+#if defined(__USE_SSE) || defined(DOXYGEN)
 #ifndef _VECTOR3_SSE_H
 #define _VECTOR3_SSE_H
 //------------------------------------------------------------------------------
@@ -418,3 +419,4 @@
 
 //------------------------------------------------------------------------------
 #endif
+#endif
Index: nebula2/code/nebula2/inc/mathlib/_vector4_sse.h
===================================================================
--- nebula2/code/nebula2/inc/mathlib/_vector4_sse.h (revisión: 3218)
+++ nebula2/code/nebula2/inc/mathlib/_vector4_sse.h (copia de trabajo)
@@ -1,3 +1,4 @@
+#if defined(__USE_SSE) || defined(DOXYGEN)
 #ifndef _VECTOR4_SSE_H
 #define _VECTOR4_SSE_H
 //------------------------------------------------------------------------------
@@ -323,3 +324,4 @@
 
 //------------------------------------------------------------------------------
 #endif
+#endif
Index: nebula2/code/nebula2/inc/mathlib/_matrix33_sse.h
===================================================================
--- nebula2/code/nebula2/inc/mathlib/_matrix33_sse.h (revisión: 3218)
+++ nebula2/code/nebula2/inc/mathlib/_matrix33_sse.h (copia de trabajo)
@@ -1,3 +1,4 @@
+#if defined(__USE_SSE) || defined(DOXYGEN)
 #ifndef _MATRIX33_SSE_H
 #define _MATRIX33_SSE_H
 //------------------------------------------------------------------------------
@@ -700,3 +701,4 @@
 
 //------------------------------------------------------------------------------
 #endif
+#endif
Index: nebula2/code/nebula2/inc/mathlib/_matrix44_sse.h
===================================================================
--- nebula2/code/nebula2/inc/mathlib/_matrix44_sse.h (revisión: 3218)
+++ nebula2/code/nebula2/inc/mathlib/_matrix44_sse.h (copia de trabajo)
@@ -1,3 +1,4 @@
+#if defined(__USE_SSE) || defined(DOXYGEN)
 #ifndef _MATRIX44_SSE_H
 #define _MATRIX44_SSE_H
 //------------------------------------------------------------------------------
@@ -850,3 +851,4 @@
 
 //------------------------------------------------------------------------------
 #endif
+#endif

Index: nebula2/code/nebula2/src/util/nmd5.cc
===================================================================
--- nebula2/code/nebula2/src/util/nmd5.cc (revisión: 3218)
+++ nebula2/code/nebula2/src/util/nmd5.cc (copia de trabajo)
@@ -286,4 +286,4 @@
  dest[i] = ((uint4)src[j]) | (((uint4)src[j+1])<<8) |
       (((uint4)src[j+2])<<16) | (((uint4)src[j+3])<<24);
  }
-}
\ Sin fin-de-línea al final del archivo
+}
Index: nebula2/code/nebula2/inc/kernel/nobject.h
===================================================================
--- nebula2/code/nebula2/inc/kernel/nobject.h (revisión: 3218)
+++ nebula2/code/nebula2/inc/kernel/nobject.h (copia de trabajo)
@@ -114,7 +114,7 @@
         {
             return true;
         }
-    } while (actClass = actClass->GetSuperClass());
+    } while (0 == (actClass = actClass->GetSuperClass()));
     return false;
 }
 

Index: nebula2/code/nebula2/src/kernel/nwin32stacktrace.cc
===================================================================
--- nebula2/code/nebula2/src/kernel/nwin32stacktrace.cc (revisión: 3218)
+++ nebula2/code/nebula2/src/kernel/nwin32stacktrace.cc (copia de trabajo)
@@ -1,3 +1,4 @@
+#if (defined __WIN32__ && !defined(__XBxX__)) || defined(DOXYGEN)
 //------------------------------------------------------------------------------
 //  nwin32stacktrace.cc
 //
@@ -223,3 +224,4 @@
 
     return true;
 }
+#endif
Index: nebula2/code/nebula2/src/kernel/nwin32wrapper.cc
===================================================================
--- nebula2/code/nebula2/src/kernel/nwin32wrapper.cc (revisión: 3218)
+++ nebula2/code/nebula2/src/kernel/nwin32wrapper.cc (copia de trabajo)
@@ -1,3 +1,4 @@
+#if (defined __WIN32__ && !defined(__XBxX__)) || defined(DOXYGEN)
 //------------------------------------------------------------------------------
 //  nwin32wrapper.cc
 //  (C) 2004 RadonLabs GmbH
@@ -93,3 +94,4 @@
     n_assert(this->shGetFolderPathFunc);
     return this->shGetFolderPathFunc(hwndOwner, nFolder, hToken, dwFlags, pszPath);
 }
+#endif
Index: nebula2/code/nebula2/inc/misc/nwin32prefserver.h
===================================================================
--- nebula2/code/nebula2/inc/misc/nwin32prefserver.h (revisión: 3218)
+++ nebula2/code/nebula2/inc/misc/nwin32prefserver.h (copia de trabajo)
@@ -1,3 +1,4 @@
+#if defined(__WIN32__) || defined(DOXYGEN)
 #ifndef N_WIN32PREFSERVER_H
 #define N_WIN32PREFSERVER_H
 //------------------------------------------------------------------------------
@@ -41,3 +42,4 @@
 };
 //------------------------------------------------------------------------------
 #endif
+#endif
Index: nebula2/code/nebula2/src/misc/nwin32prefserver_main.cc
===================================================================
--- nebula2/code/nebula2/src/misc/nwin32prefserver_main.cc (revisión: 3218)
+++ nebula2/code/nebula2/src/misc/nwin32prefserver_main.cc (copia de trabajo)
@@ -1,3 +1,4 @@
+#if defined(__WIN32__) || defined(DOXYGEN)
 //------------------------------------------------------------------------------
 //  nwin32prefserver_main.cc
 //  (C) 2004 RadonLabs GmbH
@@ -171,3 +172,4 @@
     }
     return returnValue;
 }
+#endif
Index: nebula2/code/nebula2/src/misc/niniprefserver_main.cc
===================================================================
--- nebula2/code/nebula2/src/misc/niniprefserver_main.cc (revisión: 3218)
+++ nebula2/code/nebula2/src/misc/niniprefserver_main.cc (copia de trabajo)
@@ -1,3 +1,4 @@
+#if defined(__WIN32__) || defined(DOXYGEN)
 //------------------------------------------------------------------------------
 //  niniprefserver.h
 //  (C) 2005 Kim, Hyoun Woo.
@@ -111,3 +112,4 @@
     return WritePrivateProfileString(section.Get(), key.Get(), NULL,
                                      this->fileName.Get()) ? true : false;
 }
+#endif
Index: nebula2/code/nebula2/inc/kernel/nwin32stacktrace.h
===================================================================
--- nebula2/code/nebula2/inc/kernel/nwin32stacktrace.h (revisión: 3218)
+++ nebula2/code/nebula2/inc/kernel/nwin32stacktrace.h (copia de trabajo)
@@ -1,3 +1,4 @@
+#if (defined __WIN32__ && !defined(__XBxX__)) || defined(DOXYGEN)
 #ifndef N_STACKTRACE_H
 #define N_STACKTRACE_H
 //------------------------------------------------------------------------------
@@ -56,3 +57,4 @@
 };
 //------------------------------------------------------------------------------
 #endif
+#endif
Index: nebula2/code/nebula2/inc/kernel/nwin32wrapper.h
===================================================================
--- nebula2/code/nebula2/inc/kernel/nwin32wrapper.h (revisión: 3218)
+++ nebula2/code/nebula2/inc/kernel/nwin32wrapper.h (copia de trabajo)
@@ -1,3 +1,4 @@
+#if (defined __WIN32__ && !defined(__XBxX__)) || defined(DOXYGEN)
 #ifndef N_WIN32WRAPPER_H
 #define N_WIN32WRAPPER_H
 //------------------------------------------------------------------------------
@@ -73,3 +74,4 @@
 
 //------------------------------------------------------------------------------
 #endif
+#endif
Index: nebula2/code/nebula2/inc/misc/niniprefserver.h
===================================================================
--- nebula2/code/nebula2/inc/misc/niniprefserver.h (revisión: 3218)
+++ nebula2/code/nebula2/inc/misc/niniprefserver.h (copia de trabajo)
@@ -1,3 +1,4 @@
+#if defined(__WIN32__) || defined(DOXYGEN)
 #ifndef N_INIPREFSERVER_H
 #define N_INIPREFSERVER_H
 //------------------------------------------------------------------------------
@@ -130,3 +131,4 @@
 }
 //------------------------------------------------------------------------------
 #endif
+#endif
Index: nebula2/code/nebula2/src/tools/nanalyzeexport.cc
===================================================================
--- nebula2/code/nebula2/src/tools/nanalyzeexport.cc (revisión: 3218)
+++ nebula2/code/nebula2/src/tools/nanalyzeexport.cc (copia de trabajo)
@@ -8,14 +8,19 @@
 #include "gfx2/ngfxserver2.h"
 
 nNebulaUsePackage(nnebula);
+#ifdef __WIN32__
 nNebulaUsePackage(ndinput8);
 nNebulaUsePackage(ndirect3d9);
 nNebulaUsePackage(ndshow);
+#endif
 nNebulaUsePackage(ngui);
 nNebulaUsePackage(nnetwork);
+#ifdef __WIN32__
 nNebulaUsePackage(ndsound);
+#endif
 
 //------------------------------------------------------------------------------
+#ifdef __WIN32__
 /*
     Win32 specific method which checks the registry for the Nebula2
     Toolkit's project path. If the reg keys are not found, the
@@ -42,6 +47,7 @@
     }
     return nString(projectDir);
 }
+#endif
 
 //------------------------------------------------------------------------------
 /*
@@ -52,12 +58,16 @@
     // initialize Nebula runtime
     nKernelServer kernelServer;
     kernelServer.AddPackage(nnebula);
+#ifdef __WIN32__
     kernelServer.AddPackage(ndinput8);
     kernelServer.AddPackage(ndirect3d9);
     kernelServer.AddPackage(ndshow);
+#endif
     kernelServer.AddPackage(ngui);
     kernelServer.AddPackage(nnetwork);
+#ifdef __WIN32__
     kernelServer.AddPackage(ndsound);
+#endif
 
     // initialize a display mode object
     nDisplayMode2 displayMode;
@@ -70,7 +80,10 @@
     displayMode.SetHeight(20);
     displayMode.SetType(nDisplayMode2::Windowed);
 
-    nString projDir = ReadProjRegistryKey();
+    nString projDir;
+#ifdef __WIN32__
+    projDir = ReadProjRegistryKey();
+#endif
     if (projDir.IsEmpty())
     {
         projDir = "home:";

Index: nebula2/code/nebula2/bldfiles/ntoollib/tools.bld
===================================================================
--- nebula2/code/nebula2/bldfiles/ntoollib/tools.bld (revisión: 3218)
+++ nebula2/code/nebula2/bldfiles/ntoollib/tools.bld (copia de trabajo)
@@ -207,6 +207,7 @@
 
 beginmodule nclientsh
     setdir tools
+    setplatform win32
     setfiles {
         nclientsh
     }
@@ -256,6 +257,7 @@
 
 beginmodule nmasterserversh
     setdir tools
+    setplatform win32
     setfiles {
         nmasterserversh
     }
@@ -284,6 +286,7 @@
 
 beginmodule nsetpath
     setdir tools
+    setplatform win32
     setfiles {
         nsetpath
     }
Index: nebula2/code/nebula2/bldfiles/nnebula/gfx2.bld
===================================================================
--- nebula2/code/nebula2/bldfiles/nnebula/gfx2.bld (revisión: 3218)
+++ nebula2/code/nebula2/bldfiles/nnebula/gfx2.bld (copia de trabajo)
@@ -189,6 +189,7 @@
 
 beginmodule nd3d9font
     setdir gfx2
+    setplatform win32
     setheaders {
         nd3d9font
     }
@@ -199,6 +200,7 @@
 
 beginmodule nd3d9mesh
     setdir gfx2
+    setplatform win32
     setheaders {
         nd3d9mesh
     }
@@ -209,6 +211,7 @@
 
 beginmodule nd3d9mesharray
     setdir gfx2
+    setplatform win32
     setheaders {
         nd3d9mesharray
     }
@@ -219,6 +222,7 @@
 
 beginmodule nd3d9occlusionquery
     setdir gfx2
+    setplatform win32
     setheaders {
         nd3d9occlusionquery
     }
@@ -229,6 +233,7 @@
 
 beginmodule nd3d9server
     setdir gfx2
+    setplatform win32
     setheaders {
         nd3d9server
     }
@@ -254,6 +259,7 @@
 
 beginmodule nd3d9shader
     setdir gfx2
+    setplatform win32
     setheaders {
         nd3d9shader
     }
@@ -264,6 +270,7 @@
 
 beginmodule nd3d9shaderinclude
     setdir gfx2
+    setplatform win32
     setheaders {
         nd3d9shaderinclude
     }
@@ -274,6 +281,7 @@
 
 beginmodule nd3d9texture
     setdir gfx2
+    setplatform win32
     setheaders {
         nd3d9texture
     }
@@ -284,6 +292,7 @@
 
 beginmodule nd3d9windowhandler
     setdir gfx2
+    setplatform win32
     setheaders {
         nd3d9windowhandler
     }
Index: nebula2/code/nebula2/bldfiles/nnebula/input.bld
===================================================================
--- nebula2/code/nebula2/bldfiles/nnebula/input.bld (revisión: 3218)
+++ nebula2/code/nebula2/bldfiles/nnebula/input.bld (copia de trabajo)
@@ -157,6 +157,7 @@
 
 beginmodule ndinputerror
     setdir input
+    setplatform win32
     setfiles {
     ndinputerror
     }
Index: nebula2/code/nebula2/bldfiles/nnebula/audio3.bld
===================================================================
--- nebula2/code/nebula2/bldfiles/nnebula/audio3.bld (revisión: 3218)
+++ nebula2/code/nebula2/bldfiles/nnebula/audio3.bld (copia de trabajo)
@@ -15,6 +15,7 @@
 
 beginmodule naudiofile
     setdir audio3
+    setplatform win32
     setheaders {
         naudiofile
     }
@@ -37,6 +38,7 @@
 
 beginmodule noggfile
     setdir audio3
+    setplatform win32
     setheaders {
         noggfile
     }
@@ -51,6 +53,10 @@
         ogg_d.lib
         vorbis_d.lib
     }
+    setlibs_linux {
+ ogg
+ theora
+    }
 endmodule
 
 beginmodule nsound3
@@ -75,6 +81,7 @@
 
 beginmodule nwavfile
     setdir audio3
+    setplatform win32
     setheaders {
         nwavfile
     }
@@ -114,6 +121,7 @@
 
 beginmodule ndsound3
     setdir audio3
+    setplatform win32
     setheaders {
         ndsound3
     }
@@ -124,6 +132,7 @@
 
 beginmodule ndsoundresource
     setdir audio3
+    setplatform win32
     setheaders {
         ndsoundresource
     }
@@ -134,6 +143,7 @@
 
 beginmodule ndsoundserver3
     setdir audio3
+    setplatform win32
     setheaders {
         ndsoundserver3
     }
Index: nebula2/code/nebula2/bldfiles/nnebula/misc.bld
===================================================================
--- nebula2/code/nebula2/bldfiles/nnebula/misc.bld (revisión: 3218)
+++ nebula2/code/nebula2/bldfiles/nnebula/misc.bld (copia de trabajo)
@@ -37,6 +37,7 @@
 
 beginmodule niniprefserver
     setdir misc
+    setplatform win32
     setheaders {
         niniprefserver
     }
@@ -65,6 +66,7 @@
 
 beginmodule nwin32prefserver
     setdir misc
+    setplatform win32
     setheaders {
         nwin32prefserver
     }

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV

*** NOTE: To reply to the list use "reply to all",  ***
***       to reply direct to the sender use "reply" ***
_______________________________________________
Nebuladevice-discuss mailing list
Nebuladevice-discuss@...
https://lists.sourceforge.net/lists/listinfo/nebuladevice-discuss

Re: Linux compilation

by Vadim Macagon :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Marco Antonio Gómez Martín wrote:
>    Hello!
>
>    I have been compiling nebula2tools target (revision 3218) in
> GNU/Linux (Ubuntu, kernel 2.6.17). I have detected some errors in the
> current SVN state, that I  have changed locally. Just in case main
> developers want to commit them to SVN, I am going to detail what I have
> found (and changed), attaching the associated patch files. I also
> include some explanations about the changes to ease the task of
> considering whether commit them or not.

Thanks for doing all this, I've made some notes below as to what I
actually ended up doing.

> SVN IGNORE
> ----------
>
> Please add the svn:ignore properties to nebula2/bin/linux directory.

Done.

> SSE SUPPORT
> -----------
>
> Nowadays, g++ is not invoked using the correct flags to support MMX and
> SSE extensions. I have changed nebula2/buildsys3/config.mak to do that.
> Unfortunately, SSE code is Win32 specific, so it do not compile in
> Linux. With this patch, source code use the __USE_SSE macro to determine
> whether the SSE code must be compiled or not.

I left out the change to config.mak, seeing as SSE doesn't build anyway.
The .h don't need to be modified since they don't get included outside
the corresponding .cc unless the existing __USE_SSE__ flag is defined
(no need for another __USE_SSE flag).

> NETWORK
> -------
>
> I do not know in detail network modules and targets. I have learnt
> that some of the modules make use of windows specific functions and
> defines, such as nbuddyclient, that uses WinBase.h.

I managed to get the network stuff building, the win32 specific stuff
was a minor issue (console text color setting and winsock initialization
that I just #ifdef-ed out). The majority of the work involved fixing the
mixed case includes (someone got a bit sloppy). So, it builds, but I
leave it up to you to figure out if it actually works :)

> WIN32 SPECIFICS CODE
> --------------------
>
> Added #define's to code created for Win32 platform.

Instead of #ifdef-ing the win32 specific code I fixed the .bld files.

> WIN32 SPECIFICS MODULES AND TARGETS
> -----------------------------------
>
> - audio3.bld: direct sound modules. I have seen that naudiofile is
> windows dependent, because it make use of WAVEFORMATEX type. That forced
> me to remove this module from Linux compilation.

If someone wants to fix nAudioFile that shouldn't be too hard.

> WARNINGS
> --------
>
> G++ generates a great amount of warnings. I have just resolve two of them.

I left this patch out for now, I might commit it later. It probably
would be nice if we could get rid of all those warnings though.


-+ enlight +-


-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV

*** NOTE: To reply to the list use "reply to all",  ***
***       to reply direct to the sender use "reply" ***
_______________________________________________
Nebuladevice-discuss mailing list
Nebuladevice-discuss@...
https://lists.sourceforge.net/lists/listinfo/nebuladevice-discuss