Autotools patches

libolt

01-12-2007 21:20:52

CaseyB,

I have created some patches for the auto tools build system used by OgreAL on Linux and other Unix platforms.

The first issue I found when attempting to build OgreAL on Linux and FreeBSD is that it doesn't check that OIS is available via pkg-config. I added this to configure.ac.

The second issue is that none of the Demos link against OIS, which causes the build to fail.

The third issue is that the ManySource_Demo and PlayPen demo are not included in the build process.

The fourth issue is that each Demo's Listener.cpp is looking for OIS::numKeyboards when at least with the version of OIS included in Ubuntu 7.10 it is defined as OIS::numKeyBoards.

I have gone ahead and corrected all of these issues as well as added a Makefile.am to the ManySources_Demo and PlayPen directories so that they will build.

The following is the output of svn diff, which should include all of the above mentioned changes.


Index: configure.ac
===================================================================
--- configure.ac (revision 90)
+++ configure.ac (working copy)
@@ -24,6 +24,9 @@
dnl freealut requires openal
PKG_CHECK_MODULES(OPENAL, freealut)

+dnl The Demos require OIS
+PKG_CHECK_MODULES(OIS, OIS)
+
dnl You may want to export each var individually
AC_SUBST(OGREAL_CFLAGS,"$OGRE_CFLAGS $VORBIS_FLAGS $OPENAL_FLAGS")
AC_SUBST(OGREAL_LIBS, "$OGRE_LIBS $VORBIS_LIBS $OPENAL_LIBS")
@@ -41,7 +44,9 @@
Demos/Basic_Demo/Makefile \
Demos/Directional_Demo/Makefile \
Demos/Doppler_Demo/Makefile \
+ Demos/ManySources_Demo/Makefile \
Demos/MultiChannel_Demo/Makefile \
+ Demos/PlayPen/Makefile \
OgreAL.pc])

AC_OUTPUT
Index: Demos/Directional_Demo/Listener.cpp
===================================================================
--- Demos/Directional_Demo/Listener.cpp (revision 90)
+++ Demos/Directional_Demo/Listener.cpp (working copy)
@@ -40,7 +40,7 @@
mMouse = static_cast<OIS::Mouse*>(mInputManager->createInputObject(OIS::OISMouse, true));
mMouse->setEventCallback(this);
}
- if(mInputManager->numKeyboards() > 0)
+ if(mInputManager->numKeyBoards() > 0)
{
mKeyboard = static_cast<OIS::Keyboard*>(mInputManager->createInputObject(OIS::OISKeyboard, true));
mKeyboard->setEventCallback(this);
Index: Demos/Directional_Demo/Makefile.am
===================================================================
--- Demos/Directional_Demo/Makefile.am (revision 90)
+++ Demos/Directional_Demo/Makefile.am (working copy)
@@ -1,6 +1,6 @@
-INCLUDES= -I$(top_srcdir)/include $(OGREAL_CFLAGS)
+INCLUDES= -I$(top_srcdir)/include $(OGREAL_CFLAGS) $(OIS_CFLAGS)
demosdir= $(abs_top_builddir)/Demos/bin
demos_PROGRAMS= Directional
Directional_SOURCES= Listener.cpp Listener.h main.cpp OgreApp.cpp OgreApp.h
Directional_LDFLAGS= -L$(top_builddir)/src
-Directional_LDADD= -lOgreAL
+Directional_LDADD= -lOgreAL $(OIS_LIBS)
Index: Demos/Basic_Demo/Listener.cpp
===================================================================
--- Demos/Basic_Demo/Listener.cpp (revision 90)
+++ Demos/Basic_Demo/Listener.cpp (working copy)
@@ -38,7 +38,7 @@
mMouse = static_cast<OIS::Mouse*>(mInputManager->createInputObject(OIS::OISMouse, true));
mMouse->setEventCallback(this);
}
- if(mInputManager->numKeyboards() > 0)
+ if(mInputManager->numKeyBoards() > 0)
{
mKeyboard = static_cast<OIS::Keyboard*>(mInputManager->createInputObject(OIS::OISKeyboard, true));
mKeyboard->setEventCallback(this);
Index: Demos/Basic_Demo/Makefile.am
===================================================================
--- Demos/Basic_Demo/Makefile.am (revision 90)
+++ Demos/Basic_Demo/Makefile.am (working copy)
@@ -1,6 +1,6 @@
-INCLUDES= -I$(top_srcdir)/include $(OGREAL_CFLAGS)
+INCLUDES= -I$(top_srcdir)/include $(OGREAL_CFLAGS) $(OIS_CFLAGS)
demosdir= $(abs_top_builddir)/Demos/bin
demos_PROGRAMS= Basic
Basic_SOURCES= Listener.cpp Listener.h main.cpp OgreApp.cpp OgreApp.h
Basic_LDFLAGS= -L$(top_builddir)/src
-Basic_LDADD= -lOgreAL
+Basic_LDADD= -lOgreAL $(OIS_LIBS)
Index: Demos/MultiChannel_Demo/Listener.cpp
===================================================================
--- Demos/MultiChannel_Demo/Listener.cpp (revision 90)
+++ Demos/MultiChannel_Demo/Listener.cpp (working copy)
@@ -38,7 +38,7 @@
mMouse = static_cast<OIS::Mouse*>(mInputManager->createInputObject(OIS::OISMouse, true));
mMouse->setEventCallback(this);
}
- if(mInputManager->numKeyboards() > 0)
+ if(mInputManager->numKeyBoards() > 0)
{
mKeyboard = static_cast<OIS::Keyboard*>(mInputManager->createInputObject(OIS::OISKeyboard, true));
mKeyboard->setEventCallback(this);
Index: Demos/MultiChannel_Demo/Makefile.am
===================================================================
--- Demos/MultiChannel_Demo/Makefile.am (revision 90)
+++ Demos/MultiChannel_Demo/Makefile.am (working copy)
@@ -1,6 +1,6 @@
-INCLUDES= -I$(top_srcdir)/include $(OGREAL_CFLAGS)
+INCLUDES= -I$(top_srcdir)/include $(OGREAL_CFLAGS) $(OIS_CFLAGS)
demosdir= $(abs_top_builddir)/Demos/bin
demos_PROGRAMS= MultiChannel
MultiChannel_SOURCES= Listener.cpp Listener.h main.cpp OgreApp.cpp OgreApp.h
MultiChannel_LDFLAGS= -L$(top_builddir)/src
-MultiChannel_LDADD= -lOgreAL
+MultiChannel_LDADD= -lOgreAL $(OIS_LIBS)
Index: Demos/PlayPen/Listener.cpp
===================================================================
--- Demos/PlayPen/Listener.cpp (revision 90)
+++ Demos/PlayPen/Listener.cpp (working copy)
@@ -38,7 +38,7 @@
mMouse = static_cast<OIS::Mouse*>(mInputManager->createInputObject(OIS::OISMouse, true));
mMouse->setEventCallback(this);
}
- if(mInputManager->numKeyboards() > 0)
+ if(mInputManager->numKeyBoards() > 0)
{
mKeyboard = static_cast<OIS::Keyboard*>(mInputManager->createInputObject(OIS::OISKeyboard, true));
mKeyboard->setEventCallback(this);
Index: Demos/PlayPen/Makefile.am
===================================================================
--- Demos/PlayPen/Makefile.am (revision 0)
+++ Demos/PlayPen/Makefile.am (revision 0)
@@ -0,0 +1,6 @@
+INCLUDES= -I$(top_srcdir)/include $(OGREAL_CFLAGS) $(OIS_CFLAGS)
+demosdir= $(abs_top_builddir)/Demos/bin
+demos_PROGRAMS= PlayPen
+PlayPen_SOURCES= Listener.cpp Listener.h main.cpp OgreApp.cpp OgreApp.h
+PlayPen_LDFLAGS= -L$(top_builddir)/src
+PlayPen_LDADD= -lOgreAL $(OIS_LIBS)
Index: Demos/Doppler_Demo/Listener.cpp
===================================================================
--- Demos/Doppler_Demo/Listener.cpp (revision 90)
+++ Demos/Doppler_Demo/Listener.cpp (working copy)
@@ -123,7 +123,7 @@
mMouse = static_cast<OIS::Mouse*>(mInputManager->createInputObject(OIS::OISMouse, true));
mMouse->setEventCallback(this);
}
- if(mInputManager->numKeyboards() > 0)
+ if(mInputManager->numKeyBoards() > 0)
{
mKeyboard = static_cast<OIS::Keyboard*>(mInputManager->createInputObject(OIS::OISKeyboard, true));
mKeyboard->setEventCallback(this);
Index: Demos/Doppler_Demo/Makefile.am
===================================================================
--- Demos/Doppler_Demo/Makefile.am (revision 90)
+++ Demos/Doppler_Demo/Makefile.am (working copy)
@@ -1,6 +1,6 @@
-INCLUDES= -I$(top_srcdir)/include $(OGREAL_CFLAGS)
+INCLUDES= -I$(top_srcdir)/include $(OGREAL_CFLAGS) $(OIS_CFLAGS)
demosdir= $(abs_top_builddir)/Demos/bin
demos_PROGRAMS= Doppler
Doppler_SOURCES= Listener.cpp Listener.h main.cpp OgreApp.cpp OgreApp.h BetaGUI.h BetaGUI.cpp
Doppler_LDFLAGS= -L$(top_builddir)/src
-Doppler_LDADD= -lOgreAL
+Doppler_LDADD= -lOgreAL $(OIS_LIBS)
Index: Demos/Makefile.am
===================================================================
--- Demos/Makefile.am (revision 90)
+++ Demos/Makefile.am (working copy)
@@ -1,3 +1,3 @@
# EXTRA_DIST=Media
-SUBDIRS=bin Basic_Demo Directional_Demo Doppler_Demo MultiChannel_Demo
+SUBDIRS=bin Basic_Demo Directional_Demo Doppler_Demo ManySources_Demo MultiChannel_Demo PlayPen

Index: Demos/ManySources_Demo/Listener.cpp
===================================================================
--- Demos/ManySources_Demo/Listener.cpp (revision 90)
+++ Demos/ManySources_Demo/Listener.cpp (working copy)
@@ -38,7 +38,7 @@
mMouse = static_cast<OIS::Mouse*>(mInputManager->createInputObject(OIS::OISMouse, true));
mMouse->setEventCallback(this);
}
- if(mInputManager->numKeyboards() > 0)
+ if(mInputManager->numKeyBoards() > 0)
{
mKeyboard = static_cast<OIS::Keyboard*>(mInputManager->createInputObject(OIS::OISKeyboard, true));
mKeyboard->setEventCallback(this);
Index: Demos/ManySources_Demo/Makefile.am
===================================================================
--- Demos/ManySources_Demo/Makefile.am (revision 0)
+++ Demos/ManySources_Demo/Makefile.am (revision 0)
@@ -0,0 +1,6 @@
+INCLUDES= -I$(top_srcdir)/include $(OGREAL_CFLAGS) $(OIS_CFLAGS)
+demosdir= $(abs_top_builddir)/Demos/bin
+demos_PROGRAMS= ManySources
+ManySources_SOURCES= Listener.cpp Listener.h main.cpp OgreApp.cpp OgreApp.h
+ManySources_LDFLAGS= -L$(top_builddir)/src
+ManySources_LDADD= -lOgreAL $(OIS_LIBS)


I hope this helps. If you want I can send you the diff file.

[edit]
I forgot to mention that 'make install' also fails with the following:


make[2]: Nothing to be done for `install-data-am'.
make[2]: Leaving directory `/home/libolt/builds/ogreal/src'
make[1]: Leaving directory `/home/libolt/builds/ogreal/src'
Making install in Demos
make[1]: Entering directory `/home/libolt/builds/ogreal/Demos'
Making install in bin
make[2]: Entering directory `/home/libolt/builds/ogreal/Demos/bin'
make[3]: Entering directory `/home/libolt/builds/ogreal/Demos/bin'
make[3]: Nothing to be done for `install-exec-am'.
for i in plugins.cfg resources.cfg ; do \
sed -e "s,@OGRE_PLUGINDIR\@,/usr/local/lib/OGRE,g" -e "s,@OGREAL_MEDIADIR\@,../../Demos/Media,g" ./$i.in > $i.tmp && \
/usr/bin/install -c -m 644 $i.tmp $i && \
rm -f $i.tmp; \
done
sed: can't read ./plugins.cfg.in: No such file or directory
sed: can't read ./resources.cfg.in: No such file or directory
make[3]: *** [install-data-local] Error 2
make[3]: Leaving directory `/home/libolt/builds/ogreal/Demos/bin'
make[2]: *** [install-am] Error 2
make[2]: Leaving directory `/home/libolt/builds/ogreal/Demos/bin'
make[1]: *** [install-recursive] Error 1
make[1]: Leaving directory `/home/libolt/builds/ogreal/Demos'
make: *** [install-recursive] Error 1


It seems that plugins.cfg.in and resources.cfg.in are missing and causing plugins.cfg and resources.cfg to not being properly generated. I haven't gotten around to looking into what is required for this yet.
[/edit]

I still am unable to get OgreAL to actually run (none of the demos work either) on any of my Linux or FreeBSD systems. They all give me the same error I posted in my last thread.

Cheers,

Mike

ArtHure

01-12-2007 22:44:54

Alright. Then until now it's not easily possible to compile
and use OgreAL with success? Or is it just the problem with that cfg files.
And if these problems are solved OgreAL should work on linux systems?

libolt

01-12-2007 22:56:09

ArtHure,

I just posted a patch in your other thread related to the .cfg file issue. This should solve all build/install problems, hopefully. However whether or not the Demos/OgreAL apps run is another issue unfortunately. I haven't had any success getting anything to run as I posted in the thread I started a couple of days ago.

What I submitted here and in the other thread are patches to make OgreAL build on linux. I'm hoping CaseyB or someone more familiar with the code base can look into these issues at some point. I believe CaseyB is working at restructuring some of the code currently.

Mike

CaseyB

02-12-2007 01:34:12

Thank you for those patches. I develop on Windows but I have heard that it was running on Linux at one point. I may have broken the Linux compatibility though. I am doing some restructuring that should be done in the next couple of days and I'll look into the issue with the demos. I am pretty sure I know what the problem is and how to fix it, I just need to finish this first. Thanks for your patience. :)

libolt

02-12-2007 05:09:23

It's no problem, I totally understand. Just take your time. I'll definitely give it a shot once you get your changes made and do what I can to help. I'm planning to use OgreAL in my game, so I'll do what I can to help keep it running on the Linux/Unix platforms. :)

Cheers,

Mike

notserpe

05-03-2008 03:41:40

Building CEGUI from HEAD source as well as Ogre...
Came across numKeyBoard/numKeyboard case problem mentioned above.

This is building on Ubuntu 7.10 but has nothing to do with it. I'm using OIS from CVS.

numKeyBoard must be numKeyboard in Samples/common/src/CEGuiOgreBaseApplication.cpp

to get CEGUI HEAD to compile and install.

-E

CaseyB

05-03-2008 04:42:04

That's actually an issue in OIS CVS Head. I use the one I do in order to comply with the precompiled dependencies that are distributed with Ogre. I'd really like to use the latest version which is getNumDevices(DeviceType); :?