Updated VCMI

This commit is contained in:
pelya
2011-09-22 20:03:38 +03:00
parent 2889066f60
commit 63af8c0944
36 changed files with 381 additions and 1719 deletions

View File

@@ -24,7 +24,7 @@ if uname -s | grep -i "windows" > /dev/null ; then
MYARCH=windows-x86
fi
cd project && env PATH=$NDKBUILDPATH nice -n19 ndk-build -j4 V=1 && \
cd project && env PATH=$NDKBUILDPATH nice -n19 ndk-build V=1 -j4 && \
{ grep "CustomBuildScript=y" ../AndroidAppSettings.cfg > /dev/null && \
[ -`which ndk-build | grep '/android-ndk-r[56789]'` != - ] && \
echo Stripping libapplication.so by hand \

View File

@@ -1,6 +1,6 @@
# The application settings for Android libSDL port
AppSettingVersion=17
LibSdlVersion=1.3
LibSdlVersion=1.2
AppName="Ballfield"
AppFullName=net.olofson.ballfield
ScreenOrientation=h

View File

@@ -38,7 +38,7 @@ done
)
if [ -n "$CRYSTAX_WCHAR" ]; then
CRYSTAX_WCHAR_INCLUDE=-I$NDK/sources/crystax/include
CRYSTAX_WCHAR_INCLUDE=-isystem$NDK/sources/crystax/include
CRYSTAX_WCHAR_LIB="$NDK/sources/crystax/libs/armeabi/libcrystax_static.a"
fi
@@ -46,13 +46,13 @@ CFLAGS="\
-fexceptions -frtti \
-fpic -ffunction-sections -funwind-tables -D__ARM_ARCH_5__ -D__ARM_ARCH_5T__ -D__ARM_ARCH_5E__ -D__ARM_ARCH_5TE__ -Wno-psabi \
-march=armv5te -mtune=xscale -msoft-float -mthumb -Os -fomit-frame-pointer -fno-strict-aliasing -finline-limit=64 \
-I$NDK/platforms/$PLATFORMVER/arch-arm/usr/include -Wa,--noexecstack \
-isystem$NDK/platforms/$PLATFORMVER/arch-arm/usr/include -Wa,--noexecstack \
-DANDROID \
-DNDEBUG -O2 -g \
-I$NDK/sources/cxx-stl/gnu-libstdc++/include \
-I$NDK/sources/cxx-stl/gnu-libstdc++/libs/armeabi/include \
-I$LOCAL_PATH/../sdl-1.2/include \
`echo $APP_MODULES | sed \"s@\([-a-zA-Z0-9_.]\+\)@-I$LOCAL_PATH/../\1/include@g\"` \
-isystem$NDK/sources/cxx-stl/gnu-libstdc++/include \
-isystem$NDK/sources/cxx-stl/gnu-libstdc++/libs/armeabi/include \
-isystem$LOCAL_PATH/../sdl-1.2/include \
`echo $APP_MODULES | sed \"s@\([-a-zA-Z0-9_.]\+\)@-isystem$LOCAL_PATH/../\1/include@g\"` \
$CRYSTAX_WCHAR_INCLUDE"
SHARED="-shared -Wl,-soname,libapplication.so"
@@ -81,6 +81,8 @@ $NDK/platforms/$PLATFORMVER/arch-arm/usr/lib/libstdc++.a \
-Wl,-rpath-link=$NDK/platforms/$PLATFORMVER/arch-arm/usr/lib -lsupc++ \
$CRYSTAX_WCHAR_LIB"
#echo env CFLAGS=\""$CFLAGS"\" LDFLAGS=\""$LDFLAGS"\" "$@"
env PATH=$NDK/toolchains/$GCCPREFIX-$GCCVER/prebuilt/$MYARCH/bin:$LOCAL_PATH:$PATH \
CFLAGS="$CFLAGS" \
CXXFLAGS="$CFLAGS" \

View File

@@ -1 +1 @@
ballfield
vcmi

View File

@@ -6,12 +6,17 @@ AppFullName=com.teeworlds
ScreenOrientation=h
InhibitSuspend=n
AppDataDownloadUrl="Game data is 8 Mb|http://sourceforge.net/projects/libsdl-android/files/TeeWorlds/teeworlds.zip/download"
VideoDepthBpp=16
NeedDepthBuffer=n
NeedStencilBuffer=n
NeedGles2=n
SwVideoMode=n
SdlVideoResize=n
SdlVideoResizeKeepAspect=n
NeedDepthBuffer=n
SwVideoMode=n
CompatibilityHacks=n
AppUsesMouse=y
AppNeedsTwoButtonMouse=y
ForceRelativeMouseMode=y
AppNeedsArrowKeys=y
AppNeedsTextInput=y
AppUsesJoystick=y
@@ -22,6 +27,9 @@ RedefinedKeys="SPACE RETURN LEFT RIGHT LSHIFT ESCAPE RSHIFT LSHIFT"
AppTouchscreenKeyboardKeysAmount=6
AppTouchscreenKeyboardKeysAmountAutoFire=0
RedefinedKeysScreenKb="SPACE RETURN LEFT RIGHT RSHIFT LSHIFT"
StartupMenuButtonTimeout=3000
HiddenMenuOptions=''
FirstStartMenuOptions=''
MultiABI=y
AppVersionCode=5207
AppVersionName="0.5.2.07"

View File

@@ -0,0 +1,8 @@
libvcmi.so
AI
Scripting
debug
out
vcmiserver
vcmiserver.zip
build.log

View File

@@ -31,12 +31,12 @@ StartupMenuButtonTimeout=3000
HiddenMenuOptions='KeyboardConfigMainMenu AudioConfig OptionalDownloadConfig'
FirstStartMenuOptions=''
MultiABI=n
AppVersionCode=08503
AppVersionName="0.85.03"
CompiledLibraries="sdl_mixer sdl_image sdl_ttf avutil avcore avcodec avformat swscale boost_program_options boost_filesystem boost_iostreams boost_system boost_thread vcmi android"
AppVersionCode=08604
AppVersionName="0.86.04"
CompiledLibraries="mad sdl_mixer sdl_image sdl_ttf avutil avcore avcodec avformat swscale boost_program_options boost_filesystem boost_iostreams boost_system boost_thread vcmi android"
CustomBuildScript=n
AppCflags='-DDATA_DIR=\\"/sdcard/app-data/eu.vcmi\\" -DBIN_DIR=\\"/data/data/eu.vcmi/files\\" -DLIB_DIR=\\"/data/data/eu.vcmi/files\\" -DWITH_AVCODEC_DECODE_VIDEO2=1 -Wstrict-aliasing -Wcast-align -Wpointer-arith -Waddress'
AppLdflags='-lz -Ljni/application/vcmi -lvcmi'
AppSubdirsBuild='vcmi/client vcmi/CGameInterface.cpp vcmi/CCallback.cpp'
AppSubdirsBuild='vcmi/client vcmi/CCallback.cpp'
AppCmdline=''
ReadmeText='^You may press "Home" now - the data will be downloaded in background'

View File

@@ -2,6 +2,7 @@
$(shell mkdir -p AI debug/AI Scripting debug/Scripting \
out/vcmi/lib out/vcmi/server out/vcmi/AI/StupidAI \
out/vcmi/AI/GeniusAI out/vcmi/client out/vcmi/Scripting/ERM)
$(shell rm -f ../../../obj/local/armeabi/libvcmi.so)
LOCAL_PATH=$(shell dirname $0)
LOCAL_PATH=`cd $LOCAL_PATH && pwd`

View File

@@ -2,9 +2,9 @@ Quick compilation guide:
Download my GIT repo from https://github.com/pelya/commandergenius,
then install Android SDK 3.1 from http://developer.android.com,
NDK r5 from http://crystax.net/ and "ant" tool, then launch commands
android update project -p project
rm project/jni/application/src
ln -s vcmi project/jni/application/src
android update project -p project
echo > project/jni/application/vcmi/libvcmi.so
then download VCMI into the dir project/jni/application/vcmi/vcmi
(or create a symlink to it if you already have downloaded it), then apply patch vcmi-android.diff,

View File

@@ -1,23 +1,8 @@
Index: lib/Connection.h
===================================================================
--- lib/Connection.h (revision 2220)
+++ lib/Connection.h (working copy)
@@ -82,7 +82,9 @@
{
bool operator()(const std::type_info *a, const std::type_info *b) const
{
- return a->before(*b);
+ // Comparing pointers is bad bad practice, because type_info pointers to the same types
+ // are different inside shared library and the executable that links to that library
+ return strcmp(a->name(), b->name()) > 0;
}
};
Index: lib/CLodHandler.cpp
===================================================================
--- lib/CLodHandler.cpp (revision 2220)
--- lib/CLodHandler.cpp (revision 2387)
+++ lib/CLodHandler.cpp (working copy)
@@ -78,13 +78,15 @@
@@ -87,13 +87,15 @@
Entry ourEntry = *en_it;
if(length) *length = ourEntry.realSize;
@@ -34,7 +19,7 @@ Index: lib/CLodHandler.cpp
FILE * f = fopen((myDir + "/" + ourEntry.realName).c_str(), "rb");
if (f)
{
@@ -100,16 +102,21 @@
@@ -109,16 +111,21 @@
delete[] outp;
return NULL;
}
@@ -58,7 +43,7 @@ Index: lib/CLodHandler.cpp
return outp;
}
else //we will decompress file
@@ -122,7 +129,12 @@
@@ -131,7 +138,12 @@
infs2(outp, ourEntry.size, ourEntry.realSize, decomp);
mutex->unlock();
delete[] outp;
@@ -74,7 +59,7 @@ Index: lib/CLodHandler.cpp
}
Index: lib/Interprocess.h
===================================================================
--- lib/Interprocess.h (revision 2220)
--- lib/Interprocess.h (revision 2387)
+++ lib/Interprocess.h (working copy)
@@ -1,3 +1,4 @@
+/*
@@ -144,9 +129,24 @@ Index: lib/Interprocess.h
+ fwrite("1", 1, 1, ff);
+ fclose(ff);
+}
Index: lib/Connection.h
===================================================================
--- lib/Connection.h (revision 2387)
+++ lib/Connection.h (working copy)
@@ -82,7 +82,9 @@
{
bool operator()(const std::type_info *a, const std::type_info *b) const
{
- return a->before(*b);
+ // Comparing pointers is bad bad practice, because type_info pointers to the same types
+ // are different inside shared library and the executable that links to that library
+ return strcmp(a->name(), b->name()) > 0;
}
};
Index: server/stdafx.h
===================================================================
--- server/stdafx.h (revision 2220)
--- server/stdafx.h (revision 2387)
+++ server/stdafx.h (working copy)
@@ -15,8 +15,8 @@
#include "../global.h"
@@ -161,7 +161,7 @@ Index: server/stdafx.h
#include <boost/asio.hpp>
Index: server/CVCMIServer.cpp
===================================================================
--- server/CVCMIServer.cpp (revision 2220)
--- server/CVCMIServer.cpp (revision 2387)
+++ server/CVCMIServer.cpp (working copy)
@@ -29,7 +29,7 @@
using namespace boost;
@@ -189,7 +189,7 @@ Index: server/CVCMIServer.cpp
boost::system::error_code error;
tlog0<<"Listening for connections at port " << acceptor->local_endpoint().port() << std::endl;
tcp::socket * s = new tcp::socket(acceptor->io_service());
tcp::socket * s = new tcp::socket(acceptor->get_io_service());
boost::thread acc(boost::bind(vaccept,acceptor,s,&error));
+ /*
sr->setToTrueAndNotify();
@@ -200,19 +200,25 @@ Index: server/CVCMIServer.cpp
if (error)
Index: server/CGameHandler.cpp
===================================================================
--- server/CGameHandler.cpp (revision 2220)
--- server/CGameHandler.cpp (revision 2387)
+++ server/CGameHandler.cpp (working copy)
@@ -602,7 +602,9 @@
if(apply)
@@ -638,6 +638,7 @@
(packType != typeList.getTypeID<ArrangeStacks>() || !isAllowedArrangePack((ArrangeStacks*)pack)) && // for dialogs like garrison
states[getCurrentPlayer()].queries.size())
{
+ tlog0<<__FUNCTION__ << " at " << __FILE__ << ":" << __LINE__ << std::endl;
complain("Answer the query before attempting any further actions!");
PackageApplied applied;
applied.result = false;
@@ -650,6 +651,7 @@
else if(apply)
{
bool result = apply->applyOnGH(this,&c,pack);
+ tlog0<<__FUNCTION__ << " at " << __FILE__ << ":" << __LINE__ << std::endl;
tlog5 << "Message successfully applied (result=" << result << ")!\n";
//send confirmation that we've applied the package
@@ -1795,7 +1797,7 @@
@@ -1833,7 +1835,7 @@
iw.player = h1->tempOwner;
iw.components.push_back(Component(Component::SEC_SKILL, 18, ScholarLevel, 0));
@@ -223,7 +229,7 @@ Index: server/CGameHandler.cpp
if (cs2.spells.size())//if found new spell - apply
Index: CConsoleHandler.cpp
===================================================================
--- CConsoleHandler.cpp (revision 2220)
--- CConsoleHandler.cpp (revision 2387)
+++ CConsoleHandler.cpp (working copy)
@@ -143,6 +143,7 @@
@@ -243,7 +249,7 @@ Index: CConsoleHandler.cpp
int CConsoleHandler::run()
Index: global.h
===================================================================
--- global.h (revision 2220)
--- global.h (revision 2387)
+++ global.h (working copy)
@@ -4,6 +4,7 @@
#include <iostream>
@@ -253,7 +259,7 @@ Index: global.h
#include <string> //std::find
#include <boost/logic/tribool.hpp>
#include <boost/unordered_set.hpp>
@@ -729,29 +730,21 @@
@@ -725,29 +726,21 @@
}
@@ -289,9 +295,25 @@ Index: global.h
//for explicit overrides
#ifdef _MSC_VER
#define OVERRIDE override
Index: AI/GeniusAI/neuralNetwork.cpp
===================================================================
--- AI/GeniusAI/neuralNetwork.cpp (revision 2387)
+++ AI/GeniusAI/neuralNetwork.cpp (working copy)
@@ -14,9 +14,9 @@
static bool in = 0;
if(!in)
{
- float x = (rand()+1)/float(RAND_MAX+1);
+ float x = (rand())/float(RAND_MAX);
float f = sqrtf( - 2.0f * log(x) );
- x = (rand()+1)/float(RAND_MAX+1);
+ x = (rand())/float(RAND_MAX);
kept = f * cosf( 2.0f * M_PI * x );
in = true;
return f * sinf( 2.0f * M_PI * x );
Index: Scripting/ERM/ERMParser.cpp
===================================================================
--- Scripting/ERM/ERMParser.cpp (revision 2220)
--- Scripting/ERM/ERMParser.cpp (revision 2387)
+++ Scripting/ERM/ERMParser.cpp (working copy)
@@ -2,7 +2,7 @@
#include <boost/version.hpp>
@@ -304,10 +326,10 @@ Index: Scripting/ERM/ERMParser.cpp
#include <boost/bind.hpp>
Index: client/Graphics.cpp
===================================================================
--- client/Graphics.cpp (revision 2220)
--- client/Graphics.cpp (revision 2387)
+++ client/Graphics.cpp (working copy)
@@ -333,8 +333,15 @@
tasks += GET_SURFACE(backgroundsm[id],name);
@@ -315,8 +315,15 @@
tasks += GET_SURFACE(backgroundsm[id], b["bg120"].String());
}
+#ifdef ANDROID
@@ -322,7 +344,7 @@ Index: client/Graphics.cpp
for(size_t y=0; y < heroMoveArrows->ourImages.size(); ++y)
{
@@ -541,13 +548,20 @@
@@ -508,13 +515,20 @@
pr[3].first = &Graphics::flags4;
pr[3].second+=("AF00.DEF"),("AF01.DEF"),("AF02.DEF"),("AF03.DEF"),("AF04.DEF"),
("AF05.DEF"),("AF06.DEF"),("AF07.DEF");
@@ -344,11 +366,66 @@ Index: client/Graphics.cpp
}
SDL_Surface * Graphics::getPic(int ID, bool fort, bool builded)
{
@@ -677,7 +691,7 @@
return NULL;
}
- int magic = *(const int*)hlp;
+ int magic = read_unaligned_u32(hlp);
if(len < 10000 || (magic != 589598 && magic != 589599))
{
tlog1 << "Suspicious font file (length " << len <<", fname " << name << "), logging to suspicious_" << name << ".fnt\n";
Index: client/SDL_Extensions.cpp
===================================================================
--- client/SDL_Extensions.cpp (revision 2387)
+++ client/SDL_Extensions.cpp (working copy)
@@ -119,8 +119,8 @@
if(incrementPtr == -1)
ptr -= 2;
- Uint16 * const px = (Uint16*)ptr;
- *px = (B>>3) + ((G>>2) << 5) + ((R>>3) << 11); //drop least significant bits of 24 bpp encoded color
+ Uint16 px = (B>>3) + ((G>>2) << 5) + ((R>>3) << 11); //drop least significant bits of 24 bpp encoded color
+ memcpy(ptr, &px, sizeof(px));
if(incrementPtr == 1)
ptr += 2; //bpp
@@ -150,9 +150,9 @@
const int rmask = 0xF800, gmask = 0x7E0, bmask = 0x1F;
const int rshift = 11, gshift = 5, bshift = 0;
- const Uint8 r5 = (*((Uint16 *)ptr) & rmask) >> rshift,
- b5 = (*((Uint16 *)ptr) & bmask) >> bshift,
- g5 = (*((Uint16 *)ptr) & gmask) >> gshift;
+ const Uint8 r5 = (read_unaligned_u16(ptr) & rmask) >> rshift,
+ b5 = (read_unaligned_u16(ptr) & bmask) >> bshift,
+ g5 = (read_unaligned_u16(ptr) & gmask) >> gshift;
const Uint32 r8 = (r5 << (8 - rbit)) | (r5 >> (2*rbit - 8)),
g8 = (g5 << (8 - gbit)) | (g5 >> (2*gbit - 8)),
@@ -649,7 +649,7 @@
return *p;
case 2:
- return *(Uint16 *)p;
+ return read_unaligned_u16(p);
case 3:
/*
@@ -661,7 +661,7 @@
//#endif
case 4:
- return *(Uint32 *)p;
+ return read_unaligned_u32(p);
default:
return 0; // shouldn't happen, but avoids warnings
Index: client/Client.cpp
===================================================================
--- client/Client.cpp (revision 2220)
--- client/Client.cpp (revision 2387)
+++ client/Client.cpp (working copy)
@@ -40,7 +40,7 @@
@@ -41,7 +41,7 @@
#include "../lib/RegisterTypes.cpp"
extern std::string NAME;
@@ -357,22 +434,7 @@ Index: client/Client.cpp
/*
* Client.cpp, part of VCMI engine
@@ -432,7 +432,13 @@
hotSeat = (humanPlayers > 1);
std::vector<FileInfo> scriptModules;
- CFileUtility::getFilesWithExt(scriptModules, "./Scripting", ".dll");
+ CFileUtility::getFilesWithExt(scriptModules,
+#ifdef ANDROID
+ LIB_DIR "/"
+#else
+ "./"
+#endif
+ "Scripting", ".dll");
BOOST_FOREACH(FileInfo &m, scriptModules)
{
CScriptingModule * nm = CDynLibHandler::getNewScriptingModule(m.name);
@@ -505,9 +511,9 @@
@@ -476,9 +476,9 @@
void CClient::handlePack( CPack * pack )
{
@@ -384,7 +446,7 @@ Index: client/Client.cpp
apply->applyOnClBefore(this,pack);
tlog5 << "\tMade first apply on cl\n";
gs->apply(pack);
@@ -642,18 +648,22 @@
@@ -639,18 +639,22 @@
startServer();
th.update();
@@ -408,7 +470,7 @@ Index: client/Client.cpp
waitForServer();
th.update();
@@ -668,27 +678,31 @@
@@ -665,27 +669,31 @@
CServerHandler::CServerHandler(bool runServer /*= false*/)
{
serverThread = NULL;
@@ -444,7 +506,7 @@ Index: client/Client.cpp
}
Index: client/GUIBase.cpp
===================================================================
--- client/GUIBase.cpp (revision 2220)
--- client/GUIBase.cpp (revision 2387)
+++ client/GUIBase.cpp (working copy)
@@ -11,6 +11,7 @@
#include "../CThreadHelper.h"
@@ -483,9 +545,9 @@ Index: client/GUIBase.cpp
:lastClick(-500, -500)
Index: client/CAnimation.h
===================================================================
--- client/CAnimation.h (revision 2220)
--- client/CAnimation.h (revision 2387)
+++ client/CAnimation.h (working copy)
@@ -46,6 +46,8 @@
@@ -47,6 +47,8 @@
std::map<size_t, std::vector <size_t> > offset;
unsigned char * data;
@@ -494,7 +556,7 @@ Index: client/CAnimation.h
SDL_Color * palette;
public:
@@ -124,6 +126,8 @@
@@ -125,6 +127,8 @@
* 2nd byte = size of segment
* raw data (if any)
*/
@@ -503,7 +565,7 @@ Index: client/CAnimation.h
class CompImage : public IImage
{
//x,y - margins, w,h - sprite size
@@ -157,8 +161,8 @@
@@ -158,8 +162,8 @@
friend class CompImageLoader;
};
@@ -515,7 +577,7 @@ Index: client/CAnimation.h
{
Index: client/CDefHandler.h
===================================================================
--- client/CDefHandler.h (revision 2220)
--- client/CDefHandler.h (revision 2387)
+++ client/CDefHandler.h (working copy)
@@ -30,7 +30,6 @@
ui32 totalInBlock;
@@ -539,7 +601,7 @@ Index: client/CDefHandler.h
static CDefHandler * giveDef(const std::string & defName);
Index: client/CCreatureAnimation.h
===================================================================
--- client/CCreatureAnimation.h (revision 2220)
--- client/CCreatureAnimation.h (revision 2387)
+++ client/CCreatureAnimation.h (working copy)
@@ -66,6 +66,8 @@
int curFrame, internalFrame; //number of currently displayed frame
@@ -552,7 +614,7 @@ Index: client/CCreatureAnimation.h
int nextFrameT(SDL_Surface * dest, int x, int y, bool attacker, unsigned char animCount, bool incrementFrame = true, bool yellowBorder = false, bool blueBorder = false, SDL_Rect * destRect = NULL); //0 - success, any other - error //print next
Index: client/CMT.cpp
===================================================================
--- client/CMT.cpp (revision 2220)
--- client/CMT.cpp (revision 2387)
+++ client/CMT.cpp (working copy)
@@ -92,8 +92,10 @@
void dispose();
@@ -573,20 +635,15 @@ Index: client/CMT.cpp
THC tlog0<<"\tLoading default system settings: "<<pomtime.getDif()<<std::endl;
//initializing audio
@@ -137,10 +140,12 @@
CCS->soundh->init();
CCS->soundh->setVolume(GDefaultOptions.soundVolume);
CCS->musich = new CMusicHandler;
+
//CGI->musich->init();
//CGI->musich->setVolume(GDefaultOptions.musicVolume);
@@ -141,6 +144,7 @@
CCS->musich->setVolume(GDefaultOptions.musicVolume);
tlog0<<"\tInitializing sound: "<<pomtime.getDif()<<std::endl;
tlog0<<"Initializing screen and sound handling: "<<tmh.getDif()<<std::endl;
+
initDLL(::console,logfile);
const_cast<CGameInfo*>(CGI)->setFromLib();
@@ -154,7 +159,9 @@
@@ -154,7 +158,9 @@
CCS->curh->show();
tlog0<<"Screen handler: "<<pomtime.getDif()<<std::endl;
pomtime.getDif();
@@ -596,7 +653,7 @@ Index: client/CMT.cpp
graphics->loadHeroAnims();
tlog0<<"\tMain graphics: "<<tmh.getDif()<<std::endl;
tlog0<<"Initializing game graphics: "<<tmh.getDif()<<std::endl;
@@ -186,11 +193,15 @@
@@ -186,11 +192,15 @@
}
@@ -612,7 +669,7 @@ Index: client/CMT.cpp
{
tlog0 << "Starting... " << std::endl;
po::options_description opts("Allowed options");
@@ -237,7 +248,6 @@
@@ -237,7 +247,6 @@
console->start();
atexit(dispose);
tlog0 <<"Creating console and logfile: "<<pomtime.getDif() << std::endl;
@@ -620,7 +677,7 @@ Index: client/CMT.cpp
conf.init();
tlog0 <<"Loading settings: "<<pomtime.getDif() << std::endl;
tlog0 << NAME << std::endl;
@@ -262,6 +272,11 @@
@@ -266,6 +275,11 @@
tlog0<<"\tInitializing video: "<<pomtime.getDif()<<std::endl;
//we can properly play intro only in the main thread, so we have to move loading to the separate thread
@@ -632,7 +689,7 @@ Index: client/CMT.cpp
boost::thread loading(init);
if(!vm.count("battle") && !vm.count("nointro"))
@@ -270,6 +285,7 @@
@@ -274,6 +288,7 @@
SDL_FillRect(screen,NULL,0);
CSDL_Ext::update(screen);
loading.join();
@@ -640,7 +697,7 @@ Index: client/CMT.cpp
tlog0<<"Initialization of VCMI (together): "<<total.getDif()<<std::endl;
if(!vm.count("battle"))
@@ -286,8 +302,17 @@
@@ -290,8 +305,17 @@
si->playerInfos[1].color = 1;
startGame(si);
}
@@ -658,7 +715,7 @@ Index: client/CMT.cpp
return 0;
}
@@ -558,10 +583,12 @@
@@ -561,10 +585,12 @@
tlog2 << "Warning: SDL says that " << bpp << "bpp is wrong and suggests " << suggestedBpp << std::endl;
}
@@ -671,7 +728,7 @@ Index: client/CMT.cpp
if((screen = SDL_SetVideoMode(w, h, suggestedBpp, SDL_SWSURFACE|(fullscreen?SDL_FULLSCREEN:0))) == NULL)
{
@@ -606,14 +633,27 @@
@@ -609,14 +635,27 @@
setResolution = true;
}
@@ -702,7 +759,7 @@ Index: client/CMT.cpp
//tlog0 << "got " << (int)ev->type;
if (ret == 0 || (ev->type==SDL_QUIT) ||
(ev->type == SDL_KEYDOWN && ev->key.keysym.sym==SDLK_F4 && (ev->key.keysym.mod & KMOD_ALT)))
@@ -632,7 +672,7 @@
@@ -635,7 +674,7 @@
SDL_Delay(750);
SDL_Quit();
tlog0 << "Ending...\n";
@@ -711,7 +768,7 @@ Index: client/CMT.cpp
}
else if(LOCPLINT && ev->type == SDL_KEYDOWN && ev->key.keysym.sym==SDLK_F4)
{
@@ -641,7 +681,7 @@
@@ -644,7 +683,7 @@
setScreenRes(conf.cc.screenx, conf.cc.screeny, conf.cc.bpp, full);
GH.totalRedraw();
delete ev;
@@ -720,7 +777,7 @@ Index: client/CMT.cpp
}
else if(ev->type == SDL_USEREVENT)
{
@@ -671,7 +711,7 @@
@@ -674,7 +713,7 @@
}
delete ev;
@@ -729,7 +786,7 @@ Index: client/CMT.cpp
}
//tlog0 << " pushing ";
@@ -679,7 +719,7 @@
@@ -682,7 +721,7 @@
events.push(ev);
eventsM.unlock();
//tlog0 << " done\n";
@@ -738,14 +795,14 @@ Index: client/CMT.cpp
}
void startGame(StartInfo * options, CConnection *serv/* = NULL*/)
@@ -740,3 +780,4 @@
@@ -742,3 +781,4 @@
ev.user.code = 1;
SDL_PushEvent(&ev);
}
+
Index: client/Client.h
===================================================================
--- client/Client.h (revision 2220)
--- client/Client.h (revision 2387)
+++ client/Client.h (working copy)
@@ -43,7 +43,7 @@
public:
@@ -758,7 +815,7 @@ Index: client/Client.h
Index: client/CDefHandler.cpp
===================================================================
--- client/CDefHandler.cpp (revision 2220)
--- client/CDefHandler.cpp (revision 2387)
+++ client/CDefHandler.cpp (working copy)
@@ -50,10 +50,19 @@
SDL_FreeSurface(ourImages[i].bitmap);
@@ -1087,7 +1144,7 @@ Index: client/CDefHandler.cpp
}
Index: client/CCreatureAnimation.cpp
===================================================================
--- client/CCreatureAnimation.cpp (revision 2220)
--- client/CCreatureAnimation.cpp (revision 2387)
+++ client/CCreatureAnimation.cpp (working copy)
@@ -37,15 +37,23 @@
}
@@ -1172,9 +1229,9 @@ Index: client/CCreatureAnimation.cpp
}
Index: client/CAnimation.cpp
===================================================================
--- client/CAnimation.cpp (revision 2220)
--- client/CAnimation.cpp (revision 2387)
+++ client/CAnimation.cpp (working copy)
@@ -44,6 +44,8 @@
@@ -46,6 +46,8 @@
~SDLImageLoader();
};
@@ -1183,18 +1240,15 @@ Index: client/CAnimation.cpp
class CompImageLoader
{
CompImage * image;
@@ -67,7 +69,7 @@
@@ -69,11 +71,18 @@
CompImageLoader(CompImage * Img);
~CompImageLoader();
};
-
+*/
//Small internal class for parsing texts
class TextParser
{
@@ -95,6 +97,13 @@
}
}
/*************************************************************************
* DefFile, class used for def loading *
*************************************************************************/
+
+#define CHECK_LOD_MEM_BLOCK_SIZE1(S, FF, F, L) { \
@@ -1206,7 +1260,7 @@ Index: client/CAnimation.cpp
CDefFile::CDefFile(std::string Name):
data(NULL),
palette(NULL)
@@ -112,15 +121,18 @@
@@ -91,15 +100,18 @@
{ 0, 0, 0, 192} // 75% - shadow border below selection
};
@@ -1226,7 +1280,7 @@ Index: client/CAnimation.cpp
unsigned int totalBlocks = readNormalNr(data, it);
it+=4;
@@ -135,6 +147,7 @@
@@ -117,6 +129,7 @@
for (unsigned int i=0; i<totalBlocks; i++)
{
@@ -1234,7 +1288,7 @@ Index: client/CAnimation.cpp
size_t blockID = readNormalNr(data, it);
it+=4;
size_t totalEntries = readNormalNr(data, it);
@@ -146,6 +159,7 @@
@@ -128,6 +141,7 @@
for (unsigned int j=0; j<totalEntries; j++)
{
@@ -1242,7 +1296,7 @@ Index: client/CAnimation.cpp
size_t currOffset = readNormalNr(data, it);
offset[blockID].push_back(currOffset);
it += 4;
@@ -162,7 +176,9 @@
@@ -144,7 +158,9 @@
const ui8 * FDef = data+it->second[frame];
@@ -1253,7 +1307,7 @@ Index: client/CAnimation.cpp
SSpriteDef sprite;
//sprite.size = SDL_SwapLE32(sd.size);//unused
@@ -188,6 +204,7 @@
@@ -170,6 +186,7 @@
//pixel data is not compressed, copy data to surface
for (unsigned int i=0; i<sprite.height; i++)
{
@@ -1261,7 +1315,7 @@ Index: client/CAnimation.cpp
loader.Load(sprite.width, FDef[currentOffset]);
currentOffset += sprite.width;
loader.EndLine();
@@ -197,22 +214,33 @@
@@ -179,22 +196,33 @@
case 1:
{
//for each line we have offset of pixel data
@@ -1297,7 +1351,7 @@ Index: client/CAnimation.cpp
loader.Load(length, FDef + currentOffset);
currentOffset+=length;
}
@@ -237,12 +265,14 @@
@@ -219,12 +247,14 @@
while (TotalRowLength<sprite.width)
{
@@ -1312,7 +1366,7 @@ Index: client/CAnimation.cpp
loader.Load(length, FDef[currentOffset]);
currentOffset += length;
}
@@ -260,17 +290,20 @@
@@ -242,17 +272,20 @@
{
for (unsigned int i=0; i<sprite.height; i++)
{
@@ -1333,7 +1387,7 @@ Index: client/CAnimation.cpp
loader.Load(length, FDef + currentOffset);
currentOffset += length;
}
@@ -288,6 +321,7 @@
@@ -270,6 +303,7 @@
tlog0<<"Error: unsupported format of def file:"<<sprite.format<<"\n";
break;
}
@@ -1341,7 +1395,7 @@ Index: client/CAnimation.cpp
};
CDefFile::~CDefFile()
@@ -332,7 +366,7 @@
@@ -314,7 +348,7 @@
inline void SDLImageLoader::Load(size_t size, const ui8 * data)
{
@@ -1350,7 +1404,7 @@ Index: client/CAnimation.cpp
{
memcpy((void *)position, data, size);
position += size;
@@ -341,7 +375,7 @@
@@ -323,7 +357,7 @@
inline void SDLImageLoader::Load(size_t size, ui8 color)
{
@@ -1359,7 +1413,7 @@ Index: client/CAnimation.cpp
{
memset((void *)position, color, size);
position += size;
@@ -363,6 +397,7 @@
@@ -345,6 +379,7 @@
////////////////////////////////////////////////////////////////////////////////
@@ -1367,7 +1421,7 @@ Index: client/CAnimation.cpp
CompImageLoader::CompImageLoader(CompImage * Img):
image(Img),
position(NULL),
@@ -536,6 +571,7 @@
@@ -518,6 +553,7 @@
image->surf = newPtr;
}
@@ -1375,7 +1429,7 @@ Index: client/CAnimation.cpp
/*************************************************************************
* Classes for images, support loading from file and drawing on surface *
*************************************************************************/
@@ -641,6 +677,8 @@
@@ -625,6 +661,8 @@
SDL_FreeSurface(surf);
}
@@ -1384,7 +1438,7 @@ Index: client/CAnimation.cpp
CompImage::CompImage(const CDefFile *data, size_t frame, size_t group):
surf(NULL),
line(NULL),
@@ -861,6 +899,7 @@
@@ -845,6 +883,7 @@
delete [] line;
delete [] palette;
}
@@ -1392,9 +1446,9 @@ Index: client/CAnimation.cpp
/*************************************************************************
* CAnimation for animations handling, can load part of file if needed *
@@ -953,9 +992,11 @@
@@ -889,9 +928,11 @@
//try to get image from def
if (source[group][frame].empty())
if (source[group][frame].getType() == JsonNode::DATA_NULL)
{
+ /*
if (compressed)
@@ -1406,9 +1460,9 @@ Index: client/CAnimation.cpp
else //load from separate file
Index: client/GUIBase.h
===================================================================
--- client/GUIBase.h (revision 2220)
--- client/GUIBase.h (revision 2387)
+++ client/GUIBase.h (working copy)
@@ -546,6 +546,8 @@
@@ -558,6 +558,8 @@
CGuiHandler();
~CGuiHandler();
void run(); // holds the main loop for the whole program after initialization and manages the update/rendering system
@@ -1417,3 +1471,65 @@ Index: client/GUIBase.h
void totalRedraw(); //forces total redraw (using showAll), sets a flag, method gets called at the end of the rendering
void simpleRedraw(); //update only top interface and draw background from buffer, sets a flag, method gets called at the end of the rendering
Index: client/CSndHandler.cpp
===================================================================
--- client/CSndHandler.cpp (revision 2387)
+++ client/CSndHandler.cpp (working copy)
@@ -151,16 +151,17 @@
}
const char *data = mfile->data();
- unsigned int numFiles = SDL_SwapLE32(*(Uint32 *)&data[0]);
- struct soundEntry *se = (struct soundEntry *)&data[4];
+ unsigned int numFiles = SDL_SwapLE32(read_unaligned_u32(&data[0]));
+ struct soundEntry se;
- for (unsigned int i=0; i<numFiles; i++, se++)
+ for (unsigned int i=0; i<numFiles; i++)
{
Entry entry;
+ memcpy(&se, &data[4+i*sizeof(se)], sizeof(se));
- entry.name = se->filename;
- entry.offset = SDL_SwapLE32(se->offset);
- entry.size = SDL_SwapLE32(se->size);
+ entry.name = se.filename;
+ entry.offset = SDL_SwapLE32(se.offset);
+ entry.size = SDL_SwapLE32(se.size);
entry.data = mfile->data() + entry.offset;
entries.push_back(entry);
@@ -186,24 +187,26 @@
return;
}
const unsigned char *data = (const unsigned char *)mfile->data();
- unsigned int numFiles = SDL_SwapLE32(*(Uint32 *)&data[0]);
- struct videoEntry *ve = (struct videoEntry *)&data[4];
+ unsigned int numFiles = SDL_SwapLE32(read_unaligned_u32(&data[0]));
+ struct videoEntry ve;
- for (unsigned int i=0; i<numFiles; i++, ve++)
+ for (unsigned int i=0; i<numFiles; i++)
{
Entry entry;
+ memcpy(&ve, &data[4+i*sizeof(ve)], sizeof(ve));
- entry.name = ve->filename;
- entry.offset = SDL_SwapLE32(ve->offset);
+ entry.name = ve.filename;
+ entry.offset = SDL_SwapLE32(ve.offset);
entry.name.erase(entry.name.find_last_of('.'));
// There is no size, so check where the next file is
if (i == numFiles - 1) {
entry.size = mfile->size() - entry.offset;
} else {
- struct videoEntry *ve_next = ve+1;
+ struct videoEntry ve_next;
+ memcpy(&ve_next, &data[4+(i+1)*sizeof(ve)], sizeof(ve));
- entry.size = SDL_SwapLE32(ve_next->offset) - entry.offset;
+ entry.size = SDL_SwapLE32(ve_next.offset) - entry.offset;
}
entry.data = mfile->data() + entry.offset;

View File

@@ -5,8 +5,10 @@ include $(CLEAR_VARS)
LOCAL_MODULE := sdl_image
LOCAL_C_INCLUDES := $(LOCAL_PATH) $(LOCAL_PATH)/../jpeg/include $(LOCAL_PATH)/../png/include $(LOCAL_PATH)/../sdl-$(SDL_VERSION)/include $(LOCAL_PATH)/include
LOCAL_CFLAGS := -O3 -DLOAD_PNG -DLOAD_JPG -DLOAD_GIF -DLOAD_BMP -DLOAD_PCX -DLOAD_LBM -DLOAD_PNM -DLOAD_TGA
# Add -DANDROID_RGB to LOCAL_CFLAGS to make SDL_image output JPEG in native RGB565 format
LOCAL_CFLAGS := -O3 \
-DLOAD_JPG -DLOAD_PNG -DLOAD_BMP -DLOAD_GIF -DLOAD_LBM \
-DLOAD_PCX -DLOAD_PNM -DLOAD_TGA -DLOAD_XCF -DLOAD_XPM \
-DLOAD_XV
LOCAL_CPP_EXTENSION := .cpp

View File

@@ -90,7 +90,7 @@ int IMG_Init(int flags)
}
initialized |= result;
return (result);
return (initialized);
}
void IMG_Quit()

View File

@@ -11,10 +11,17 @@
#include "SDL_image.h"
// For ImageIO framework and also LaunchServices framework (for UTIs)
#include <ApplicationServices/ApplicationServices.h>
// Used because CGDataProviderCreate became deprecated in 10.5
#include <AvailabilityMacros.h>
#include <TargetConditionals.h>
#if (TARGET_OS_IPHONE == 1) || (TARGET_IPHONE_SIMULATOR == 1)
#import <MobileCoreServices/MobileCoreServices.h> // for UTCoreTypes.h
#import <ImageIO/ImageIO.h>
#else
// For ImageIO framework and also LaunchServices framework (for UTIs)
#include <ApplicationServices/ApplicationServices.h>
#endif
/**************************************************************
***** Begin Callback functions for block reading *************
@@ -149,7 +156,7 @@ static CGImageRef CreateCGImageFromCGImageSource(CGImageSourceRef image_source)
{
CGImageRef image_ref = NULL;
if(NULL == image_source)
if(NULL == image_source)
{
return NULL;
}
@@ -157,6 +164,10 @@ static CGImageRef CreateCGImageFromCGImageSource(CGImageSourceRef image_source)
// Get the first item in the image source (some image formats may
// contain multiple items).
image_ref = CGImageSourceCreateImageAtIndex(image_source, 0, NULL);
if(NULL == image_ref)
{
IMG_SetError("CGImageSourceCreateImageAtIndex() failed");
}
return image_ref;
}

View File

@@ -239,7 +239,7 @@ static SDL_Surface *LoadBMP_RW (SDL_RWops *src, int freesrc)
goto done;
}
if ( strncmp(magic, "BM", 2) != 0 ) {
SDL_SetError("File is not a Windows BMP file");
IMG_SetError("File is not a Windows BMP file");
was_error = SDL_TRUE;
goto done;
}
@@ -340,6 +340,10 @@ static SDL_Surface *LoadBMP_RW (SDL_RWops *src, int freesrc)
switch (biBitCount) {
case 15:
case 16:
Rmask = SDL_ReadLE32(src);
Gmask = SDL_ReadLE32(src);
Bmask = SDL_ReadLE32(src);
break;
case 32:
Rmask = SDL_ReadLE32(src);
Gmask = SDL_ReadLE32(src);
@@ -402,7 +406,7 @@ static SDL_Surface *LoadBMP_RW (SDL_RWops *src, int freesrc)
}
if ((biCompression == BI_RLE4) || (biCompression == BI_RLE8)) {
was_error = readRlePixels(surface, src, biCompression == BI_RLE8);
if (was_error) SDL_SetError("Error reading from BMP");
if (was_error) IMG_SetError("Error reading from BMP");
goto done;
}
top = (Uint8 *)surface->pixels;
@@ -435,7 +439,7 @@ static SDL_Surface *LoadBMP_RW (SDL_RWops *src, int freesrc)
for ( i=0; i<surface->w; ++i ) {
if ( i%(8/ExpandBMP) == 0 ) {
if ( !SDL_RWread(src, &pixel, 1, 1) ) {
SDL_SetError(
IMG_SetError(
"Error reading from BMP");
was_error = SDL_TRUE;
goto done;
@@ -564,7 +568,7 @@ LoadICOCUR_RW(SDL_RWops * src, int type, int freesrc)
bfType = SDL_ReadLE16(src);
bfCount = SDL_ReadLE16(src);
if ((bfReserved != 0) || (bfType != type) || (bfCount == 0)) {
SDL_SetError("File is not a Windows %s file", type == 1 ? "ICO" : "CUR");
IMG_SetError("File is not a Windows %s file", type == 1 ? "ICO" : "CUR");
was_error = SDL_TRUE;
goto done;
}
@@ -617,7 +621,7 @@ LoadICOCUR_RW(SDL_RWops * src, int type, int freesrc)
biClrUsed = SDL_ReadLE32(src);
biClrImportant = SDL_ReadLE32(src);
} else {
SDL_SetError("Unsupported ICO bitmap format");
IMG_SetError("Unsupported ICO bitmap format");
was_error = SDL_TRUE;
goto done;
}
@@ -648,13 +652,13 @@ LoadICOCUR_RW(SDL_RWops * src, int type, int freesrc)
ExpandBMP = 0;
break;
default:
SDL_SetError("ICO file with unsupported bit count");
IMG_SetError("ICO file with unsupported bit count");
was_error = SDL_TRUE;
goto done;
}
break;
default:
SDL_SetError("Compressed ICO files not supported");
IMG_SetError("Compressed ICO files not supported");
was_error = SDL_TRUE;
goto done;
}
@@ -713,7 +717,7 @@ LoadICOCUR_RW(SDL_RWops * src, int type, int freesrc)
for (i = 0; i < surface->w; ++i) {
if (i % (8 / ExpandBMP) == 0) {
if (!SDL_RWread(src, &pixel, 1, 1)) {
SDL_SetError("Error reading from ICO");
IMG_SetError("Error reading from ICO");
was_error = SDL_TRUE;
goto done;
}
@@ -754,7 +758,7 @@ LoadICOCUR_RW(SDL_RWops * src, int type, int freesrc)
for (i = 0; i < surface->w; ++i) {
if (i % (8 / ExpandBMP) == 0) {
if (!SDL_RWread(src, &pixel, 1, 1)) {
SDL_SetError("Error reading from ICO");
IMG_SetError("Error reading from ICO");
was_error = SDL_TRUE;
goto done;
}

View File

@@ -34,6 +34,12 @@
#include <jpeglib.h>
#if JPEG_LIB_VERSION >= 80
typedef JPEG_boolean boolean;
#define TRUE JPEG_TRUE
#define FALSE JPEG_FALSE
#endif
/* Define this for fast loading and not as good image quality */
/*#define FAST_JPEG*/
@@ -420,13 +426,7 @@ SDL_Surface *IMG_LoadJPG_RW(SDL_RWops *src)
#endif
} else {
/* Set 24-bit RGB output */
#ifdef ANDROID_RGB
const SDL_PixelFormat *fmt = SDL_GetVideoInfo()->vfmt;
cinfo.out_color_space = (fmt->BitsPerPixel==16) ? JCS_RGB_565 : JCS_RGB;
#else
cinfo.out_color_space = JCS_RGB;
#endif
cinfo.quantize_colors = FALSE;
#ifdef FAST_JPEG
cinfo.scale_num = 1;
@@ -437,11 +437,6 @@ SDL_Surface *IMG_LoadJPG_RW(SDL_RWops *src)
lib.jpeg_calc_output_dimensions(&cinfo);
/* Allocate an output surface to hold the image */
#ifdef ANDROID_RGB
surface = SDL_AllocSurface(SDL_SWSURFACE, cinfo.output_width, cinfo.output_height,
(fmt->BitsPerPixel==16) ? 16 : 24,
fmt->Rmask, fmt->Gmask, fmt->Bmask, 0);
#else
surface = SDL_AllocSurface(SDL_SWSURFACE,
cinfo.output_width, cinfo.output_height, 24,
#if SDL_BYTEORDER == SDL_LIL_ENDIAN
@@ -450,7 +445,6 @@ SDL_Surface *IMG_LoadJPG_RW(SDL_RWops *src)
0xFF0000, 0x00FF00, 0x0000FF,
#endif
0);
#endif
}
if ( surface == NULL ) {

View File

@@ -55,7 +55,7 @@ typedef struct
Uint8 pad1; /* dummy value, for padding */
Uint16 tcolor; /* transparent color */
Uint8 xAspect, /* pixel aspect ratio */
yAspect;
yAspect;
Sint16 Lpage; /* width of the screen in pixels */
Sint16 Hpage; /* height of the screen in pixels */
} BMHD;
@@ -89,7 +89,7 @@ SDL_Surface *IMG_LoadLBM_RW( SDL_RWops *src )
SDL_Surface *Image;
Uint8 id[4], pbm, colormap[MAXCOLORS*3], *MiniBuf, *ptr, count, color, msk;
Uint32 size, bytesloaded, nbcolors;
Uint32 i, j, bytesperline, nbplanes, plane, h;
Uint32 i, j, bytesperline, nbplanes, stencil, plane, h;
Uint32 remainingbytes;
Uint32 width;
BMHD bmhd;
@@ -238,12 +238,13 @@ SDL_Surface *IMG_LoadLBM_RW( SDL_RWops *src )
nbplanes = 1;
}
if ( bmhd.mask & 1 ) ++nbplanes; /* There is a mask ( 'stencil' ) */
stencil = (bmhd.mask & 1); /* There is a mask ( 'stencil' ) */
/* Allocate memory for a temporary buffer ( used for
decompression/deinterleaving ) */
if ( ( MiniBuf = (void *)malloc( bytesperline * nbplanes ) ) == NULL )
MiniBuf = (void *)malloc( bytesperline * (nbplanes + stencil) );
if ( MiniBuf == NULL )
{
error="no enough memory for temporary buffer";
goto done;
@@ -260,7 +261,8 @@ SDL_Surface *IMG_LoadLBM_RW( SDL_RWops *src )
/* There is no palette in 24 bits ILBM file */
if ( nbcolors>0 && flagHAM==0 )
{
int nbrcolorsfinal = 1 << nbplanes;
/* FIXME: Should this include the stencil? See comment below */
int nbrcolorsfinal = 1 << (nbplanes + stencil);
ptr = &colormap[0];
for ( i=0; i<nbcolors; i++ )
@@ -308,7 +310,7 @@ SDL_Surface *IMG_LoadLBM_RW( SDL_RWops *src )
{
/* uncompress the datas of each planes */
for ( plane=0; plane < nbplanes; plane++ )
for ( plane=0; plane < (nbplanes+stencil); plane++ )
{
ptr = MiniBuf + ( plane * bytesperline );
@@ -331,7 +333,7 @@ SDL_Surface *IMG_LoadLBM_RW( SDL_RWops *src )
if ( ( count > remainingbytes ) || !SDL_RWread( src, &color, 1, 1 ) )
{
error="error reading BODY chunk";
error="error reading BODY chunk";
goto done;
}
memset( ptr, color, count );
@@ -384,7 +386,7 @@ SDL_Surface *IMG_LoadLBM_RW( SDL_RWops *src )
{
memset( ptr, 0, 8 );
for ( plane=0; plane < nbplanes; plane++ )
for ( plane=0; plane < (nbplanes + stencil); plane++ )
{
color = *( MiniBuf + i + ( plane * bytesperline ) );
msk = 0x80;

View File

@@ -71,6 +71,10 @@
#endif
#include <png.h>
/* Check for the older version of libpng */
#if (PNG_LIBPNG_VER_MAJOR == 1) && (PNG_LIBPNG_VER_MINOR < 4)
#define LIBPNG_VERSION_12
#endif
static struct {
int loaded;
@@ -80,6 +84,8 @@ static struct {
void (*png_destroy_read_struct) (png_structpp png_ptr_ptr, png_infopp info_ptr_ptr, png_infopp end_info_ptr_ptr);
png_uint_32 (*png_get_IHDR) (png_structp png_ptr, png_infop info_ptr, png_uint_32 *width, png_uint_32 *height, int *bit_depth, int *color_type, int *interlace_method, int *compression_method, int *filter_method);
png_voidp (*png_get_io_ptr) (png_structp png_ptr);
png_byte (*png_get_channels) (png_structp png_ptr, png_infop info_ptr);
png_uint_32 (*png_get_PLTE) (png_structp png_ptr, png_infop info_ptr, png_colorp *palette, int *num_palette);
png_uint_32 (*png_get_tRNS) (png_structp png_ptr, png_infop info_ptr, png_bytep *trans, int *num_trans, png_color_16p *trans_values);
png_uint_32 (*png_get_valid) (png_structp png_ptr, png_infop info_ptr, png_uint_32 flag);
void (*png_read_image) (png_structp png_ptr, png_bytepp image);
@@ -91,6 +97,9 @@ static struct {
void (*png_set_read_fn) (png_structp png_ptr, png_voidp io_ptr, png_rw_ptr read_data_fn);
void (*png_set_strip_16) (png_structp png_ptr);
int (*png_sig_cmp) (png_bytep sig, png_size_t start, png_size_t num_to_check);
#ifndef LIBPNG_VERSION_12
jmp_buf* (*png_set_longjmp_fn) (png_structp, png_longjmp_ptr, size_t);
#endif
} lib;
#ifdef LOAD_PNG_DYNAMIC
@@ -129,6 +138,13 @@ int IMG_InitPNG()
SDL_UnloadObject(lib.handle);
return -1;
}
lib.png_get_channels =
(png_byte (*) (png_structp, png_infop))
SDL_LoadFunction(lib.handle, "png_get_channels");
if ( lib.png_get_channels == NULL ) {
SDL_UnloadObject(lib.handle);
return -1;
}
lib.png_get_io_ptr =
(png_voidp (*) (png_structp))
SDL_LoadFunction(lib.handle, "png_get_io_ptr");
@@ -136,6 +152,13 @@ int IMG_InitPNG()
SDL_UnloadObject(lib.handle);
return -1;
}
lib.png_get_PLTE =
(png_uint_32 (*) (png_structp, png_infop, png_colorp *, int *))
SDL_LoadFunction(lib.handle, "png_get_PLTE");
if ( lib.png_get_PLTE == NULL ) {
SDL_UnloadObject(lib.handle);
return -1;
}
lib.png_get_tRNS =
(png_uint_32 (*) (png_structp, png_infop, png_bytep *, int *, png_color_16p *))
SDL_LoadFunction(lib.handle, "png_get_tRNS");
@@ -213,6 +236,15 @@ int IMG_InitPNG()
SDL_UnloadObject(lib.handle);
return -1;
}
#ifndef LIBPNG_VERSION_12
lib.png_set_longjmp_fn =
(jmp_buf * (*) (png_structp, png_longjmp_ptr, size_t))
SDL_LoadFunction(lib.handle, "png_set_longjmp_fn");
if ( lib.png_set_longjmp_fn == NULL ) {
SDL_UnloadObject(lib.handle);
return -1;
}
#endif
}
++lib.loaded;
@@ -236,7 +268,9 @@ int IMG_InitPNG()
lib.png_create_read_struct = png_create_read_struct;
lib.png_destroy_read_struct = png_destroy_read_struct;
lib.png_get_IHDR = png_get_IHDR;
lib.png_get_channels = png_get_channels;
lib.png_get_io_ptr = png_get_io_ptr;
lib.png_get_PLTE = png_get_PLTE;
lib.png_get_tRNS = png_get_tRNS;
lib.png_get_valid = png_get_valid;
lib.png_read_image = png_read_image;
@@ -248,6 +282,9 @@ int IMG_InitPNG()
lib.png_set_read_fn = png_set_read_fn;
lib.png_set_strip_16 = png_set_strip_16;
lib.png_sig_cmp = png_sig_cmp;
#ifndef LIBPNG_VERSION_12
lib.png_set_longjmp_fn = png_set_longjmp_fn;
#endif
}
++lib.loaded;
@@ -347,7 +384,12 @@ SDL_Surface *IMG_LoadPNG_RW(SDL_RWops *src)
* the normal method of doing things with libpng). REQUIRED unless you
* set up your own error handlers in png_create_read_struct() earlier.
*/
if ( setjmp(png_ptr->jmpbuf) ) {
#ifndef LIBPNG_VERSION_12
if ( setjmp(*lib.png_set_longjmp_fn(png_ptr, longjmp, sizeof (jmp_buf))) )
#else
if ( setjmp(png_ptr->jmpbuf) )
#endif
{
error = "Error reading the PNG file.";
goto done;
}
@@ -416,9 +458,9 @@ SDL_Surface *IMG_LoadPNG_RW(SDL_RWops *src)
Rmask = 0x000000FF;
Gmask = 0x0000FF00;
Bmask = 0x00FF0000;
Amask = (info_ptr->channels == 4) ? 0xFF000000 : 0;
Amask = (lib.png_get_channels(png_ptr, info_ptr) == 4) ? 0xFF000000 : 0;
} else {
int s = (info_ptr->channels == 4) ? 0 : 8;
int s = (lib.png_get_channels(png_ptr, info_ptr) == 4) ? 0 : 8;
Rmask = 0xFF000000 >> s;
Gmask = 0x00FF0000 >> s;
Bmask = 0x0000FF00 >> s;
@@ -426,7 +468,7 @@ SDL_Surface *IMG_LoadPNG_RW(SDL_RWops *src)
}
}
surface = SDL_AllocSurface(SDL_SWSURFACE, width, height,
bit_depth*info_ptr->channels, Rmask,Gmask,Bmask,Amask);
bit_depth*lib.png_get_channels(png_ptr, info_ptr), Rmask,Gmask,Bmask,Amask);
if ( surface == NULL ) {
error = "Out of memory";
goto done;
@@ -467,6 +509,9 @@ SDL_Surface *IMG_LoadPNG_RW(SDL_RWops *src)
/* Load the palette, if any */
palette = surface->format->palette;
if ( palette ) {
int png_num_palette;
png_colorp png_palette;
lib.png_get_PLTE(png_ptr, info_ptr, &png_palette, &png_num_palette);
if(color_type == PNG_COLOR_TYPE_GRAY) {
palette->ncolors = 256;
for(i = 0; i < 256; i++) {
@@ -474,12 +519,12 @@ SDL_Surface *IMG_LoadPNG_RW(SDL_RWops *src)
palette->colors[i].g = i;
palette->colors[i].b = i;
}
} else if (info_ptr->num_palette > 0 ) {
palette->ncolors = info_ptr->num_palette;
for( i=0; i<info_ptr->num_palette; ++i ) {
palette->colors[i].b = info_ptr->palette[i].blue;
palette->colors[i].g = info_ptr->palette[i].green;
palette->colors[i].r = info_ptr->palette[i].red;
} else if (png_num_palette > 0 ) {
palette->ncolors = png_num_palette;
for( i=0; i<png_num_palette; ++i ) {
palette->colors[i].b = png_palette[i].blue;
palette->colors[i].g = png_palette[i].green;
palette->colors[i].r = png_palette[i].red;
}
}
}

View File

@@ -123,8 +123,10 @@ static struct color_hash *create_colorhash(int maxnum)
return NULL;
memset(hash->table, 0, bytes);
hash->entries = malloc(maxnum * sizeof(struct hash_entry));
if(!hash->entries)
if(!hash->entries) {
free(hash->table);
return NULL;
}
hash->next_free = hash->entries;
return hash;
}
@@ -259,11 +261,13 @@ static char *get_next_line(char ***lines, SDL_RWops *src, int len)
len += 4; /* "\",\n\0" */
if(len > buflen){
buflen = len;
linebuf = realloc(linebuf, buflen);
if(!linebuf) {
char *linebufnew = realloc(linebuf, buflen);
if(!linebufnew) {
free(linebuf);
error = "Out of memory";
return NULL;
}
linebuf = linebufnew;
}
if(SDL_RWread(src, linebuf, len - 1, 1) <= 0) {
error = "Premature end of data";
@@ -277,11 +281,13 @@ static char *get_next_line(char ***lines, SDL_RWops *src, int len)
if(buflen == 0)
buflen = 16;
buflen *= 2;
linebuf = realloc(linebuf, buflen);
if(!linebuf) {
char *linebufnew = realloc(linebuf, buflen);
if(!linebufnew) {
free(linebuf);
error = "Out of memory";
return NULL;
}
linebuf = linebufnew;
}
if(SDL_RWread(src, linebuf + n, 1, 1) <= 0) {
error = "Premature end of data";

View File

@@ -38,7 +38,7 @@ extern "C" {
*/
#define SDL_IMAGE_MAJOR_VERSION 1
#define SDL_IMAGE_MINOR_VERSION 2
#define SDL_IMAGE_PATCHLEVEL 10
#define SDL_IMAGE_PATCHLEVEL 11
/* This macro can be used to fill a version structure with the compile-time
* version of the SDL_image library.

View File

@@ -1,164 +0,0 @@
# Makefile to build and install the SDL_mixer library
top_builddir = .
srcdir = .
objects = build
prefix = /usr/local
exec_prefix = ${prefix}
bindir = $(DESTDIR)${exec_prefix}/bin
libdir = $(DESTDIR)${exec_prefix}/lib
includedir = $(DESTDIR)${prefix}/include
datarootdir = $(DESTDIR)${prefix}/share
datadir = ${datarootdir}
mandir = ${datarootdir}/man
auxdir = ./build-scripts
distpath = $(srcdir)/..
distdir = SDL_mixer-1.2.11
distfile = $(distdir).tar.gz
EXE =
SHELL = /bin/bash
CC = gcc
CFLAGS = -g -O2
EXTRA_CFLAGS = -D_GNU_SOURCE=1 -D_GNU_SOURCE=1 -D_REENTRANT -I/usr/include/SDL -DWAV_MUSIC -DMP3_MUSIC -I/usr/include/smpeg -I/usr/include/SDL -D_GNU_SOURCE=1 -D_REENTRANT -DMP3_DYNAMIC=\"libsmpeg-0.4.so.0\"
LDFLAGS =
EXTRA_LDFLAGS = -lSDL
LIBTOOL = $(SHELL) $(top_builddir)/libtool
INSTALL = /usr/bin/install -c
AR = ar
RANLIB = ranlib
WINDRES =
SDL_CFLAGS = -D_GNU_SOURCE=1 -D_REENTRANT -I/usr/include/SDL
SDL_LIBS = -lSDL
TARGET = libSDL_mixer.la
OBJECTS = $(objects)/effect_position.lo $(objects)/effect_stereoreverse.lo $(objects)/effects_internal.lo $(objects)/load_aiff.lo $(objects)/load_voc.lo $(objects)/mixer.lo $(objects)/music.lo $(objects)/wavestream.lo $(objects)/dynamic_mp3.lo
VERSION_OBJECTS =
PLAYWAVE_OBJECTS = $(objects)/playwave.lo
PLAYMUS_OBJECTS = $(objects)/playmus.lo
DIST = CHANGES COPYING CWProjects.sea.bin MPWmake.sea.bin Makefile.in SDL_mixer.pc.in README SDL_mixer.h SDL_mixer.qpg.in SDL_mixer.spec SDL_mixer.spec.in VisualC.zip Watcom-OS2.zip Xcode.tar.gz acinclude autogen.sh build-scripts configure configure.in dynamic_flac.c dynamic_flac.h dynamic_mod.c dynamic_mod.h dynamic_mp3.c dynamic_mp3.h dynamic_ogg.c dynamic_ogg.h effect_position.c effect_stereoreverse.c effects_internal.c effects_internal.h gcc-fat.sh libmikmod-3.1.12.zip load_aiff.c load_aiff.h load_flac.c load_flac.h load_ogg.c load_ogg.h load_voc.c load_voc.h mixer.c music.c music_cmd.c music_cmd.h music_flac.c music_flac.h music_mad.c music_mad.h music_mod.c music_mod.h music_ogg.c music_ogg.h native_midi native_midi_gpl playmus.c playwave.c timidity wavestream.c wavestream.h version.rc
LT_AGE = 10
LT_CURRENT = 10
LT_RELEASE = 1.2
LT_REVISION = 1
LT_LDFLAGS = -no-undefined -rpath $(libdir) -release $(LT_RELEASE) -version-info $(LT_CURRENT):$(LT_REVISION):$(LT_AGE)
all: $(srcdir)/configure Makefile $(objects) $(objects)/$(TARGET) $(objects)/playwave$(EXE) $(objects)/playmus$(EXE)
$(srcdir)/configure: $(srcdir)/configure.in
@echo "Warning, configure.in is out of date"
#(cd $(srcdir) && sh autogen.sh && sh configure)
@sleep 3
Makefile: $(srcdir)/Makefile.in
$(SHELL) config.status $@
$(objects):
$(SHELL) $(auxdir)/mkinstalldirs $@
.PHONY: all install install-hdrs install-lib install-bin uninstall uninstall-hdrs uninstall-lib uninstall-bin clean distclean dist
-include $(OBJECTS:.lo=.d)
$(objects)/effect_position.lo: ./effect_position.c
$(LIBTOOL) --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
$(objects)/effect_stereoreverse.lo: ./effect_stereoreverse.c
$(LIBTOOL) --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
$(objects)/effects_internal.lo: ./effects_internal.c
$(LIBTOOL) --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
$(objects)/load_aiff.lo: ./load_aiff.c
$(LIBTOOL) --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
$(objects)/load_voc.lo: ./load_voc.c
$(LIBTOOL) --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
$(objects)/mixer.lo: ./mixer.c
$(LIBTOOL) --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
$(objects)/music.lo: ./music.c
$(LIBTOOL) --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
$(objects)/wavestream.lo: ./wavestream.c
$(LIBTOOL) --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
$(objects)/dynamic_mp3.lo: ./dynamic_mp3.c
$(LIBTOOL) --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
-include $(PLAYWAVE_OBJECTS:.lo=.d)
$(objects)/playwave.lo: ./playwave.c
$(LIBTOOL) --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
-include $(PLAYMUS_OBJECTS:.lo=.d)
$(objects)/playmus.lo: ./playmus.c
$(LIBTOOL) --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
$(objects)/$(TARGET): $(OBJECTS) $(VERSION_OBJECTS)
$(LIBTOOL) --mode=link $(CC) -o $@ $(OBJECTS) $(VERSION_OBJECTS) $(LDFLAGS) $(EXTRA_LDFLAGS) $(LT_LDFLAGS)
$(objects)/playwave$(EXE): $(objects)/playwave.lo $(objects)/$(TARGET)
$(LIBTOOL) --mode=link $(CC) -o $@ $(objects)/playwave.lo $(SDL_CFLAGS) $(SDL_LIBS) $(objects)/$(TARGET)
$(objects)/playmus$(EXE): $(objects)/playmus.lo $(objects)/$(TARGET)
$(LIBTOOL) --mode=link $(CC) -o $@ $(objects)/playmus.lo $(SDL_CFLAGS) $(SDL_LIBS) $(objects)/$(TARGET)
install: all install-hdrs install-lib #install-bin
install-hdrs:
$(SHELL) $(auxdir)/mkinstalldirs $(includedir)/SDL
for src in $(srcdir)/SDL_mixer.h; do \
file=`echo $$src | sed -e 's|^.*/||'`; \
$(INSTALL) -m 644 $$src $(includedir)/SDL/$$file; \
done
$(SHELL) $(auxdir)/mkinstalldirs $(libdir)/pkgconfig
$(INSTALL) -m 644 SDL_mixer.pc $(libdir)/pkgconfig/
install-lib: $(objects) $(objects)/$(TARGET)
$(SHELL) $(auxdir)/mkinstalldirs $(libdir)
$(LIBTOOL) --mode=install $(INSTALL) $(objects)/$(TARGET) $(libdir)/$(TARGET)
install-bin:
$(SHELL) $(auxdir)/mkinstalldirs $(bindir)
$(LIBTOOL) --mode=install $(INSTALL) -m 755 $(objects)/playwave$(EXE) $(bindir)/playwave$(EXE)
$(LIBTOOL) --mode=install $(INSTALL) -m 755 $(objects)/playmus$(EXE) $(bindir)/playmus$(EXE)
uninstall: uninstall-hdrs uninstall-lib uninstall-bin
uninstall-hdrs:
for src in $(srcdir)/SDL_mixer.h; do \
file=`echo $$src | sed -e 's|^.*/||'`; \
rm -f $(includedir)/SDL/$$file; \
done
-rmdir $(includedir)/SDL
rm -f $(libdir)/pkgconfig/SDL_mixer.pc
-rmdir $(libdir)/pkgconfig
uninstall-lib:
$(LIBTOOL) --mode=uninstall rm -f $(libdir)/$(TARGET)
uninstall-bin:
rm -f $(bindir)/playwave$(EXE)
rm -f $(bindir)/playmus$(EXE)
clean:
rm -rf $(objects)
distclean: clean
rm -f Makefile
rm -f SDL_mixer.qpg
rm -f config.status config.cache config.log libtool
rm -f SDL_mixer.pc
rm -rf $(srcdir)/autom4te*
find $(srcdir) \( \
-name '*~' -o \
-name '*.bak' -o \
-name '*.old' -o \
-name '*.rej' -o \
-name '*.orig' -o \
-name '.#*' \) \
-exec rm -f {} \;
dist $(distfile):
$(SHELL) $(auxdir)/mkinstalldirs $(distdir)
tar cf - $(DIST) | (cd $(distdir); tar xf -)
rm -rf `find $(distdir) -name .svn`
rm -f `find $(distdir) -name '.#*'`
tar cvf - $(distdir) | gzip --best >$(distfile)
rm -rf $(distdir)
rpm: $(distfile)
rpmbuild -ta $?

View File

@@ -1,142 +0,0 @@
# Makefile to build and install the SDL_mixer library
top_builddir = .
srcdir = @srcdir@
objects = build
prefix = @prefix@
exec_prefix = @exec_prefix@
bindir = $(DESTDIR)@bindir@
libdir = $(DESTDIR)@libdir@
includedir = $(DESTDIR)@includedir@
datarootdir = $(DESTDIR)@datarootdir@
datadir = @datadir@
mandir = @mandir@
auxdir = @ac_aux_dir@
distpath = $(srcdir)/..
distdir = SDL_mixer-@VERSION@
distfile = $(distdir).tar.gz
@SET_MAKE@
EXE = @EXE@
SHELL = @SHELL@
CC = @CC@
CFLAGS = @BUILD_CFLAGS@
EXTRA_CFLAGS = @EXTRA_CFLAGS@
LDFLAGS = @BUILD_LDFLAGS@
EXTRA_LDFLAGS = @EXTRA_LDFLAGS@
LIBTOOL = @LIBTOOL@
INSTALL = @INSTALL@
AR = @AR@
RANLIB = @RANLIB@
WINDRES = @WINDRES@
SDL_CFLAGS = @SDL_CFLAGS@
SDL_LIBS = @SDL_LIBS@
TARGET = libSDL_mixer.la
OBJECTS = @OBJECTS@
VERSION_OBJECTS = @VERSION_OBJECTS@
PLAYWAVE_OBJECTS = @PLAYWAVE_OBJECTS@
PLAYMUS_OBJECTS = @PLAYMUS_OBJECTS@
DIST = CHANGES COPYING CWProjects.sea.bin MPWmake.sea.bin Makefile.in SDL_mixer.pc.in README SDL_mixer.h SDL_mixer.qpg.in SDL_mixer.spec SDL_mixer.spec.in VisualC.zip Watcom-OS2.zip Xcode.tar.gz acinclude autogen.sh build-scripts configure configure.in dynamic_flac.c dynamic_flac.h dynamic_mod.c dynamic_mod.h dynamic_mp3.c dynamic_mp3.h dynamic_ogg.c dynamic_ogg.h effect_position.c effect_stereoreverse.c effects_internal.c effects_internal.h gcc-fat.sh libmikmod-3.1.12.zip load_aiff.c load_aiff.h load_flac.c load_flac.h load_ogg.c load_ogg.h load_voc.c load_voc.h mixer.c music.c music_cmd.c music_cmd.h music_flac.c music_flac.h music_mad.c music_mad.h music_mod.c music_mod.h music_ogg.c music_ogg.h native_midi native_midi_gpl playmus.c playwave.c timidity wavestream.c wavestream.h version.rc
LT_AGE = @LT_AGE@
LT_CURRENT = @LT_CURRENT@
LT_RELEASE = @LT_RELEASE@
LT_REVISION = @LT_REVISION@
LT_LDFLAGS = -no-undefined -rpath $(libdir) -release $(LT_RELEASE) -version-info $(LT_CURRENT):$(LT_REVISION):$(LT_AGE)
all: $(srcdir)/configure Makefile $(objects) $(objects)/$(TARGET) $(objects)/playwave$(EXE) $(objects)/playmus$(EXE)
$(srcdir)/configure: $(srcdir)/configure.in
@echo "Warning, configure.in is out of date"
#(cd $(srcdir) && sh autogen.sh && sh configure)
@sleep 3
Makefile: $(srcdir)/Makefile.in
$(SHELL) config.status $@
$(objects):
$(SHELL) $(auxdir)/mkinstalldirs $@
.PHONY: all install install-hdrs install-lib install-bin uninstall uninstall-hdrs uninstall-lib uninstall-bin clean distclean dist
-include $(OBJECTS:.lo=.d)
@DEPENDS@
@VERSION_DEPENDS@
-include $(PLAYWAVE_OBJECTS:.lo=.d)
@PLAYWAVE_DEPENDS@
-include $(PLAYMUS_OBJECTS:.lo=.d)
@PLAYMUS_DEPENDS@
$(objects)/$(TARGET): $(OBJECTS) $(VERSION_OBJECTS)
$(LIBTOOL) --mode=link $(CC) -o $@ $(OBJECTS) $(VERSION_OBJECTS) $(LDFLAGS) $(EXTRA_LDFLAGS) $(LT_LDFLAGS)
$(objects)/playwave$(EXE): $(objects)/playwave.lo $(objects)/$(TARGET)
$(LIBTOOL) --mode=link $(CC) -o $@ $(objects)/playwave.lo $(SDL_CFLAGS) $(SDL_LIBS) $(objects)/$(TARGET)
$(objects)/playmus$(EXE): $(objects)/playmus.lo $(objects)/$(TARGET)
$(LIBTOOL) --mode=link $(CC) -o $@ $(objects)/playmus.lo $(SDL_CFLAGS) $(SDL_LIBS) $(objects)/$(TARGET)
install: all install-hdrs install-lib #install-bin
install-hdrs:
$(SHELL) $(auxdir)/mkinstalldirs $(includedir)/SDL
for src in $(srcdir)/SDL_mixer.h; do \
file=`echo $$src | sed -e 's|^.*/||'`; \
$(INSTALL) -m 644 $$src $(includedir)/SDL/$$file; \
done
$(SHELL) $(auxdir)/mkinstalldirs $(libdir)/pkgconfig
$(INSTALL) -m 644 SDL_mixer.pc $(libdir)/pkgconfig/
install-lib: $(objects) $(objects)/$(TARGET)
$(SHELL) $(auxdir)/mkinstalldirs $(libdir)
$(LIBTOOL) --mode=install $(INSTALL) $(objects)/$(TARGET) $(libdir)/$(TARGET)
install-bin:
$(SHELL) $(auxdir)/mkinstalldirs $(bindir)
$(LIBTOOL) --mode=install $(INSTALL) -m 755 $(objects)/playwave$(EXE) $(bindir)/playwave$(EXE)
$(LIBTOOL) --mode=install $(INSTALL) -m 755 $(objects)/playmus$(EXE) $(bindir)/playmus$(EXE)
uninstall: uninstall-hdrs uninstall-lib uninstall-bin
uninstall-hdrs:
for src in $(srcdir)/SDL_mixer.h; do \
file=`echo $$src | sed -e 's|^.*/||'`; \
rm -f $(includedir)/SDL/$$file; \
done
-rmdir $(includedir)/SDL
rm -f $(libdir)/pkgconfig/SDL_mixer.pc
-rmdir $(libdir)/pkgconfig
uninstall-lib:
$(LIBTOOL) --mode=uninstall rm -f $(libdir)/$(TARGET)
uninstall-bin:
rm -f $(bindir)/playwave$(EXE)
rm -f $(bindir)/playmus$(EXE)
clean:
rm -rf $(objects)
distclean: clean
rm -f Makefile
rm -f SDL_mixer.qpg
rm -f config.status config.cache config.log libtool
rm -f SDL_mixer.pc
rm -rf $(srcdir)/autom4te*
find $(srcdir) \( \
-name '*~' -o \
-name '*.bak' -o \
-name '*.old' -o \
-name '*.rej' -o \
-name '*.orig' -o \
-name '.#*' \) \
-exec rm -f {} \;
dist $(distfile):
$(SHELL) $(auxdir)/mkinstalldirs $(distdir)
tar cf - $(DIST) | (cd $(distdir); tar xf -)
rm -rf `find $(distdir) -name .svn`
rm -f `find $(distdir) -name '.#*'`
tar cvf - $(distdir) | gzip --best >$(distfile)
rm -rf $(distdir)
rpm: $(distfile)
rpmbuild -ta $?

View File

@@ -1,12 +0,0 @@
prefix=/usr/local
exec_prefix=${prefix}
libdir=${exec_prefix}/lib
includedir=${prefix}/include
Name: SDL_mixer
Description: mixer library for Simple DirectMedia Layer
Version: 1.2.11
Requires: sdl >= 1.2.10
Libs: -L${libdir} -lSDL_mixer
Cflags: -I${includedir}/SDL

View File

@@ -1,12 +0,0 @@
prefix=@prefix@
exec_prefix=@exec_prefix@
libdir=@libdir@
includedir=@includedir@
Name: SDL_mixer
Description: mixer library for Simple DirectMedia Layer
Version: @VERSION@
Requires: sdl >= @SDL_VERSION@
Libs: -L${libdir} -lSDL_mixer
Cflags: -I${includedir}/SDL

View File

@@ -1,127 +0,0 @@
<QPG:Generation>
<QPG:Options>
<QPG:User unattended="yes" verbosity="0" listfiles="yes"/>
<QPG:Defaults type="qnx_package"/>
<QPG:Source></QPG:Source>
<QPG:Release date="today" number="+"/>
<QPG:Build></QPG:Build>
<QPG:FileSorting strip="yes"/>
<QPG:Package targets="standart"/>
<QPG:Repository generate="yes"/>
<QPG:FinalDir></QPG:FinalDir>
<QPG:Cleanup></QPG:Cleanup>
</QPG:Options>
<QPG:Responsible>
<QPG:Company>QNX.ORG.RU Community</QPG:Company>
<QPG:Department></QPG:Department>
<QPG:Group></QPG:Group>
<QPG:Team>QNX.ORG.RU Team</QPG:Team>
<QPG:Employee>Mike Gorchak</QPG:Employee>
<QPG:EmailAddress>mike@malva.ua</QPG:EmailAddress>
</QPG:Responsible>
<QPG:Values>
<QPG:Files>
<QPG:Add file="./COPYING" install="LicenseUrl/" handling="repdata"/>
<QPG:Add permissions="0755" file="./.libs/libSDL_mixer-1.2.so.2" install="/opt/lib/"/>
<QPG:Add filetype="symlink" file="libSDL_mixer.so" install="/opt/lib/" linkto="libSDL_mixer-1.2.so.2"/>
<QPG:Add filetype="symlink" file="libSDL_mixer-1.1.so.2" install="/opt/lib/" linkto="libSDL_mixer-1.2.so.2"/>
<QPG:Add filetype="symlink" file="libSDL_mixer-1.0.so.2" install="/opt/lib/" linkto="libSDL_mixer-1.2.so.2"/>
<QPG:Add permissions="0644" file="./.libs/libSDL_mixer.a" install="/opt/lib/"/>
<QPG:Add permissions="0644" file="./.libs/libSDL_mixer.lai" install="/opt/lib/libSDL_mixer.la"/>
<QPG:Add permissions="0644" file="./SDL_mixer.h" install="/opt/include/SDL/"/>
<QPG:Add permissions="0644" file="./CHANGES" install="/usr/doc/SDL12_mixer/"/>
<QPG:Add permissions="0644" file="./COPYING" install="/usr/doc/SDL12_mixer/"/>
<QPG:Add permissions="0644" file="./README" install="/usr/doc/SDL12_mixer/"/>
</QPG:Files>
<QPG:PackageFilter>
<QPM:PackageManifest>
<QPM:PackageDescription>
<QPM:PackageType>Library</QPM:PackageType>
<QPM:PackageName>SDL_mixer</QPM:PackageName>
<QPM:PackageReleaseNumber>1</QPM:PackageReleaseNumber>
<QPM:PackageRepository>http://qnx.org.ru/repository</QPM:PackageRepository>
<QPM:FileVersion>2.0</QPM:FileVersion>
</QPM:PackageDescription>
<QPM:ProductDescription>
<QPM:ProductName>SDL_mixer</QPM:ProductName>
<QPM:ProductIdentifier>SDL_mixer</QPM:ProductIdentifier>
<QPM:ProductEmail>slouken@libsdl.org</QPM:ProductEmail>
<QPM:VendorName>public</QPM:VendorName>
<QPM:VendorInstallName>public</QPM:VendorInstallName>
<QPM:VendorURL>http://www.libsdl.org</QPM:VendorURL>
<QPM:VendorEmbedURL/>
<QPM:VendorEmail>slouken@libsdl.org</QPM:VendorEmail>
<QPM:AuthorName>Sam Lantinga, Stephane Peter and Ryan Gordon</QPM:AuthorName>
<QPM:AuthorURL>http://www.libsdl.org</QPM:AuthorURL>
<QPM:AuthorEmbedURL/>
<QPM:AuthorEmail>slouken@libsdl.org</QPM:AuthorEmail>
<QPM:ProductIconSmall/>
<QPM:ProductIconLarge/>
<QPM:ProductDescriptionShort>SDL_mixer - is simple multi-channel audio mixer. The mixer can currently load Microsoft WAVE files and Creative Labs VOC files as audio samples, and can load MIDI files via Timidity and the various music formats via MikMod.</QPM:ProductDescriptionShort>
<QPM:ProductDescriptionLong>SDL_mixer - is simple multi-channel audio mixer. The mixer can currently load Microsoft WAVE files and Creative Labs VOC files as audio samples, and can load MIDI files via Timidity and the following music formats via MikMod: .MOD .S3M .IT .XM.</QPM:ProductDescriptionLong>
<QPM:ProductDescriptionURL>http://www.libsdl.org/projects/SDL_mixer</QPM:ProductDescriptionURL>
<QPM:ProductDescriptionEmbedURL/>
</QPM:ProductDescription>
<QPM:ReleaseDescription>
<QPM:ReleaseVersion>1.2.11</QPM:ReleaseVersion>
<QPM:ReleaseUrgency>High</QPM:ReleaseUrgency>
<QPM:ReleaseStability>Stable</QPM:ReleaseStability>
<QPM:ReleaseNoteMinor/>
<QPM:ReleaseNoteMajor/>
<QPM:ReleaseBuild>1</QPM:ReleaseBuild>
<QPM:CountryExclude/>
<QPM:ReleaseCopyright>GNU Lesser General Public License</QPM:ReleaseCopyright>
</QPM:ReleaseDescription>
<QPM:ContentDescription>
<QPM:ContentTopic xmlmultiple="true">Software Development/Libraries and Extensions/C Libraries</QPM:ContentTopic>
<QPM:ContentKeyword>SDL, music, sound, WAV, VOC, MIDI, MID, MOD, S3M, XM, IT</QPM:ContentKeyword>
<QPM:TargetOS>qnx6</QPM:TargetOS>
<QPM:HostOS>none</QPM:HostOS>
<QPM:DisplayEnvironment xmlmultiple="true">Console</QPM:DisplayEnvironment>
<QPM:TargetAudience xmlmultiple="true">Developer</QPM:TargetAudience>
<QPM:TargetAudience xmlmultiple="true">User</QPM:TargetAudience>
</QPM:ContentDescription>
<QPM:LicenseUrl>repdata://LicenseUrl/COPYING</QPM:LicenseUrl>
</QPM:PackageManifest>
</QPG:PackageFilter>
<QPG:PackageFilter proc="none" target="none">
<QPM:PackageManifest>
<QPM:ProductInstallationDependencies>
<QPM:ProductRequirements></QPM:ProductRequirements>
</QPM:ProductInstallationDependencies>
</QPM:PackageManifest>
</QPG:PackageFilter>
<QPG:PackageFilter proc="x86" target="none">
<QPM:PackageManifest>
<QPM:ProductInstallationDependencies>
<QPM:ProductRequirements></QPM:ProductRequirements>
</QPM:ProductInstallationDependencies>
</QPM:PackageManifest>
</QPG:PackageFilter>
<QPG:PackageFilter proc="none" target="x86">
<QPM:PackageManifest>
<QPM:ProductInstallationDependencies>
<QPM:ProductRequirements></QPM:ProductRequirements>
</QPM:ProductInstallationDependencies>
</QPM:PackageManifest>
</QPG:PackageFilter>
<QPG:PackageFilter proc="x86" target="x86">
<QPM:PackageManifest>
<QPM:ProductInstallationDependencies>
<QPM:ProductRequirements></QPM:ProductRequirements>
</QPM:ProductInstallationDependencies>
</QPM:PackageManifest>
</QPG:PackageFilter>
</QPG:Values>
</QPG:Generation>

View File

@@ -1,127 +0,0 @@
<QPG:Generation>
<QPG:Options>
<QPG:User unattended="yes" verbosity="0" listfiles="yes"/>
<QPG:Defaults type="qnx_package"/>
<QPG:Source></QPG:Source>
<QPG:Release date="today" number="+"/>
<QPG:Build></QPG:Build>
<QPG:FileSorting strip="yes"/>
<QPG:Package targets="standart"/>
<QPG:Repository generate="yes"/>
<QPG:FinalDir></QPG:FinalDir>
<QPG:Cleanup></QPG:Cleanup>
</QPG:Options>
<QPG:Responsible>
<QPG:Company>QNX.ORG.RU Community</QPG:Company>
<QPG:Department></QPG:Department>
<QPG:Group></QPG:Group>
<QPG:Team>QNX.ORG.RU Team</QPG:Team>
<QPG:Employee>Mike Gorchak</QPG:Employee>
<QPG:EmailAddress>mike@malva.ua</QPG:EmailAddress>
</QPG:Responsible>
<QPG:Values>
<QPG:Files>
<QPG:Add file="./COPYING" install="LicenseUrl/" handling="repdata"/>
<QPG:Add permissions="0755" file="./.libs/libSDL_mixer-1.2.so.2" install="/opt/lib/"/>
<QPG:Add filetype="symlink" file="libSDL_mixer.so" install="/opt/lib/" linkto="libSDL_mixer-1.2.so.2"/>
<QPG:Add filetype="symlink" file="libSDL_mixer-1.1.so.2" install="/opt/lib/" linkto="libSDL_mixer-1.2.so.2"/>
<QPG:Add filetype="symlink" file="libSDL_mixer-1.0.so.2" install="/opt/lib/" linkto="libSDL_mixer-1.2.so.2"/>
<QPG:Add permissions="0644" file="./.libs/libSDL_mixer.a" install="/opt/lib/"/>
<QPG:Add permissions="0644" file="./.libs/libSDL_mixer.lai" install="/opt/lib/libSDL_mixer.la"/>
<QPG:Add permissions="0644" file="./SDL_mixer.h" install="/opt/include/SDL/"/>
<QPG:Add permissions="0644" file="./CHANGES" install="/usr/doc/SDL12_mixer/"/>
<QPG:Add permissions="0644" file="./COPYING" install="/usr/doc/SDL12_mixer/"/>
<QPG:Add permissions="0644" file="./README" install="/usr/doc/SDL12_mixer/"/>
</QPG:Files>
<QPG:PackageFilter>
<QPM:PackageManifest>
<QPM:PackageDescription>
<QPM:PackageType>Library</QPM:PackageType>
<QPM:PackageName>SDL_mixer</QPM:PackageName>
<QPM:PackageReleaseNumber>1</QPM:PackageReleaseNumber>
<QPM:PackageRepository>http://qnx.org.ru/repository</QPM:PackageRepository>
<QPM:FileVersion>2.0</QPM:FileVersion>
</QPM:PackageDescription>
<QPM:ProductDescription>
<QPM:ProductName>SDL_mixer</QPM:ProductName>
<QPM:ProductIdentifier>SDL_mixer</QPM:ProductIdentifier>
<QPM:ProductEmail>slouken@libsdl.org</QPM:ProductEmail>
<QPM:VendorName>public</QPM:VendorName>
<QPM:VendorInstallName>public</QPM:VendorInstallName>
<QPM:VendorURL>http://www.libsdl.org</QPM:VendorURL>
<QPM:VendorEmbedURL/>
<QPM:VendorEmail>slouken@libsdl.org</QPM:VendorEmail>
<QPM:AuthorName>Sam Lantinga, Stephane Peter and Ryan Gordon</QPM:AuthorName>
<QPM:AuthorURL>http://www.libsdl.org</QPM:AuthorURL>
<QPM:AuthorEmbedURL/>
<QPM:AuthorEmail>slouken@libsdl.org</QPM:AuthorEmail>
<QPM:ProductIconSmall/>
<QPM:ProductIconLarge/>
<QPM:ProductDescriptionShort>SDL_mixer - is simple multi-channel audio mixer. The mixer can currently load Microsoft WAVE files and Creative Labs VOC files as audio samples, and can load MIDI files via Timidity and the various music formats via MikMod.</QPM:ProductDescriptionShort>
<QPM:ProductDescriptionLong>SDL_mixer - is simple multi-channel audio mixer. The mixer can currently load Microsoft WAVE files and Creative Labs VOC files as audio samples, and can load MIDI files via Timidity and the following music formats via MikMod: .MOD .S3M .IT .XM.</QPM:ProductDescriptionLong>
<QPM:ProductDescriptionURL>http://www.libsdl.org/projects/SDL_mixer</QPM:ProductDescriptionURL>
<QPM:ProductDescriptionEmbedURL/>
</QPM:ProductDescription>
<QPM:ReleaseDescription>
<QPM:ReleaseVersion>@VERSION@</QPM:ReleaseVersion>
<QPM:ReleaseUrgency>High</QPM:ReleaseUrgency>
<QPM:ReleaseStability>Stable</QPM:ReleaseStability>
<QPM:ReleaseNoteMinor/>
<QPM:ReleaseNoteMajor/>
<QPM:ReleaseBuild>1</QPM:ReleaseBuild>
<QPM:CountryExclude/>
<QPM:ReleaseCopyright>GNU Lesser General Public License</QPM:ReleaseCopyright>
</QPM:ReleaseDescription>
<QPM:ContentDescription>
<QPM:ContentTopic xmlmultiple="true">Software Development/Libraries and Extensions/C Libraries</QPM:ContentTopic>
<QPM:ContentKeyword>SDL, music, sound, WAV, VOC, MIDI, MID, MOD, S3M, XM, IT</QPM:ContentKeyword>
<QPM:TargetOS>qnx6</QPM:TargetOS>
<QPM:HostOS>none</QPM:HostOS>
<QPM:DisplayEnvironment xmlmultiple="true">Console</QPM:DisplayEnvironment>
<QPM:TargetAudience xmlmultiple="true">Developer</QPM:TargetAudience>
<QPM:TargetAudience xmlmultiple="true">User</QPM:TargetAudience>
</QPM:ContentDescription>
<QPM:LicenseUrl>repdata://LicenseUrl/COPYING</QPM:LicenseUrl>
</QPM:PackageManifest>
</QPG:PackageFilter>
<QPG:PackageFilter proc="none" target="none">
<QPM:PackageManifest>
<QPM:ProductInstallationDependencies>
<QPM:ProductRequirements></QPM:ProductRequirements>
</QPM:ProductInstallationDependencies>
</QPM:PackageManifest>
</QPG:PackageFilter>
<QPG:PackageFilter proc="x86" target="none">
<QPM:PackageManifest>
<QPM:ProductInstallationDependencies>
<QPM:ProductRequirements></QPM:ProductRequirements>
</QPM:ProductInstallationDependencies>
</QPM:PackageManifest>
</QPG:PackageFilter>
<QPG:PackageFilter proc="none" target="x86">
<QPM:PackageManifest>
<QPM:ProductInstallationDependencies>
<QPM:ProductRequirements></QPM:ProductRequirements>
</QPM:ProductInstallationDependencies>
</QPM:PackageManifest>
</QPG:PackageFilter>
<QPG:PackageFilter proc="x86" target="x86">
<QPM:PackageManifest>
<QPM:ProductInstallationDependencies>
<QPM:ProductRequirements></QPM:ProductRequirements>
</QPM:ProductInstallationDependencies>
</QPM:PackageManifest>
</QPG:PackageFilter>
</QPG:Values>
</QPG:Generation>

View File

@@ -1,64 +0,0 @@
%define name SDL_mixer
%define version 1.2.11
%define release 1
Summary: Simple DirectMedia Layer - Sample Mixer Library
Name: %{name}
Version: %{version}
Release: %{release}
Source0: %{name}-%{version}.tar.gz
License: LGPL
Group: System Environment/Libraries
BuildRoot: /var/tmp/%{name}-buildroot
Prefix: %{_prefix}
%description
Due to popular demand, here is a simple multi-channel audio mixer.
It supports 4 channels of 16 bit stereo audio, plus a single channel
of music, mixed by the popular MikMod MOD, Timidity MIDI, Ogg Vorbis,
Tremor, SMPEG MP3, and libmad MP3 libraries.
%package devel
Summary: Libraries, includes and more to develop SDL applications.
Group: Development/Libraries
Requires: %{name}
%description devel
Due to popular demand, here is a simple multi-channel audio mixer.
It supports 4 channels of 16 bit stereo audio, plus a single channel
of music, mixed by the popular MikMod MOD, Timidity MIDI, Ogg Vorbis,
Tremor, SMPEG MP3, and libmad MP3 libraries.
%prep
%setup
%build
CFLAGS="$RPM_OPT_FLAGS" ./configure --prefix=%{prefix}
make
%install
rm -rf $RPM_BUILD_ROOT
make install prefix=$RPM_BUILD_ROOT/%{prefix}
%clean
rm -rf $RPM_BUILD_ROOT
%files
%defattr(-,root,root)
%doc README CHANGES COPYING
%{prefix}/lib/lib*.so.*
%files devel
%defattr(-,root,root)
%{prefix}/lib/lib*.a
%{prefix}/lib/lib*.la
%{prefix}/lib/lib*.so
%{prefix}/include/SDL/
%{prefix}/lib/pkgconfig/*.pc
%changelog
* Wed Jan 19 2000 Sam Lantinga
- converted to get package information from configure
* Sun Jan 16 2000 Hakan Tandogan <hakan@iconsult.com>
- initial spec file

View File

@@ -1,64 +0,0 @@
%define name SDL_mixer
%define version @VERSION@
%define release 1
Summary: Simple DirectMedia Layer - Sample Mixer Library
Name: %{name}
Version: %{version}
Release: %{release}
Source0: %{name}-%{version}.tar.gz
License: LGPL
Group: System Environment/Libraries
BuildRoot: /var/tmp/%{name}-buildroot
Prefix: %{_prefix}
%description
Due to popular demand, here is a simple multi-channel audio mixer.
It supports 4 channels of 16 bit stereo audio, plus a single channel
of music, mixed by the popular MikMod MOD, Timidity MIDI, Ogg Vorbis,
Tremor, SMPEG MP3, and libmad MP3 libraries.
%package devel
Summary: Libraries, includes and more to develop SDL applications.
Group: Development/Libraries
Requires: %{name}
%description devel
Due to popular demand, here is a simple multi-channel audio mixer.
It supports 4 channels of 16 bit stereo audio, plus a single channel
of music, mixed by the popular MikMod MOD, Timidity MIDI, Ogg Vorbis,
Tremor, SMPEG MP3, and libmad MP3 libraries.
%prep
%setup
%build
CFLAGS="$RPM_OPT_FLAGS" ./configure --prefix=%{prefix}
make
%install
rm -rf $RPM_BUILD_ROOT
make install prefix=$RPM_BUILD_ROOT/%{prefix}
%clean
rm -rf $RPM_BUILD_ROOT
%files
%defattr(-,root,root)
%doc README CHANGES COPYING
%{prefix}/lib/lib*.so.*
%files devel
%defattr(-,root,root)
%{prefix}/lib/lib*.a
%{prefix}/lib/lib*.la
%{prefix}/lib/lib*.so
%{prefix}/include/SDL/
%{prefix}/lib/pkgconfig/*.pc
%changelog
* Wed Jan 19 2000 Sam Lantinga
- converted to get package information from configure
* Sun Jan 16 2000 Hakan Tandogan <hakan@iconsult.com>
- initial spec file

View File

@@ -1,18 +0,0 @@
#!/bin/sh
#
echo "Generating build information using autoconf"
echo "This may take a while ..."
# Regenerate configuration files
cat acinclude/* >aclocal.m4
found=false
for autoconf in autoconf autoconf259 autoconf-2.59
do if which $autoconf >/dev/null 2>&1; then $autoconf && found=true; break; fi
done
if test x$found = xfalse; then
echo "Couldn't find autoconf, aborting"
exit 1
fi
# Run configure for this platform
echo "Now you are ready to run ./configure"

View File

@@ -1,584 +0,0 @@
dnl Process this file with autoconf to produce a configure script.
AC_INIT(README)
AC_CONFIG_AUX_DIRS($srcdir/build-scripts)
dnl Set various version strings - taken gratefully from the GTk sources
# Making releases:
# MICRO_VERSION += 1;
# INTERFACE_AGE += 1;
# BINARY_AGE += 1;
# if any functions have been added, set INTERFACE_AGE to 0.
# if backwards compatibility has been broken,
# set BINARY_AGE and INTERFACE_AGE to 0.
#
MAJOR_VERSION=1
MINOR_VERSION=2
MICRO_VERSION=11
INTERFACE_AGE=1
BINARY_AGE=11
VERSION=$MAJOR_VERSION.$MINOR_VERSION.$MICRO_VERSION
AC_SUBST(MAJOR_VERSION)
AC_SUBST(MINOR_VERSION)
AC_SUBST(MICRO_VERSION)
AC_SUBST(INTERFACE_AGE)
AC_SUBST(BINARY_AGE)
AC_SUBST(VERSION)
# libtool versioning
LT_INIT([win32-dll])
LT_RELEASE=$MAJOR_VERSION.$MINOR_VERSION
LT_CURRENT=`expr $MICRO_VERSION - $INTERFACE_AGE`
LT_REVISION=$INTERFACE_AGE
LT_AGE=`expr $BINARY_AGE - $INTERFACE_AGE`
m4_pattern_allow([^LT_])
AC_SUBST(LT_RELEASE)
AC_SUBST(LT_CURRENT)
AC_SUBST(LT_REVISION)
AC_SUBST(LT_AGE)
dnl Detect the canonical build and host environments
AC_CONFIG_AUX_DIRS($srcdir/build-scripts)
dnl AC_CANONICAL_HOST
dnl Check for tools
AC_PROG_LIBTOOL
AC_PROG_CC
AC_PROG_INSTALL
AC_PROG_MAKE_SET
if test -z "$host_alias"; then
hostaliaswindres=
else
hostaliaswindres="$host_alias-windres"
fi
AC_CHECK_PROGS(WINDRES, [windres $hostaliaswindres $host_os-windres])
dnl Set up the compiler and linker flags
case "$host" in
*-*-cygwin*)
# We build SDL on cygwin without the UNIX emulation layer
BASE_CFLAGS="-I/usr/include/mingw -mno-cygwin"
BASE_LDFLAGS="-mno-cygwin"
;;
*)
BASE_CFLAGS="-D_GNU_SOURCE=1"
BASE_LDFLAGS=""
;;
esac
BUILD_CFLAGS="$CFLAGS $CPPFLAGS"
EXTRA_CFLAGS="$INCLUDE $BASE_CFLAGS"
BUILD_LDFLAGS="$LDFLAGS"
EXTRA_LDFLAGS="$BASE_LDFLAGS"
## These are common directories to find software packages
#for path in /usr/freeware /usr/pkg /usr/local; do
# if test -d $path/include; then
# EXTRA_CFLAGS="$EXTRA_CFLAGS -I$path/include"
# fi
# if test -d $path/lib; then
# EXTRA_LDFLAGS="$EXTRA_LDFLAGS -L$path/lib"
# fi
#done
CPPFLAGS="$CPPFLAGS $EXTRA_CFLAGS"
CFLAGS="$CFLAGS $EXTRA_CFLAGS"
LDFLAGS="$LDFLAGS $EXTRA_LDFLAGS"
dnl Check for compiler characteristics
AC_C_CONST
dnl See whether we can use gcc style dependency tracking
AC_ARG_ENABLE(dependency-tracking,
AC_HELP_STRING([--enable-dependency-tracking],
[Use gcc -MMD -MT dependency tracking [[default=yes]]]),
, enable_dependency_tracking=yes)
if test x$enable_dependency_tracking = xyes; then
have_gcc_mmd_mt=no
AC_MSG_CHECKING(for GCC -MMD -MT option)
AC_TRY_COMPILE([
#if !defined(__GNUC__) || __GNUC__ < 3
#error Dependency tracking requires GCC 3.0 or newer
#endif
],[
],[
have_gcc_mmd_mt=yes
])
AC_MSG_RESULT($have_gcc_mmd_mt)
if test x$have_gcc_mmd_mt = xyes; then
DEPENDENCY_TRACKING_OPTIONS="-MMD -MT \$@"
fi
fi
case "$host" in
*-*-cygwin* | *-*-mingw32*)
VERSION_SOURCES="$srcdir/version.rc"
EXE=".exe"
if test "$build" != "$host"; then # cross-compiling
# Default cross-compile location
ac_default_prefix=/usr/local/cross-tools/i386-mingw32
else
# Look for the location of the tools and install there
if test "$BUILD_PREFIX" != ""; then
ac_default_prefix=$BUILD_PREFIX
fi
fi
;;
*)
SOURCES=""
EXE=""
;;
esac
# Standard C sources
SOURCES="$SOURCES \
$srcdir/effect_position.c \
$srcdir/effect_stereoreverse.c \
$srcdir/effects_internal.c \
$srcdir/load_aiff.c \
$srcdir/load_voc.c \
$srcdir/mixer.c \
$srcdir/music.c"
dnl set this to use on systems that use lib64 instead of lib
base_libdir=`echo \${libdir} | sed 's/.*\/\(.*\)/\1/; q'`
dnl Function to find a library in the compiler search path
find_lib()
{
gcc_bin_path=[`$CC -print-search-dirs 2>/dev/null | fgrep programs: | sed 's/[^=]*=\(.*\)/\1/' | sed 's/:/ /g'`]
gcc_lib_path=[`$CC -print-search-dirs 2>/dev/null | fgrep libraries: | sed 's/[^=]*=\(.*\)/\1/' | sed 's/:/ /g'`]
env_lib_path=[`echo $LIBS $LDFLAGS $* | sed 's/-L[ ]*//g'`]
if test "$cross_compiling" = yes; then
host_lib_path=""
else
host_lib_path="/usr/$base_libdir /usr/local/$base_libdir"
fi
for path in $gcc_bin_path $gcc_lib_path $env_lib_path $host_lib_path; do
lib=[`ls -- $path/$1 2>/dev/null | sort | sed 's/.*\/\(.*\)/\1/; q'`]
if test x$lib != x; then
echo $lib
return
fi
done
}
dnl Check for SDL
SDL_VERSION=1.2.10
AM_PATH_SDL($SDL_VERSION,
:,
AC_MSG_ERROR([*** SDL version $SDL_VERSION not found!])
)
EXTRA_CFLAGS="$EXTRA_CFLAGS $SDL_CFLAGS"
EXTRA_LDFLAGS="$EXTRA_LDFLAGS $SDL_LIBS"
dnl Check for math library
AC_CHECK_LIB(m, pow, [LIBM="-lm"])
dnl Check command-line options
AC_ARG_ENABLE([music-cmd],
AC_HELP_STRING([--enable-music-cmd], [support an external music player [[default=yes]]]),
[], [enable_music_cmd=detect])
if test "x$enable_music_cmd" != xno; then
AC_CHECK_FUNCS([fork vfork])
if test "x$ac_cv_func_fork" = "xyes"; then
EXTRA_CFLAGS="$EXTRA_CFLAGS -DHAVE_FORK"
elif test "x$ac_cv_func_vfork" = "xyes"; then
EXTRA_CFLAGS="$EXTRA_CFLAGS -DHAVE_VFORK"
elif test "x$enable_music_cmd" = "xyes"; then
AC_MSG_ERROR([external music player not available on your platform])
else
enable_music_cmd=no
fi
if test "x$enable_music_cmd" != xno; then
SOURCES="$SOURCES $srcdir/music_cmd.c"
EXTRA_CFLAGS="$EXTRA_CFLAGS -DCMD_MUSIC"
fi
fi
AC_ARG_ENABLE([music-wave],
AC_HELP_STRING([--enable-music-wave], [enable streaming WAVE music [[default=yes]]]),
[], [enable_music_wave=yes])
if test x$enable_music_wave = xyes; then
SOURCES="$SOURCES $srcdir/wavestream.c"
EXTRA_CFLAGS="$EXTRA_CFLAGS -DWAV_MUSIC"
fi
AC_ARG_ENABLE([music-mod],
AC_HELP_STRING([--enable-music-mod], [enable MOD music via mikmod [[default=yes]]]),
[], [enable_music_mod=yes])
AC_ARG_ENABLE([music-mod-shared],
AC_HELP_STRING([--enable-music-mod-shared], [dynamically load MOD support [[default=yes]]]),
[], [enable_music_mod_shared=yes])
if test x$enable_music_mod = xyes; then
have_libmikmod=no
libmikmod_maj=3
libmikmod_min=1
libmikmod_rev=10
libmikmod_ver="$libmikmod_maj.$libmikmod_min.$libmikmod_rev"
AC_PATH_PROG(LIBMIKMOD_CONFIG, libmikmod-config, no, [$PATH])
if test "$LIBMIKMOD_CONFIG" != "no" ; then
CFLAGS_SAVED="$CFLAGS"
LIBS_SAVED="$LIBS"
CFLAGS="$CFLAGS -DLIBMIKMOD_MUSIC `$LIBMIKMOD_CONFIG --cflags`"
LIBS="$LIBS `$LIBMIKMOD_CONFIG --libs`"
have_libmikmod=yes
AC_MSG_CHECKING([for libmikmod - version >= $libmikmod_ver])
AC_TRY_RUN([
#include "mikmod.h"
#include "stdio.h"
int main(int argc, char **argv)
{
long maj=$libmikmod_maj,min=$libmikmod_min,rev=$libmikmod_rev,ver=MikMod_GetVersion();
/*printf("(%d.%d.%d) ",ver>>16,(ver>>8)&0xff,ver&0xff);*/
if(ver>=((maj<<16)|(min<<8)|(rev))) {
printf("yes\n");
return 0;
}
printf("no\n*** libmikmod is older than %d.%d.%d, not using.\n",maj,min,rev);
return 1;
}
], [], have_libmikmod=no; CFLAGS="$CFLAGS_SAVED"; LIBS="$LIBS_SAVED",
[echo $ac_n "cross compiling; assumed OK... $ac_c"])
fi
if test x$have_libmikmod = xyes; then
case "$host" in
*-*-darwin*)
mikmod_lib=[`find_lib libmikmod.dylib`]
;;
*-*-cygwin* | *-*-mingw32*)
mikmod_lib=[`find_lib "mikmod*.dll"`]
;;
*)
mikmod_lib=[`find_lib "libmikmod*.so.[0-9]"`]
if test x$mikmod_lib = x; then
mikmod_lib=[`find_lib "libmikmod*.so.[0-9]*"`]
fi
;;
esac
SOURCES="$SOURCES $srcdir/*_mod.c"
EXTRA_CFLAGS="$EXTRA_CFLAGS -DMOD_MUSIC `$LIBMIKMOD_CONFIG --cflags`"
if test x$enable_music_mod_shared = xyes && test x$mikmod_lib != x; then
echo "-- dynamic libmikmod -> $mikmod_lib"
EXTRA_CFLAGS="$EXTRA_CFLAGS -DMOD_DYNAMIC=\\\"$mikmod_lib\\\""
else
EXTRA_LDFLAGS="$EXTRA_LDFLAGS `$LIBMIKMOD_CONFIG --libs`"
fi
else
AC_MSG_WARN([*** Unable to find MikMod library (http://mikmod.raphnet.net/)])
AC_MSG_WARN([MOD support disabled])
fi
fi
AC_ARG_ENABLE([music-midi],
AC_HELP_STRING([--enable-music-midi], [enable MIDI music via timidity [[default=yes]]]),
[], [enable_music_midi=yes])
if test x$enable_music_midi = xyes; then
EXTRA_CFLAGS="$EXTRA_CFLAGS -DMID_MUSIC"
AC_ARG_ENABLE([music-timidity-midi],
AC_HELP_STRING([--enable-music-timidity-midi], [enable timidity MIDI output [[default=yes]]]),
[], [enable_music_timidity_midi=yes])
if test x$enable_music_timidity_midi = xyes; then
EXTRA_CFLAGS="$EXTRA_CFLAGS -DUSE_TIMIDITY_MIDI -I\$(srcdir)/timidity"
SOURCES="$SOURCES $srcdir/timidity/*.c"
fi
AC_ARG_ENABLE([music-native-midi],
AC_HELP_STRING([--enable-music-native-midi], [enable native MIDI music output [[default=yes]]]),
[], [enable_music_native_midi=yes])
if test x$enable_music_native_midi = xyes; then
use_music_native_midi=no
case "$host" in
*-*-cygwin* | *-*-mingw32*)
use_music_native_midi=yes
EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lwinmm"
;;
*-*-darwin*)
use_music_native_midi=yes
EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-framework,AudioToolbox -Wl,-framework,AudioUnit -Wl,-framework,CoreServices"
;;
esac
if test x$use_music_native_midi = xyes; then
EXTRA_CFLAGS="$EXTRA_CFLAGS -DUSE_NATIVE_MIDI -I\$(srcdir)/native_midi"
SOURCES="$SOURCES $srcdir/native_midi/*.c"
fi
fi
AC_ARG_ENABLE([music-native-midi-gpl],
AC_HELP_STRING([--enable-music-native-midi-gpl], [enable native MIDI on UNIX using GPL code [[default=no]]]),
[], [enable_music_native_midi_gpl=no])
if test x$enable_music_native_midi_gpl = xyes; then
use_music_native_midi_gpl=no
case "$host" in
*-*-linux* | *-*-freebsd*)
use_music_native_midi_gpl=yes
;;
esac
if test x$use_music_native_midi_gpl = xyes; then
EXTRA_CFLAGS="$EXTRA_CFLAGS -DUSE_NATIVE_MIDI -I\$(srcdir)/native_midi"
SOURCES="$SOURCES $srcdir/native_midi_gpl/*.c"
fi
fi
fi
AC_ARG_ENABLE([music-ogg],
AC_HELP_STRING([--enable-music-ogg], [enable Ogg Vorbis music [[default=yes]]]),
[], [enable_music_ogg=yes])
AC_ARG_ENABLE(music-ogg-tremor,
AC_HELP_STRING([--enable-music-ogg-tremor], [enable OGG Vorbis music via libtremor [[default=no]]]),
[], enable_music_ogg_tremor=no)
AC_ARG_ENABLE([music-ogg-shared],
AC_HELP_STRING([--enable-music-ogg-shared], [dynamically load Ogg Vorbis support [[default=yes]]]),
[], [enable_music_ogg_shared=yes])
if test x$enable_music_ogg = xyes; then
if test x$enable_music_ogg_tremor = xyes; then
AC_CHECK_HEADER([tremor/ivorbisfile.h], [have_tremor_hdr=yes])
AC_CHECK_LIB([vorbisidec], [ov_open_callbacks], [have_tremor_lib=yes])
if test x$have_tremor_hdr = xyes -a x$have_tremor_lib = xyes; then
case "$host" in
*-*-darwin*)
ogg_lib=[`find_lib libvorbisidec.dylib`]
if test x$ogg_lib = x; then
ogg_lib=[`find_lib libvorbisidec.[0-9]`]
fi
if test x$ogg_lib = x; then
ogg_lib=[`find_lib libvorbisidec.[0-9]*`]
fi
;;
*-*-cygwin* | *-*-mingw32*)
ogg_lib=[`find_lib "vorbisidec*.dll"`]
;;
*)
ogg_lib=[`find_lib "libvorbisidec.so.[0-9]"`]
if test x$ogg_lib = x; then
ogg_lib=[`find_lib "libvorbisidec.so.[0-9]*"`]
fi
;;
esac
SOURCES="$SOURCES $srcdir/*_ogg.c"
EXTRA_CFLAGS="$EXTRA_CFLAGS -DOGG_MUSIC -DOGG_USE_TREMOR"
if test x$enable_music_ogg_shared = xyes && test x$ogg_lib != x; then
echo "-- dynamic libvorbisidec -> $ogg_lib"
EXTRA_CFLAGS="$EXTRA_CFLAGS -DOGG_DYNAMIC=\\\"$ogg_lib\\\""
else
EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lvorbisidec -lvorbis -logg $LIBM"
fi
else
AC_MSG_WARN([*** Unable to find Ogg Vorbis Tremor library (http://www.xiph.org/)])
AC_MSG_WARN([Ogg Vorbis support disabled])
fi
else
AC_CHECK_HEADER([vorbis/vorbisfile.h], [have_ogg_hdr=yes])
AC_CHECK_LIB([vorbisfile], [ov_open_callbacks], [have_ogg_lib=yes])
if test x$have_ogg_hdr = xyes -a x$have_ogg_lib = xyes; then
case "$host" in
*-*-darwin*)
ogg_lib=[`find_lib libvorbisfile.dylib`]
;;
*-*-cygwin* | *-*-mingw32*)
ogg_lib=[`find_lib "libvorbisfile*.dll"`]
;;
*)
ogg_lib=[`find_lib "libvorbisfile.so.[0-9]"`]
if test x$ogg_lib = x; then
ogg_lib=[`find_lib "libvorbisfile.so.[0-9]*"`]
fi
;;
esac
SOURCES="$SOURCES $srcdir/*_ogg.c"
EXTRA_CFLAGS="$EXTRA_CFLAGS -DOGG_MUSIC"
if test x$enable_music_ogg_shared = xyes && test x$ogg_lib != x; then
echo "-- dynamic libvorbisfile -> $ogg_lib"
EXTRA_CFLAGS="$EXTRA_CFLAGS -DOGG_DYNAMIC=\\\"$ogg_lib\\\""
else
EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lvorbisfile -lvorbis -logg $LIBM"
fi
else
AC_MSG_WARN([*** Unable to find Ogg Vorbis library (http://www.xiph.org/)])
AC_MSG_WARN([Ogg Vorbis support disabled])
fi
fi
fi
libflac_ver=8
AC_ARG_ENABLE([music-flac],
AC_HELP_STRING([--enable-music-flac], [enable FLAC music [[default=yes]]]),
[], [enable_music_flac=yes])
AC_ARG_ENABLE([music-flac-shared],
AC_HELP_STRING([--enable-music-flac-shared],
[dynamically load FLAC support [[default=yes]]]),
[], [enable_music_flac_shared=yes])
if test x$enable_music_flac = xyes; then
AC_CHECK_HEADER([FLAC/export.h], [have_flac_export=yes])
if test x$have_flac_export = xyes; then
LIBS_SAVED="$LIBS"
LIBS="-lFLAC"
AC_MSG_CHECKING([for libflac so-name version >= $libflac_ver])
AC_TRY_RUN([
#include "FLAC/export.h"
#include "stdio.h"
int main( int argc, char *argv[] ) {
#if defined(FLAC_API_VERSION_CURRENT) && (FLAC_API_VERSION_CURRENT >= $libflac_ver)
return 0;
#else
return 1;
#endif
}
], have_flac_ver=yes, have_flac_ver=no)
LIBS="$LIBS_SAVED"
AC_MSG_RESULT($have_flac_ver)
fi
if test x$have_flac_ver = xyes; then
AC_CHECK_HEADER([FLAC/stream_decoder.h], [have_flac_hdr=yes])
AC_CHECK_LIB([FLAC], [FLAC__stream_decoder_new], [have_flac_lib=yes])
if test x$have_flac_hdr = xyes -a x$have_flac_lib = xyes; then
case "$host" in
*-*-darwin*)
flac_lib=[`find_lib libFLAC.dylib`]
;;
*-*-cygwin* | *-*-mingw32*)
flac_lib=[`find_lib "libFLAC*.dll"`]
;;
*)
flac_lib=[`find_lib "libFLAC.so.[0-9]"`]
if test x$flac_lib = x; then
flac_lib=[`find_lib "libFLAC.so.[0-9]*"`]
fi
;;
esac
SOURCES="$SOURCES $srcdir/*_flac.c"
EXTRA_CFLAGS="$EXTRA_CFLAGS -DFLAC_MUSIC"
if test x$enable_music_flac_shared = xyes && test x$flac_lib != x; then
echo "-- dynamic libFLAC -> $flac_lib"
EXTRA_CFLAGS="$EXTRA_CFLAGS -DFLAC_DYNAMIC=\\\"$flac_lib\\\""
else
EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lFLAC"
fi
fi
else
AC_MSG_WARN([*** Unable to find FLAC library (http://flac.sourceforge.net/)])
AC_MSG_WARN([FLAC support disabled])
fi
fi
AC_ARG_ENABLE(music-mp3,
AC_HELP_STRING([--enable-music-mp3], [enable MP3 music via smpeg [[default=yes]]]),
[], enable_music_mp3=yes)
AC_ARG_ENABLE([music-mp3-shared],
AC_HELP_STRING([--enable-music-mp3-shared], [dynamically load MP3 support [[default=yes]]]),
[], [enable_music_mp3_shared=yes])
if test x$enable_music_mp3 = xyes; then
SMPEG_VERSION=0.4.3
AM_PATH_SMPEG($SMPEG_VERSION, have_smpeg=yes, have_smpeg=no)
if test x$have_smpeg = xyes; then
case "$host" in
*-*-darwin*)
smpeg_lib=[`find_lib libsmpeg.dylib`]
;;
*-*-cygwin* | *-*-mingw32*)
smpeg_lib=[`find_lib "smpeg*.dll"`]
;;
*)
smpeg_lib=[`find_lib "libsmpeg*.so.[0-9]"`]
if test x$smpeg_lib = x; then
smpeg_lib=[`find_lib "libsmpeg*.so.[0-9]*"`]
fi
;;
esac
SOURCES="$SOURCES $srcdir/*_mp3.c"
EXTRA_CFLAGS="$EXTRA_CFLAGS -DMP3_MUSIC $SMPEG_CFLAGS"
if test x$enable_music_mp3_shared = xyes && test x$smpeg_lib != x; then
echo "-- dynamic libsmpeg -> $smpeg_lib"
EXTRA_CFLAGS="$EXTRA_CFLAGS -DMP3_DYNAMIC=\\\"$smpeg_lib\\\""
else
EXTRA_LDFLAGS="$EXTRA_LDFLAGS $SMPEG_LIBS"
fi
else
AC_MSG_WARN([*** Unable to find SMPEG library (http://icculus.org/smpeg/)])
fi
fi
AC_ARG_ENABLE(music-mp3-mad-gpl,
AC_HELP_STRING([--enable-music-mp3-mad-gpl], [enable MP3 music via libmad GPL code [[default=no]]]),
[], [enable_music_mp3_mad_gpl=no])
if test x$enable_music_mp3_mad_gpl = xyes; then
AC_MSG_CHECKING(for libmad headers)
have_libmad=no
AC_TRY_COMPILE([
#include "mad.h"
],[
],[
have_libmad=yes
])
AC_MSG_RESULT($have_libmad)
if test x$have_libmad = xyes; then
SOURCES="$SOURCES $srcdir/music_mad.c"
EXTRA_CFLAGS="$EXTRA_CFLAGS -DMP3_MAD_MUSIC"
EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lmad"
else
AC_MSG_WARN([*** Unable to find MAD library (http://www.underbit.com/products/mad/)])
fi
fi
if test x$have_smpeg != xyes -a x$have_libmad != xyes; then
AC_MSG_WARN([MP3 support disabled])
fi
OBJECTS=`echo $SOURCES`
DEPENDS=`echo $SOURCES`
OBJECTS=`echo "$OBJECTS" | sed 's,[[^ ]]*/\([[^ ]]*\)\.c,$(objects)/\1.lo,g'`
DEPENDS=`echo "$DEPENDS" | sed 's,\([[^ ]]*\)/\([[^ ]]*\)\.c,\\
$(objects)/\2.lo: \1/\2.c\\
\$(LIBTOOL) --mode=compile \$(CC) \$(CFLAGS) \$(EXTRA_CFLAGS) '"$DEPENDENCY_TRACKING_OPTIONS"' -c \$< -o \$@,g'`
VERSION_OBJECTS=`echo $VERSION_SOURCES`
VERSION_DEPENDS=`echo $VERSION_SOURCES`
VERSION_OBJECTS=`echo "$VERSION_OBJECTS" | sed 's,[[^ ]]*/\([[^ ]]*\)\.rc,$(objects)/\1.o,g'`
VERSION_DEPENDS=`echo "$VERSION_DEPENDS" | sed 's,\([[^ ]]*\)/\([[^ ]]*\)\.rc,\\
$(objects)/\2.o: \1/\2.rc\\
\$(WINDRES) \$< \$@,g'`
PLAYWAVE_SOURCES="$srcdir/playwave.c"
PLAYWAVE_OBJECTS=`echo $PLAYWAVE_SOURCES`
PLAYWAVE_DEPENDS=`echo $PLAYWAVE_SOURCES`
PLAYWAVE_OBJECTS=`echo "$PLAYWAVE_OBJECTS" | sed 's,[[^ ]]*/\([[^ ]]*\)\.c,$(objects)/\1.lo,g'`
PLAYWAVE_DEPENDS=`echo "$PLAYWAVE_DEPENDS" | sed 's,\([[^ ]]*\)/\([[^ ]]*\)\.c,\\
$(objects)/\2.lo: \1/\2.c\\
\$(LIBTOOL) --mode=compile \$(CC) \$(CFLAGS) \$(EXTRA_CFLAGS) '"$DEPENDENCY_TRACKING_OPTIONS"' -c \$< -o \$@,g'`
PLAYMUS_SOURCES="$srcdir/playmus.c"
PLAYMUS_OBJECTS=`echo $PLAYMUS_SOURCES`
PLAYMUS_DEPENDS=`echo $PLAYMUS_SOURCES`
PLAYMUS_OBJECTS=`echo "$PLAYMUS_OBJECTS" | sed 's,[[^ ]]*/\([[^ ]]*\)\.c,$(objects)/\1.lo,g'`
PLAYMUS_DEPENDS=`echo "$PLAYMUS_DEPENDS" | sed 's,\([[^ ]]*\)/\([[^ ]]*\)\.c,\\
$(objects)/\2.lo: \1/\2.c\\
\$(LIBTOOL) --mode=compile \$(CC) \$(CFLAGS) \$(EXTRA_CFLAGS) '"$DEPENDENCY_TRACKING_OPTIONS"' -c \$< -o \$@,g'`
dnl Expand the sources and objects needed to build the library
AC_SUBST(ac_aux_dir)
AC_SUBST(OBJECTS)
AC_SUBST(DEPENDS)
AC_SUBST(VERSION_OBJECTS)
AC_SUBST(VERSION_DEPENDS)
AC_SUBST(PLAYWAVE_OBJECTS)
AC_SUBST(PLAYWAVE_DEPENDS)
AC_SUBST(PLAYMUS_OBJECTS)
AC_SUBST(PLAYMUS_DEPENDS)
AC_SUBST(BUILD_CFLAGS)
AC_SUBST(EXTRA_CFLAGS)
AC_SUBST(BUILD_LDFLAGS)
AC_SUBST(EXTRA_LDFLAGS)
AC_SUBST(EXE)
AC_SUBST(WINDRES)
AC_SUBST(SDL_VERSION)
AC_SUBST(SDL_CFLAGS)
AC_SUBST(SDL_LIBS)
AC_OUTPUT([
Makefile SDL_mixer.spec SDL_mixer.qpg SDL_mixer.pc
])

View File

@@ -1,185 +0,0 @@
#!/bin/sh
#
# Build Universal binaries on Mac OS X, thanks Ryan!
#
# Usage: ./configure CC="sh gcc-fat.sh" && make && rm -rf ppc ppc64 x86 x64
# PowerPC 32-bit compiler flags (10.4 runtime compatibility)
GCC_COMPILE_PPC32="gcc-4.0 -arch ppc -mmacosx-version-min=10.4 \
-DMAC_OS_X_VERSION_MIN_REQUIRED=1040 \
-nostdinc \
-F/Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks \
-I/Developer/SDKs/MacOSX10.4u.sdk/usr/lib/gcc/powerpc-apple-darwin10/4.0.1/include \
-isystem /Developer/SDKs/MacOSX10.4u.sdk/usr/include"
GCC_LINK_PPC32="\
-L/Developer/SDKs/MacOSX10.4u.sdk/usr/lib/gcc/powerpc-apple-darwin10/4.0.1 \
-Wl,-syslibroot,/Developer/SDKs/MacOSX10.4u.sdk"
# PowerPC 64-bit compiler flags (10.5 runtime compatibility)
GCC_COMPILE_PPC64="gcc-4.0 -arch ppc64 -mmacosx-version-min=10.5 \
-DMAC_OS_X_VERSION_MIN_REQUIRED=1050 \
-nostdinc \
-F/Developer/SDKs/MacOSX10.5.sdk/System/Library/Frameworks \
-I/Developer/SDKs/MacOSX10.5.sdk/usr/lib/gcc/powerpc-apple-darwin10/4.0.1/include \
-isystem /Developer/SDKs/MacOSX10.5.sdk/usr/include"
GCC_LINK_PPC64="\
-L/Developer/SDKs/MacOSX10.5.sdk/usr/lib/gcc/powerpc-apple-darwin10/4.0.1/ppc64 \
-Wl,-syslibroot,/Developer/SDKs/MacOSX10.5.sdk"
# Intel 32-bit compiler flags (10.4 runtime compatibility)
GCC_COMPILE_X86="gcc-4.0 -arch i386 -mmacosx-version-min=10.4 \
-DMAC_OS_X_VERSION_MIN_REQUIRED=1040 \
-nostdinc \
-F/Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks \
-I/Developer/SDKs/MacOSX10.4u.sdk/usr/lib/gcc/i686-apple-darwin10/4.0.1/include \
-isystem /Developer/SDKs/MacOSX10.4u.sdk/usr/include"
GCC_LINK_X86="\
-L/Developer/SDKs/MacOSX10.4u.sdk/usr/lib/gcc/i686-apple-darwin10/4.0.1 \
-Wl,-syslibroot,/Developer/SDKs/MacOSX10.4u.sdk"
# Intel 64-bit compiler flags (10.5 runtime compatibility)
GCC_COMPILE_X64="gcc-4.0 -arch x86_64 -mmacosx-version-min=10.5 \
-DMAC_OS_X_VERSION_MIN_REQUIRED=1050 \
-nostdinc \
-F/Developer/SDKs/MacOSX10.5.sdk/System/Library/Frameworks \
-I/Developer/SDKs/MacOSX10.5.sdk/usr/lib/gcc/i686-apple-darwin10/4.0.1/include \
-isystem /Developer/SDKs/MacOSX10.5.sdk/usr/include"
GCC_LINK_X64="\
-L/Developer/SDKs/MacOSX10.5.sdk/usr/lib/gcc/i686-apple-darwin10/4.0.1/x86_64 \
-Wl,-syslibroot,/Developer/SDKs/MacOSX10.5.sdk"
# Output both PowerPC and Intel object files
args="$*"
compile=yes
link=yes
while test x$1 != x; do
case $1 in
--version) exec gcc $1;;
-v) exec gcc $1;;
-V) exec gcc $1;;
-print-prog-name=*) exec gcc $1;;
-print-search-dirs) exec gcc $1;;
-E) GCC_COMPILE_PPC32="$GCC_COMPILE_PPC32 -E"
GCC_COMPILE_PPC64="$GCC_COMPILE_PPC64 -E"
GCC_COMPILE_X86="$GCC_COMPILE_X86 -E"
GCC_COMPILE_X64="$GCC_COMPILE_X64 -E"
compile=no; link=no;;
-c) link=no;;
-o) output=$2;;
*.c|*.cc|*.cpp|*.S) source=$1;;
esac
shift
done
if test x$link = xyes; then
GCC_COMPILE_PPC32="$GCC_COMPILE_PPC32 $GCC_LINK_PPC32"
GCC_COMPILE_PPC64="$GCC_COMPILE_PPC64 $GCC_LINK_PPC64"
GCC_COMPILE_X86="$GCC_COMPILE_X86 $GCC_LINK_X86"
GCC_COMPILE_X64="$GCC_COMPILE_X64 $GCC_LINK_X64"
fi
if test x"$output" = x; then
if test x$link = xyes; then
output=a.out
elif test x$compile = xyes; then
output=`echo $source | sed -e 's|.*/||' -e 's|\(.*\)\.[^\.]*|\1|'`.o
fi
fi
# Compile PPC 32-bit
if test x"$output" != x; then
dir=ppc/`dirname $output`
if test -d $dir; then
:
else
mkdir -p $dir
fi
fi
set -- $args
while test x$1 != x; do
if test -f "ppc/$1" && test "$1" != "$output"; then
ppc_args="$ppc_args ppc/$1"
else
ppc_args="$ppc_args $1"
fi
shift
done
$GCC_COMPILE_PPC32 $ppc_args || exit $?
if test x"$output" != x; then
cp $output ppc/$output
fi
# Compile PPC 64-bit
if test x"$output" != x; then
dir=ppc64/`dirname $output`
if test -d $dir; then
:
else
mkdir -p $dir
fi
fi
set -- $args
while test x$1 != x; do
if test -f "ppc64/$1" && test "$1" != "$output"; then
ppc64_args="$ppc64_args ppc64/$1"
else
ppc64_args="$ppc64_args $1"
fi
shift
done
$GCC_COMPILE_PPC64 $ppc64_args || exit $?
if test x"$output" != x; then
cp $output ppc64/$output
fi
# Compile X86 32-bit
if test x"$output" != x; then
dir=x86/`dirname $output`
if test -d $dir; then
:
else
mkdir -p $dir
fi
fi
set -- $args
while test x$1 != x; do
if test -f "x86/$1" && test "$1" != "$output"; then
x86_args="$x86_args x86/$1"
else
x86_args="$x86_args $1"
fi
shift
done
$GCC_COMPILE_X86 $x86_args || exit $?
if test x"$output" != x; then
cp $output x86/$output
fi
# Compile X86 32-bit
if test x"$output" != x; then
dir=x64/`dirname $output`
if test -d $dir; then
:
else
mkdir -p $dir
fi
fi
set -- $args
while test x$1 != x; do
if test -f "x64/$1" && test "$1" != "$output"; then
x64_args="$x64_args x64/$1"
else
x64_args="$x64_args $1"
fi
shift
done
$GCC_COMPILE_X64 $x64_args || exit $?
if test x"$output" != x; then
cp $output x64/$output
fi
if test x"$output" != x; then
lipo -create -o $output ppc/$output ppc64/$output x86/$output x64/$output
fi

View File

@@ -1,38 +0,0 @@
#include "winresrc.h"
LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
/////////////////////////////////////////////////////////////////////////////
//
// Version
//
VS_VERSION_INFO VERSIONINFO
FILEVERSION 1,2,11,0
PRODUCTVERSION 1,2,11,0
FILEFLAGSMASK 0x3fL
FILEFLAGS 0x0L
FILEOS 0x40004L
FILETYPE 0x2L
FILESUBTYPE 0x0L
BEGIN
BLOCK "StringFileInfo"
BEGIN
BLOCK "040904b0"
BEGIN
VALUE "CompanyName", "\0"
VALUE "FileDescription", "SDL_mixer\0"
VALUE "FileVersion", "1, 2, 11, 0\0"
VALUE "InternalName", "SDL_mixer\0"
VALUE "LegalCopyright", "Copyright © 2009 Sam Lantinga\0"
VALUE "OriginalFilename", "SDL_mixer.dll\0"
VALUE "ProductName", "Simple DirectMedia Layer\0"
VALUE "ProductVersion", "1, 2, 11, 0\0"
END
END
BLOCK "VarFileInfo"
BEGIN
VALUE "Translation", 0x409, 1200
END
END