From a9966a11fc6d96e86fc75fc191e8eb1b63140fda Mon Sep 17 00:00:00 2001 From: Alex Zolotarev Date: Sun, 2 Oct 2011 17:49:09 +0200 Subject: [PATCH] [linux] Build fixes --- common.pri | 3 +++ map/map_tests/map_tests.pro | 2 +- platform/platform_linux.cpp | 6 ++++-- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/common.pri b/common.pri index 6a69573824..235b27fcd7 100644 --- a/common.pri +++ b/common.pri @@ -110,6 +110,9 @@ unix|win32-g++ { QMAKE_CXXFLAGS_RELEASE += -O3 QMAKE_CFLAGS_RELEASE *= -ffast-math QMAKE_CXXFLAGS_RELEASE *= -ffast-math + QMAKE_CFLAGS *= -fdata-sections -ffunction-sections + QMAKE_CXXFLAGS *= -fdata-sections -ffunction-sections + QMAKE_LFLAGS *= -Wl,--gc-sections } linux-g++* { diff --git a/map/map_tests/map_tests.pro b/map/map_tests/map_tests.pro index 88708f91db..ab73d5eab6 100644 --- a/map/map_tests/map_tests.pro +++ b/map/map_tests/map_tests.pro @@ -6,7 +6,7 @@ CONFIG -= app_bundle TEMPLATE = app ROOT_DIR = ../.. -DEPENDENCIES = map yg indexer platform geometry coding base freetype fribidi expat +DEPENDENCIES = map indexer platform geometry coding base include($$ROOT_DIR/common.pri) diff --git a/platform/platform_linux.cpp b/platform/platform_linux.cpp index f3e1065b74..748fd50dcd 100644 --- a/platform/platform_linux.cpp +++ b/platform/platform_linux.cpp @@ -4,7 +4,9 @@ #include #include -static bool GetUserWritableDir(string & outDir) +#define LOCALAPPDATA_DIR "MapsWithMe" + +bool GetUserWritableDir(string & outDir) { char * path = ::getenv("HOME"); if (path) @@ -18,7 +20,7 @@ static bool GetUserWritableDir(string & outDir) } /// @return full path including binary itself -static bool GetPathToBinary(string & outPath) +bool GetPathToBinary(string & outPath) { char path[4096] = {0}; if (0 < ::readlink("/proc/self/exe", path, ARRAY_SIZE(path)))