Fix Launchpad builds

This commit is contained in:
Michał Janiszewski 2016-09-01 21:44:40 +02:00
parent 6a665330c2
commit 4481859898
4 changed files with 28 additions and 13 deletions

View File

@ -80,9 +80,21 @@ option(FORCE64 "Force native (x86-64) build. Do not use, for experimental purpos
option(DISABLE_OPENGL "Disable OpenGL support.")
option(DISABLE_RCT2 "WIP: Try building without using code and data segments from vanilla.")
option(USE_MMAP "Use mmap to try loading rct2's data segment into memory.")
option(LAUNCHPAD_BUILD "Sets some build system options on launchpad.net")
if (LAUNCHPAD_BUILD)
if (CMAKE_SIZEOF_VOID_P EQUAL 8)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-error=pointer-to-int-cast -Wno-error=int-to-pointer-cast")
endif()
else()
if (FORCE64)
set(TARGET_M "-m64")
else ()
set(TARGET_M "-m32")
endif()
endif()
if (FORCE64)
set(TARGET_M "-m64")
set(OBJ_FORMAT "elf64-x86-64")
set(LINKER_SCRIPT "ld_script_x86_64.xc")
if ((APPLE OR WIN32) AND NOT USE_MMAP)
@ -90,7 +102,6 @@ if (FORCE64)
set(USE_MMAP ON)
endif()
else ()
set(TARGET_M "-m32")
set(OBJ_FORMAT "elf32-i386")
set(LINKER_SCRIPT "ld_script_i386.xc")
endif ()
@ -203,8 +214,8 @@ if (APPLE)
endif (APPLE)
# set necessary flags to compile code as is
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${TARGET_M} -std=gnu99 -fno-pie -fstrict-aliasing -Werror -Wundef -Wmissing-declarations")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${TARGET_M} -std=gnu++11 -fno-pie -fstrict-aliasing -Werror -Wundef -Wmissing-declarations")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${TARGET_M} -std=gnu99 -fno-pie -fstrict-aliasing -Werror -Wno-error=date-time -Wundef -Wmissing-declarations")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${TARGET_M} -std=gnu++11 -fno-pie -fstrict-aliasing -Werror -Wno-error=date-time -Wundef -Wmissing-declarations")
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} ${TARGET_M}")
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${CMAKE_SHARED_LINKER_FLAGS}")

4
debian/control vendored
View File

@ -4,10 +4,10 @@ Section: misc
Priority: optional
Standards-Version: 3.9.2
Multi-Arch: same
Build-Depends: debhelper (>= 9), cmake, libsdl2-dev, libsdl2-ttf-dev, gcc, pkg-config, g++-multilib, gcc-multilib, libjansson4 (>= 2.7), libjansson-dev (>= 2.7), libspeex-dev, libspeexdsp-dev, libcurl4-openssl-dev, libcrypto++-dev, libfontconfig1-dev, libfreetype6-dev, libpng-dev
Build-Depends: debhelper (>= 9), cmake, libsdl2-dev, libsdl2-ttf-dev, gcc, pkg-config, libjansson4 (>= 2.7), libjansson-dev (>= 2.7), libspeex-dev, libspeexdsp-dev, libcurl4-openssl-dev, libcrypto++-dev, libfontconfig1-dev, libfreetype6-dev, libpng-dev, libssl-dev
Package: openrct2
Architecture: i386
Architecture: any
Homepage: https://openrct2.website/
Vcs-Browser: https://github.com/OpenRCT2/OpenRCT2
Vcs-Git: https://github.com/OpenRCT2/OpenRCT2

10
debian/rules vendored
View File

@ -2,12 +2,10 @@
BUILDDIR=build_dir
build:
scripts/linux/install.sh
mkdir $(BUILDDIR)
cd $(BUILDDIR); cmake -DCMAKE_BUILD_TYPE=RelWithDebInfo ..
make -C $(BUILDDIR)
touch build
extra_flags := $(if $(filter i386,$(DEB_HOST_ARCH)),"-DLAUNCHPAD_BUILD=on","-DLAUNCHPAD_BUILD=on -DUSE_MMAP=on -DDISABLE_RCT2=on")
override_dh_auto_configure:
dh_auto_configure -a -- $(extra_flags)
%:
dh $@

View File

@ -24,7 +24,13 @@
#endif
#ifdef USE_MMAP
#define GOOD_PLACE_FOR_DATA_SEGMENT ((uintptr_t)0x200000000)
#if defined(PLATFORM_64BIT)
#define GOOD_PLACE_FOR_DATA_SEGMENT ((uintptr_t)0x200000000)
#elif defined(PLATFORM_32BIT)
#define GOOD_PLACE_FOR_DATA_SEGMENT ((uintptr_t)0x09000000)
#else
#error "Unknown platform"
#endif
#else
#define GOOD_PLACE_FOR_DATA_SEGMENT ((uintptr_t)0x8a4000)
#endif