From 23ba4047addd7b4691d0d755f947b1fef952f334 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Wed, 14 Oct 2009 11:00:59 -0600 Subject: [PATCH] Linux build system: Use the environment variables OVERRIDE_CFLAGS and OVERRIDE_LDFLAGS to allow cflags and ldflags to be user specified. Fixes #3770 (calibre build problems) --- setup/extensions.py | 7 +++++-- setup/install.py | 6 ++++++ 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/setup/extensions.py b/setup/extensions.py index c2b8467300..e3283b0ea3 100644 --- a/setup/extensions.py +++ b/setup/extensions.py @@ -134,8 +134,11 @@ if isosx: if isunix: cc = os.environ.get('CC', 'gcc') cxx = os.environ.get('CXX', 'g++') - cflags = '-O3 -Wall -DNDEBUG -fPIC -fno-strict-aliasing -pipe'.split() - ldflags = ['-Wall'] + cflags = os.environ.get('OVERRIDE_CFLAGS', + '-O3 -Wall -DNDEBUG -fno-strict-aliasing -pipe') + cflags = shlex.split(cflags) + '-fPIC' + ldflags = os.environ.get('OVERRIDE_LDFLAGS', '-Wall') + ldflags = shlex.split(ldflags) cflags += shlex.split(os.environ.get('CFLAGS', '')) ldflags += shlex.split(os.environ.get('LDFLAGS', '')) diff --git a/setup/install.py b/setup/install.py index fb17049e4c..1dbbb3f8a5 100644 --- a/setup/install.py +++ b/setup/install.py @@ -200,6 +200,12 @@ class Install(Develop): /share/calibre. These can all be controlled via options. The default is the prefix of your python installation. + + The .desktop, .mime and icon files are installed using XDG. The + location they are installed to can be controlled by setting + the environment variables: + XDG_DATA_DIRS=/usr/share equivalent + XDG_UTILS_INSTALL_MODE=system ''') short_description = 'Install calibre from source'