Commit Graph

208 Commits

Author SHA1 Message Date
Gregory Hainaut 979ea92754 gsdx: make png++ optional
Some distributions (Fedora) doesn't have a png++ package...
2015-06-04 20:22:05 +02:00
Gregory Hainaut 8d6d8067fd linux: rename everything. It is PCSX2 is uppercase letter
Sorry for all maintainers that will need to upgrade their packages
2015-05-18 10:04:23 +02:00
Gregory Hainaut 5c046180a1 cmake: properly add detection of lzma
Code is 100% optional.

Code will allow be enabled if lzma-dev is installed at compile time
2015-05-17 22:08:10 +02:00
Gregory Hainaut 8cd533304c gsdx: new dependency on linux => png++
Note: it is only header file that wrap the standard png (which was
already mandatory for wx/sdl)
2015-05-16 12:47:28 +02:00
Gregory Hainaut 88a714327a linux-zzogl: don't build anymore zzogl by default
Sadly, no time to maintain it neither to improve it.

Note: I think new openGL 4.x feature would make the plugin faster

Anyway, now GSdx-ogl is probably better than zzogl
2015-05-14 17:38:42 +02:00
Gregory Hainaut cb6e8a7d6a gsdx-linux: Don't enable EGL by default
I was hoping that EGL become a standard much more faster. Currently it is an useless dep
so let's disable it by default.
2015-05-11 15:33:40 +02:00
Gregory Hainaut 286fe4db8c cmake/gsdx: check png++ is installed to support png image
Otherwise fallback to bmp file
2015-05-11 11:32:13 +02:00
Gregory Hainaut 797e3d81da cmake: CheckLib allow to search only include
Some libraries doesn't have any .so file
2015-05-11 11:28:09 +02:00
Gregory Hainaut 335695bd0e purge GLES from GSdx !
mobile will use vulkan (or any new API) anyway
2015-05-01 20:02:17 +02:00
Gregory Hainaut b68270ded1 Merge pull request #448 from PCSX2/lilypad-linux-port
Lilypad linux port
Basic support of Keyboard and Joystick

No gui to configure anything. Not well tested yet.
2015-03-01 16:52:23 +01:00
Gregory Hainaut fb100e05f2 cmake: improve previous commit
Avoid to set -m32 two times

Fix issue #463
2015-02-27 10:02:38 +01:00
Gregory Hainaut b5612ec622 cmake: always set -m32 for 32 bits build
It fixes cross-compilition issue when users/env set CC/CXX variables
2015-02-22 22:17:38 +01:00
Gregory Hainaut 7985f5114c cmake: enable lilypad
I manage to have x/start button working with 0/1 key. Here the reference configuration.

[General\ Settings]
Force\ Cursor\ Hide=0
Mouse\ Unfocus=0
Background=0
Multiple\ Bindings=0
DirectInput\ Game\ Devices=0
XInput=0
DualShock\ 3=0
Multitap\ 1=0
Multitap\ 2=0
Escape\ Fullscreen\ Hack=0
Disable\ Screen\ Saver=0
Logging=0
Save\ State\ in\ Title=0
GH2=0
Turbo\ Key\ Hack=0
Vista\ Volume=0
Close\ Hacks=0
Keyboard\ Mode=16
Mouse\ Mode=0
Volume=0
[Pad\ 0\ 0]
Mode=1
Auto\ Analog=0
[Pad\ 0\ 1]
Mode=1
Auto\ Analog=0
[Pad\ 0\ 2]
Mode=1
Auto\ Analog=0
[Pad\ 0\ 3]
Mode=1
Auto\ Analog=0
[Pad\ 1\ 0]
Mode=1
Auto\ Analog=0
[Pad\ 1\ 1]
Mode=1
Auto\ Analog=0
[Pad\ 1\ 2]
Mode=1
Auto\ Analog=0
[Pad\ 1\ 3]
Mode=1
Auto\ Analog=0
[Device\ 0]
Display\ Name=displayName
Instance\ ID=instanceID
Product\ ID=deviceID
API=16
Type=1
Binding 0=0x00040030, 0, 31, 65536, 0, 0, 0
Binding 1=0x00040031, 0, 19, 65536, 0, 0, 0
Binding 2=0x00040002, 0, 50, 65536, 0, 0, 0
Binding 3=0x00040003, 0, 51, 65536, 0, 0, 0
Binding 4=0x00040004, 0, 52, 65536, 0, 0, 0
Binding 5=0x00040005, 0, 53, 65536, 0, 0, 0
Binding 6=0x00040006, 0, 54, 65536, 0, 0, 0
Binding 7=0x00040007, 0, 55, 65536, 0, 0, 0
Binding 8=0x00040008, 0, 56, 65536, 0, 0, 0
Binding 9=0x00040009, 0, 57, 65536, 0, 0, 0
Binding 10=0x0004000C, 0, 58, 65536, 0, 0, 0
Binding 11=0x0004000D, 0, 59, 65536, 0, 0, 0
Binding 12=0x0004000E, 0, 60, 65536, 0, 0, 0
Binding 13=0x0004000F, 0, 61, 65536, 0, 0, 0
Binding 14=0x00200010, 0, 62, 65536, 0, 0, 1
Binding 15=0x00200011, 0, 63, 65536, 0, 0, 1
Binding 16=0x01020012, 0, 33, 65536, 0, 0, 13172
Binding 17=0x02020012, 0, 35, 65536, 0, 0, 13172
Binding 18=0x02020014, 0, 39, 65536, 0, 0, 13172
Binding 19=0x02020015, 0, 38, 65536, 0, 0, 13172
2015-02-20 23:05:21 +01:00
Gregory Hainaut 2471306fc4 cmake: actually onepad requires X11 2015-02-20 23:05:21 +01:00
Gregory Hainaut c5e6013d75 Merge pull request #419 from PCSX2/64-bit-crashes-fix
64 bit crashes fix
2015-01-17 12:08:24 +01:00
Miguel A. Colón Vélez f160c39814 Remove dead code from cmake/ApiValidation.cmake. 2015-01-12 02:54:49 -05:00
Miguel A. Colón Vélez 90c4322fc5 Remove check for wxrc since it's not needed. 2015-01-09 07:44:26 -05:00
Miguel A. Colón Vélez 3b83d6d302 Make FindwxWidgets find the correct version/toolkit via wx-config.
WX_vs_SDL() is still needed.
2015-01-09 07:18:16 -05:00
Miguel A. Colón Vélez cc9b6fa5a4 Search for wx-config-3.0 and wxrc-3.0.
The comment made it look as an arch-only thing which was misleading.
.
Gentoo uses
wx-config-3.0 and wxrc-3.0
2015-01-08 22:27:16 -05:00
Miguel A. Colón Vélez f392493245 Don't assume .git exists just because git is installed.
find_package(Git) is done in SearchForStuff it could be deleted over there
but it fits better there. The only thing this line did was saying git was
not found for a second time since if it was found then it never triggered.
.
Check for the existance of .git to avoid
fatal: Not a git repository (or any of the parent directories): .git
2015-01-06 21:14:10 -05:00
Gregory Hainaut b03162747c sVU: add an option to remove it
The goal is to reduce the burden for new architecture port.

Patch is mostly inspired from 3kinox initial patch. The diff are
*/ used ifdef instead of raw removal
*/ gui don't rely on UseMicroVU* option
*/ completely remove sVU_micro.* file
2015-01-06 23:45:43 +01:00
Gregory Hainaut 678c8a5cd6 cmake: validate wx api
checks wx-config version is compatible with the one requested by the user (wx 2.8 or wx 3.0 with WX28_API option)
2015-01-06 21:55:33 +01:00
Gregory Hainaut a0d54df522 Merge pull request #415 from micove/build-cleanup
Improve build system.
2015-01-06 21:36:24 +01:00
Gregory Hainaut e447ffc8b2 cmake: fix asan on 64 bits 2015-01-05 23:45:37 +01:00
Miguel A. Colón Vélez 305942c78b Rely on the user specifying WX28_API. 2015-01-04 15:08:12 -05:00
Gregory Hainaut 90d27bf5f6 cmake: try to validate the user option
* GTK3_API requires a wxWidget that support it too
=> avoid complexe compilation error
* SDL2_API requires a wxWidget without SDL support (wxUSE_LIBSDL = 0)
=> avoid run time  crash

SDL check hypothesis: wx is linked against SDL1.2 and not SDL2. It would need to be improved on a distant future
2015-01-04 20:43:26 +01:00
Gregory Hainaut 0346da2fa0 cmake: both zzogl and gsdx require gtk
Actually everything require GTK
2015-01-04 19:54:05 +01:00
Miguel A. Colón Vélez 8440d263cd Respect the CC and CXX environment variables when cross building. 2015-01-04 00:56:47 -05:00
Miguel A. Colón Vélez e23e2ac327 Rely on clang autodetection instead of user input. 2015-01-03 22:07:16 -05:00
Miguel A. Colón Vélez 6e28a8e694 Update the archlinux wx fix.
This fixes it for build.sh and when not using build.sh (packaging).
.
Also fix native 32bit build which should also be broken and attempt to
predict the future and fix it for lib32-wx3.0. Worst case the filenames
have to be fixed which is trivial.
.
When wx2.8 support is dropped then only the lib32-wx3.0 IF should remain.
When crosscompilation support gets dropped then the first IF gets deleted
unless we also dropped wx2.8 support then everything gets deleted.
2015-01-03 22:00:47 -05:00
Miguel A. Colón Vélez c2cba0d4ae Quick regression fix for SDL2 detection.
I only had to add "PATH_SUFFIXES SDL2".
.
include is superfluous
SDL2-2.0 is a distro specific convenience symlink. Use the correct one
as before.
.
I probably did this as an artificial way of disabling pkgconfig when cross
compiling and before disabling pkgconfig for all cross compiling but it's
wrong. I thought I had fixed this already.
2015-01-03 14:51:04 +01:00
Miguel A. Colón Vélez be1842f4e9 Detect clang and automatically set USE_CLANG.
User may forget or not know about -DUSE_CLANG=TRUE. It could probably
be always autodetected instead of requiring user input.
.
Trivial wording changes to compiler_version.
2015-01-03 14:51:04 +01:00
Miguel A. Colón Vélez c8c22cf6a0 Notify about cross build option upon failure.
Tell the user to use CMAKE_TOOLCHAIN_FILE upon failure.
.
Cleanup detectOperatingSystem. Should be the same but adding
GNU and kFreeBSD from Debian and filtering out pre OS X Apple.
.
libaio is linux only. Also check for the correct header since
aio.h is the POSIX one. Both are in /usr/include/ anyway.
Only build core if (Linux AND NOT AIO_FOUND) == false.
.
Use Unix for GTK and X11. Macs has gtk-quartzs and xquartz or native X11.
*BSD, linux, etc should have both.
2015-01-03 14:51:04 +01:00
Miguel A. Colón Vélez b42c9defb1 Avoid PKG_CONFIG_PATH issues.
Even before this pull request it was required to set PKG_CONFIG_PATH
when cross compiling since pkg-config always searches for native
libraries. This would require to backup an already existing ENV
variable if present, detect the distro specific place the pkgconfig folder is,
and restore the original ENV variable if it was present. Cmake as shown in:
.
http://www.cmake.org/gitweb?p=cmake.git;a=commitdiff;h=3df51470
.
added support for this but requires CMAKE_MINIMUM_REQUIRED_VERSION as 3.1
which is kind of strict since it was released 10 days ago.
.
To avoid the ugliness let just avoid pkg-config when cross compiling. This
means only EGL, SDL2 and GTK3 have to be updated since the rest work w/o
pkg-config.
- EGL is fixed with PR #409
- SDL2 is fixed here and it's trivial.
- GTK3 is non-trivial. For this one use pkg-config for native builds since
  the .pc file is kept up to date automatically. For cross compilation
  use the provided FindGTK3 which I made by using the sed documented
  inside the file and updating the dependencies for GTK3. Since I checked
  each and every single .pc file to make sure they are up to date this
  should have the same behaviour as pkg-config. Prefer the .pc files for
  native builds since it does not need to be manually updated and when
  the native 64bit port gets finished all the cross compile options should
  be removed which is quite easy since most of the code got moved to the
  CMAKE_TOOLCHAIN_FILE.
Note:
Cmake Modules are BSD-3-clause therefore GPL compatible.
2015-01-03 14:51:04 +01:00
Miguel A. Colón Vélez bed7a4f92e Be really strict about dependencies.
The obtained binaries before and after this commit are identical (sha1sum)
when compiled in Debian/Ubuntu/Fedora/ArchLinux.
.
The linker will always pick the 32bit libraries the only thing this does is
make sure we have all the 32bit dependencies installed. Basically we avoid
detecting the 64bit libraries and telling the users the 32bit libraries were
found. We always link with 32bit libraries therefore this avoids having to
wait 5-10min to just be told -lXXX is missing.
.
The only thing really needed are
set(CMAKE_LIBRARY_ARCHITECTURE "../lib32")
set(CMAKE_LIBRARY_ARCHITECTURE ".")
.
which basically ensures we don't pick 64bit headers since
CMAKE_LIBRARY_ARCHITECTURE always gets tested first and for some reason
FindGTK2 test searches lib64 first then lib32/lib. These values are hardcoded.
Right now these arch specific headers are not used but can't say this will
always be true.
.
FIND_LIBRARY_USE_LIB64_PATHS is not needed for native builds and it's covered
by CMAKE_SYSTEM_IGNORE_PATH.
.
NOTE:
We filter out lib32 because multilib is not compatible with multiarch.
2015-01-03 14:51:04 +01:00
Miguel A. Colón Vélez 553536f9cb Fix build in Fedora and print a confimation of cross compilation.
- Fedora only needs --arch if cross compiling.
  + It's only used to select libdir so i386=i686=i986
- Messages are nice to debug build logs.
.
Everything seems to work unless some other distro broke. Other
distros need to add CMAKE_TOOLCHAIN_FILE or --cross-multilib if
they cross compiled amd64 -> i686.
2015-01-03 14:51:04 +01:00
Miguel A. Colón Vélez b03ca5fcf4 Include some rather simple CMAKE_TOOLCHAIN_FILE.
- Update the build.sh and fix some typos.
  + Don't add the OSX ones because I have not tested them and it won't
    even build anyway due to the libaio dependency. Needs to use POSIX AIO
    or something else.
- They are rather simple and all the magic happens in two lines.
  + First line tells cmake to get ready to compile FOR linux or darwin.
    It also sets CMAKE_CROSSCOMPILING to true which is the only way to
    let cmake known that we are using stuff not from the host.
  + CMAKE_C_COMPILER/CMAKE_CXX_COMPILER are basically used to detect
    the architecture of the target. Since I used generic cc/c++ the
    hardcoded -m32 is needed to ensure we get TARGET=i386. Also
    since I hardcode -m32 and use c++/cc it's to be noted that
    we can only do i386->i386 (trivial), amd64 -> i386, and x32->i386.
    .
    Using something like i586-linux-gnu-{gcc,g++} would also work and
    enable arm -> i386, etc but it's infeasible and impractical to do all
    the combinations. File is simple enough that a distro or user can
    create their own and cross compiling is rather tedious compared
    to using a chroot to compile it.
- I tested it in Debian with "dpkg-buildpackage -ai386" but installing the
  build dependencies was rather tedious.
2015-01-03 14:51:04 +01:00
Miguel A. Colón Vélez d6d06d243c Begin cleaning up the cross build code.
http://www.vtk.org/Wiki/CMake_Cross_Compiling
http://www.cmake.org/cmake/help/v3.0/manual/cmake-toolchains.7.html
.
The official way that cmake does cross compiling is via the use of a
CMAKE_TOOLCHAIN_FILE. This has to be given by the user and can't be
included from within a Cmake file since setting up the toolchain has
to be the first thing that happens.
.
After the file is given and validated cmake behaves nicely and all the
workarounds and hacks are not really needed anymore.
.
The consequence of this change is that without this file cmake will
try to build for the HOST architecture as expected and with the file
it will build for the TARGET architecture of the given toolchain. Due to
this remove 64BIT_BUILD_DONT_WORK and just ERROR out if the user tries
in the same way as before.
2015-01-03 14:51:04 +01:00
Miguel A. Colón Vélez 8ea0766773 Use TargetArch to correctly detect the target.
Currently crosscompiling was broken since we detected the cpu of the host
not of the target. Building arm -> i386, i386->amd64, etc resulted in
interesting stuff.
.
CMAKE_HOST_SYSTEM_PROCESSOR and CMAKE_SYSTEM_PROCESSOR should have done this
but they are incredibly broken and unreliable. I use
CMAKE_HOST_SYSTEM_PROCESSOR just to retain the format of the old message
and is not used for critical stuff so it does not matter.
.
This code also allows scalability so that if one day in the very distant
and unlikely future the x86/x86_64 specific code gets made portable
by replacing asm/MMX/SSE*/AVX/etc code with generic/portable code then
it also would work on all architectures.
.
For *BSD/OS X it probably would need to use POSIX AIO instead of linux
specific libaio but that is a different issue.
.
Error out the x86_64 builds.
Also the 64BIT_BUILD_DONT_WORK option became obsolete more info in following
commit.
2015-01-03 14:51:04 +01:00
Miguel A. Colón Vélez e548ada1e9 Disable the use of multiple architectures in darwin.
- Update copyright due to incoming changes.
- Don't support universal binaries until they actually work therefore
  only allow 1 architecture in CMAKE_OSX_ARCHITECTURES.
- Don't allow an empty ARCH list.
  We probably asked for ppc or ppc64 w/o support for it.
2015-01-03 14:51:04 +01:00
Miguel A. Colón Vélez b18b0fdf28 Add TargetArch.cmake.
For now just dump the original and add the BSD-2-Clause.
.
It's GPL compatible so it's okay.
.
I was writting one myself but found this one and it handles apple
which I did not consider since I can't test it.
2015-01-03 14:51:04 +01:00
Miguel A. Colón Vélez 6dd3094802 Fix the rare case in which EGL is not found.
EGL sometimes is not found. Checklib 1st does
.
string(TOLOWER ${lib} lower_lib)
pkg_search_module(${var} QUIET ${lower_lib})
.
Therefore this part should be equivalent since we always compare lower.
.
This part seems to not find anything and then it does.
.
find_library(${var}_LIBRARIES ${lib})
.
Here it also does not find anything since it tries to find libegl
while the library is called libEGL therefore I changed the name to upper.
to avoid
_internal_message("-- ${lib} not found (miss lib)")
.
It could fail in the unlikely event that someone renamed libEGL to libegl.
This bug is triggered when you combine crosscompiling from amd64 to
i386 with Debian multiarch paths. For other distros it should work with
pkg_search_module normally.
2014-12-24 11:41:04 -05:00
Gregory Hainaut d00666a4d9 cmake: regression to select SDL/GTK + 64bits fix 2014-12-22 19:31:32 +01:00
Gregory Hainaut 0c17d67fa5 cmake: add a new option to select the doc path in package mode
DOC_DIR_COMPILATION=/usr/share/doc/pcsx2

close issue #402
2014-12-21 16:51:41 +01:00
Gregory Hainaut dc1cd3eb25 cmake: forbid user to use experimental flags
Namely GTK3_API and 64BIT_BUILD_DONT_WORK

The former was barely tested and doesn't compile with standard wx
The latter doesn't work at all

Note: I was very close to disable SDL2 too.  If wxWidget was built with
SDL1 support it will crash
2014-12-21 10:46:33 +01:00
Gregory Hainaut 1f54bb73aa cmake: enable some aggressive warning
Allow to track strict aliasing issue and overflow
2014-12-20 13:43:25 +01:00
Gregory Hainaut 66d7aa75e2 cmake: move -DNDEBUG to global option 2014-12-20 13:43:25 +01:00
Gregory Hainaut 63ba78b664 remove zzogl-pg-cg
superseeded by zzogl-pg
2014-12-13 12:28:37 +01:00
Gregory Hainaut 800262fc14 cmake: add a new GTK3.0 option
Thanks #micove for the patch
2014-12-10 22:07:48 +01:00
Gregory Hainaut 0a4f9e43d9 cmake: clean sdl management
* sdl is mandatory for spu2x
* cmake will include either /usr/include/SDL or /usr/include/SDL2 so no
  need to add extra ifdef
2014-12-07 21:06:21 +01:00