Browse Source

Very little changes to compile under linux and other unix-like OS. Added autoconf/automake scripts to easy compile on all unix-like OS(try autoconf; automake --add-missing;./configure)

Vadim Glazunov 17 years ago
parent
commit
8b53778417
17 changed files with 31 additions and 20 deletions
  1. 2 0
      CCallback.cpp
  2. 1 1
      CGameInfo.h
  3. 4 4
      CGameInterface.cpp
  4. 1 1
      CGameState.cpp
  5. 4 4
      CHeroWindow.cpp
  6. 2 0
      CLua.cpp
  7. 2 0
      CLua.h
  8. 3 1
      CLuaHandler.cpp
  9. 1 1
      CMT.cpp
  10. 1 1
      CMessage.cpp
  11. 1 1
      CMessage.h
  12. 1 1
      CPreGame.h
  13. 1 1
      SDL_Extensions.cpp
  14. 1 1
      hch/CAmbarCendamo.cpp
  15. 2 2
      hch/CVideoHandler.h
  16. 1 1
      nodrze.h
  17. 3 0
      tchar_amigaos4.h

+ 2 - 0
CCallback.cpp

@@ -14,7 +14,9 @@
 #include "CPlayerInterface.h"
 #include "hch/CBuildingHandler.h"
 
+extern "C" {
 LUALIB_API int (luaL_error) (lua_State *L, const char *fmt, ...);
+}
 
 int CCallback::lowestSpeed(CGHeroInstance * chi)
 {

+ 1 - 1
CGameInfo.h

@@ -3,7 +3,7 @@
 
 #include "StartInfo.h"
 #include "SDL.h"
-#include "CPregame.h"
+#include "CPreGame.h"
 
 #include <vector>
 

+ 4 - 4
CGameInterface.cpp

@@ -1,6 +1,6 @@
-	#include "stdafx.h"
+#include "stdafx.h"
 #include "CGameInterface.h"
-#include "CAdvMapInterface.h"
+#include "CAdvmapInterface.h"
 #include "CMessage.h"
 #include "mapHandler.h"
 #include "SDL_Extensions.h"
@@ -44,12 +44,12 @@ CGlobalAI * CAIHandler::getNewAI(CCallback * cb, std::string dllname)
 	; //TODO: handle AI library on Linux
 #endif
 	char * temp = new char[50];
-#ifndef __amigaos4__
+#if !defined(__amigaos4__) && !defined(__unix__)
 	getName(temp);
 #endif
 	std::cout << "Loaded .dll with AI named " << temp << std::endl;
 	delete temp;
-#ifndef __amigaos4__
+#if !defined(__amigaos4__) && !defined(__unix__)
 	ret = getAI();
 	ret->init(cb);
 #else

+ 1 - 1
CGameState.cpp

@@ -2,7 +2,7 @@
 #include "CGameInterface.h"
 #include "CPlayerInterface.h"
 #include <algorithm>
-#include "SDL_Thread.h"
+#include "SDL_thread.h"
 #include "SDL_Extensions.h"
 #include "CBattleInterface.h" //for CBattleHex
 #include <queue>

+ 4 - 4
CHeroWindow.cpp

@@ -1030,7 +1030,7 @@ void LClickableArea::clickLeft(boost::logic::tribool down)
 {
 	if(!down)
 	{
-		#ifndef __amigaos4__
+		#if !defined(__amigaos4__) && !defined(__unix__)
 		LOCPLINT->showInfoDialog("TEST TEST AAA", std::vector<SComponent*>());
 		#else
 		#warning error here!
@@ -1050,7 +1050,7 @@ void RClickableArea::clickRight(boost::logic::tribool down)
 {
 	if(!down)
 	{
-		#ifndef __amigaos4__
+		#if !defined(__amigaos4__) && !defined(__unix__)
 		LOCPLINT->showInfoDialog("TEST TEST AAA", std::vector<SComponent*>());
 		#else
 		#warning error here!
@@ -1062,7 +1062,7 @@ void LRClickableAreaWText::clickLeft(boost::logic::tribool down)
 {
 	if(!down)
 	{
-		#ifndef __amigaos4__
+		#if !defined(__amigaos4__) && !defined(__unix__)
 		LOCPLINT->showInfoDialog(text, std::vector<SComponent*>());
 		#else
 		#warning error here!
@@ -1110,7 +1110,7 @@ void LRClickableAreaWTextComp::clickLeft(boost::logic::tribool down)
 {
 	if((!down) && pressedL)
 	{
-#ifndef __amigaos4__
+#if !defined(__amigaos4__) && !defined(__unix__)
 		LOCPLINT->showInfoDialog(text, std::vector<SComponent*>(1, new SComponent(SComponent::Etype(baseType), type, bonus)));
 #else
 #warning error here!

+ 2 - 0
CLua.cpp

@@ -2,12 +2,14 @@
 #include "CLua.h"
 #include "CLuaHandler.h"
 #include "hch/CHeroHandler.h"
+extern "C" {
 #include "lua.h"
 #include "lualib.h"
 #include "lauxlib.h"
 #include "lobject.h"
 #include "lgc.h"
 #include "lapi.h"
+}
 #include "CGameInfo.h"
 #include "CGameState.h"
 #include <sstream>

+ 2 - 0
CLua.h

@@ -1,6 +1,8 @@
 #pragma once
 #include "global.h"
+extern "C" {
 #include "lstate.h"
+}
 #include <set>
 #include <map>
 class CLua;

+ 3 - 1
CLuaHandler.cpp

@@ -1,8 +1,10 @@
 #include "stdafx.h"
 
+extern "C" {
 #include "lua.h"
 #include "lualib.h"
-#include "lauxlib.h"
+#include "lauxlib.h" 
+}
 //#include <luabind/luabind.hpp>
 //#include <luabind/function.hpp>
 //#include <luabind/class.hpp>

+ 1 - 1
CMT.cpp

@@ -2,7 +2,7 @@
 //
 #include "stdafx.h"
 #include "SDL.h"
-#include "SDL_TTF.h"
+#include "SDL_ttf.h"
 #include "hch/CVideoHandler.h"
 #include "SDL_mixer.h"
 #include "hch/CBuildingHandler.h"

+ 1 - 1
CMessage.cpp

@@ -1,6 +1,6 @@
 #include "stdafx.h"
 #include "CMessage.h"
-#include "SDL_TTF.h"
+#include "SDL_ttf.h"
 #include "hch/CSemiDefHandler.h"
 #include "hch/CDefHandler.h"
 #include "CGameInfo.h"

+ 1 - 1
CMessage.h

@@ -2,7 +2,7 @@
 #define CMESSAGE_H
 
 #include "global.h"
-#include "SDL_TTF.h"
+#include "SDL_ttf.h"
 #include "SDL.h"
 #include "CPreGame.h"
 

+ 1 - 1
CPreGame.h

@@ -93,7 +93,7 @@ public:
 	IntSelBut( SDL_Rect Pos, T Fun,CDefHandler* Imgs, bool Sel=false, CPoinGroup<T>* gr=NULL, int My=-1)
 		: Button<T>(Pos,Fun,Imgs,Sel,gr),key(My){ourPoinGroup=gr;};
 	void select(bool on=true) {(*this).Button<T>::select(on);ourPoinGroup->setYour(this);
-		#ifndef __amigaos4__
+		#if !defined(__amigaos4__) && !defined(__unix__)
 		CPG->printRating();
 		#else
 		#warning not compile here

+ 1 - 1
SDL_Extensions.cpp

@@ -1,6 +1,6 @@
 #include "stdafx.h"
 #include "SDL_Extensions.h"
-#include "SDL_TTF.h"
+#include "SDL_ttf.h"
 #include "CGameInfo.h"
 #include <iostream>
 #include <utility>

+ 1 - 1
hch/CAmbarCendamo.cpp

@@ -7,7 +7,7 @@
 #include "CTownHandler.h"
 #include "CDefObjInfoHandler.h"
 #include "../SDL_Extensions.h"
-#include "boost\filesystem.hpp"
+#include "boost/filesystem.hpp"
 #include "../CGameState.h"
 #include "CLodHandler.h"
 #include <set>

+ 2 - 2
hch/CVideoHandler.h

@@ -114,7 +114,7 @@ struct SMKStruct
 class DLLHandler
 {
 public:
-#ifndef __amigaos4__
+#if !defined(__amigaos4__) && !defined(__unix__)
 	HINSTANCE dll;
 #else
 	void *dll;
@@ -131,7 +131,7 @@ class CBIKHandler
 public:
 	DLLHandler ourLib;
 	int newmode;
-#ifndef __amigaos4__
+#if !defined(__amigaos4__) && !defined(__unix__)
 	HANDLE hBinkFile;
 #else
 	void *hBinkFile;

+ 1 - 1
nodrze.h

@@ -189,7 +189,7 @@ template <typename T> void nodrze<T>::wypiszObficie(std::ostream & strum)
 template <typename T, class X> T* operator%(nodrze<T> & drzewko, X co)
 {
 	CLOG ("Szukam " <<co <<std::endl);
-#ifndef __amigaos4__
+#if !defined(__amigaos4__) && !defined(__unix__)
 	drzewko.wypiszObficie(*C->gl->loguj);
 #endif
 	wezel<T> * w = drzewko.korzen;

+ 3 - 0
tchar_amigaos4.h

@@ -42,6 +42,9 @@
  * NOTE: This tests _UNICODE, which is different from the UNICODE define
  *       used to differentiate Win32 API calls.
  */
+#ifdef __unix__
+#define _TCHAR char*
+#endif
 #ifdef	_UNICODE