redox/recipes/openttd/01_redox.patch
2018-12-29 10:15:32 -07:00

74 lines
2.7 KiB
Diff

diff -rupwN source/config.lib source-new/config.lib
--- source/config.lib 2018-12-29 07:28:58.975290421 -0700
+++ source-new/config.lib 2018-12-29 10:11:42.310241717 -0700
@@ -1486,7 +1486,7 @@ make_cflags_and_ldflags() {
# Special CXXFlags for HOST
CXXFLAGS="$CXXFLAGS"
# Libs to compile. In fact this is just LDFLAGS
- LIBS="-lstdc++"
+ LIBS="-lstdc++ -lSDL -lorbital"
# LDFLAGS used for HOST
LDFLAGS="$LDFLAGS"
# FEATURES for HOST (lto)
@@ -1594,7 +1594,7 @@ make_cflags_and_ldflags() {
fi
if [ "$os" != "CYGWIN" ] && [ "$os" != "HAIKU" ] && [ "$os" != "OPENBSD" ] && [ "$os" != "MINGW" ] && [ "$os" != "MORPHOS" ] && [ "$os" != "OSX" ] && [ "$os" != "DOS" ] && [ "$os" != "WINCE" ] && [ "$os" != "PSP" ] && [ "$os" != "OS2" ]; then
- LIBS="$LIBS -lpthread"
+ LIBS="$LIBS -Wl,--whole-archive -lpthread -Wl,--no-whole-archive"
fi
if [ "$os" != "CYGWIN" ] && [ "$os" != "HAIKU" ] && [ "$os" != "MINGW" ] && [ "$os" != "DOS" ] && [ "$os" != "WINCE" ]; then
diff -rupwN source/src/music/extmidi.cpp source-new/src/music/extmidi.cpp
--- source/src/music/extmidi.cpp 2018-12-29 07:28:59.143295501 -0700
+++ source-new/src/music/extmidi.cpp 2018-12-29 10:14:06.637357598 -0700
@@ -115,7 +115,11 @@ void MusicDriver_ExtMidi::DoPlay()
switch (this->pid) {
case 0: {
close(0);
+#if defined(__redox__)
+ int d = open("null:", O_RDONLY);
+#else
int d = open("/dev/null", O_RDONLY);
+#endif
if (d != -1 && dup2(d, 1) != -1 && dup2(d, 2) != -1) {
execvp(this->params[0], this->params);
}
diff -rupwN source/src/rev.cpp.in source-new/src/rev.cpp.in
--- source/src/rev.cpp.in 2018-12-29 07:28:59.167296226 -0700
+++ source-new/src/rev.cpp.in 2018-12-29 10:11:42.314241804 -0700
@@ -57,7 +57,7 @@ const char _openttd_build_date[] = __DAT
* (compiling from sources without any version control software)
* and 2 is for modified revision.
*/
-const byte _openttd_revision_modified = !!MODIFIED!!;
+const byte _openttd_revision_modified = 2;
/**
* The NewGRF revision of OTTD:
diff -rupwN source/src/stdafx.h source-new/src/stdafx.h
--- source/src/stdafx.h 2018-12-29 07:28:59.203297314 -0700
+++ source-new/src/stdafx.h 2018-12-29 10:11:42.314241804 -0700
@@ -12,6 +12,9 @@
#ifndef STDAFX_H
#define STDAFX_H
+#include <strings.h>
+#include <alloca.h>
+
#if defined(__APPLE__)
#include "os/macosx/osx_stdafx.h"
#endif /* __APPLE__ */
diff -rupwN source/src/string.cpp source-new/src/string.cpp
--- source/src/string.cpp 2018-12-29 07:28:59.207297436 -0700
+++ source-new/src/string.cpp 2018-12-29 10:11:42.314241804 -0700
@@ -528,7 +528,7 @@ size_t Utf8TrimString(char *s, size_t ma
return length;
}
-#ifdef DEFINE_STRCASESTR
+#if 0
char *strcasestr(const char *haystack, const char *needle)
{
size_t hay_len = strlen(haystack);