summaryrefslogtreecommitdiff
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
parent7f67ff5af4560ea7e74dcee81779b5211f11ca7b (diff)
downloadautoconf-archive-6af2231b10be0b15efaaa9d4fdad3bd844868f21.tar.gz
Make assembler-option macros more portable and exit early if assembler not found
-rw-r--r--m4/ax_prog_fasm_opt.m429
-rw-r--r--m4/ax_prog_hla_opt.m429
-rw-r--r--m4/ax_prog_masm_opt.m429
-rw-r--r--m4/ax_prog_nasm_opt.m429
-rw-r--r--m4/ax_prog_tasm_opt.m429
-rw-r--r--m4/ax_prog_yasm_opt.m429
6 files changed, 108 insertions, 66 deletions
diff --git a/m4/ax_prog_fasm_opt.m4 b/m4/ax_prog_fasm_opt.m4
index b54a485..a127800 100644
--- a/m4/ax_prog_fasm_opt.m4
+++ b/m4/ax_prog_fasm_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_FASM_OPT],[
-AC_REQUIRE([AX_PROG_FASM])dnl
-AC_MSG_CHECKING([if $fasm accepts $1])
-echo '' > conftest.asm
-if $fasm $$2 $1 conftest.asm > conftest.err; then
- $2="$$2 $1"
- AC_MSG_RESULT([yes])
-else
- AC_MSG_RESULT([no])
-fi
+ AC_REQUIRE([AX_PROG_FASM])dnl
+ AC_MSG_CHECKING([if fasm '$fasm' accepts $1])
+ AS_IF([test "x$fasm" = "xno"],
+ [
+ AC_MSG_RESULT([no])
+ AC_MSG_WARN([fasm assembler not found])
+ ],
+ [
+ AS_ECHO '' > conftest.asm
+ AS_IF([$fasm $$2 $1 conftest.asm > conftest.err],
+ [$2="$$2 $1"
+ AC_MSG_RESULT([yes])],
+ [AC_MSG_RESULT([no])]
+ )
+ ]
+ )
])
diff --git a/m4/ax_prog_hla_opt.m4 b/m4/ax_prog_hla_opt.m4
index b656c3f..af8b3b8 100644
--- a/m4/ax_prog_hla_opt.m4
+++ b/m4/ax_prog_hla_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_HLA_OPT],[
-AC_REQUIRE([AX_PROG_HLA])dnl
-AC_MSG_CHECKING([if $hla accepts $1])
-echo '' > conftest.hla
-if $hla $$2 $1 conftest.hla > conftest.err; then
- $2="$$2 $1"
- AC_MSG_RESULT([yes])
-else
- AC_MSG_RESULT([no])
-fi
+ AC_REQUIRE([AX_PROG_HLA])dnl
+ AC_MSG_CHECKING([if HLA '$hla' accepts $1])
+ AS_IF([test "x$hla" = "xno"],
+ [
+ AC_MSG_RESULT([no])
+ AC_MSG_WARN([HLA assembler not found])
+ ],
+ [
+ AS_ECHO '' > conftest.hla
+ AS_IF([$hla $$2 $1 conftest.hla > conftest.err],
+ [$2="$$2 $1"
+ AC_MSG_RESULT([yes])],
+ [AC_MSG_RESULT([no])]
+ )
+ ]
+ )
])
diff --git a/m4/ax_prog_masm_opt.m4 b/m4/ax_prog_masm_opt.m4
index 1480aea..65650c3 100644
--- a/m4/ax_prog_masm_opt.m4
+++ b/m4/ax_prog_masm_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_MASM_OPT],[
-AC_REQUIRE([AX_PROG_MASM])dnl
-AC_MSG_CHECKING([if $masm accepts $1])
-echo '' > conftest.asm
-if $masm $$2 $1 conftest.asm > conftest.err; then
- $2="$$2 $1"
- AC_MSG_RESULT([yes])
-else
- AC_MSG_RESULT([no])
-fi
+ AC_REQUIRE([AX_PROG_MASM])dnl
+ AC_MSG_CHECKING([if MASM '$masm' accepts $1])
+ AS_IF([test "x$masm" = "xno"],
+ [
+ AC_MSG_RESULT([no])
+ AC_MSG_WARN([MASM assembler not found])
+ ],
+ [
+ AS_ECHO '' > conftest.asm
+ AS_IF([$masm $$2 $1 conftest.asm > conftest.err],
+ [$2="$$2 $1"
+ AC_MSG_RESULT([yes])],
+ [AC_MSG_RESULT([no])]
+ )
+ ]
+ )
])
diff --git a/m4/ax_prog_nasm_opt.m4 b/m4/ax_prog_nasm_opt.m4
index 96bfe9f..e38d6d1 100644
--- a/m4/ax_prog_nasm_opt.m4
+++ b/m4/ax_prog_nasm_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_NASM_OPT],[
-AC_REQUIRE([AX_PROG_NASM])dnl
-AC_MSG_CHECKING([if $nasm accepts $1])
-echo '' > conftest.asm
-if $nasm $$2 $1 conftest.asm > conftest.err; then
- $2="$$2 $1"
- AC_MSG_RESULT([yes])
-else
- AC_MSG_RESULT([no])
-fi
+ AC_REQUIRE([AX_PROG_NASM])dnl
+ AC_MSG_CHECKING([if NASM '$nasm' accepts $1])
+ AS_IF([test "x$nasm" = "xno"],
+ [
+ AC_MSG_RESULT([no])
+ AC_MSG_WARN([NASM assembler not found])
+ ],
+ [
+ AS_ECHO '' > conftest.asm
+ AS_IF([$nasm $$2 $1 conftest.asm > conftest.err],
+ [$2="$$2 $1"
+ AC_MSG_RESULT([yes])],
+ [AC_MSG_RESULT([no])]
+ )
+ ]
+ )
])
diff --git a/m4/ax_prog_tasm_opt.m4 b/m4/ax_prog_tasm_opt.m4
index 47efe7f..c01a501 100644
--- a/m4/ax_prog_tasm_opt.m4
+++ b/m4/ax_prog_tasm_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_TASM_OPT],[
-AC_REQUIRE([AX_PROG_TASM])dnl
-AC_MSG_CHECKING([if $tasm accepts $1])
-echo '' > conftest.asm
-if $tasm $$2 $1 conftest.asm > conftest.err; then
- $2="$$2 $1"
- AC_MSG_RESULT([yes])
-else
- AC_MSG_RESULT([no])
-fi
+ AC_REQUIRE([AX_PROG_TASM])dnl
+ AC_MSG_CHECKING([if TASM '$tasm' accepts $1])
+ AS_IF([test "x$tasm" = "xno"],
+ [
+ AC_MSG_RESULT([no])
+ AC_MSG_WARN([TASM assembler not found])
+ ],
+ [
+ AS_ECHO '' > conftest.asm
+ AS_IF([$tasm $$2 $1 conftest.asm > conftest.err],
+ [$2="$$2 $1"
+ AC_MSG_RESULT([yes])],
+ [AC_MSG_RESULT([no])]
+ )
+ ]
+ )
])
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])]
+ )
+ ]
+ )
])