This wiki is archived and useful information is being migrated to the main website

Compiling/Solaris Notes

From BZFlagWiki
Revision as of 01:44, 1 December 2016 by Zehra (Talk | contribs) (added category)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Solaris 10 (Oct, 2009)[edit]

These notes are based on attempts to get bzflag-2.0.12 to compile and run on Solaris 10

Sparc packages[edit]

Sparc packages (in /opt) from Sunfreeware are required to build.

It is not necessary to install in /opt. If desired a user may skip all the "opt" stuff or substitute the correct location instead. Most of these packages will install in /usr/local. /usr/local may not be available to all users.


  • curl-7.19.6-sol10-sparc-local.gz
  • libidn-1.14-sol10-sparc-local.gz
  • libssh2-1.2-sol10-sparc-local.gz
  • openssl-0.9.8k-sol10-sparc-local.gz
  • libintl-3.4.0-sol10-sparc-local.gz
  • libiconv-1.11-sol10-sparc-local.gz

If an error is generated that indicates that a libary has been moved, it may be required to go into the library's .la file and update the location manualy.

Other errors that may require an update to the *.la files may look like:

libtool: link: cannot find the library `/usr/local/lib/' or unhandled argument `/usr/local/lib/'

If this is the case then the following lines in SMCliconv/lib/, etc, will need to be updated:

dependency_libs=' -R/usr/local/lib -R/usr/lib -R/usr/openwin/lib  -R/opt/SMCossl/ssl/lib  -R/usr/local/BerkeleyDB.4.7/lib -R/usr/local/BerkeleyDB.4.2/lib -R/usr/X11R6/lib 
-L/usr/local/lib -L/usr/lib -L/usr/openwin/lib  -L/opt/SMCossl/ssl/lib  -L/usr/local/BerkeleyDB.4.2/lib </b> /opt/SMClibidn/lib/ </b> -L/usr/local/pgsql/lib 
-L/usr/X11R6/lib /opt/SMClintl/lib/ -lsec -lc /opt/SMClssh2/lib/  /opt/SMCliconv/lib/  -lssl -lcrypto -lsocket -lnsl -lz'

These commands can be used to fix the missing links

ln -s /usr/sfw/bin/gmake /usr/sfw/bin/make

ln -s /usr/xpg4/bin/ar /usr/bin/ar

Modifying environment variables[edit]

export CPPFLAGS="-I/opt/SMClintl/include -I/opt/SMCossl/ssl/include -I/opt/SMCcurl/include -I/opt/SMClssh2/include"
export CPPFLAGS="$CPPFLAGS -I/opt/SMClibidn/include -L/opt/SMClintl/lib -L/opt/SMCossl/ssl/lib -L/opt/SMCcurl/lib "
export CPPFLAGS="$CPPFLAGS -L/opt/SMClssh2/lib -L/opt/SMClibidn/lib -L/opt/c-ares/lib -L/pt/SMCossl/ssl/lib -I/usr/openwin/include/GL"

export LDFLAGS="-L/usr/lib -L/opt/SMClintl/lib -L/opt/SMClibidn/lib -L/opt/SMClssh2/lib"

export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:/opt/SMCcurl/lib:/opt/SMClibidn/lib:/opt/SMClintl/lib:/opt/SMClssh2/lib:/opt/SMCliconv/lib:/opt/SMCossl/lib:/opt/SMCossl/ssl/lib"

Runing configure[edit]

./configure --with-libcurl=/opt/SMCcurl --prefix=/opt/bzflag --build=sun4

Editing sources[edit]

In include/SceneNode.h, change "glColor" to myColor":
(Solves the "Expected ')' before '->' token" error)

#define myColor3f(r, g, b)      SceneNode::myColor3f(r, g, b)
#define myColor4f(r, g, b, a)   SceneNode::myColor4f(r, g, b, a)
#define myColor3fv(rgb)         SceneNode::myColor3fv(rgb)
#define myColor4fv(rgba)        SceneNode::myColor4fv(rgba)

 static void         myColor3f(GLfloat r, GLfloat g, GLfloat b)
  #ifdef __MINGW32__
        {if (!colorOverride) ::myColor3f(r, g, b); };
        { (*color3f)(r, g, b); }

      static void         myColor4f(GLfloat r, GLfloat g, GLfloat b, GLfloat a)
  #ifdef __MINGW32__
        {if (!colorOverride) ::myColor4f(r, g, b, a); };
        { (*color4f)(r, g, b, a); }

      static void         myColor3fv(const GLfloat* rgb)
  #ifdef __MINGW32__
        {if (!colorOverride) ::myColor3fv(rgb); };
        { (*color3fv)(rgb); }

      static void         myColor4fv(const GLfloat* rgba)
  #ifdef __MINGW32__
        {if (!colorOverride) ::myColor4fv(rgba); };

Fixing Makefiles[edit]

Add -lresolv to LIBS in src/bzfs/Makefile, src/bzflag/Makefile, src/bzadmin/Makefile
(Solves the inet_aton unresolved symbol error)

LIBS = -lsocket -lm -lresolv

In src/platform edit the Makefile and uncomment the Solaris stuff:

am_libPlatform_la_OBJECTS = PlatformFactory.lo \
        BzfDisplay.lo \
        BzfJoystick.lo \
        BzfVisual.lo \
        BzfWindow.lo \
        BzfMedia.lo \
        wave.lo \
        SolarisPlatformFactory.lo \
        SolarisMedia.lo \
        XDisplay.lo \
        XVisual.lo \

It is important to ensure that the platform.a file is built correctly.

Make and test[edit]

make; src/bzflag/bzflag