|
25 | 25 |
|
26 | 26 | m4_include([util_paths.m4])
|
27 | 27 |
|
| 28 | +############################################################################### |
| 29 | +# Overwrite the existing version of AC_PROG_CC with our own custom variant. |
| 30 | +# Unlike the regular AC_PROG_CC, the compiler list must always be passed. |
| 31 | +AC_DEFUN([AC_PROG_CC], |
| 32 | +[ |
| 33 | + AC_LANG_PUSH(C) |
| 34 | + AC_ARG_VAR([CC], [C compiler command]) |
| 35 | + AC_ARG_VAR([CFLAGS], [C compiler flags]) |
| 36 | +
|
| 37 | + _AC_ARG_VAR_LDFLAGS() |
| 38 | + _AC_ARG_VAR_LIBS() |
| 39 | + _AC_ARG_VAR_CPPFLAGS() |
| 40 | +
|
| 41 | + AC_CHECK_TOOLS(CC, [$1]) |
| 42 | +
|
| 43 | + test -z "$CC" && AC_MSG_FAILURE([no acceptable C compiler found in \$PATH]) |
| 44 | +
|
| 45 | + # Provide some information about the compiler. |
| 46 | + _AS_ECHO_LOG([checking for _AC_LANG compiler version]) |
| 47 | + set X $ac_compile |
| 48 | + ac_compiler=$[2] |
| 49 | + for ac_option in --version -v -V -qversion -version; do |
| 50 | + _AC_DO_LIMIT([$ac_compiler $ac_option >&AS_MESSAGE_LOG_FD]) |
| 51 | + done |
| 52 | +
|
| 53 | + m4_expand_once([_AC_COMPILER_EXEEXT]) |
| 54 | + m4_expand_once([_AC_COMPILER_OBJEXT]) |
| 55 | +
|
| 56 | + _AC_PROG_CC_G |
| 57 | +
|
| 58 | + AC_LANG_POP(C) |
| 59 | +]) |
| 60 | + |
| 61 | +############################################################################### |
| 62 | +# Overwrite the existing version of AC_PROG_CXX with our own custom variant. |
| 63 | +# Unlike the regular AC_PROG_CXX, the compiler list must always be passed. |
| 64 | +AC_DEFUN([AC_PROG_CXX], |
| 65 | +[ |
| 66 | + AC_LANG_PUSH(C++) |
| 67 | + AC_ARG_VAR([CXX], [C++ compiler command]) |
| 68 | + AC_ARG_VAR([CXXFLAGS], [C++ compiler flags]) |
| 69 | +
|
| 70 | + _AC_ARG_VAR_LDFLAGS() |
| 71 | + _AC_ARG_VAR_LIBS() |
| 72 | + _AC_ARG_VAR_CPPFLAGS() |
| 73 | +
|
| 74 | + AC_CHECK_TOOLS(CXX, [$1]) |
| 75 | +
|
| 76 | + # Provide some information about the compiler. |
| 77 | + _AS_ECHO_LOG([checking for _AC_LANG compiler version]) |
| 78 | + set X $ac_compile |
| 79 | + ac_compiler=$[2] |
| 80 | + for ac_option in --version -v -V -qversion; do |
| 81 | + _AC_DO_LIMIT([$ac_compiler $ac_option >&AS_MESSAGE_LOG_FD]) |
| 82 | + done |
| 83 | +
|
| 84 | + m4_expand_once([_AC_COMPILER_EXEEXT]) |
| 85 | + m4_expand_once([_AC_COMPILER_OBJEXT]) |
| 86 | +
|
| 87 | + _AC_PROG_CXX_G |
| 88 | +
|
| 89 | + AC_LANG_POP(C++) |
| 90 | +]) |
| 91 | + |
28 | 92 | ################################################################################
|
29 | 93 | # Create a function/macro that takes a series of named arguments. The call is
|
30 | 94 | # similar to AC_DEFUN, but the setup of the function looks like this:
|
|
0 commit comments