autoconf: modernize and modularize
[tftp-hpa.git] / autoconf / m4 / pa_build_ifelse.m4
blob1aacfcd7e835c19227031015556de15b9a923000
1 dnl --------------------------------------------------------------------------
2 dnl PA_BUILD_IFELSE(input [,success [,failure]])
3 dnl
4 dnl  Same as AC_LINK_IFELSE for languages where linking is applicable,
5 dnl  otherwise AC_COMPILE_IFELSE.
6 dnl
7 dnl If the first argument is empty, use _AC_LANG_IO_PROGRAM.
8 dnl --------------------------------------------------------------------------
9 m4_defun([_PA_BUILD_IFELSE],
10 [m4_case(_AC_LANG,
11  [Erlang], [AC_COMPILE_IFELSE($@)],
12  [AC_LINK_IFELSE($@)])])
14 AC_DEFUN([PA_BUILD_IFELSE],
15 [_PA_BUILD_IFELSE([m4_ifblank([$1],[AC_LANG_SOURCE(_AC_LANG_IO_PROGRAM)],
16  [$1])],[$2],[$3])])