Skip to content

Commit c062afc

Browse files
configury: support --disable-werror
1 parent 332522e commit c062afc

File tree

2 files changed

+33
-33
lines changed

2 files changed

+33
-33
lines changed

configure

Lines changed: 29 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -799,6 +799,7 @@ enable_fast_install
799799
with_gnu_ld
800800
enable_libtool_lock
801801
enable_largefile
802+
enable_werror
802803
with_system_libunwind
803804
enable_host_shared
804805
'
@@ -1445,6 +1446,7 @@ Optional Features:
14451446
optimize for fast installation [default=yes]
14461447
--disable-libtool-lock avoid locking (might break parallel builds)
14471448
--disable-largefile omit support for large files
1449+
--disable-werror disable building with -Werror
14481450
--enable-host-shared build host code as shared libraries
14491451
14501452
Optional Packages:
@@ -7777,23 +7779,25 @@ _LT_EOF
77777779
fi
77787780
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_force_load" >&5
77797781
$as_echo "$lt_cv_ld_force_load" >&6; }
7780-
case $host_os in
7781-
rhapsody* | darwin1.[012])
7782+
# Allow for Darwin 4-7 (macOS 10.0-10.3) although these are not expect to
7783+
# build without first building modern cctools / linker.
7784+
case $host_cpu-$host_os in
7785+
*-rhapsody* | *-darwin1.[012])
77827786
_lt_dar_allow_undefined='${wl}-undefined ${wl}suppress' ;;
7783-
darwin1.*)
7787+
*-darwin1.*)
77847788
_lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;;
7785-
darwin*) # darwin 5.x on
7786-
# if running on 10.5 or later, the deployment target defaults
7787-
# to the OS version, if on x86, and 10.4, the deployment
7788-
# target defaults to 10.4. Don't you love it?
7789-
case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in
7790-
10.0,*86*-darwin8*|10.0,*-darwin[91]*)
7791-
_lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;;
7789+
*-darwin*)
7790+
# darwin 5.x (macOS 10.1) onwards we only need to adjust when the
7791+
# deployment target is forced to an earlier version.
7792+
case ${MACOSX_DEPLOYMENT_TARGET-UNSET},$host in
7793+
UNSET,*-darwin[89]*|UNSET,*-darwin[12][0123456789]*)
7794+
;;
77927795
10.[012][,.]*)
7793-
_lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;;
7794-
10.*)
7795-
_lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;;
7796-
esac
7796+
_lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress'
7797+
;;
7798+
*)
7799+
;;
7800+
esac
77977801
;;
77987802
esac
77997803
if test "$lt_cv_apple_cc_single_mod" = "yes"; then
@@ -9562,7 +9566,7 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
95629566
if test "$GCC" = yes && test "$with_gnu_ld" = no; then
95639567
case $host_cpu in
95649568
hppa*64*)
9565-
archive_cmds='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
9569+
archive_cmds='$CC -shared ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
95669570
;;
95679571
ia64*)
95689572
archive_cmds='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
@@ -9574,7 +9578,7 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
95749578
else
95759579
case $host_cpu in
95769580
hppa*64*)
9577-
archive_cmds='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
9581+
archive_cmds='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
95789582
;;
95799583
ia64*)
95809584
archive_cmds='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
@@ -10458,16 +10462,6 @@ freebsd* | dragonfly*)
1045810462
esac
1045910463
;;
1046010464
10461-
gnu*)
10462-
version_type=linux
10463-
need_lib_prefix=no
10464-
need_version=no
10465-
library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}'
10466-
soname_spec='${libname}${release}${shared_ext}$major'
10467-
shlibpath_var=LD_LIBRARY_PATH
10468-
hardcode_into_libs=yes
10469-
;;
10470-
1047110465
haiku*)
1047210466
version_type=linux
1047310467
need_lib_prefix=no
@@ -10589,7 +10583,7 @@ linux*oldld* | linux*aout* | linux*coff*)
1058910583
# project, but have not yet been accepted: they are GCC-local changes
1059010584
# for the time being. (See
1059110585
# https://lists.gnu.org/archive/html/libtool-patches/2018-05/msg00000.html)
10592-
linux* | k*bsd*-gnu | kopensolaris*-gnu | uclinuxfdpiceabi)
10586+
linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu* | uclinuxfdpiceabi)
1059310587
version_type=linux
1059410588
need_lib_prefix=no
1059510589
need_version=no
@@ -11278,7 +11272,7 @@ else
1127811272
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
1127911273
lt_status=$lt_dlunknown
1128011274
cat > conftest.$ac_ext <<_LT_EOF
11281-
#line 11281 "configure"
11275+
#line 11275 "configure"
1128211276
#include "confdefs.h"
1128311277
1128411278
#if HAVE_DLFCN_H
@@ -11384,7 +11378,7 @@ else
1138411378
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
1138511379
lt_status=$lt_dlunknown
1138611380
cat > conftest.$ac_ext <<_LT_EOF
11387-
#line 11387 "configure"
11381+
#line 11381 "configure"
1138811382
#include "confdefs.h"
1138911383
1139011384
#if HAVE_DLFCN_H
@@ -11979,7 +11973,12 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu
1197911973
1198011974
1198111975
11982-
if test -n "${with_target_subdir}"; then
11976+
# Check whether --enable-werror was given.
11977+
if test "${enable_werror+set}" = set; then :
11978+
enableval=$enable_werror;
11979+
fi
11980+
11981+
if test "x$enable_werror" != "xno" && test -n "${with_target_subdir}"; then :
1198311982
WARN_FLAGS="$WARN_FLAGS -Werror"
1198411983
fi
1198511984

configure.ac

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -145,9 +145,10 @@ ACX_PROG_CC_WARNING_OPTS([-W -Wall -Wwrite-strings -Wstrict-prototypes \
145145
-Wmissing-format-attribute -Wcast-qual],
146146
[WARN_FLAGS])
147147

148-
if test -n "${with_target_subdir}"; then
149-
WARN_FLAGS="$WARN_FLAGS -Werror"
150-
fi
148+
AC_ARG_ENABLE([werror],
149+
[AS_HELP_STRING([--disable-werror], [disable building with -Werror])])
150+
AS_IF([test "x$enable_werror" != "xno" && test -n "${with_target_subdir}"],
151+
[WARN_FLAGS="$WARN_FLAGS -Werror"])
151152

152153
AC_SUBST(WARN_FLAGS)
153154

0 commit comments

Comments
 (0)