summaryrefslogtreecommitdiff
path: root/m4/ax_prog_yasm_opt.m4
diff options
context:
space:
mode:
authorBogdan Drozdowski <>2022-06-06 21:02:19 +0200
committerBogdan Drozdowski <>2022-06-06 21:02:19 +0200
commit6af2231b10be0b15efaaa9d4fdad3bd844868f21 (patch)
treef12ba1ad2eb300b0230bed0be7d3056477edfb6d /m4/ax_prog_yasm_opt.m4
parent7f67ff5af4560ea7e74dcee81779b5211f11ca7b (diff)
downloadautoconf-archive-6af2231b10be0b15efaaa9d4fdad3bd844868f21.tar.gz
Make assembler-option macros more portable and exit early if assembler not found
Diffstat (limited to 'm4/ax_prog_yasm_opt.m4')
-rw-r--r--m4/ax_prog_yasm_opt.m429
1 files changed, 18 insertions, 11 deletions
diff --git a/m4/ax_prog_yasm_opt.m4 b/m4/ax_prog_yasm_opt.m4
index 7087cc0..d179161 100644
--- a/m4/ax_prog_yasm_opt.m4
+++ b/m4/ax_prog_yasm_opt.m4
@@ -18,7 +18,7 @@
#
# LICENSE
#
-# Copyright (c) 2007,2009 Bogdan Drozdowski <bogdandr@op.pl>
+# Copyright (c) 2007,2009,2022 Bogdan Drozdowski <bogdro /AT/ users . sourceforge . net>
#
# This program is free software: you can redistribute it and/or modify it
# under the terms of the GNU Lesser General Public License as published by
@@ -46,16 +46,23 @@
# modified version of the Autoconf Macro, you may extend this special
# exception to the GPL to apply to your modified version as well.
-#serial 9
+#serial 10
AC_DEFUN([AX_PROG_YASM_OPT],[
-AC_REQUIRE([AX_PROG_YASM])dnl
-AC_MSG_CHECKING([if $yasm accepts $1])
-echo '' > conftest.asm
-if $yasm $$2 $1 conftest.asm > conftest.err; then
- $2="$$2 $1"
- AC_MSG_RESULT([yes])
-else
- AC_MSG_RESULT([no])
-fi
+ AC_REQUIRE([AX_PROG_YASM])dnl
+ AC_MSG_CHECKING([if YASM '$yasm' accepts $1])
+ AS_IF([test "x$yasm" = "xno"],
+ [
+ AC_MSG_RESULT([no])
+ AC_MSG_WARN([YASM assembler not found])
+ ],
+ [
+ AS_ECHO '' > conftest.asm
+ AS_IF([$yasm $$2 $1 conftest.asm > conftest.err],
+ [$2="$$2 $1"
+ AC_MSG_RESULT([yes])],
+ [AC_MSG_RESULT([no])]
+ )
+ ]
+ )
])