Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compilation on FreeBSD, OpenBSD, and NetBSD #407

Open
wants to merge 9 commits into
base: slippi
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 9 additions & 4 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ option(ENCODE_FRAMEDUMPS "Encode framedumps in AVI format" ON)
option(FASTLOG "Enable all logs" OFF)
option(OPROFILING "Enable profiling" OFF)
option(GDBSTUB "Enable gdb stub for remote debugging." OFF)
if(${CMAKE_SYSTEM_NAME} STREQUAL "Linux")
if(${CMAKE_SYSTEM_NAME} STREQUAL "Linux" OR ${CMAKE_SYSTEM_NAME} MATCHES "FreeBSD|OpenBSD|NetBSD")
option(VTUNE "Enable Intel VTune integration for JIT symbols." OFF)
endif()

Expand Down Expand Up @@ -359,6 +359,9 @@ if(UNIX)
if(LINUX_LOCAL_DEV)
add_definitions('-DLINUX_LOCAL_DEV')
endif(LINUX_LOCAL_DEV)
if(INSTALLMODE)
add_definitions('-DINSTALLMODE')
endif(INSTALLMODE)
endif(UNIX)

# Dolphin requires threads.
Expand Down Expand Up @@ -681,7 +684,9 @@ include_directories(Externals/base64)
add_subdirectory(Externals/Bochs_disasm)
include_directories(Externals/Bochs_disasm)

add_subdirectory(Externals/glslang)
#if (NOT ${CMAKE_SYSTEM_NAME} MATCHES "FreeBSD|OpenBSD|NetBSD")
add_subdirectory(Externals/glslang)
#endif()

add_subdirectory(Externals/SlippiLib)
include_directories(Externals/SlippiLib)
Expand Down Expand Up @@ -990,7 +995,7 @@ if(NOT DISABLE_WX)
# not when building wx itself (see wxw3 CMakeLists.txt for that)
if(APPLE)
add_definitions(-D__WXOSX_COCOA__)
elseif(${CMAKE_SYSTEM_NAME} MATCHES "Linux|FreeBSD")
elseif(${CMAKE_SYSTEM_NAME} MATCHES "Linux|FreeBSD|OpenBSD|NetBSD")
add_definitions(-D__WXGTK__)

# Check for required libs
Expand All @@ -1015,7 +1020,7 @@ if(NOT DISABLE_WX)
add_definitions(-DHAVE_WX=1)
endif(NOT DISABLE_WX)

if(${CMAKE_SYSTEM_NAME} MATCHES "FreeBSD|NetBSD")
if(${CMAKE_SYSTEM_NAME} MATCHES "FreeBSD|NetBSD|OpenBSD")
set(LIBS ${LIBS} usbhid)
endif()

Expand Down
195 changes: 195 additions & 0 deletions Data/Config/Dolphin.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,195 @@
[General]
LastFilename =
ShowLag = False
ShowFrameCount = False
ISOPaths = 0
RecursiveISOPaths = False
NANDRootPath =
DumpPath =
WirelessMac =
WiiSDCardPath =
[Interface]
ConfirmStop = False
UsePanicHandlers = True
OnScreenDisplayMessages = True
HideCursor = True
AutoHideCursor = False
MainWindowPosX = 640
MainWindowPosY = 0
MainWindowWidth = 640
MainWindowHeight = 458
LanguageCode =
ShowToolbar = True
ShowStatusbar = True
ShowSeekbar = True
ShowLogWindow = False
ShowLogConfigWindow = False
ExtendedFPSInfo = False
ThemeName = Clean Blue
PauseOnFocusLost = False
DisableTooltips = False
[Display]
FullscreenResolution = Auto
Fullscreen = True
RenderToMain = False
RenderWindowXPos = -1
RenderWindowYPos = -1
RenderWindowWidth = 640
RenderWindowHeight = 480
RenderWindowAutoSize = False
KeepWindowOnTop = False
ProgressiveScan = False
PAL60 = True
DisableScreenSaver = True
ForceNTSCJ = False
[GameList]
ListDrives = False
ListWad = True
ListElfDol = True
ListWii = True
ListGC = True
ListJap = True
ListPal = True
ListUsa = True
ListAustralia = True
ListFrance = True
ListGermany = True
ListItaly = True
ListKorea = True
ListNetherlands = True
ListRussia = True
ListSpain = True
ListTaiwan = True
ListWorld = True
ListUnknown = True
ListSort = 3
ListSortSecondary = 0
ColorCompressed = True
ColumnPlatform = True
ColumnBanner = True
ColumnNotes = True
ColumnFileName = True
ColumnID = True
ColumnRegion = True
ColumnSize = True
ColumnState = False
[Core]
HLE_BS2 = False
TimingVariance = 8
CPUCore = 1
Fastmem = True
CPUThread = True
DSPHLE = True
SyncOnSkipIdle = True
SyncGPU = False
SyncGpuMaxDistance = 200000
SyncGpuMinDistance = -200000
SyncGpuOverclock = 1.00000000
FPRF = False
AccurateNaNs = False
DefaultISO =
BootDefaultISO = False
DVDRoot =
Apploader =
SelectedLanguage = 0
OverrideGCLang = False
DPL2Decoder = False
TimeStretching = False
RSHACK = False
Latency = 0
ReduceTimingDispersion = False
SlippiJukeboxEnabled = True
SlippiJukeboxVolume = 100
SlippiOnlineDelay = 2
SlippiEnableSpectator = True
SlippiSpectatorLocalPort = 51441
SlippiSaveReplays = True
SlippiEnableQuickChat = 0
SlippiForceNetplayPort = False
SlippiNetplayPort = 2626
SlippiForceLanIp = False
SlippiLanIp =
SlippiReplayMonthFolders = False
SlippiReplayDir = /home/nekobit/Slippi
SlippiPlaybackDisplayFrameIndex = False
BlockingPipes = False
MemcardAPath =
MemcardBPath =
AgpCartAPath =
AgpCartBPath =
SlotA = 255
SerialPort1 = 255
BBA_MAC =
SIDevice0 = 12
AdapterRumble0 = True
SimulateKonga0 = False
SIDevice1 = 12
AdapterRumble1 = True
SimulateKonga1 = False
SIDevice2 = 12
AdapterRumble2 = True
SimulateKonga2 = False
SIDevice3 = 12
AdapterRumble3 = True
SimulateKonga3 = False
WiiSDCard = False
WiiKeyboard = False
WiimoteContinuousScanning = False
WiimoteEnableSpeaker = False
RunCompareServer = False
RunCompareClient = False
EmulationSpeed = 1.00000000
FrameSkip = 0x00000000
Overclock = 1.00000000
OverclockEnable = False
GFXBackend =
GPUDeterminismMode = auto
PerfMapDir =
EnableCustomRTC = False
CustomRTCValue = 0x386d4380
AllowAllNetplayVersions = False
QoSEnabled = True
AdapterWarning = True
ShownLagReductionWarning = False
[Movie]
PauseMovie = False
Author =
DumpFrames = False
DumpFramesSilent = False
ShowInputDisplay = False
ShowRTC = False
[DSP]
EnableJIT = True
DumpAudio = False
DumpAudioSilent = False
DumpUCode = False
Backend = No audio output
Volume = 25
CaptureLog = False
[Input]
BackgroundInput = False
[FifoPlayer]
LoopReplay = True
[Analytics]
ID = e672622bd03c212d03894f5c0150c5bc
Enabled = False
PermissionAsked = True
[Network]
SSLDumpRead = False
SSLDumpWrite = False
SSLVerifyCert = False
SSLDumpRootCA = False
SSLDumpPeerCert = False
[BluetoothPassthrough]
Enabled = False
VID = -1
PID = -1
LinkKeys =
[Sysconf]
SensorBarPosition = 1
SensorBarSensitivity = 50331648
SpeakerVolume = 88
WiimoteMotor = True
WiiLanguage = 1
AspectRatio = 1
Screensaver = 0
7 changes: 7 additions & 0 deletions Data/Config/Logger.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
[LogWindow]
x = 400
y = 600
pos = 2
[Options]
Font = 0
WrapLines = False
Empty file added Data/Logs/dolphin.log
Empty file.
Binary file added Data/Wii/shared2/sys/SYSCONF
Binary file not shown.
Binary file added Data/dolphin-emu
Binary file not shown.
Binary file added Data/traversal_server
Binary file not shown.
3 changes: 1 addition & 2 deletions Externals/glslang/glslang/Include/PoolAlloc.h
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,6 @@ class TPoolAllocator {
// of use is to simultaneously deallocate everything at once
// by calling pop(), and to not have to solve memory leak problems.
//

protected:
friend struct tHeader;

Expand Down Expand Up @@ -240,7 +239,7 @@ class TPoolAllocator {

int numCalls; // just an interesting statistic
size_t totalBytes; // just an interesting statistic
private:
public:
TPoolAllocator& operator=(const TPoolAllocator&); // don't allow assignment operator
TPoolAllocator(const TPoolAllocator&); // don't allow default copy constructor
};
Expand Down
4 changes: 4 additions & 0 deletions Externals/glslang/glslang/Public/ShaderLang.h
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,11 @@ SH_IMPORT_EXPORT int ShInitialize();
//
// Driver should call this at process shutdown.
//
#ifdef __FreeBSD__
SH_IMPORT_EXPORT int ShFinalize();
#else
SH_IMPORT_EXPORT int __fastcall ShFinalize();
#endif

//
// Types of languages the compiler can consume.
Expand Down
4 changes: 2 additions & 2 deletions Externals/semver/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ if(UNIX)
add_definitions(-std=c++14)
endif()

if(APPLE)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-error -Wno-unused-but-set-variable -Wno-missing-variable-declarations")
if(CMAKE_CXX_COMPILER_ID MATCHES "Clang")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-error -Wno-unused-but-set-variable -Wno-missing-variable-declarations")
endif()

if(WIN32)
Expand Down
3 changes: 2 additions & 1 deletion Source/Core/Common/CommonPaths.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,8 @@
#endif

// Shared data dirs (Sys and shared User for Linux)
#if defined(_WIN32) || defined(LINUX_LOCAL_DEV)
#if defined(_WIN32) || defined(LINUX_LOCAL_DEV) || defined(__FreeBSD__) \
|| defined(__OpenBSD__) || defined(__NetBSD__)
#define SYSDATA_DIR "Sys"
#elif defined __APPLE__
#define SYSDATA_DIR "Contents/Resources/Sys"
Expand Down
21 changes: 15 additions & 6 deletions Source/Core/Common/FileUtil.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@
#define S_ISDIR(m) (((m)&S_IFMT) == S_IFDIR)
#endif

static std::string s_user_paths[NUM_PATH_INDICES];

// This namespace has various generic functions related to files and paths.
// The code still needs a ton of cleanup.
// REMEMBER: strdup considered harmful!
Expand Down Expand Up @@ -735,7 +737,7 @@ std::string GetApplicationSupportDirectory()
}
#endif

std::string &GetExeDirectory()
std::string GetExeDirectory()
{
static std::string DolphinPath;
if (DolphinPath.empty())
Expand All @@ -749,6 +751,8 @@ std::string &GetExeDirectory()
else
DolphinPath = TStrToUTF8(Dolphin_exe_Path);
DolphinPath = DolphinPath.substr(0, DolphinPath.find_last_of('\\'));
#elif defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__NetBSD__)
return "."; // Hack
#else
char Dolphin_exe_Path[PATH_MAX];
ssize_t len = ::readlink("/proc/self/exe", Dolphin_exe_Path, sizeof(Dolphin_exe_Path));
Expand Down Expand Up @@ -791,16 +795,22 @@ std::string GetSysDirectory()
{
std::string sysDir;

#if defined(__APPLE__)
sysDir = GetBundleDirectory() + DIR_SEP + SYSDATA_DIR;
#elif defined(_WIN32) || defined(LINUX_LOCAL_DEV)
#if defined(_WIN32)
sysDir = GetExeDirectory() + DIR_SEP + SYSDATA_DIR;
#elif defined(LINUX_LOCAL_DEV) || defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__NetBSD__)
# ifdef INSTALLMODE
sysDir = s_user_paths[D_USER_IDX] + "/Sys";
# else
sysDir = GetExeDirectory() + DIR_SEP + SYSDATA_DIR;
# endif
#elif defined(__APPLE__)
sysDir = GetBundleDirectory() + DIR_SEP + SYSDATA_DIR;
#else
sysDir = SYSDATA_DIR;
#endif
sysDir += DIR_SEP;

INFO_LOG(COMMON, "GetSysDirectory: Setting to %s:", sysDir.c_str());
INFO_LOG(COMMON, "GetSysDirectory: Setting to %s: ", sysDir.c_str());
return sysDir;
}

Expand All @@ -817,7 +827,6 @@ std::string GetSlippiUserJSONPath()
return userFilePath;
}

static std::string s_user_paths[NUM_PATH_INDICES];
static void RebuildUserDirectories(unsigned int dir_index)
{
switch (dir_index)
Expand Down
2 changes: 1 addition & 1 deletion Source/Core/Common/FileUtil.h
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ std::string GetBundleDirectory();
std::string GetApplicationSupportDirectory();
#endif

std::string &GetExeDirectory();
std::string GetExeDirectory();

std::string GetHomeDirectory();

Expand Down
5 changes: 4 additions & 1 deletion Source/Core/Core/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,10 @@ if(LIBUSB_FOUND)
IPC_HLE/WII_IPC_HLE_Device_usb_bt_real.cpp)
endif(LIBUSB_FOUND)

set(LIBS ${LIBS} videovulkan)
# Can be fixed, but temporarily disabled: Use OpenGL
#if(NOT ${CMAKE_SYSTEM_NAME} MATCHES "FreeBSD|NetBSD|OpenBSD")
set(LIBS ${LIBS} videovulkan)
#endif()

set(LIBS ${LIBS} ${MBEDTLS_LIBRARIES})

Expand Down
Loading