Skip to content

Commit

Permalink
Updated autoconf build to support new headers, and fixed python impor…
Browse files Browse the repository at this point in the history
…ts and tests
  • Loading branch information
cdfrey committed Jul 28, 2012
1 parent 4e5dc77 commit 3aa69cc
Show file tree
Hide file tree
Showing 35 changed files with 149 additions and 123 deletions.
8 changes: 7 additions & 1 deletion Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,16 @@ EXTRA_DIST = adonthell.pc.in adonthell.pc.cmake autogen.sh README.Win32 \
config/UsePkgConfig.cmake config/PythonExtraLibs.cmake config.h.cmake \
scripts/make-bundle.sh README.MacOSX

SUBDIRS = src doc test
SUBDIRS = . src doc test

pkgconfigdir = $(libdir)/pkgconfig
pkgconfig_DATA = adonthell.pc

$(pkgconfig_DATA): config.status

all-local:
ln -fs $(top_srcdir)/src $(top_builddir)/adonthell

clean-local:
rm -f $(top_builddir)/adonthell

2 changes: 1 addition & 1 deletion adonthell.pc.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@ Name: Adonthell
Description: Role Playing Game Engine
Version: @VERSION@
Libs: -L${libdir} -ladonthell_py_runtime -ladonthell_base -ladonthell_python -ladonthell_gfx -ladonthell_input -ladonthell_event -ladonthell_rpg -ladonthell_world
Cflags: -I${includedir}/adonthell
Cflags: -I${includedir}/adonthell-@VERSION@

2 changes: 1 addition & 1 deletion adonthell.pc.in
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@ Name: Adonthell
Description: Role Playing Game Engine
Version: @VERSION@
Libs: -L${libdir} -ladonthell_py_runtime -ladonthell_base -ladonthell_python -ladonthell_gfx -ladonthell_input -ladonthell_event -ladonthell_rpg -ladonthell_world
Cflags: -I${includedir}/adonthell
Cflags: -I${includedir}/adonthell-@VERSION@

10 changes: 6 additions & 4 deletions src/audio/Makefile.am
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
AM_CXXFLAGS = -I$(top_srcdir)/src
DEFAULT_INCLUDES = -I$(srcdir) -I$(top_builddir)
AM_CXXFLAGS = -I$(top_builddir)
DEFAULT_INCLUDES = -I$(top_builddir)
EXTRA_DIST = CMakeLists.txt

adonthellincludedir = $(pkgincludedir)-@VERSION@/adonthell

## Our header files
pkgincludeaudiodir = $(pkgincludedir)/audio
pkgincludeaudiodir = $(adonthellincludedir)/audio
pkgincludeaudio_HEADERS = \
audio.h \
audio_event.h \
Expand Down Expand Up @@ -36,7 +38,7 @@ pkglibaudio_LTLIBRARIES = _sdl.la

### SDL backend
## Our header files
pkgincludeaudiosdldir = $(pkgincludedir)/audio/sdl
pkgincludeaudiosdldir = $(adonthellincludedir)/audio/sdl

## Rules to build libaudio_sdl
_sdl_la_SOURCES = \
Expand Down
6 changes: 3 additions & 3 deletions src/audio/sdl/audio_sdl.cc
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,9 @@
#include "SDL.h"
#include "SDL_mixer.h"

#include "audio/sound.h"
#include "audio/audio.h"
#include "base/logging.h"
#include <adonthell/audio/sound.h>
#include <adonthell/audio/audio.h>
#include <adonthell/base/logging.h>

//TODO These values should be gotten from a config file or something
int audio_rate = 44100;
Expand Down
6 changes: 4 additions & 2 deletions src/base/Makefile.am
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
backenddir = @backenddir@
AM_CXXFLAGS = -I$(top_srcdir)/src
AM_CXXFLAGS = -I$(top_builddir)
EXTRA_DIST = CMakeLists.txt

adonthellincludedir = $(pkgincludedir)-@VERSION@/adonthell

## Our header files
pkgincludebasedir = $(pkgincludedir)/base
pkgincludebasedir = $(adonthellincludedir)/base
pkgincludebase_HEADERS = \
base.h \
callback.h \
Expand Down
8 changes: 5 additions & 3 deletions src/event/Makefile.am
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
AM_CXXFLAGS = -I$(top_srcdir)/src
DEFAULT_INCLUDES = -I$(srcdir) -I$(top_builddir)
AM_CXXFLAGS = -I$(top_builddir)
DEFAULT_INCLUDES = -I$(top_builddir)
EXTRA_DIST = CMakeLists.txt

adonthellincludedir = $(pkgincludedir)-@VERSION@/adonthell

## Our header files
pkgincludeeventdir = $(pkgincludedir)/event
pkgincludeeventdir = $(adonthellincludedir)/event
pkgincludeevent_HEADERS = \
date.h \
event.h \
Expand Down
8 changes: 5 additions & 3 deletions src/gfx/Makefile.am
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
AM_CXXFLAGS = -I$(top_srcdir)/src
DEFAULT_INCLUDES = -I$(srcdir) -I$(top_builddir)
AM_CXXFLAGS = -I$(top_builddir)
DEFAULT_INCLUDES = -I$(top_builddir)
EXTRA_DIST = CMakeLists.txt sdlgl/screen_sdlgl.h sdlgl/surface_sdlgl.h sdlgl/gfx_sdlgl.cc \
sdlgl/screen_sdlgl.cc sdlgl/surface_sdlgl.cc sdl/screen_sdl.h sdl/surface_sdl.h \
sdl/gfx_sdl.cc sdl/screen_sdl.cc sdl/surface_sdl.cc sdl2/screen_sdl.h sdl2/surface_sdl.h \
sdl2/gfx_sdl.cc sdl2/screen_sdl.cc sdl2/surface_sdl.cc


adonthellincludedir = $(pkgincludedir)-@VERSION@/adonthell

## Our header files
pkgincludegfxdir = $(pkgincludedir)/gfx
pkgincludegfxdir = $(adonthellincludedir)/gfx
pkgincludegfx_HEADERS = \
drawable.h \
drawing_area.h \
Expand Down
10 changes: 6 additions & 4 deletions src/gui/Makefile.am
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
AM_CXXFLAGS = -I$(top_srcdir)/src
DEFAULT_INCLUDES = -I$(srcdir) -I$(top_builddir) $(FT2_CFLAGS)
AM_CXXFLAGS = -I$(top_builddir)
DEFAULT_INCLUDES = -I$(top_builddir) $(FT2_CFLAGS)
EXTRA_DIST = CMakeLists.txt

pkgincludeinputdir = $(pkgincludedir)/gui
pkgincludeinput_HEADERS = \
adonthellincludedir = $(pkgincludedir)-@VERSION@/adonthell

pkgincludeguidir = $(adonthellincludedir)/gui
pkgincludegui_HEADERS = \
button.h \
canvas.h \
conversation.h \
Expand Down
10 changes: 6 additions & 4 deletions src/input/Makefile.am
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
AM_CXXFLAGS = -I$(top_srcdir)/src
DEFAULT_INCLUDES = -I$(srcdir) -I$(top_builddir)
AM_CXXFLAGS = -I$(top_builddir)
DEFAULT_INCLUDES = -I$(top_builddir)
EXTRA_DIST = CMakeLists.txt sdl/manager_sdl.h sdl/input_sdl.cc \
sdl/manager_sdl.cc sdl2/manager_sdl.h sdl2/input_sdl.cc \
sdl2/manager_sdl.cc


adonthellincludedir = $(pkgincludedir)-@VERSION@/adonthell

## Our header files
pkgincludeinputdir = $(pkgincludedir)/input
pkgincludeinputdir = $(adonthellincludedir)/input
pkgincludeinput_HEADERS = \
input.h \
control_event.h \
Expand Down Expand Up @@ -41,7 +43,7 @@ pkglibinput_LTLIBRARIES = _sdl.la

### SDL backend
## Our header files
pkgincludeinputsdldir = $(pkgincludedir)/input/sdl
pkgincludeinputsdldir = $(adonthellincludedir)/input/sdl
pkgincludeinputsdl_HEADERS = \
$(sdlbackenddir)/manager_sdl.h

Expand Down
6 changes: 4 additions & 2 deletions src/main/Makefile.am
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
AM_CXXFLAGS = -I$(top_srcdir)/src
AM_CXXFLAGS = -I$(top_builddir)
EXTRA_DIST = CMakeLists.txt sdl/linux.cc sdl/winnt.cc sdl/osx.h sdl/osx.m

adonthellincludedir = $(pkgincludedir)-@VERSION@/adonthell

## Our header files
pkgincludemaindir = $(pkgincludedir)/main/
pkgincludemaindir = $(adonthellincludedir)/main/
pkgincludemain_HEADERS = \
adonthell.h

Expand Down
2 changes: 1 addition & 1 deletion src/py-runtime/Makefile.am
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
AM_CXXFLAGS = -I$(top_srcdir)/src
AM_CXXFLAGS = -I$(top_builddir)
EXTRA_DIST = py_runtime.i CMakeLists.txt
CLEANFILES = $(top_srcdir)/src/py-runtime/py_runtime.cc

Expand Down
4 changes: 2 additions & 2 deletions src/py-wrappers/adonthell/Makefile.am
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
AM_CXXFLAGS = -I$(top_srcdir)/src
AM_CXXFLAGS = -I$(top_builddir)
EXTRA_DIST = py_debug.i py_base.i py_event.i py_gfx.i py_gui.i py_input.i py_audio.i py_main.i py_rpg.i py_world.i CMakeLists.txt
CLEANFILES = $(top_srcdir)/src/py-wrappers/adonthell/py_debug_wrap.cc \
$(top_srcdir)/src/py-wrappers/adonthell/py_base_wrap.cc \
Expand Down Expand Up @@ -123,7 +123,7 @@ _debug_la_LIBADD = $(PY_LIBADD) \
$(PY_RUNTIME)

## Swig arguments
SWIG_ARGS = -python -modern -noexcept -I$(top_srcdir)/src
SWIG_ARGS = -python -modern -noexcept -I$(top_builddir)

## Rules for Python wrappers generation
base.py: py_base_wrap.cc
Expand Down
2 changes: 1 addition & 1 deletion src/py-wrappers/adonthell/py_audio.i
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ extern "C" {
%include "std_string.i"

%import "py_event.i" // since audio_event inherits from event
%import "base/types.h"
%import <adonthell/base/types.h>

%include <adonthell/audio/audio.h>
%include <adonthell/audio/sound.h>
Expand Down
2 changes: 1 addition & 1 deletion src/py-wrappers/adonthell/py_event.i
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ namespace events {
}
}

%import "base/types.h"
%import <adonthell/base/types.h>
%include <adonthell/event/date.h>
%include <adonthell/event/event.h>
%include <adonthell/event/time_event.h>
Expand Down
2 changes: 1 addition & 1 deletion src/py-wrappers/adonthell/py_gfx.i
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ extern "C" {
%include "stdint.i"
%include "std_string.i"

%import "base/types.h"
%import <adonthell/base/types.h>
%include <adonthell/gfx/gfx.h>
%include <adonthell/gfx/drawing_area.h>
%include <adonthell/gfx/drawable.h>
Expand Down
6 changes: 3 additions & 3 deletions src/py-wrappers/adonthell/py_gui.i
Original file line number Diff line number Diff line change
Expand Up @@ -94,9 +94,9 @@ namespace gui {
}
}

%import "base/types.h"
%import(module="gfx") "gfx/drawable.h"
%import(module="event") "event/event.h"
%import <adonthell/base/types.h>
%import(module="gfx") <adonthell/gfx/drawable.h>
%import(module="event") <adonthell/event/event.h>

%include <adonthell/gui/widget.h>
%include <adonthell/gui/font.h>
Expand Down
2 changes: 1 addition & 1 deletion src/py-wrappers/adonthell/py_input.i
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ extern "C" {
%include "stdint.i"
%include "std_string.i"

%import "base/types.h"
%import <adonthell/base/types.h>
%include <adonthell/input/input.h>
%include <adonthell/input/event.h>
%include <adonthell/input/keyboard_event.h>
Expand Down
4 changes: 2 additions & 2 deletions src/py-wrappers/adonthell/py_rpg.i
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,8 @@ namespace rpg {

%typemap(freearg) const std::vector<std::string> & "delete $1;"

%import "base/types.h"
%import(module="event") "event/event.h"
%import <adonthell/base/types.h>
%import(module="event") <adonthell/event/event.h>
%include <adonthell/python/script.h>
%include <adonthell/rpg/item.h>
%include <adonthell/rpg/slot.h>
Expand Down
6 changes: 3 additions & 3 deletions src/py-wrappers/adonthell/py_world.i
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@ extern "C" {
%include "stdint.i"
%include "std_string.i"

%import "base/types.h"
%import(module="event") "event/event.h"
%import(module="gfx") "gfx/drawable.h"
%import <adonthell/base/types.h>
%import(module="event") <adonthell/event/event.h>
%import(module="gfx") <adonthell/gfx/drawable.h>

// typemap for returning a string pointer as python string
%typemap(out) std::string * {
Expand Down
6 changes: 4 additions & 2 deletions src/python/Makefile.am
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
AM_CXXFLAGS = -I$(top_srcdir)/src
AM_CXXFLAGS = -I$(top_builddir)
DEFAULT_INCLUDES = -I$(top_builddir)
EXTRA_DIST = CMakeLists.txt

adonthellincludedir = $(pkgincludedir)-@VERSION@/adonthell

## Our header files
pkgincludepythondir = $(pkgincludedir)/python
pkgincludepythondir = $(adonthellincludedir)/python
pkgincludepython_HEADERS = \
callback_support.h \
callback.h \
Expand Down
6 changes: 4 additions & 2 deletions src/rpg/Makefile.am
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
AM_CXXFLAGS = -I$(top_srcdir)/src
AM_CXXFLAGS = -I$(top_builddir)
EXTRA_DIST = CMakeLists.txt

adonthellincludedir = $(pkgincludedir)-@VERSION@/adonthell

## Our header files
pkgincluderpgdir = $(pkgincludedir)/rpg
pkgincluderpgdir = $(adonthellincludedir)/rpg
pkgincluderpg_HEADERS = \
character.h \
dialog.h \
Expand Down
6 changes: 4 additions & 2 deletions src/world/Makefile.am
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
AM_CXXFLAGS = -I$(top_srcdir)/src
AM_CXXFLAGS = -I$(top_builddir)
EXTRA_DIST = CMakeLists.txt

adonthellincludedir = $(pkgincludedir)-@VERSION@/adonthell

## Our header files
pkgincludeworlddir = $(pkgincludedir)/world
pkgincludeworlddir = $(adonthellincludedir)/world
pkgincludeworld_HEADERS = \
action.h \
area.h \
Expand Down
4 changes: 2 additions & 2 deletions test/Makefile.am
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
AM_CXXFLAGS = -I$(top_srcdir)/src
AM_CXXFLAGS = -I$(top_builddir)

SUBDIRS = data

Expand All @@ -22,7 +22,7 @@ callbacktest_LDADD = -L$(top_builddir)/src/base/ -ladonthell_base
diskiotest_SOURCES = diskiotest.cc
diskiotest_LDADD = -L$(top_builddir)/src/base/ -ladonthell_base

guitest_CXXFLAGS = $(FT2_CFLAGS) -I$(top_srcdir)/src $(PY_CFLAGS)
guitest_CXXFLAGS = $(FT2_CFLAGS) -I$(top_builddir) $(PY_CFLAGS)
guitest_SOURCES = guitest.cc
guitest_LDADD = \
-L$(top_builddir)/src/python/ -ladonthell_python $(PY_LIBS)\
Expand Down
8 changes: 4 additions & 4 deletions test/audiotest.cc
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#include "audio/audio.h"
#include "audio/audio_manager.h"
#include "base/configuration.h"
#include "base/logging.h"
#include <adonthell/audio/audio.h>
#include <adonthell/audio/audio_manager.h>
#include <adonthell/base/configuration.h>
#include <adonthell/base/logging.h>

#include <iostream>

Expand Down
4 changes: 2 additions & 2 deletions test/callbacktest.cc
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#include <iostream>
#include "base/base.h"
#include "base/serializer.h"
#include <adonthell/base/base.h>
#include <adonthell/base/serializer.h>


class calltest
Expand Down
14 changes: 7 additions & 7 deletions test/dialogtest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@ using std::cout;
using std::endl;
using std::cin;
#include <sstream>
#include "base/base.h"
#include "gfx/gfx.h"
#include "input/input.h"
#include "gui/gui.h"
#include "main/adonthell.h"
#include "gui/draw.h"
#include "rpg/dialog.h"
#include <adonthell/base/base.h>
#include <adonthell/gfx/gfx.h>
#include <adonthell/input/input.h>
#include <adonthell/gui/gui.h>
#include <adonthell/main/adonthell.h>
#include <adonthell/gui/draw.h>
#include <adonthell/rpg/dialog.h>

class InputHandler {
private:
Expand Down
2 changes: 1 addition & 1 deletion test/diskiotest.cc
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#include "base/diskio.h"
#include <adonthell/base/diskio.h>
#include <iostream>

using std::cout;
Expand Down
4 changes: 2 additions & 2 deletions test/gfxtest.cc
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#include <iostream>
#include "gfx/gfx.h"
#include "base/timer.h"
#include <adonthell/gfx/gfx.h>
#include <adonthell/base/timer.h>

//#include "main/adonthell.h"

Expand Down
12 changes: 6 additions & 6 deletions test/guitest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@

using std::string;

#include "base/base.h"
#include "event/factory.h"
#include "gfx/gfx.h"
#include "input/input.h"
#include "gui/gui.h"
#include "main/adonthell.h"
#include <adonthell/base/base.h>
#include <adonthell/event/factory.h>
#include <adonthell/gfx/gfx.h>
#include <adonthell/input/input.h>
#include <adonthell/gui/gui.h>
#include <adonthell/main/adonthell.h>

class InputHandler {
private:
Expand Down
Loading

0 comments on commit 3aa69cc

Please sign in to comment.