#
# Copyright (C) 1996-2007 Gero Kuhlmann
#
# $Id: nb_check_comp.m4,v 1.3 2007/02/01 12:09:23 gkminix Exp $
#
#
#
# Define a macro which can be used to run an assembler or compiler and
# act on its return code
#
# NB_CHECK_COMP(progname, programcode[, exec-if-true[, exec-if-false]])
#
AC_DEFUN([NB_CHECK_COMP],
[cat > conftest.test <<EOF
[$2]
EOF
AS_IF([AC_TRY_EVAL([$1 -o conftest.out conftest.test])],
  [m4_ifvaln([$3], [$3])],
  [echo "$as_me: program exited with status $ac_status" >&AS_MESSAGE_LOG_FD
   echo "$as_me: failed program was:" >&AS_MESSAGE_LOG_FD
   sed 's/^/| /' conftest.test >&AS_MESSAGE_LOG_FD
   m4_ifvaln([$4], [$4])dnl]
)dnl
rm -f conftest*])

