Imported Upstream version 1.1.11
[platform/upstream/cdrkit.git] / 3rd-party / zisofs_tools / aclocal.m4
1 dnl --------------------------------------------------------------------------
2 dnl PA_ADD_CFLAGS()
3 dnl
4 dnl Attempt to add the given option to CFLAGS, if it doesn't break compilation
5 dnl --------------------------------------------------------------------------
6 AC_DEFUN(PA_ADD_CFLAGS,
7 [AC_MSG_CHECKING([if $CC accepts $1])
8  pa_add_cflags__old_cflags="$CFLAGS"
9  CFLAGS="$CFLAGS $1"
10  AC_TRY_LINK([#include <stdio.h>],
11  [printf("Hello, World!\n");],
12  AC_MSG_RESULT([yes]),
13  AC_MSG_RESULT([no])
14  CFLAGS="$pa_add_cflags__old_cflags")])
15
16 dnl ------------------------------------------------------------------------
17 dnl  PA_WITH_BOOL
18 dnl
19 dnl  PA_WITH_BOOL(option, default, help, enable, disable)
20 dnl
21 dnl  Provides a more convenient way to specify --with-option and
22 dnl  --without-option, with a default.  default should be either 0 or 1.
23 dnl ------------------------------------------------------------------------
24 AC_DEFUN(PA_WITH_BOOL,
25 [AC_ARG_WITH([$1], [$3],
26 if test ["$withval"] != no; then
27 [$4]
28 else
29 [$5]
30 fi,
31 if test [$2] -ne 0; then
32 [$4]
33 else
34 [$5]
35 fi)])