From 6e118887a57618bfefe310105888a27e3eebf465 Mon Sep 17 00:00:00 2001 From: "gregory.hainaut" Date: Fri, 11 Jun 2010 13:51:43 +0000 Subject: [PATCH] * Apply a co-patch of Air and me to use linux friendly include path [cmake]: * Update to use the above patch. * Remove a52. Need to use system version. * Remove stub file. Append pcsx2 to 3rparty library to ease futur support. Important Note: codeblock will probably need some update. (add 3rdparty/soundtouch_linux_include in include path) git-svn-id: http://pcsx2.googlecode.com/svn/trunk@3200 96395faa-99c1-11dd-bbfe-3dabce05a288 --- 3rdparty/CMakeLists.txt | 9 +------ 3rdparty/SoundTouch/CMakeLists.txt | 2 +- 3rdparty/bzip2/CMakeLists.txt | 2 +- 3rdparty/liba52/CMakeLists.txt | 2 +- 3rdparty/soundtouch_linux_include/soundtouch | 1 + 3rdparty/zlib/CMakeLists.txt | 2 +- cmake/BuildParameters.cmake | 6 ----- cmake/FindSoundTouch.cmake | 9 ++++--- cmake/SearchForStuff.cmake | 25 +++--------------- pcsx2/PrecompiledHeader.h | 2 +- plugins/CDVDiso/CMakeLists.txt | 2 -- plugins/CDVDiso/src/libiso.cpp | 4 +-- plugins/CDVDlinuz/CMakeLists.txt | 2 -- plugins/CMakeLists.txt | 26 +++++++++---------- plugins/spu2-x/CMakeLists.txt | 2 -- plugins/spu2-x/src/Decoder.cpp | 22 +++++++++++----- plugins/spu2-x/src/Linux/ConfigSoundTouch.cpp | 2 +- plugins/spu2-x/src/SndOut_Portaudio.cpp | 4 +-- plugins/spu2-x/src/Timestretcher.cpp | 3 +-- plugins/spu2-x/src/Wavedump_wav.cpp | 2 +- plugins/zerospu2/voices.cpp | 3 +-- plugins/zerospu2/zerodma.cpp | 3 +-- plugins/zerospu2/zerospu2.cpp | 4 +-- plugins/zerospu2/zeroworker.cpp | 4 +-- plugins/zzogl-pg/CMakeLists.txt | 6 ----- plugins/zzogl-pg/opengl/zpipe.cpp | 2 +- 26 files changed, 58 insertions(+), 93 deletions(-) create mode 120000 3rdparty/soundtouch_linux_include/soundtouch delete mode 100644 plugins/CDVDiso/CMakeLists.txt delete mode 100644 plugins/CDVDlinuz/CMakeLists.txt delete mode 100644 plugins/spu2-x/CMakeLists.txt delete mode 100644 plugins/zzogl-pg/CMakeLists.txt diff --git a/3rdparty/CMakeLists.txt b/3rdparty/CMakeLists.txt index 752fef914b..f42df6d0b2 100644 --- a/3rdparty/CMakeLists.txt +++ b/3rdparty/CMakeLists.txt @@ -1,21 +1,14 @@ - -# make bzip2 # build project bzip2 if(projectBZip2) add_subdirectory(bzip2) endif(projectBZip2) -# make zlib # build project zlib if(projectZLIB) add_subdirectory(zlib) endif(projectZLIB) -# make SoundTouch +# build project SoundTouch if(projectSoundTouch) add_subdirectory(SoundTouch) endif(projectSoundTouch) - - -# make liba52 -add_subdirectory(liba52) \ No newline at end of file diff --git a/3rdparty/SoundTouch/CMakeLists.txt b/3rdparty/SoundTouch/CMakeLists.txt index 2c8fc54451..507cd26e3d 100644 --- a/3rdparty/SoundTouch/CMakeLists.txt +++ b/3rdparty/SoundTouch/CMakeLists.txt @@ -1,7 +1,7 @@ # SoundTouch library # library name -set(SoundTouchName SoundTouch) +set(SoundTouchName pcsx2_SoundTouch) set(CommonFlags -m32 diff --git a/3rdparty/bzip2/CMakeLists.txt b/3rdparty/bzip2/CMakeLists.txt index b4423f31dc..b07b2f62cd 100644 --- a/3rdparty/bzip2/CMakeLists.txt +++ b/3rdparty/bzip2/CMakeLists.txt @@ -1,7 +1,7 @@ # bzip2 library # library name -set(bzip2Name bzip2) +set(bzip2Name pcsx2_bzip2) set(CommonFlags -m32 diff --git a/3rdparty/liba52/CMakeLists.txt b/3rdparty/liba52/CMakeLists.txt index d2a323907a..e3649cf177 100644 --- a/3rdparty/liba52/CMakeLists.txt +++ b/3rdparty/liba52/CMakeLists.txt @@ -1,7 +1,7 @@ # a52 library # library name -set(a52Name a52) +set(a52Name pcsx2_a52) set(CommonFlags -Wall diff --git a/3rdparty/soundtouch_linux_include/soundtouch b/3rdparty/soundtouch_linux_include/soundtouch new file mode 120000 index 0000000000..018b6b2aeb --- /dev/null +++ b/3rdparty/soundtouch_linux_include/soundtouch @@ -0,0 +1 @@ +../SoundTouch \ No newline at end of file diff --git a/3rdparty/zlib/CMakeLists.txt b/3rdparty/zlib/CMakeLists.txt index 534a7b073f..1d9d9ea5fb 100644 --- a/3rdparty/zlib/CMakeLists.txt +++ b/3rdparty/zlib/CMakeLists.txt @@ -1,7 +1,7 @@ # zlib library # library name -set(zlibName zlib) +set(zlibName pcsx2_zlib) set(CommonFlags -W diff --git a/cmake/BuildParameters.cmake b/cmake/BuildParameters.cmake index 2c599875e6..26076d9692 100644 --- a/cmake/BuildParameters.cmake +++ b/cmake/BuildParameters.cmake @@ -3,7 +3,6 @@ # Enable/disable the stipping : -DCMAKE_BUILD_STRIP=TRUE|FALSE ### Force the choice of 3rd party library in pcsx2 over system libraries # Use all internal lib: -DFORCE_INTERNAL_ALL=TRUE -# Use a52 internal lib: -DFORCE_INTERNAL_A52=TRUE # Use bzip internal lib: -DFORCE_INTERNAL_BZIP2=TRUE # Use soundtouch internal lib: -DFORCE_INTERNAL_SOUNDTOUCH=TRUE # Use zlib internal lib: -DFORCE_INTERNAL_ZLIB=TRUE @@ -38,16 +37,11 @@ endif(NOT DEFINED CMAKE_BUILD_STRIP) # Select library system vs 3rdparty #------------------------------------------------------------------------------- if(FORCE_INTERNAL_ALL) - set(FORCE_INTERNAL_A52 TRUE) set(FORCE_INTERNAL_BZIP2 TRUE) set(FORCE_INTERNAL_SOUNDTOUCH TRUE) set(FORCE_INTERNAL_ZLIB TRUE) endif(FORCE_INTERNAL_ALL) -if(NOT DEFINED FORCE_INTERNAL_A52) - set(FORCE_INTERNAL_A52 FALSE) -endif(NOT DEFINED FORCE_INTERNAL_A52) - if(NOT DEFINED FORCE_INTERNAL_BZIP2) set(FORCE_INTERNAL_BZIP2 FALSE) endif(NOT DEFINED FORCE_INTERNAL_BZIP2) diff --git a/cmake/FindSoundTouch.cmake b/cmake/FindSoundTouch.cmake index 013678a09e..f4a4373f5c 100644 --- a/cmake/FindSoundTouch.cmake +++ b/cmake/FindSoundTouch.cmake @@ -10,10 +10,11 @@ if(SOUNDTOUCH_INCLUDE_DIR AND SOUNDTOUCH_LIBRARIES) endif(SOUNDTOUCH_INCLUDE_DIR AND SOUNDTOUCH_LIBRARIES) # include dir -find_path(SOUNDTOUCH_INCLUDE_DIR SoundTouch.h - /usr/include/soundtouch - /usr/local/include/soundtouch - ) +#find_path(SOUNDTOUCH_INCLUDE_DIR SoundTouch.h +# /usr/include/soundtouch +# /usr/local/include/soundtouch +# ) +find_path(SOUNDTOUCH_INCLUDE_DIR soundtouch/SoundTouch.h) # finally the library itself find_library(libSoundTouch NAMES SoundTouch) diff --git a/cmake/SearchForStuff.cmake b/cmake/SearchForStuff.cmake index 966cfbc726..bad4308ae5 100644 --- a/cmake/SearchForStuff.cmake +++ b/cmake/SearchForStuff.cmake @@ -35,7 +35,6 @@ include(FindSoundTouch) # Current implementation: # 1/ include 3rdparty sub-directory that we will used (either request or fallback) # 2/ include system one -# 3/ include 3rdpary main (just in case we miss some include files) #---------------------------------------- # Fallback on 3rdparty libraries #---------------------------------------- @@ -64,20 +63,10 @@ if(NOT SOUNDTOUCH_FOUND OR FORCE_INTERNAL_SOUNDTOUCH) set(SOUNDTOUCH_FOUND TRUE) # Set path set(SOUNDTOUCH_LIBRARIES SoundTouch) - include_directories(${PROJECT_SOURCE_DIR}/3rdparty/SoundTouch) + # include_directories(${PROJECT_SOURCE_DIR}/3rdparty/SoundTouch) + include_directories(${PROJECT_SOURCE_DIR}/3rdparty/soundtouch_linux_include) endif(NOT SOUNDTOUCH_FOUND OR FORCE_INTERNAL_SOUNDTOUCH) -if(NOT A52_FOUND OR FORCE_INTERNAL_A52) - # use project one - set(projectA52 TRUE) - set(A52_FOUND TRUE) - # Set path - set(A52_LIBRARIES A52) - # XXX Need to be updated when repository will be updated - # For the moment include are done with the last fallback in bottom of the file - # include_directories(${PROJECT_SOURCE_DIR}/3rdparty/a52_internal) -endif(NOT A52_FOUND OR FORCE_INTERNAL_A52) - #---------------------------------------- # Use system include (if not 3rdparty one) #---------------------------------------- @@ -94,9 +83,9 @@ if(Linux) endif(Linux) # A52 -if(A52_FOUND AND NOT projectA52) +if(A52_FOUND) include_directories(${A52_INCLUDE_DIR}) -endif(A52_FOUND AND NOT projectA52) +endif(A52_FOUND) # ALSA if(ALSA_FOUND) @@ -164,9 +153,3 @@ endif(wxWidgets_FOUND) if(ZLIB_FOUND AND NOT projectZLIB) include_directories(${ZLIB_INCLUDE_DIRS}) endif(ZLIB_FOUND AND NOT projectZLIB) - -#---------------------------------------- -# In all others situation fallback to the 3rdparty -#---------------------------------------- -# XXX Must be delete when all include will be fixed -include_directories(${PROJECT_SOURCE_DIR}/3rdparty) diff --git a/pcsx2/PrecompiledHeader.h b/pcsx2/PrecompiledHeader.h index 4ed610d80d..b68d145823 100644 --- a/pcsx2/PrecompiledHeader.h +++ b/pcsx2/PrecompiledHeader.h @@ -76,7 +76,7 @@ typedef int BOOL; // unchanged for long periods of time, or happen to be used by almost everything, so they // need a full recompile anyway, when modified (etc) -#include +#include "zlib.h" #include "Pcsx2Defs.h" #include "i18n.h" diff --git a/plugins/CDVDiso/CMakeLists.txt b/plugins/CDVDiso/CMakeLists.txt deleted file mode 100644 index 9f18fb33d9..0000000000 --- a/plugins/CDVDiso/CMakeLists.txt +++ /dev/null @@ -1,2 +0,0 @@ -# CDVDiso plugin -add_subdirectory(src) \ No newline at end of file diff --git a/plugins/CDVDiso/src/libiso.cpp b/plugins/CDVDiso/src/libiso.cpp index 8a4d85fa43..97591936f5 100644 --- a/plugins/CDVDiso/src/libiso.cpp +++ b/plugins/CDVDiso/src/libiso.cpp @@ -23,8 +23,8 @@ #include #include -#include -#include +#include "zlib.h" +#include "bzlib.h" #include "CDVDiso.h" #include "libiso.h" diff --git a/plugins/CDVDlinuz/CMakeLists.txt b/plugins/CDVDlinuz/CMakeLists.txt deleted file mode 100644 index 98ac06b0de..0000000000 --- a/plugins/CDVDlinuz/CMakeLists.txt +++ /dev/null @@ -1,2 +0,0 @@ -# CDVDLinuz plugin -add_subdirectory(Src) \ No newline at end of file diff --git a/plugins/CMakeLists.txt b/plugins/CMakeLists.txt index f0b8caf9a9..0efeac7bc3 100644 --- a/plugins/CMakeLists.txt +++ b/plugins/CMakeLists.txt @@ -7,17 +7,17 @@ # make CDVDiso if(EXISTS "${PROJECT_SOURCE_DIR}/plugins/CDVDiso" AND CDVDiso) - add_subdirectory(CDVDiso) + add_subdirectory(CDVDiso/src) endif(EXISTS "${PROJECT_SOURCE_DIR}/plugins/CDVDiso" AND CDVDiso) # make CDVDisoEFP -if(EXISTS "${PROJECT_SOURCE_DIR}/plugins/CDVDisoEFP" AND CDVDisoEFP) - add_subdirectory(CDVDisoEFP) -endif(EXISTS "${PROJECT_SOURCE_DIR}/plugins/CDVDisoEFP" AND CDVDisoEFP) +# if(EXISTS "${PROJECT_SOURCE_DIR}/plugins/CDVDisoEFP" AND CDVDisoEFP) +# add_subdirectory(CDVDisoEFP) +# endif(EXISTS "${PROJECT_SOURCE_DIR}/plugins/CDVDisoEFP" AND CDVDisoEFP) # make CDVDlinuz if(EXISTS "${PROJECT_SOURCE_DIR}/plugins/CDVDlinuz" AND CDVDlinuz) - add_subdirectory(CDVDlinuz) + add_subdirectory(CDVDlinuz/Src) endif(EXISTS "${PROJECT_SOURCE_DIR}/plugins/CDVDlinuz" AND CDVDlinuz) # make CDVDnull @@ -26,9 +26,9 @@ if(EXISTS "${PROJECT_SOURCE_DIR}/plugins/CDVDnull" AND CDVDnull) endif(EXISTS "${PROJECT_SOURCE_DIR}/plugins/CDVDnull" AND CDVDnull) # make CDVDolio -if(EXISTS "${PROJECT_SOURCE_DIR}/plugins/CDVDolio" AND CDVDolio) - add_subdirectory(CDVDolio) -endif(EXISTS "${PROJECT_SOURCE_DIR}/plugins/CDVDolio" AND CDVDolio) +# if(EXISTS "${PROJECT_SOURCE_DIR}/plugins/CDVDolio" AND CDVDolio) +# add_subdirectory(CDVDolio) +# endif(EXISTS "${PROJECT_SOURCE_DIR}/plugins/CDVDolio" AND CDVDolio) # make CDVDpeops #if(EXISTS "${PROJECT_SOURCE_DIR}/plugins/CDVDpeops" AND CDVDpeops) @@ -71,9 +71,9 @@ if(EXISTS "${PROJECT_SOURCE_DIR}/plugins/PadNull" AND PadNull) endif(EXISTS "${PROJECT_SOURCE_DIR}/plugins/PadNull" AND PadNull) # make PeopsSPU2 -if(EXISTS "${PROJECT_SOURCE_DIR}/plugins/PeopsSPU2" AND PeopsSPU2) - add_subdirectory(PeopsSPU2) -endif(EXISTS "${PROJECT_SOURCE_DIR}/plugins/PeopsSPU2" AND PeopsSPU2) +# if(EXISTS "${PROJECT_SOURCE_DIR}/plugins/PeopsSPU2" AND PeopsSPU2) +# add_subdirectory(PeopsSPU2) +# endif(EXISTS "${PROJECT_SOURCE_DIR}/plugins/PeopsSPU2" AND PeopsSPU2) # make SPU2null if(EXISTS "${PROJECT_SOURCE_DIR}/plugins/SPU2null" AND SPU2null) @@ -82,7 +82,7 @@ endif(EXISTS "${PROJECT_SOURCE_DIR}/plugins/SPU2null" AND SPU2null) # make spu2-x if(EXISTS "${PROJECT_SOURCE_DIR}/plugins/spu2-x" AND spu2-x) - add_subdirectory(spu2-x) + add_subdirectory(spu2-x/src) endif(EXISTS "${PROJECT_SOURCE_DIR}/plugins/spu2-x" AND spu2-x) # make SSSPSXPAD @@ -107,7 +107,7 @@ endif(EXISTS "${PROJECT_SOURCE_DIR}/plugins/USBnull" AND USBnull) # make zzogl-pg if(EXISTS "${PROJECT_SOURCE_DIR}/plugins/zzogl-pg" AND zzogl) - add_subdirectory(zzogl-pg) + add_subdirectory(zzogl-pg/opengl) endif(EXISTS "${PROJECT_SOURCE_DIR}/plugins/zzogl-pg" AND zzogl) # make zeropad diff --git a/plugins/spu2-x/CMakeLists.txt b/plugins/spu2-x/CMakeLists.txt deleted file mode 100644 index bd6542ebef..0000000000 --- a/plugins/spu2-x/CMakeLists.txt +++ /dev/null @@ -1,2 +0,0 @@ -# make spu-x -add_subdirectory(src) diff --git a/plugins/spu2-x/src/Decoder.cpp b/plugins/spu2-x/src/Decoder.cpp index 1fa16e05f2..dc66713d14 100644 --- a/plugins/spu2-x/src/Decoder.cpp +++ b/plugins/spu2-x/src/Decoder.cpp @@ -16,17 +16,25 @@ //Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// Commenting this will disable all the code in Decoder.cpp (which is the only code that uses liba52 in spu2-x.) -#define ENABLE_DECODER - #include "Global.h" -#ifdef ENABLE_DECODER +// Commenting this will disable all the code in Decoder.cpp (which is the only code that uses liba52 in spu2-x.) +#ifndef ENABLE_DECODER +# define ENABLE_DECODER 1 +#endif + +#if ENABLE_DECODER extern "C" { -#include "liba52/inttypes.h" -#include "liba52/a52.h" -#include "liba52/mm_accel.h" +#ifdef _MSC_VER +# include "liba52/inttypes.h" +# include "liba52/a52.h" +# include "liba52/mm_accel.h" +#else +# include +# include "a52dec/a52.h" +# include "a52dec/mm_accel.h" +#endif } extern u32 spdif_read_data(u8 *buff, u32 max_data); diff --git a/plugins/spu2-x/src/Linux/ConfigSoundTouch.cpp b/plugins/spu2-x/src/Linux/ConfigSoundTouch.cpp index b960037c1d..fa9c7c5f0b 100644 --- a/plugins/spu2-x/src/Linux/ConfigSoundTouch.cpp +++ b/plugins/spu2-x/src/Linux/ConfigSoundTouch.cpp @@ -22,7 +22,7 @@ #include "Global.h" #include "Dialogs.h" #include "Config.h" -#include "SoundTouch/SoundTouch.h" +#include "soundtouch/SoundTouch.h" namespace SoundtouchCfg { diff --git a/plugins/spu2-x/src/SndOut_Portaudio.cpp b/plugins/spu2-x/src/SndOut_Portaudio.cpp index 8acf650d82..50d8b5bdad 100644 --- a/plugins/spu2-x/src/SndOut_Portaudio.cpp +++ b/plugins/spu2-x/src/SndOut_Portaudio.cpp @@ -20,10 +20,10 @@ #define _WIN32_DCOM #include "Dialogs.h" -#include "portaudio/include/portaudio.h" +#include "portaudio.h" #ifdef __WIN32__ -#include "portaudio/include/pa_win_wasapi.h" +#include "pa_win_wasapi.h" #endif #ifdef __LINUX__ diff --git a/plugins/spu2-x/src/Timestretcher.cpp b/plugins/spu2-x/src/Timestretcher.cpp index 18ea35a1df..6f0b613a26 100644 --- a/plugins/spu2-x/src/Timestretcher.cpp +++ b/plugins/spu2-x/src/Timestretcher.cpp @@ -16,8 +16,7 @@ */ #include "Global.h" -#include "SoundTouch/SoundTouch.h" -#include "SoundTouch/WavFile.h" +#include "soundtouch/SoundTouch.h" static soundtouch::SoundTouch* pSoundTouch = NULL; diff --git a/plugins/spu2-x/src/Wavedump_wav.cpp b/plugins/spu2-x/src/Wavedump_wav.cpp index 4a8acb36ff..e668229d4a 100644 --- a/plugins/spu2-x/src/Wavedump_wav.cpp +++ b/plugins/spu2-x/src/Wavedump_wav.cpp @@ -16,7 +16,7 @@ */ #include "Global.h" -#include "SoundTouch/WavFile.h" +#include "soundtouch/WavFile.h" static WavOutFile* _new_WavOutFile( const char* destfile ) { diff --git a/plugins/zerospu2/voices.cpp b/plugins/zerospu2/voices.cpp index 8a11e7cd90..81b2f33118 100644 --- a/plugins/zerospu2/voices.cpp +++ b/plugins/zerospu2/voices.cpp @@ -21,8 +21,7 @@ #include "zerospu2.h" -#include "SoundTouch/SoundTouch.h" -#include "SoundTouch/WavFile.h" +#include "soundtouch/SoundTouch.h" // VOICE_PROCESSED definitions diff --git a/plugins/zerospu2/zerodma.cpp b/plugins/zerospu2/zerodma.cpp index aa6a878ee1..f16e435d8d 100644 --- a/plugins/zerospu2/zerodma.cpp +++ b/plugins/zerospu2/zerodma.cpp @@ -22,8 +22,7 @@ #include #include -#include "SoundTouch/SoundTouch.h" -#include "SoundTouch/WavFile.h" +#include "soundtouch/SoundTouch.h" void CALLBACK SPU2readDMAMem(u16 *pMem, int size, int channel) { diff --git a/plugins/zerospu2/zerospu2.cpp b/plugins/zerospu2/zerospu2.cpp index 905a73831b..557dd7601d 100644 --- a/plugins/zerospu2/zerospu2.cpp +++ b/plugins/zerospu2/zerospu2.cpp @@ -27,8 +27,8 @@ #include #include -#include "SoundTouch/SoundTouch.h" -#include "SoundTouch/WavFile.h" +#include "soundtouch/SoundTouch.h" +#include "soundtouch/WavFile.h" char libraryName[256]; diff --git a/plugins/zerospu2/zeroworker.cpp b/plugins/zerospu2/zeroworker.cpp index 538445d659..4d1f97516c 100644 --- a/plugins/zerospu2/zeroworker.cpp +++ b/plugins/zerospu2/zeroworker.cpp @@ -18,8 +18,8 @@ #include "zerospu2.h" #include "zeroworker.h" -#include "SoundTouch/SoundTouch.h" -#include "SoundTouch/WavFile.h" +#include "soundtouch/SoundTouch.h" +#include "soundtouch/WavFile.h" s32 g_logsound = 0; WavOutFile* g_pWavRecord=NULL; // used for recording diff --git a/plugins/zzogl-pg/CMakeLists.txt b/plugins/zzogl-pg/CMakeLists.txt deleted file mode 100644 index 2e86b1acdb..0000000000 --- a/plugins/zzogl-pg/CMakeLists.txt +++ /dev/null @@ -1,6 +0,0 @@ -# zzogl plugin - -# zerogs plugin opengl -if(UNIX) - add_subdirectory(opengl) -endif(UNIX) \ No newline at end of file diff --git a/plugins/zzogl-pg/opengl/zpipe.cpp b/plugins/zzogl-pg/opengl/zpipe.cpp index ac604780f7..1911dcf308 100644 --- a/plugins/zzogl-pg/opengl/zpipe.cpp +++ b/plugins/zzogl-pg/opengl/zpipe.cpp @@ -8,7 +8,7 @@ #include //#define ZLIB_WINAPI -#include "zlib/zlib.h" +#include "zlib.h" int def(char *src, char *dst, int bytes_to_compress, int *bytes_after_compressed) ; int inf(char *src, char *dst, int bytes_to_decompress, int maximum_after_decompress) ;