Skip to content

Commit

Permalink
Bug 1641760 - Move --with-system-zlib to python configure. r=froydnj
Browse files Browse the repository at this point in the history
As all versions of zlib >= 1.2.3.1 have a pkg-config file, and 1.2.3.1
is close to 14 years old, let's drop 1.2.3 and just use pkg-config, which
simplifies what we need to do dramatically.

Differential Revision: https://phabricator.services.mozilla.com/D77404
  • Loading branch information
glandium committed May 29, 2020
1 parent 8883f72 commit eba22e2
Show file tree
Hide file tree
Showing 8 changed files with 24 additions and 72 deletions.
1 change: 0 additions & 1 deletion aclocal.m4
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ builtin(include, build/autoconf/compiler-opts.m4)dnl
builtin(include, build/autoconf/expandlibs.m4)dnl
builtin(include, build/autoconf/arch.m4)dnl
builtin(include, build/autoconf/android.m4)dnl
builtin(include, build/autoconf/zlib.m4)dnl
builtin(include, build/autoconf/icu.m4)dnl
builtin(include, build/autoconf/clang-plugin.m4)dnl
builtin(include, build/autoconf/alloc.m4)dnl
Expand Down
54 changes: 0 additions & 54 deletions build/autoconf/zlib.m4

This file was deleted.

1 change: 0 additions & 1 deletion build/moz.configure/old.configure
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,6 @@ def old_configure_options(*options):
'--with-system-nspr',
'--with-system-nss',
'--with-system-png',
'--with-system-zlib',
'--with-user-appdir',
'--x-includes',
'--x-libraries',
Expand Down
4 changes: 3 additions & 1 deletion build/moz.configure/util.configure
Original file line number Diff line number Diff line change
Expand Up @@ -409,7 +409,9 @@ def dependable(obj):
return obj
if isfunction(obj):
return depends(when=True)(obj)
return depends(when=True)(lambda: obj)
# Depend on --help to make lint happy if the dependable is used as an input
# to an option().
return depends('--help', when=True)(lambda _: obj)


always = dependable(True)
Expand Down
1 change: 0 additions & 1 deletion js/src/aclocal.m4
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ builtin(include, ../../build/autoconf/compiler-opts.m4)dnl
builtin(include, ../../build/autoconf/expandlibs.m4)dnl
builtin(include, ../../build/autoconf/arch.m4)dnl
builtin(include, ../../build/autoconf/android.m4)dnl
builtin(include, ../../build/autoconf/zlib.m4)dnl
builtin(include, ../../build/autoconf/icu.m4)dnl
builtin(include, ../../build/autoconf/clang-plugin.m4)dnl
builtin(include, ../../build/autoconf/alloc.m4)dnl
Expand Down
10 changes: 0 additions & 10 deletions js/src/old-configure.in
Original file line number Diff line number Diff line change
Expand Up @@ -1132,16 +1132,6 @@ MOZ_ARG_HEADER(External Packages)

MOZ_CONFIG_NSPR(js)

dnl ========================================================
dnl system zlib Support
dnl ========================================================
dnl Standalone js defaults to system zlib
if test -n "$JS_STANDALONE"; then
ZLIB_DIR=yes
fi

MOZ_ZLIB_CHECK([1.2.3])

if test -n "$ZLIB_IN_MOZGLUE"; then
AC_DEFINE(ZLIB_IN_MOZGLUE)
fi
Expand Down
21 changes: 21 additions & 0 deletions moz.configure
Original file line number Diff line number Diff line change
Expand Up @@ -261,6 +261,8 @@ set_config('WASM_OBJ_SUFFIX', 'wasm')
# Make `profiling` available to this file even when js/moz.configure
# doesn't end up included.
profiling = dependable(False)
# Same for js_standalone
js_standalone = dependable(False)

include(include_project_configure)

Expand Down Expand Up @@ -701,6 +703,25 @@ def strip_flags(flags, profiling, target):
set_config('STRIP_FLAGS', strip_flags)


@depends(js_standalone, target)
def system_zlib_default(js_standalone, target):
return js_standalone and target.kernel != 'WINNT'

js_option('--with-system-zlib', nargs='?', default=system_zlib_default,
help='{Use|Do not use} system libz')

@depends('--with-system-zlib')
def deprecated_system_zlib_path(value):
if len(value) == 1:
die('--with-system-zlib=PATH is not supported anymore. Please use '
'--with-system-zlib and set any necessary pkg-config environment variable.')

pkg_check_modules('MOZ_ZLIB', 'zlib >= 1.2.3', when='--with-system-zlib')

set_config('MOZ_SYSTEM_ZLIB', True, when='--with-system-zlib')
add_old_configure_assignment('MOZ_SYSTEM_ZLIB', True, when='--with-system-zlib')


# Please do not add configure checks from here on.

# Fallthrough to autoconf-based configure
Expand Down
4 changes: 0 additions & 4 deletions old-configure.in
Original file line number Diff line number Diff line change
Expand Up @@ -1473,10 +1473,6 @@ if test -z "$MOZ_SYSTEM_NSS"; then
esac
fi

dnl system ZLIB support
dnl ========================================================
MOZ_ZLIB_CHECK([1.2.3])

if test -z "$SKIP_LIBRARY_CHECKS"; then

dnl ========================================================
Expand Down

0 comments on commit eba22e2

Please sign in to comment.