Commit graph

37 commits

Author SHA1 Message Date
Dirk Hohndel
5e345fba0a Make system detection compile on Mac
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-06-14 13:29:13 -07:00
Dirk Hohndel
1120379b2b qmake: change the folder structure assumed for LIBMARBLEDEVEL
LIBMARBLEDEVEL is now assumed to point to the install prefix used for a
marble install (instead of into a mix of source and build trees as it did
in the past).

This makes it much easier to have Qt4 and Qt5 versions of this library and
link to the right one as needed.

Of course this requires a matching LD_LIBRARY_PATH when launching a
such-built Subsurface.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-06-06 10:06:12 -07:00
Dirk Hohndel
4c8369a7ba More cross building stuff
This is all mostly to make my life easier.
I'm not thrilled with the marble changes - as Linus pointed out before the
way we do these "LIBxxxDEVEL" changes is broken as it will still first
link against any library installed in the system. But since I have removed
any globally installed copies of these libraries this actually works for
me and it does help when experimenting with different build options for
the main libraries that we depend on.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-04-21 08:54:04 -07:00
Anton Lundin
198199adae Remove printing when building for Android
Qt for Android doesn't support printing.

Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-03-27 10:42:07 -07:00
Anton Lundin
605cff32a5 Remove usermanual when building for Android
Our usermanual is based on webkit, and thats not supported in Qt for
Android. We should probably replace it with a Android native webview
somehow.

Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-03-27 10:41:52 -07:00
Anton Lundin
42df3528a0 Disable marble on Android
marble uses webkit, and thats not compatible with Android.

Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-03-27 10:40:52 -07:00
Anton Lundin
770bf9afba Introduce NO_MARBLE define, make GlobeGPS a dummy
Some users have requested a way to build subsurface without marble.

This hides all traces in the ui and creates a GlobeGPS-dummy thats
just a QLabel saying that marble is disabled, in case its shown
somehow. The dummy is there so we can just ignore the fact that marble
is disabled in the rest of the code.

Fixes #394

Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-03-27 10:40:06 -07:00
Lubomir I. Ivanov
b3f78185a5 Add the WIN32_CONSOLE_APP flag
If the user passes 'CONFIG += console' to qmake, we define
WIN32_CONSOLE_APP that will be used in the source code
to determine if this is a console or a GUI application on Win32.

Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-03-25 07:57:25 -07:00
Dirk Hohndel
4edf37f9be Update cross building for Windows on Linux
This updates the instructions and the plumbing to be able to link against
a locally built libgit2

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-03-07 16:33:00 -08:00
Dirk Hohndel
3b1624ec69 Add a workaround for using post 0.20 git versions of libgit2
Add the following to your qmake command line and things should compile
again:

qmake ... CONFIG+=libgit21-api

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-03-07 09:23:42 -08:00
Linus Torvalds
689fe36030 Initial implementation of git save format
This saves the dive data into a git object repository instead of a
single XML file.

We create a git object tree with each dive as a separate file,
hierarchically by trip and date.

NOTE 1: This largely duplicates the XML saving code, because trying to
share it seemed just too painful: the logic is very similar, but the
details of the actual strings end up differing sufficiently that there
are tons of trivial differences.

The git save format is line-based with minimal quoting, while XML quotes
everything with either "<..\>" or using single quotes around attributes.

NOTE 2: You currently need a dummy "file" to save to, which points to
the real save location: the git repository and branch to be used.  We
should make this a config thing, but for testing, do something like
this:

	echo git /home/torvalds/scuba:linus > git-test

to create that git information file, and when you use "Save To" and
specify "git-test" as the file to save to, subsurface will use the new
git save logic to save to the branch "linus" in the repository found at
"/home/torvalds/scuba".

NOTE 3: The git save format uses just the git object directory, it does
*not* check out the result in any git working tree or index.  So after
you do a save, you can do

     git log -p linus

to see what actually happened in that branch, but it will not affect any
actual checked-out state in the repository.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-03-06 14:52:03 -08:00
Thiago Macieira
0ae7c820f2 Search pkg-config before {xml2,xslt}-config
Cross-compilation tools provide the right .pc files and a pkg-config to
match, but often don't provide the scripts to match. Even if they did,
you'd have to change PATH to find them. So give pkg-config precedence.

Signed-off-by: Thiago Macieira <thiago@macieira.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-02-02 07:07:33 -08:00
Thiago Macieira
9060558a7d Fix the LIBDCDEVEL=1 build when libdivecomputer was shadow-built
When that happens, the include/version.h file is in the shadow build
dir, not in the sources.

Signed-off-by: Thiago Macieira <thiago@macieira.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-02-02 07:03:50 -08:00
Anton Lundin
93c73ccc68 Query pkg-config with libxml2 via default name to
On Ubuntu and in the source package, libxml2 defaults to naming its
pkg-config file to libxml-2.0.pc so query after the package with that
name to.
I don't know what platform ships it as libxml2, so that might be a typo.

Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-01-15 15:49:41 +07:00
Anton Lundin
11dd5bda57 Fix linking order of libxslt and libxml
libxslt depends on libxml, so we need xslt before xml on the linker-line.

Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-01-15 15:49:39 +07:00
Dirk Hohndel
bc9b9287a4 Allow us to build for older versions of Mac OSX than we are running
This requires some serious hacking around with brew to get the libraries and
frameworks that we use to also be able to run on 10.5, but this is the part
that's needed in the Subsurface configuration.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-01-02 22:45:25 -08:00
Dirk Hohndel
a0b9daf63b Improve signing script, adjust flags for gcc-4.2
On one of my machines codesign doesn't find my signing key by hash, but
does find it by name. Go figure.
Also on that same system (32bit Mac Mini with running Snow Leopard / 10.6)
gcc 4.2 doesn't support the -unused-result warning. So let's only turn
that on for more modern versions of gcc

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-12-19 20:42:59 -08:00
Lubomir I. Ivanov
1f7f5e18e2 qmake: use real tabs for all .pri files
subsurface.pro already useses that.

For consistency with the app, we use swap 4 spaces with
a tab character for indentation.

Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-12-03 13:03:46 -08:00
Lubomir I. Ivanov
af97020634 subsurface-configure.pri: exclude -Wno-maybe-uninitialized on win32
On native Windows the suggested compiler for Qt4.8 is mingw-gcc-4.4.0,
which does not has the -Wno-maybe-uninitialized flag (yet).

Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-11-28 15:29:18 -08:00
Dirk Hohndel
33b15ea906 Silence some warnings when building on Mac
The *-clang* selector doesn't appear to work correctly in my build environment
(or I just don't understand how it is supposed to work). Either way, making
this conditional on !mac works.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-11-21 05:03:56 -08:00
Lubomir I. Ivanov
b589dedf3c subsurface-configure.pri: fix for the QMAKE_HOST.os check
Looks like having $$ before QMAKE_HOST.os does not work.

Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-10-13 11:31:06 -07:00
Dirk Hohndel
35952a59d0 Get cross build to work again
...and re-enable silent mode by default for cross builds

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-10-11 13:33:38 -07:00
Lubomir I. Ivanov
8b517f8081 subsurface-configure.pri: disable auto-"silent" mode for win32
Certain versions of mingw32-make will try to "CreateProcess"
passing the contents of CC and CXX. On win32, with CONFIG += silent
CC and CXX become composite containing multiple commands
such as "@echo... && gcc", which produces undesired results.

For the time being, do not automatically enable "silent" mode
if the current OS is win32. Possibly a better solution can be
found later on.

Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-10-10 07:14:59 -07:00
Thiago Macieira
1a98e049dc Try to read the libdivecomputer.la file (created by GNU libtool)
Getting dependency information for static libraries requires extra
files. Libtool creates .la files, which are "industry standard". qmake
has its own .prl files, but it can create .la in a pinch if necessary.

This change allows us to get the actual dependency information from
libdivecomputer, without having to guess whether it linked to something
else or not. If it changes in the future, we shouldn't have to do
anything.

Signed-off-by: Thiago Macieira <thiago@macieira.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-10-09 17:43:42 -07:00
Dirk Hohndel
cf2dc742f4 We already try to link against libusb anyway
No need for the special case here.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-10-09 16:11:42 -07:00
Dirk Hohndel
7db3093b1b Try hard not to link against a shared libdivecomputer
Versioning is wrong. It's not a library shared with other projects. And at
least on Mac and Windows we bundle it with the app, anyway.

Requested-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-10-09 16:07:18 -07:00
Lubomir I. Ivanov
a3d279b776 subsurface-configure.pri: add a libiconv dependency
This is a bit crude of a solution, but the Win32 version
of libxml (or at least some versions) seem to require libiconv,
thus we add the library with pkg-config if it is available.

Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-10-09 15:47:31 -07:00
Lubomir I. Ivanov
d63327469b subsurface-configure.pri: add another libxml/libxslt detection stage
libxml and libxslt use custom -config scripts which brake
qmake and make on Win32. The output of executing a .sh or .cmd
script with the same name produces garbled output. The output
of executables with the same name is untested, but a bit excessive
as a solution.

To work around the issue add another detection stage, which checks
if the previous output from (e.g.) xml2-config is empty and try
to use pkg-config instead.

Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-10-09 15:47:29 -07:00
Lubomir I. Ivanov
19c62bc509 subsurface-configure.pri: enable the libusb detection stage
The commented out step should work as expected (in theory).

Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-10-09 15:47:23 -07:00
Lubomir I. Ivanov
a3ee9a1142 subsurface-configure.pri: pkg-config detection change
This is a small change, but it seems to work as expected on both
Linux and Win32. What happens if 2> NUL > NUL is used on Win32
for cmd.exe is that the output of both stdout and stderr seems
to pipe into NUL and pkg-config is always reported as missing.

Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-10-09 15:47:20 -07:00
Dirk Hohndel
fbb3d80d9b Don't set -Wno-maybe-uninitialized for clang
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-10-09 13:21:16 -07:00
Thiago Macieira
9f582f76d0 Turn down warnings with Clang too
Signed-off-by: Thiago Macieira <thiago@macieira.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-10-09 10:34:10 -07:00
Dirk Hohndel
97f3b3b747 Turn down warnings (after going through them)
This was getting way too noisy with tons of false positives.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-10-09 08:11:50 -07:00
Anton Lundin
cfbbf1bffe Link static to libdivecomputer
In previous build system we linked static to libdivecomputer, so start
doing that again.

Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-10-09 07:29:42 -07:00
Thiago Macieira
dddcd10162 Turn off exceptions in C++
We don't use them in our code and Qt doesn't throw either, so save a
few bytes and maybe a few setjump() calls on Windows.

Signed-off-by: Thiago Macieira <thiago@macieira.org>
2013-10-08 23:45:38 -07:00
Thiago Macieira
f51f5d581e Don't turn warnings on in Subsurface's build
We're getting a ton of them and they're mostly harmless. I've already
turned on the ones that are problematic (with -Werror even).

Signed-off-by: Thiago Macieira <thiago@macieira.org>
2013-10-08 23:44:45 -07:00
Thiago Macieira
67e49d6480 Implement a qmake-based build for Subsurface
This is working for me, but requires a bit more testing. To build,
run:
  qmake [options]

Where options might be:
  V=1               disable "silent" build
  LIBDCDEVEL=1      use side-by-side libdivecomputer
  INCLUDEPATH+=xxx  add -Ixxx (e.g., INCLUDEPATH+=/usr/local/marble/include)
  LIBS+=xxx         add xxx to the linker flags (e.g. LIBS+=-L/usr/local/marble/lib)
  or any other qmake option, including debug and release options

If your distribution is already using qtchooser in place of qmake, you
may need to pass an extra option to qmake to select the a
cross-build. For example:

  qmake -qt=i686-w64-mingw32-qt4

If your distribution is not yet using qtchooser, then you need to file
a bug report requesting it and you need to run the full path to qmake.

Note:
 - there are some ### left in the buildsystem

Signed-off-by: Thiago Macieira <thiago@macieira.org>
2013-10-08 23:29:33 -07:00