mirror of
https://github.com/sm64-port/sm64-port.git
synced 2025-01-22 07:32:09 -05:00
Add support for BSD
This commit is contained in:
parent
6b47859f75
commit
9cf199682b
12 changed files with 38 additions and 11 deletions
2
Makefile
2
Makefile
|
@ -176,7 +176,7 @@ endif
|
|||
endif
|
||||
|
||||
# Make tools if out of date
|
||||
DUMMY != make -s -C tools >&2 || echo FAIL
|
||||
DUMMY != $(MAKE) -s -C tools >&2 || echo FAIL
|
||||
ifeq ($(DUMMY),FAIL)
|
||||
$(error Failed to build tools)
|
||||
endif
|
||||
|
|
|
@ -152,9 +152,15 @@ def main():
|
|||
)
|
||||
sys.exit(1)
|
||||
|
||||
make = "make"
|
||||
|
||||
for path in os.environ["PATH"].split(os.pathsep):
|
||||
if os.path.isfile(os.path.join(path, "gmake")):
|
||||
make = "gmake"
|
||||
|
||||
# Make sure tools exist
|
||||
subprocess.check_call(
|
||||
["make", "-s", "-C", "tools/", "n64graphics", "skyconv", "mio0", "aifc_decode"]
|
||||
[make, "-s", "-C", "tools/", "n64graphics", "skyconv", "mio0", "aifc_decode"]
|
||||
)
|
||||
|
||||
# Go through the assets in roughly alphabetical order (but assets in the same
|
||||
|
|
|
@ -1,4 +1,6 @@
|
|||
#if defined(__linux__) && !defined(TARGET_WEB)
|
||||
#include "../compat.h"
|
||||
|
||||
#if (defined(__linux__) || defined(__BSD__)) && !defined(TARGET_WEB)
|
||||
/*
|
||||
Simple sound playback using ALSA API and libasound.
|
||||
Dependencies: libasound, alsa
|
||||
|
|
|
@ -1,7 +1,9 @@
|
|||
#ifndef AUDIO_ALSA_H
|
||||
#define AUDIO_ALSA_H
|
||||
|
||||
#ifdef __linux__
|
||||
#include "../compat.h"
|
||||
|
||||
#if defined(__linux__) || defined(__BSD__)
|
||||
extern struct AudioAPI audio_alsa;
|
||||
#define HAVE_ALSA 1
|
||||
#else
|
||||
|
|
|
@ -1,4 +1,6 @@
|
|||
#ifdef __linux__
|
||||
#include "../compat.h"
|
||||
|
||||
#if defined(__linux__) || defined(__BSD__)
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdbool.h>
|
||||
|
|
|
@ -1,7 +1,9 @@
|
|||
#ifndef AUDIO_PULSE_H
|
||||
#define AUDIO_PULSE_H
|
||||
|
||||
#ifdef __linux__
|
||||
#include "../compat.h"
|
||||
|
||||
#if defined(__linux__) || defined(__BSD__)
|
||||
extern struct AudioAPI audio_pulse;
|
||||
#define HAVE_PULSE_AUDIO 1
|
||||
#else
|
||||
|
|
8
src/pc/compat.h
Normal file
8
src/pc/compat.h
Normal file
|
@ -0,0 +1,8 @@
|
|||
#ifndef COMPAT_H
|
||||
#define COMPAT_H value
|
||||
|
||||
#if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) || defined(__DragonFly__)
|
||||
#define __BSD__
|
||||
#endif
|
||||
|
||||
#endif
|
|
@ -1,4 +1,4 @@
|
|||
#if !defined(__MINGW32__) && !defined(TARGET_WEB)
|
||||
#if !defined(__MINGW32__) && !defined(__BSD__) && !defined(TARGET_WEB)
|
||||
// See LICENSE for license
|
||||
|
||||
#define _XOPEN_SOURCE 600
|
||||
|
|
|
@ -1,4 +1,6 @@
|
|||
#ifdef __linux__
|
||||
#include "../compat.h"
|
||||
|
||||
#if defined(__linux__) || defined(__BSD__)
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <stdbool.h>
|
||||
|
|
|
@ -1,4 +1,6 @@
|
|||
#if !defined(__linux__) && defined(ENABLE_OPENGL)
|
||||
#include "../compat.h"
|
||||
|
||||
#if !defined(__linux__) && !defined(__BSD__) && defined(ENABLE_OPENGL)
|
||||
|
||||
#ifdef __MINGW32__
|
||||
#define FOR_WINDOWS 1
|
||||
|
|
|
@ -29,6 +29,8 @@
|
|||
|
||||
#include "configfile.h"
|
||||
|
||||
#include "compat.h"
|
||||
|
||||
#define CONFIG_FILE "sm64config.txt"
|
||||
|
||||
OSMesg D_80339BEC;
|
||||
|
@ -158,7 +160,7 @@ void main_func(void) {
|
|||
wm_api = &gfx_dxgi_api;
|
||||
#elif defined(ENABLE_OPENGL)
|
||||
rendering_api = &gfx_opengl_api;
|
||||
#if defined(__linux__)
|
||||
#if defined(__linux__) || defined(__BSD__)
|
||||
wm_api = &gfx_glx;
|
||||
#else
|
||||
wm_api = &gfx_sdl;
|
||||
|
|
|
@ -23,7 +23,6 @@ SOFTWARE.
|
|||
*/
|
||||
|
||||
#include "exoquant.h"
|
||||
#include <malloc.h>
|
||||
#include <math.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
|
|
Loading…
Reference in a new issue