diff options
author | Nirbheek Chauhan <nirbheek@centricular.com> | 2018-03-09 21:37:09 +0530 |
---|---|---|
committer | Nirbheek Chauhan <nirbheek@centricular.com> | 2018-03-09 22:11:54 +0530 |
commit | 9de66c6fb6d52e79329261ebce86b3d2db3708da (patch) | |
tree | 49867f3d9317b4afa23bf1f1ad95ff414128beb0 /recipes/openssl.recipe | |
parent | 6c7cb6fc63e728543e3392cedfe3b45b4a6ba1e9 (diff) |
openssl.recipe: Fix build on macos and ios
CFLAGS cannot be passed to Configure because it detects -arch x86_64
as a target directive and errors out. We also can't rely on CFLAG
passing it everywhere, so we have to set it with CC.
This also means we don't need the patch that adds support for
detecting -isysroot, etc, since those should always be passed
correctly now.
Diffstat (limited to 'recipes/openssl.recipe')
-rw-r--r-- | recipes/openssl.recipe | 19 |
1 files changed, 7 insertions, 12 deletions
diff --git a/recipes/openssl.recipe b/recipes/openssl.recipe index 771f0022..fde1684d 100644 --- a/recipes/openssl.recipe +++ b/recipes/openssl.recipe @@ -12,9 +12,6 @@ class Recipe(recipe.Recipe): stype = SourceType.TARBALL url = 'ftp://ftp.openssl.org/source/{0}-{1}.tar.gz'.format(name, version) deps = ['zlib'] - # Parallel make fails randomly; probably races - allow_parallel_build = False - patches = [name + '/0001-Configure-add-support-for-sysroot-isysroot-isystem.patch'] files_bins = ['openssl'] files_libs = ['libcrypto', 'libssl'] @@ -72,8 +69,12 @@ class Recipe(recipe.Recipe): self.openssl_platform = 'mingw64' else: raise NotImplementedError - # CFLAG is no typo! - self.make += ' LDFLAGS+="$LDFLAGS -fPIC" CFLAG+="$CFLAGS -fPIC -DOPENSSL_PIC"' + # NOTE: CFLAG and LDFLAG are not typos! + # Need to add CFLAGS to CC because CFLAG is not used everywhere in the + # build, and we can't pass arguments via Configure because on Darwin, + # Configure reads the `-arch x86_64` as meaning that you want to use + # `x86_64` as the platform, and errors out about a redefined platform. + self.make += ' CC="$CC $CFLAGS" LDFLAG="$LDFLAGS -fPIC" CFLAG="$CFLAGS -fPIC -DOPENSSL_PIC"' self.make_install = 'make install_sw' # We probably don't need and can't use the tools on these platforms @@ -82,10 +83,6 @@ class Recipe(recipe.Recipe): self.make += ' build_libs openssl.pc libssl.pc libcrypto.pc' self.make_install = 'make install_dev' - def strip_unknown_args(self, args): - unknown = ['-no-canonical-prefixes'] - return ' '.join([a for a in args.split(' ') if a not in unknown]) - @modify_environment def configure(self): if self.config.platform == Platform.WINDOWS: @@ -102,9 +99,7 @@ class Recipe(recipe.Recipe): ''.format(perl, m)) # OpenSSL guesses the libdir incorrectly on x86_64 config_sh = 'perl ./Configure --prefix=' + self.config.prefix + \ - ' --libdir=lib' + self.config.lib_suffix + ' ' + \ - self.strip_unknown_args(os.environ.get('CFLAGS', '')) + ' ' + \ - self.strip_unknown_args(os.environ.get('LDFLAGS', '')) + ' --libdir=lib' + self.config.lib_suffix + ' ' if self.config.target_platform == Platform.IOS: config_sh += ' no-shared no-dso ' else: |