Use pkg-config with Ruby 1.8

This commit is contained in:
Inori 2019-12-17 06:22:01 -05:00 committed by Inori
parent fa8f9915dd
commit c07a24821d
4 changed files with 13 additions and 15 deletions

View file

@ -21,7 +21,7 @@ This binding should support RGSS1, RGSS2 and RGSS3, though I've only tested it w
## Dependencies / Building
* ObjFW
* [ObjFW](https://github.com/ObjFW/ObjFW)
* libsigc++ 2.0
* PhysFS (latest hg)
* OpenAL
@ -29,7 +29,7 @@ This binding should support RGSS1, RGSS2 and RGSS3, though I've only tested it w
* SDL2_image
* SDL2_ttf
* [Ancurio's SDL_sound fork](https://github.com/Ancurio/SDL_sound)
* [My Ruby 1.8 fork](https://github.com/inori-z/ruby/tree/ruby_1_8_7), for Zlib, a Windows build that doesn't segfault, and any 1.8.1 compatibility stuff
* [My Ruby 1.8 fork](https://github.com/inori-z/ruby/tree/ruby_1_8_7), if using Ruby 1.8
* vorbisfile
* pixman
* zlib (only ruby bindings)
@ -46,7 +46,7 @@ Midi support is enabled by default and requires fluidsynth to be present at runt
By default, mkxp switches into the directory where its binary is contained and then starts reading the configuration and resolving relative paths. In case this is undesired (eg. when the binary is to be installed to a system global, read-only location), it can be turned off by adding `-Dworkdir_current=true` to meson's build arguments.
**MRI-Binding**: By default, meson will search for Ruby 1.8 libraries and includes within the system search path. This can be adjusted with `-Dcpp_args=-I[path]` for includes and `-Dcpp_link_args=-L[path]` for libraries. For newer Ruby versions, pkg-config will look for `ruby-X.Y.pc`, where `X` is the major version number and `Y` is the minor version number (e.g. `ruby-2.6.pc`). The version that will be searched for can be set with `-Dmri_version=X.Y` (`-Dmri_version=2.6` as an example).
**MRI-Binding**: Meson will use pkg-config to look for `ruby-X.Y.pc`, where `X` is the major version number and `Y` is the minor version number (e.g. `ruby-2.5.pc`). The version that will be searched for can be set with `-Dmri_version=X.Y`. `mri-version` is set to `1.8` by default.
## Supported image/audio formats

View file

@ -1,12 +1,9 @@
ver = get_option('mri_version')
if ver.version_compare('>1.8') == true
global_dependencies += dependency('ruby-' + ver)
else
lib = get_option('ruby_lib')
global_dependencies += compilers['cpp'].find_library(lib)
if ver.version_compare('>1.8') == false
add_project_arguments('-DOLD_RUBY', language: ['cpp','objc','objcpp'])
endif
global_dependencies += dependency('ruby-' + ver)
if get_option('no_preload_scripts') == true
add_project_arguments('-DNO_PRELOAD_SCRIPTS', language: ['cpp','objc','objcpp'])

View file

@ -2,9 +2,7 @@
// it's just as basic but should work fine for the moment
#include <SDL.h>
#ifdef USE_FAKEAPI
#include "fake-api.h"
#endif
#include "binding-util.h"

View file

@ -1,9 +1,5 @@
#pragma once
#ifdef __WIN32__
#include <windows.h>
#endif
#define ABI(x) __attribute__((x))
#if defined(__WIN32__)
#define PREFABI ABI(stdcall)
@ -11,6 +7,12 @@
#define PREFABI
#endif
#ifdef USE_FAKEAPI
#ifdef __WIN32__
#include <windows.h>
#endif
#ifndef __WIN32__
typedef unsigned int DWORD, UINT, *LPDWORD;
typedef char BYTE, *LPSTR, *LPCSTR, *LPCTSTR, *LPTSTR, *PBYTE;
@ -151,3 +153,4 @@ PREFABI BOOL
MKXP_GetUserName(LPSTR lpBuffer, LPDWORD pcbBuffer);
#endif
#endif