openafs/acinclude.m4
Andrew Deason 20e996af4e cf: Prevent default CFLAGS in OPENAFS_PATH_CC
Commit dba6ec9548 (cf: Set CC before calling AC_PROG_CC) moved our
logic for preventing a default CFLAGS from the top-level
configure.ac/configure-libafs.ac into OPENAFS_CONFIGURE_COMMON. This
doesn't work, because OPENAFS_CONFIGURE_COMMON calls
AC_USE_SYSTEM_EXTENSIONS, which effectively runs the compiler and sets
default CFLAGS at the beginning of OPENAFS_CONFIGURE_COMMON.

This means that if the user doesn't specify any CFLAGS, autoconf will
set our CFLAGS to the default of '-g -O2', which can break various
environments. (For example, --disable-optimize no longer works, because
that flag only controls the OPTMZ var, and doesn't touch CFLAGS.)

To fix this, move our logic for preventing default CFLAGS into
OPENAFS_PATH_CC, which is explicitly called before
OPENAFS_CONFIGURE_COMMON so we can set the compiler before autoconf sets
its defaults. This should ensure that we are setting CFLAGS before
autoconf does; otherwise, we're also probably not setting CC early
enough, either.

Change-Id: Ic64e46aee35ffd3b5ee4ad1241c4c7366d9ccb67
Reviewed-on: https://gerrit.openafs.org/15778
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Cheyenne Wills <cwills@sinenomine.net>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
2024-07-08 14:52:01 -04:00

87 lines
1.7 KiB
Plaintext

dnl This file contains the common configuration code which would
dnl otherwise be duplicated between configure and configure-libafs.
dnl
dnl NB: Because this code is a macro, references to positional shell
dnl parameters must be done like $[]1 instead of $1
AC_DEFUN([OPENAFS_CONFIGURE_COMMON],[
AC_USE_SYSTEM_EXTENSIONS
AC_PROG_CC
OPENAFS_AUTOHEADER_TOP
OPENAFS_AUTOHEADER_BOTTOM
SRCDIR_PARENT=`pwd`
#BOZO_SAVE_CORES pam
OPENAFS_OPTIONS
OPENAFS_DOC
dnl Checks for UNIX variants.
AC_SEARCH_LIBS([strerror],[cposix])
dnl Various compiler setup.
AC_TYPE_PID_T
AC_TYPE_SIZE_T
dnl Checks for programs.
AC_PROG_INSTALL
AC_PROG_LN_S
AC_PROG_RANLIB
AC_PROG_YACC
OPENAFS_LEX
dnl Checks
OPENAFS_FORCE_ABS_INSTALL
OPENAFS_CHECK_BIGENDIAN
OPENAFS_PRINTF_TAKES_Z_LEN
OPENAFS_OSTYPE
OPENAFS_SYSNAME
OPENAFS_OSCONF
OPENAFS_LINUX_CHECKS
OPENAFS_C_ATOMIC_CHECKS
OPENAFS_SOCKET_CHECKS
OPENAFS_LIBRARY_CHECKS
AC_CHECK_RESOLV_RETRANS
OPENAFS_SOCKOPT_CHECK
OPENAFS_PTHREAD_CHECKS
HOST_CPU="$host_cpu"
OPENAFS_BSD_CHECKS
OPENAFS_OPTION_TESTS
OPENAFS_TIVOLI_TESTS
OPENAFS_HEADER_CHECKS
OPENAFS_MEMBER_CHECKS
OPENAFS_LIBINTL_CHECKS
OPENAFS_MORE_OPTION_TESTS
OPENAFS_FUNCTION_CHECKS
OPENAFS_ROKEN
OPENAFS_HCRYPTO
OPENAFS_CURSES
OPENAFS_C_ATTRIBUTE
OPENAFS_C_PRAGMA
OPENAFS_C_FLEXIBLE_ARRAY
OPENAFS_MORE_ROKEN_CHECKS
OPENAFS_NETDB_CHECKS
OPENAFS_ROKEN_HEADERS
OPENAFS_BSWAP_CHECKS
OPENAFS_PIO_CHECKS
OPENAFS_REGEX_CHECKS
OPENAFS_MORE_PTHREAD_CHECKS
OPENAFS_TYPE_CHECKS
RRA_HEADER_PAM_CONST
OPENAFS_DIRECTORY_PATHS
OPENAFS_YET_MORE_OPTION_TESTS
OPENAFS_OUTPUT_VARIABLES
OPENAFS_FUSE
OPENAFS_SWIG
OPENAFS_TOPDIRS
OPENAFS_CROSSTOOLS
OPENAFS_LINT
OPENAFS_CRYPT_CHECKS
OPENAFS_C_STRUCT_LABEL_CHECK
OPENAFS_DIRENT_CHECKS
OPENAFS_SYS_RESOURCE_CHECKS
OPENAFS_UUID_CHECKS
OPENAFS_CTF_TOOLS_CHECKS
])