configury: support --disable-werror

This commit is contained in:
Ian Lance Taylor
2022-02-16 11:41:40 -08:00
parent 332522e199
commit c062afc28c
2 changed files with 33 additions and 33 deletions

59
configure vendored
View File

@@ -799,6 +799,7 @@ enable_fast_install
with_gnu_ld
enable_libtool_lock
enable_largefile
enable_werror
with_system_libunwind
enable_host_shared
'
@@ -1445,6 +1446,7 @@ Optional Features:
optimize for fast installation [default=yes]
--disable-libtool-lock avoid locking (might break parallel builds)
--disable-largefile omit support for large files
--disable-werror disable building with -Werror
--enable-host-shared build host code as shared libraries
Optional Packages:
@@ -7777,23 +7779,25 @@ _LT_EOF
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_force_load" >&5
$as_echo "$lt_cv_ld_force_load" >&6; }
case $host_os in
rhapsody* | darwin1.[012])
# Allow for Darwin 4-7 (macOS 10.0-10.3) although these are not expect to
# build without first building modern cctools / linker.
case $host_cpu-$host_os in
*-rhapsody* | *-darwin1.[012])
_lt_dar_allow_undefined='${wl}-undefined ${wl}suppress' ;;
darwin1.*)
*-darwin1.*)
_lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;;
darwin*) # darwin 5.x on
# if running on 10.5 or later, the deployment target defaults
# to the OS version, if on x86, and 10.4, the deployment
# target defaults to 10.4. Don't you love it?
case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in
10.0,*86*-darwin8*|10.0,*-darwin[91]*)
_lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;;
*-darwin*)
# darwin 5.x (macOS 10.1) onwards we only need to adjust when the
# deployment target is forced to an earlier version.
case ${MACOSX_DEPLOYMENT_TARGET-UNSET},$host in
UNSET,*-darwin[89]*|UNSET,*-darwin[12][0123456789]*)
;;
10.[012][,.]*)
_lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;;
10.*)
_lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;;
esac
_lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress'
;;
*)
;;
esac
;;
esac
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
if test "$GCC" = yes && test "$with_gnu_ld" = no; then
case $host_cpu in
hppa*64*)
archive_cmds='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
archive_cmds='$CC -shared ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
;;
ia64*)
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
else
case $host_cpu in
hppa*64*)
archive_cmds='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
archive_cmds='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
;;
ia64*)
archive_cmds='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
@@ -10458,16 +10462,6 @@ freebsd* | dragonfly*)
esac
;;
gnu*)
version_type=linux
need_lib_prefix=no
need_version=no
library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}'
soname_spec='${libname}${release}${shared_ext}$major'
shlibpath_var=LD_LIBRARY_PATH
hardcode_into_libs=yes
;;
haiku*)
version_type=linux
need_lib_prefix=no
@@ -10589,7 +10583,7 @@ linux*oldld* | linux*aout* | linux*coff*)
# project, but have not yet been accepted: they are GCC-local changes
# for the time being. (See
# https://lists.gnu.org/archive/html/libtool-patches/2018-05/msg00000.html)
linux* | k*bsd*-gnu | kopensolaris*-gnu | uclinuxfdpiceabi)
linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu* | uclinuxfdpiceabi)
version_type=linux
need_lib_prefix=no
need_version=no
@@ -11278,7 +11272,7 @@ else
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<_LT_EOF
#line 11281 "configure"
#line 11275 "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
@@ -11384,7 +11378,7 @@ else
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<_LT_EOF
#line 11387 "configure"
#line 11381 "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
@@ -11979,7 +11973,12 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu
if test -n "${with_target_subdir}"; then
# Check whether --enable-werror was given.
if test "${enable_werror+set}" = set; then :
enableval=$enable_werror;
fi
if test "x$enable_werror" != "xno" && test -n "${with_target_subdir}"; then :
WARN_FLAGS="$WARN_FLAGS -Werror"
fi

View File

@@ -145,9 +145,10 @@ ACX_PROG_CC_WARNING_OPTS([-W -Wall -Wwrite-strings -Wstrict-prototypes \
-Wmissing-format-attribute -Wcast-qual],
[WARN_FLAGS])
if test -n "${with_target_subdir}"; then
WARN_FLAGS="$WARN_FLAGS -Werror"
fi
AC_ARG_ENABLE([werror],
[AS_HELP_STRING([--disable-werror], [disable building with -Werror])])
AS_IF([test "x$enable_werror" != "xno" && test -n "${with_target_subdir}"],
[WARN_FLAGS="$WARN_FLAGS -Werror"])
AC_SUBST(WARN_FLAGS)