[534e4e4] | 1 | |
---|
| 2 | m4_define([M4CFA_PARSE_PREFIX], [ |
---|
| 3 | if test "x$prefix" = "xNONE"; then |
---|
| 4 | cfa_prefix=${ac_default_prefix} |
---|
| 5 | else |
---|
| 6 | cfa_prefix=${prefix} |
---|
| 7 | fi |
---|
[8e485801] | 8 | cfa_prefix="$(readlink -m ${cfa_prefix})/" |
---|
[534e4e4] | 9 | AC_DEFINE_UNQUOTED(CFA_PREFIX, "${cfa_prefix}", [Location of cfa install.]) |
---|
| 10 | AC_SUBST(CFA_PREFIX, ${cfa_prefix}) |
---|
| 11 | |
---|
| 12 | if test "$includedir" = '${prefix}/include'; then |
---|
[8e485801] | 13 | cfa_incdir="${cfa_prefix}include/${cfa_name}" |
---|
[534e4e4] | 14 | else |
---|
| 15 | cfa_incdir=${includedir} |
---|
| 16 | fi |
---|
[8e485801] | 17 | cfa_incdir="$(readlink -m ${cfa_incdir})/" |
---|
[534e4e4] | 18 | AC_DEFINE_UNQUOTED(CFA_INCDIR, "${cfa_incdir}", [Location of include files.]) |
---|
| 19 | AC_SUBST(CFA_INCDIR, ${cfa_incdir}) |
---|
| 20 | |
---|
| 21 | if test "$bindir" = '${exec_prefix}/bin'; then |
---|
[8e485801] | 22 | cfa_bindir="${cfa_prefix}bin" |
---|
[534e4e4] | 23 | else |
---|
| 24 | cfa_bindir=${bindir} |
---|
| 25 | fi |
---|
[8e485801] | 26 | cfa_bindir="$(readlink -m ${cfa_bindir})/" |
---|
[534e4e4] | 27 | AC_DEFINE_UNQUOTED(CFA_BINDIR, "${cfa_bindir}", [Location of cfa command.]) |
---|
| 28 | AC_SUBST(CFA_BINDIR, ${cfa_bindir}) |
---|
| 29 | |
---|
| 30 | if test "$libdir" = '${exec_prefix}/lib'; then |
---|
[a5121bf] | 31 | if test "${ARCHITECTURE}" != ""; then |
---|
[8e485801] | 32 | cfa_libdir="${cfa_prefix}lib/${cfa_name}/${ARCHITECTURE}-${CONFIGURATION}/" |
---|
[a5121bf] | 33 | else |
---|
[8e485801] | 34 | cfa_libdir="${cfa_prefix}lib/${cfa_name}/" |
---|
[a5121bf] | 35 | fi |
---|
[534e4e4] | 36 | else |
---|
[37fe352] | 37 | cfa_libdir="${libdir}/${ARCHITECTURE}${CONFIGURATION}" |
---|
[534e4e4] | 38 | fi |
---|
[8e485801] | 39 | cfa_libdir="$(readlink -m ${cfa_libdir})/" |
---|
[534e4e4] | 40 | AC_DEFINE_UNQUOTED(CFA_LIBDIR, "${cfa_libdir}", [Location of cc1 and cfa-cpp commands.]) |
---|
| 41 | AC_SUBST(CFA_LIBDIR, ${cfa_libdir}) |
---|
[37fe352] | 42 | ]) |
---|
| 43 | |
---|
| 44 | m4_define([M4CFA_PROGRAM_NAME], [ |
---|
| 45 | if test "${program_transform_name}" = ""; then |
---|
| 46 | AC_MSG_ERROR([Program transform not supported. |
---|
| 47 | Use --with-cfa-name='[[Desired name here]]' instead]) |
---|
| 48 | fi |
---|
| 49 | |
---|
| 50 | #Define the new name of the installed command |
---|
| 51 | AC_ARG_WITH(cfa-name, |
---|
| 52 | [ --with-cfa-name=NAME NAME too which cfa will be installed], |
---|
| 53 | cfa_name=$withval, cfa_name="cfa") |
---|
| 54 | |
---|
| 55 | AC_SUBST(CFA_NAME, ${cfa_name}) |
---|
| 56 | ]) |
---|
| 57 | |
---|
| 58 | AC_DEFUN([M4CFA_CANNON_CPU], [ |
---|
[305581d] | 59 | case $1 in |
---|
[ae628e1] | 60 | "host") arch_name=${host_cpu};; |
---|
[305581d] | 61 | *) arch_name=$1;; |
---|
[ae628e1] | 62 | esac |
---|
| 63 | |
---|
[37fe352] | 64 | case $arch_name in |
---|
| 65 | "x64" ) cannon_arch_name="x64";; |
---|
| 66 | "x86-64" ) cannon_arch_name="x64";; |
---|
| 67 | "x86_64" ) cannon_arch_name="x64";; |
---|
[9509a412] | 68 | "aarch64" ) cannon_arch_name="arm64";; |
---|
[9689e54] | 69 | "arm64" ) cannon_arch_name="arm64";; |
---|
[9509a412] | 70 | "ARM64" ) cannon_arch_name="arm64";; |
---|
[37fe352] | 71 | "x86" ) cannon_arch_name="x86";; |
---|
| 72 | "i386" ) cannon_arch_name="x86";; |
---|
| 73 | "i486" ) cannon_arch_name="x86";; |
---|
| 74 | "i686" ) cannon_arch_name="x86";; |
---|
| 75 | "Intel 80386") cannon_arch_name="x86";; |
---|
[9509a412] | 76 | "arm" ) cannon_arch_name="arm32";; |
---|
| 77 | "ARM" ) cannon_arch_name="arm32";; |
---|
| 78 | "arm32" ) cannon_arch_name="arm32";; |
---|
| 79 | "ARM32" ) cannon_arch_name="arm32";; |
---|
| 80 | "armv7l" ) cannon_arch_name="arm32";; |
---|
[37fe352] | 81 | *) |
---|
[d82892a] | 82 | >&2 echo "Unknown architecture " $arch_name; |
---|
[37fe352] | 83 | exit 1 |
---|
| 84 | ;; |
---|
| 85 | esac |
---|
[305581d] | 86 | ]) |
---|
[1f86d5e] | 87 | |
---|
| 88 | # http://git.savannah.gnu.org/gitweb/?p=autoconf-archive.git;a=blob_plain;f=m4/ax_check_compile_flag.m4 |
---|
| 89 | AC_DEFUN([M4CFA_CHECK_COMPILE_FLAG], |
---|
| 90 | [AC_PREREQ(2.64)dnl for _AC_LANG_PREFIX and AS_VAR_IF |
---|
| 91 | AS_VAR_PUSHDEF([CACHEVAR],[m4cfa_cv_check_[]_AC_LANG_ABBREV[]flags_$4_$1])dnl |
---|
| 92 | AC_CACHE_CHECK([whether _AC_LANG compiler accepts $1], CACHEVAR, [ |
---|
| 93 | m4cfa_check_save_flags=$[]_AC_LANG_PREFIX[]FLAGS |
---|
| 94 | _AC_LANG_PREFIX[]FLAGS="$[]_AC_LANG_PREFIX[]FLAGS $4 $1" |
---|
| 95 | AC_COMPILE_IFELSE([m4_default([$5],[AC_LANG_PROGRAM()])], |
---|
| 96 | [AS_VAR_SET(CACHEVAR,[yes])], |
---|
| 97 | [AS_VAR_SET(CACHEVAR,[no])]) |
---|
| 98 | _AC_LANG_PREFIX[]FLAGS=$m4cfa_check_save_flags]) |
---|
| 99 | AS_VAR_IF(CACHEVAR,yes, |
---|
| 100 | [m4_default([$2], :)], |
---|
| 101 | [m4_default([$3], :)]) |
---|
| 102 | AS_VAR_POPDEF([CACHEVAR])dnl |
---|
| 103 | ])dnl M4CFA_CHECK_COMPILE_FLAGS |
---|