Module Name: src Committed By: lukem Date: Thu Jul 20 15:15:23 UTC 2023
Modified Files: src/tools/compat: configure.ac Added Files: src/tools/compat/buildaux: nb_check_cc_flag.m4 Log Message: tools/compat: provide nb_check_cc_flag.m4 Implement m4 macro NB_CHECK_CC_FLAG(FLAG, [VAR=FLAG_DERIVED]) Determine if the C compiler supports FLAG, and sets output variable VAR to FLAG if FLAG is supported. If VAR is not provided, default to FLAG_DERIVED, which is FLAG converted to upper-case and all special characters replaced with "_", and the result prepended with "CC_". FLAG_DERIVED is appended to the m4 macro NB_CHECK_CC_FLAG_VARS. E.g., if FLAG is "-Wexample=yes", FLAG_DERIVED is "CC_WEXAMPLE_YES". This is implemented in separate buildaux/nb_check_cc_flag.m4, based on configure's NB_CC_FLAG(), but supports VAR override. Adapt configure from internal NB_CC_FLAG() to NB_CHECK_CC_FLAG(). (Note: AX_CHECK_COMPILE_FLAG() from autoconf-archive could be enhanced to support the clang and gcc workarounds I've implemented here.) To generate a diff of this commit: cvs rdiff -u -r1.105 -r1.106 src/tools/compat/configure.ac cvs rdiff -u -r0 -r1.1 src/tools/compat/buildaux/nb_check_cc_flag.m4 Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.