Skip to content

Commit

Permalink
Fix compiler flag checks
Browse files Browse the repository at this point in the history
Ref #34
  • Loading branch information
animetosho authored and dnzbk committed Nov 12, 2024
1 parent a802d06 commit 2a27e47
Showing 1 changed file with 24 additions and 24 deletions.
48 changes: 24 additions & 24 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -85,78 +85,78 @@ AC_LANG_PUSH(C)
dnl Platform detection / flags supported by compiler
m4_include([m4/ax_check_compile_flag.m4])
AX_CHECK_COMPILE_FLAG([-msse2], , , [-Werror])
AM_CONDITIONAL([HAS_SSE2], [test x$ax_cv_check_cxxflags__Werror__msse2 = xyes])
AM_CONDITIONAL([HAS_SSE2], [test x$ax_cv_check_cflags__Werror__msse2 = xyes])
AM_COND_IF([HAS_SSE2], [AC_SUBST(CFLAGS_SSE2, "-msse2")])
AX_CHECK_COMPILE_FLAG([-mssse3], , , [-Werror])
AM_CONDITIONAL([HAS_SSSE3], [test x$ax_cv_check_cxxflags__Werror__mssse3 = xyes])
AM_CONDITIONAL([HAS_SSSE3], [test x$ax_cv_check_cflags__Werror__mssse3 = xyes])
AM_COND_IF([HAS_SSSE3], [AC_SUBST(CFLAGS_SSSE3, "-mssse3")])
AX_CHECK_COMPILE_FLAG([-mpclmul], , , [-Werror])
AM_CONDITIONAL([HAS_PCLMUL], [test x$ax_cv_check_cxxflags__Werror__mpclmul = xyes])
AM_CONDITIONAL([HAS_PCLMUL], [test x$ax_cv_check_cflags__Werror__mpclmul = xyes])
AM_COND_IF([HAS_PCLMUL], [AC_SUBST(CFLAGS_PCLMUL, "-mpclmul -msse4.1")])
AX_CHECK_COMPILE_FLAG([-mavx], , , [-Werror])
AM_CONDITIONAL([HAS_AVX], [test x$ax_cv_check_cxxflags__Werror__mavx = xyes])
AM_CONDITIONAL([HAS_AVX], [test x$ax_cv_check_cflags__Werror__mavx = xyes])
AM_COND_IF([HAS_AVX], [AC_SUBST(CFLAGS_AVX, "-mavx")])
AX_CHECK_COMPILE_FLAG([-mxop], , , [-Werror])
AM_CONDITIONAL([HAS_XOP], [test x$ax_cv_check_cxxflags__Werror__mxop = xyes])
AM_CONDITIONAL([HAS_XOP], [test x$ax_cv_check_cflags__Werror__mxop = xyes])
AM_COND_IF([HAS_XOP], [AC_SUBST(CFLAGS_XOP, "-mavx -mxop")])
AX_CHECK_COMPILE_FLAG([-mbmi], , , [-Werror])
AM_CONDITIONAL([HAS_BMI1], [test x$ax_cv_check_cxxflags__Werror__mbmi = xyes])
AM_CONDITIONAL([HAS_BMI1], [test x$ax_cv_check_cflags__Werror__mbmi = xyes])
AM_COND_IF([HAS_BMI1], [AC_SUBST(CFLAGS_BMI1, "-mavx -mbmi -mpclmul")])
AX_CHECK_COMPILE_FLAG([-mavx2], , , [-Werror])
AM_CONDITIONAL([HAS_AVX2], [test x$ax_cv_check_cxxflags__Werror__mavx2 = xyes])
AM_CONDITIONAL([HAS_AVX2], [test x$ax_cv_check_cflags__Werror__mavx2 = xyes])
AM_COND_IF([HAS_AVX2], [AC_SUBST(CFLAGS_AVX2, "-mavx2")])
AX_CHECK_COMPILE_FLAG([-mavx512vl -mavx512bw], , , [-Werror])
AM_CONDITIONAL([HAS_AVX512], [test x$ax_cv_check_cxxflags__Werror__mavx512vl__mavx512bw = xyes])
AM_CONDITIONAL([HAS_AVX512], [test x$ax_cv_check_cflags__Werror__mavx512vl__mavx512bw = xyes])
AM_COND_IF([HAS_AVX512], [AC_SUBST(CFLAGS_AVX512, "-mavx512vl -mavx512bw")])
AM_COND_IF([HAS_AVX512], [AC_SUBST(CFLAGS_AVX512F, "-mavx512f")])
AM_COND_IF([HAS_AVX512], [AC_SUBST(CFLAGS_AVX512_HASHER, "-mavx512vl -mavx512bw -mbmi2 -mpclmul")])
AX_CHECK_COMPILE_FLAG([-mavx512vbmi], , , [-Werror])
AM_CONDITIONAL([HAS_VBMI], [test x$ax_cv_check_cxxflags__Werror__mavx512vbmi = xyes])
AM_CONDITIONAL([HAS_VBMI], [test x$ax_cv_check_cflags__Werror__mavx512vbmi = xyes])
AM_COND_IF([HAS_VBMI], [AC_SUBST(CFLAGS_VBMI, "-mavx512vl -mavx512vbmi")])
AX_CHECK_COMPILE_FLAG([-mgfni], , , [-Werror])
AM_CONDITIONAL([HAS_GFNI], [test x$ax_cv_check_cxxflags__Werror__mgfni = xyes])
AM_CONDITIONAL([HAS_GFNI], [test x$ax_cv_check_cflags__Werror__mgfni = xyes])
AM_COND_IF([HAS_GFNI], [AC_SUBST(CFLAGS_GFNI, "-mgfni -mssse3")])
AX_CHECK_COMPILE_FLAG([-mvpclmulqdq], , , [-Werror])
AM_CONDITIONAL([HAS_VPCLMUL], [test x$ax_cv_check_cxxflags__Werror__mvpclmulqdq = xyes])
AM_CONDITIONAL([HAS_VPCLMUL], [test x$ax_cv_check_cflags__Werror__mvpclmulqdq = xyes])
AM_COND_IF([HAS_VPCLMUL], [AC_SUBST(CFLAGS_VPCLMUL, "-mvpclmulqdq -mavx2")])
AX_CHECK_COMPILE_FLAG([-mno-evex512], , , [-Werror])
AM_CONDITIONAL([HAS_AVX10], [test x$ax_cv_check_cxxflags__Werror__mno_evex512 = xyes])
AM_CONDITIONAL([HAS_AVX10], [test x$ax_cv_check_cflags__Werror__mno_evex512 = xyes])
AM_COND_IF([HAS_AVX10], [AC_SUBST(CFLAGS_AVX10, "-mavx512vl -mavx512bw -mno-evex512")])
AX_CHECK_COMPILE_FLAG([-mfpu=neon -march=armv7-a], , , [-Werror])
AM_CONDITIONAL([HAS_NEON], [test x$ax_cv_check_cxxflags__Werror__mfpu_neon__march_armv7_a = xyes])
AM_CONDITIONAL([HAS_NEON], [test x$ax_cv_check_cflags__Werror__mfpu_neon__march_armv7_a = xyes])
AM_COND_IF([HAS_NEON], [AC_SUBST(CFLAGS_NEON, "-mfpu=neon -fno-lto -march=armv7-a")])
AX_CHECK_COMPILE_FLAG([-mfpu=fp-armv8], , , [-Werror])
AM_CONDITIONAL([HAS_FPARMv8], [test x$ax_cv_check_cxxflags__Werror__mfpu_fp_armv8 = xyes])
AM_CONDITIONAL([HAS_FPARMv8], [test x$ax_cv_check_cflags__Werror__mfpu_fp_armv8 = xyes])
AM_COND_IF([HAS_FPARMv8], [AC_SUBST(CFLAGS_ARMCRC_FP, "-mfpu=fp-armv8")])
AX_CHECK_COMPILE_FLAG([-march=armv8-a+sve], , , [-Werror])
AM_CONDITIONAL([HAS_SVE], [test x$ax_cv_check_cxxflags__Werror__march_armv8_apsve = xyes])
AM_CONDITIONAL([HAS_SVE], [test x$ax_cv_check_cflags__Werror__march_armv8_apsve = xyes])
AM_COND_IF([HAS_SVE], [AC_SUBST(CFLAGS_SVE, "-march=armv8-a+sve")])
AX_CHECK_COMPILE_FLAG([-march=armv8-a+sve2], , , [-Werror])
AM_CONDITIONAL([HAS_SVE2], [test x$ax_cv_check_cxxflags__Werror__march_armv8_apsve2 = xyes])
AM_CONDITIONAL([HAS_SVE2], [test x$ax_cv_check_cflags__Werror__march_armv8_apsve2 = xyes])
AM_COND_IF([HAS_SVE2], [AC_SUBST(CFLAGS_SVE2, "-march=armv8-a+sve2")])
AX_CHECK_COMPILE_FLAG([-march=armv8-a+crc], , , [-Werror])
AM_CONDITIONAL([HAS_ARMCRC], [test x$ax_cv_check_cxxflags__Werror__march_armv8_apcrc = xyes])
AM_CONDITIONAL([HAS_ARMCRC], [test x$ax_cv_check_cflags__Werror__march_armv8_apcrc = xyes])
AM_COND_IF([HAS_ARMCRC], [AC_SUBST(CFLAGS_ARMCRC, "-march=armv8-a+crc")])
AX_CHECK_COMPILE_FLAG([-march=armv8.2-a+sha3], , , [-Werror])
AM_CONDITIONAL([HAS_NEONSHA3], [test x$ax_cv_check_cxxflags__Werror__march_armv8_2_apsha3 = xyes])
AM_CONDITIONAL([HAS_NEONSHA3], [test x$ax_cv_check_cflags__Werror__march_armv8_2_apsha3 = xyes])
AM_COND_IF([HAS_NEONSHA3], [AC_SUBST(CFLAGS_NEONSHA3, "-march=armv8.2-a+sha3")])
AX_CHECK_COMPILE_FLAG([-march=rv64gcv], , , [-Werror])
AM_CONDITIONAL([HAS_RV64V], [test x$ax_cv_check_cxxflags__Werror__march_rv64gcv = xyes])
AM_CONDITIONAL([HAS_RV64V], [test x$ax_cv_check_cflags__Werror__march_rv64gcv = xyes])
AM_COND_IF([HAS_RV64V], [AC_SUBST(CFLAGS_RV64V, "-march=rv64gcv")])
AX_CHECK_COMPILE_FLAG([-march=rv32gcv], , , [-Werror])
AM_CONDITIONAL([HAS_RV32V], [test x$ax_cv_check_cxxflags__Werror__march_rv32gcv = xyes])
AM_CONDITIONAL([HAS_RV32V], [test x$ax_cv_check_cflags__Werror__march_rv32gcv = xyes])
AM_COND_IF([HAS_RV32V], [AC_SUBST(CFLAGS_RV32V, "-march=rv32gcv")])
AX_CHECK_COMPILE_FLAG([-march=rv64gc_zbkc], , , [-Werror])
AM_CONDITIONAL([HAS_RV64ZBKC], [test x$ax_cv_check_cxxflags__Werror__march_rv64gc_zbkc = xyes])
AM_CONDITIONAL([HAS_RV64ZBKC], [test x$ax_cv_check_cflags__Werror__march_rv64gc_zbkc = xyes])
AM_COND_IF([HAS_RV64ZBKC], [AC_SUBST(CFLAGS_RV64ZBKC, "-march=rv64gc_zbkc")])
AX_CHECK_COMPILE_FLAG([-march=rv32gc_zbkc], , , [-Werror])
AM_CONDITIONAL([HAS_RV32ZBKC], [test x$ax_cv_check_cxxflags__Werror__march_rv32gc_zbkc = xyes])
AM_CONDITIONAL([HAS_RV32ZBKC], [test x$ax_cv_check_cflags__Werror__march_rv32gc_zbkc = xyes])
AM_COND_IF([HAS_RV32ZBKC], [AC_SUBST(CFLAGS_RV32ZBKC, "-march=rv32gc_zbkc")])
AX_CHECK_COMPILE_FLAG([-march=rv64gcv_zvbc], , , [-Werror])
AM_CONDITIONAL([HAS_RV64ZVBC], [test x$ax_cv_check_cxxflags__Werror__march_rv64gcv_zvbc = xyes])
AM_CONDITIONAL([HAS_RV64ZVBC], [test x$ax_cv_check_cflags__Werror__march_rv64gcv_zvbc = xyes])
AM_COND_IF([HAS_RV64ZVBC], [AC_SUBST(CFLAGS_RV64ZVBC, "-march=rv64gcv_zvbc")])
AX_CHECK_COMPILE_FLAG([-march=rv32gcv_zvbc], , , [-Werror])
AM_CONDITIONAL([HAS_RV32VBC], [test x$ax_cv_check_cxxflags__Werror__march_rv32gcv_zvbc = xyes])
AM_CONDITIONAL([HAS_RV32VBC], [test x$ax_cv_check_cflags__Werror__march_rv32gcv_zvbc = xyes])
AM_COND_IF([HAS_RV32VBC], [AC_SUBST(CFLAGS_RV32ZVBC, "-march=rv32gcv_zvbc")])

AC_CHECK_DECLS([posix_memalign], [], [AC_SUBST(CFLAGS_POSIX_SOURCE, "-D_POSIX_C_SOURCE=200112L")], [[#include <stdlib.h>]])
Expand Down

0 comments on commit 2a27e47

Please sign in to comment.