From 17e9f4016e2d4d9599493f968c17f6a8c15031e6 Mon Sep 17 00:00:00 2001 From: DeaDDooMER Date: Mon, 2 Sep 2019 22:15:49 +0300 Subject: [PATCH] fix building on linux; USE_XMP_FULL -> USE_XMP_LITE --- src/lib/fluidsynth/fluidsynth.pas | 21 +++++++---------- src/lib/modplug/modplug.pas | 24 +++++++------------ src/lib/mpg123/mpg123.pas | 21 +++++++---------- src/lib/openal/al.pas | 23 +++++++----------- src/lib/xmp/xmp.pas | 39 ++++++++++++++----------------- 5 files changed, 50 insertions(+), 78 deletions(-) diff --git a/src/lib/fluidsynth/fluidsynth.pas b/src/lib/fluidsynth/fluidsynth.pas index 84b9586..6a8c34f 100644 --- a/src/lib/fluidsynth/fluidsynth.pas +++ b/src/lib/fluidsynth/fluidsynth.pas @@ -11,23 +11,18 @@ uses {$PACKRECORDS C} {$ENDIF} -{$IF 0} - {$IFNDEF LIBFLUIDSYNTH_WINDOZE_STATIC} +{$IF DEFINED(WINDOWS)} + {$IFDEF FLUIDSYNTH_WINDOZE_STATIC} + {$LINKLIB libfluidsynth.a} + {$ELSE} {$DEFINE FS_DYNAMIC} + const fluidlib = 'libfluidsynth.dll'; {$ENDIF} -{$ENDIF} - -{$IF DEFINED(FS_DYNAMIC)} -const -{$IF DEFINED(WINDOWS)} - fluidlib = 'libfluidsynth.dll'; {$ELSEIF DEFINED(UNIX)} - fluidlib = 'libfluidsynth.so'; -{$ELSE} - {$MESSAGE ERROR 'FLUIDSYNTH_DYNAMIC not supported'} -{$IFEND} + {$DEFINE FS_DYNAMIC} + const fluidlib = 'libfluidsynth.so'; {$ELSE} - {$LINKLIB libfluidsynth.a} + {$ERROR fluidsynth not supported on this platform. Fix it!} {$ENDIF} const diff --git a/src/lib/modplug/modplug.pas b/src/lib/modplug/modplug.pas index 5afde68..3c56ea1 100644 --- a/src/lib/modplug/modplug.pas +++ b/src/lib/modplug/modplug.pas @@ -19,27 +19,21 @@ interface uses ctypes; -{$IFDEF WINDOWS} - {$IFNDEF LIBMODPLUG_WINDOZE_STATIC} +{$IF DEFINED(WINDOWS)} + {$IFDEF MODPLUG_WINDOZE_STATIC} + {$LINKLIB libstdc++.a} // is this necessary? + {$LINKLIB libmodplug.a} + {$ELSE} {$DEFINE MP_DYNAMIC} + const modpluglib = 'libmodplug-1.dll'; {$ENDIF} -{$ENDIF} - -{$IFDEF MP_DYNAMIC} -const -{$IF DEFINED(WINDOWS)} - modpluglib = 'libmodplug-1.dll'; {$ELSEIF DEFINED(UNIX)} - modpluglib = 'libmodplug.so'; -{$ELSE} - {$MESSAGE ERROR 'MP_DYNAMIC not supported'} -{$IFEND} + {$DEFINE MP_DYNAMIC} + const modpluglib = 'libmodplug.so'; {$ELSE} - {$LINKLIB libstdc++.a} // is this necessary? - {$LINKLIB libmodplug.a} + {$ERROR libmpg123 not supported on this platform. Fix it!} {$ENDIF} - type PModPlugFile = Pointer; ModPlugFile = record diff --git a/src/lib/mpg123/mpg123.pas b/src/lib/mpg123/mpg123.pas index 9ad2c91..67cab97 100644 --- a/src/lib/mpg123/mpg123.pas +++ b/src/lib/mpg123/mpg123.pas @@ -28,23 +28,18 @@ uses {$PACKRECORDS C} {$ENDIF} -{$IFDEF WINDOWS} - {$IFNDEF LIBMPG123_WINDOZE_STATIC} +{$IF DEFINED(WINDOWS)} + {$IFDEF MPG123_WINDOZE_STATIC} + {$LINKLIB libmpg123.a} + {$ELSE} {$DEFINE MPG123_DYNAMIC} + const LIB_MPG123 = 'libmpg123-0.dll'; {$ENDIF} -{$ENDIF} - -{$IF DEFINED(MPG123_DYNAMIC)} -const -{$IF DEFINED(WINDOWS)} - LIB_MPG123 = 'libmpg123-0.dll'; {$ELSEIF DEFINED(UNIX)} - LIB_MPG123 = 'libmpg123.so'; -{$ELSE} - {$MESSAGE ERROR 'MPG123_DYNAMIC not supported'} -{$IFEND} + {$DEFINE MPG123_DYNAMIC} + const LIB_MPG123 = 'libmpg123.so'; {$ELSE} - {$LINKLIB libmpg123.a} + {$ERROR libmpg123 not supported on this platform. Fix it!} {$ENDIF} type diff --git a/src/lib/openal/al.pas b/src/lib/openal/al.pas index 264f0e4..ee62cd1 100644 --- a/src/lib/openal/al.pas +++ b/src/lib/openal/al.pas @@ -13,25 +13,18 @@ interface uses ctypes; -{$IFDEF WINDOWS} - {$IFNDEF AL_WINDOZE_STATIC} +{$IF DEFINED(WINDOWS)} + {$IFDEF OPENAL_WINDOZE_STATIC} + {$LINKLIB libopenal.a} + {$ELSE} + const openallib = 'openal32.dll'; {$DEFINE AL_DYNAMIC} {$ENDIF} -{$ENDIF} - -{$IF DEFINED(AL_DYNAMIC)} -const -{$IF DEFINED(WINDOWS)} - openallib = 'openal32.dll'; {$ELSEIF DEFINED(UNIX)} - openallib = 'libopenal.so'; -{$ELSE} - {$MESSAGE ERROR 'AL_DYNAMIC not supported'} -{$IFEND} -{$ELSEIF DEFINED(Darwin)} -{$LINKFRAMEWORK OpenAL} + const openallib = 'libopenal.so'; + {$DEFINE AL_DYNAMIC} {$ELSE} - {$LINKLIB libopenal.a} + {$ERROR OpenAL not supported on this platform. Fix it!} {$ENDIF} {$include al.inc} diff --git a/src/lib/xmp/xmp.pas b/src/lib/xmp/xmp.pas index 4b41b90..7f790ed 100644 --- a/src/lib/xmp/xmp.pas +++ b/src/lib/xmp/xmp.pas @@ -7,35 +7,30 @@ interface {$MODE OBJFPC} {$ENDIF} -{$IFDEF WINDOWS} - {$IFNDEF LIBXMP_WINDOZE_STATIC} - {$DEFINE XMP_DYNAMIC} - {$ENDIF} -{$ENDIF} - -{$IF DEFINED(XMP_DYNAMIC)} -const {$IF DEFINED(WINDOWS)} - {$IF DEFINED(USE_XMP_FULL)} - xmplib = 'libxmp.dll'; + {$IFDEF LIBXMP_WINDOZE_STATIC} + {$IFDEF USE_XMP_LITE} + {$LINKLIB libxmp-lite.a} + {$ELSE} + {$LINKLIB libxmp.a} + {$ENDIF} {$ELSE} - xmplib = 'libxmp-lite.dll'; + {$DEFINE XMP_DYNAMIC} + {$IFDEF USE_XMP_LITE} + const xmplib = 'libxmp-lite.dll'; + {$ELSE} + const xmplib = 'libxmp.dll'; + {$ENDIF} {$ENDIF} {$ELSEIF DEFINED(UNIX)} - {$IF DEFINED(USE_XMP_FULL)} - xmplib = 'libxmp.so'; + {$DEFINE XMP_DYNAMIC} + {$IFDEF USE_XMP_LITE} + const xmplib = 'libxmp-lite.so'; {$ELSE} - xmplib = 'libxmp-lite.so'; + const xmplib = 'libxmp.so'; {$ENDIF} {$ELSE} - {$MESSAGE ERROR 'XMP_DYNAMIC not supported'} -{$IFEND} -{$ELSE} - {$IF DEFINED(USE_XMP_FULL)} - {$LINKLIB libxmp.a} - {$ELSE} - {$LINKLIB libxmp-lite.a} - {$ENDIF} + {$ERROR libxmp not supported on this platform. Fix it!} {$ENDIF} const -- 2.29.2