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)

This commit is contained in:
Kovid Goyal 2009-10-14 11:00:59 -06:00
parent 942b0e74c1
commit 23ba4047ad
2 changed files with 11 additions and 2 deletions

View File

@ -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', ''))

View File

@ -200,6 +200,12 @@ class Install(Develop):
<prefix>/share/calibre. These can all be controlled via options.
The default <prefix> 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'