diff options
author | Maarten Bosmans <mkbosmans@gmail.com> | 2011-06-20 11:24:07 +0200 |
---|---|---|
committer | Peter Simons <simons@cryp.to> | 2011-06-25 10:13:58 +0200 |
commit | 3730d145510e5ac23fe85c05bd5ddae74cfe9a12 (patch) | |
tree | 6e49ddd224c18b099ab5cc4a2834cbd82a52bcb3 /m4/ax_cflags_aix_option.m4 | |
parent | 036337da85b561029049ed2114ae5d3d237b9c63 (diff) | |
download | autoconf-archive-3730d145510e5ac23fe85c05bd5ddae74cfe9a12.tar.gz |
ax_cflags_*_option.m4: Use AX_CHECK_COMPILE_FLAG macro to do most of the work
This gets rid of the for loop and the string splitting using sed. For
gcc_option the logic is now contained in a much easier to follow if statement.
Diffstat (limited to 'm4/ax_cflags_aix_option.m4')
-rw-r--r-- | m4/ax_cflags_aix_option.m4 | 18 |
1 files changed, 3 insertions, 15 deletions
diff --git a/m4/ax_cflags_aix_option.m4 b/m4/ax_cflags_aix_option.m4 index 96d2253..36219f1 100644 --- a/m4/ax_cflags_aix_option.m4 +++ b/m4/ax_cflags_aix_option.m4 @@ -66,31 +66,19 @@ #serial 9 AC_DEFUN([AX_FLAGS_AIX_OPTION_PRIVATE], [dnl +AX_CHECK_COMPILE_FLAG([$1], [flag_ok="yes"], [flag_ok="no"], [-qlanglvl=ansi -qsrcmsg]) AS_VAR_PUSHDEF([FLAGS],[_AC_LANG_PREFIX[]FLAGS])dnl -AS_VAR_PUSHDEF([VAR],[ax_cv_[]_AC_LANG_ABBREV[]flags_aix_option_$1])dnl -AC_CACHE_CHECK([m4_ifval($2,$2,FLAGS) for aix/cc m4_ifval($1,$1,-option)], -VAR,[VAR="no, unknown" - ac_save_[]FLAGS="$[]FLAGS" -for ac_arg dnl -in "-qlanglvl=ansi -qsrcmsg % m4_ifval($1,$1,-option)" dnl AIX - # -do FLAGS="$ac_save_[]FLAGS "`echo $ac_arg | sed -e 's,%%.*,,' -e 's,%,,'` - AC_TRY_COMPILE([],[return 0;], - [VAR=`echo $ac_arg | sed -e 's,.*% *,,'` ; break]) -done - FLAGS="$ac_save_[]FLAGS" -]) -case ".$VAR" in +case ".$flag_ok" in .ok|.ok,*) m4_ifvaln($3,$3) ;; .|.no|.no,*) m4_ifvaln($4,$4) ;; *) m4_ifvaln($3,$3,[ + VAR="$1" if echo " $[]m4_ifval($2,$2,FLAGS) " | grep " $VAR " 2>&1 >/dev/null then AC_RUN_LOG([: m4_ifval($2,$2,FLAGS) does contain $VAR]) else AC_RUN_LOG([: m4_ifval($2,$2,FLAGS)="$m4_ifval($2,$2,FLAGS) $VAR"]) m4_ifval($2,$2,FLAGS)="$m4_ifval($2,$2,FLAGS) $VAR" fi ]) ;; esac -AS_VAR_POPDEF([VAR])dnl AS_VAR_POPDEF([FLAGS])dnl ]) |