From 91ce761eef00abe379e9263282739dd0dadb4764 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Mon, 19 Oct 2009 18:03:47 -0600 Subject: [PATCH] Linux build:Allow CFLAGS used to compile mount helper to be overrideen using OVERRIDE_CFLAGS env variable --- setup/install.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/setup/install.py b/setup/install.py index 1dbbb3f8a5..0ac23582c7 100644 --- a/setup/install.py +++ b/setup/install.py @@ -6,7 +6,7 @@ __license__ = 'GPL v3' __copyright__ = '2009, Kovid Goyal ' __docformat__ = 'restructuredtext en' -import sys, os, textwrap, subprocess, shutil, tempfile, atexit, stat +import sys, os, textwrap, subprocess, shutil, tempfile, atexit, stat, shlex from setup import Command, islinux, basenames, modules, functions, \ __appname__, __version__ @@ -149,7 +149,9 @@ class Develop(Command): src = os.path.join(self.SRC, 'calibre', 'devices', 'linux_mount_helper.c') dest = os.path.join(self.staging_bindir, 'calibre-mount-helper') self.info('Installing mount helper to '+ dest) - p = subprocess.Popen(['gcc', '-Wall', '-pedantic', src, '-o', dest]) + cflags = os.environ.get('OVERRIDE_CFLAGS', '-Wall -pedantic') + cflags = shlex.split(cflags) + p = subprocess.Popen(['gcc']+cflags+[src, '-o', dest]) ret = p.wait() if ret != 0: return warn()