1
0
mirror of https://github.com/libuv/libuv synced 2025-03-28 21:13:16 +00:00

build: fix AIX xlc autotools build (#3588)

This commit is contained in:
V-for-Vasili 2022-04-06 08:07:05 -04:00 committed by GitHub
parent 223e526f27
commit 7233c428ec
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 17 additions and 1 deletions

View File

@ -28,7 +28,9 @@ AM_PROG_CC_C_O
CC_ATTRIBUTE_VISIBILITY([default], [
CC_FLAG_VISIBILITY([CFLAGS="${CFLAGS} -fvisibility=hidden"])
])
CC_CHECK_CFLAGS_APPEND([-fno-strict-aliasing])
# Xlc has a flag "-f<filename>". Need to use CC_CHECK_FLAG_SUPPORTED_APPEND so
# we exclude -fno-strict-aliasing for xlc
CC_CHECK_FLAG_SUPPORTED_APPEND([-fno-strict-aliasing])
CC_CHECK_CFLAGS_APPEND([-g])
CC_CHECK_CFLAGS_APPEND([-std=gnu89])
CC_CHECK_CFLAGS_APPEND([-Wall])

View File

@ -104,6 +104,20 @@ AC_DEFUN([CC_CHECK_LDFLAGS], [
[$2], [$3])
])
dnl Check if flag is supported by both compiler and linker
dnl If so, append it to AM_CFLAGS
dnl CC_CHECK_FLAG_SUPPORTED_APPEND([FLAG])
AC_DEFUN([CC_CHECK_FLAG_SUPPORTED_APPEND], [
CC_CHECK_CFLAGS([$1],
[CC_CHECK_LDFLAGS([$1],
[AM_CFLAGS="$AM_CFLAGS $1";
DEBUG_CFLAGS="$DEBUG_CFLAGS $1";
AC_SUBST([AM_CFLAGS])
])
])
])
dnl define the LDFLAGS_NOUNDEFINED variable with the correct value for
dnl the current linker to avoid undefined references in a shared object.
AC_DEFUN([CC_NOUNDEFINED], [