Bugfix in fnet-dc.c to enable resuming files >2 GB.
[doldaconnect.git] / acinclude.m4
CommitLineData
b2ab3796
FT
1AC_DEFUN([DOLDA_AC_GROUP],
2[AC_MSG_NOTICE([ -- $1 -- ])])
3
4m4_defun([_DOLDA_PKG_LOOP],[dnl
5if test -z "$[]$1"; then
6 $2
7fi
8ifelse(m4_eval([$# > 2]), 1, [_DOLDA_PKG_LOOP($1, m4_shift(m4_shift($@)))])
9])
10
11# DOLDA_PKG(VARIABLE-NAME, COMMANDS...)
12#
13# Evaluate COMMANDS in sequence as long as ${VARIABLE-NAME} is empty
14
15AC_DEFUN([DOLDA_PKG],[dnl
16$1=""
17_DOLDA_PKG_LOOP($1, m4_shift($@))
18if test "$[]$1" != no; then $1=yes; fi
19])
20
21# DOLDA_CHECK_HEADER(FILE, ACTION-IF-FOUND, ACTION-IF-NOT-FOUND,
22# [EXTRA-CFLAGS])
23#
24# Augmented version of AC_CHECK_HEADER that overrides CPPFLAGS
25
26AC_DEFUN([DOLDA_CHECK_HEADER],[dnl
27cpp_bak="$CPPFLAGS"
28ifelse([$4], , , [CPPFLAGS="$CPPFLAGS $4"])
29AC_CHECK_HEADER($1, $2, $3)
30CPPFLAGS="$cpp_bak"
31])
32
31119a15
FT
33# DOLDA_CHECK_FUNC(FUNCTION, ACTION-IF-FOUND, ACTION-IF-NOT-FOUND,
34# [EXTRA-CFLAGS], [EXTRA-LDFLAGS])
35#
36# Augmented version of AC_CHECK_HEADER that overrides CPPFLAGS and
37# LDFLAGS
38
39AC_DEFUN([DOLDA_CHECK_FUNC],[dnl
40cpp_bak="$CPPFLAGS"
41ld_bak="$LDFLAGS"
42ifelse([$4], , , [CPPFLAGS="$CPPFLAGS $4"])
43ifelse([$5], , , [LDFLAGS="$LDFLAGS $5"])
44AC_CHECK_FUNC($1, $2, $3)
45CPPFLAGS="$cpp_bak"
46LDFLAGS="$ldflags"
47])
48
b2ab3796
FT
49# DOLDA_ENABLE(NAME, HELP, DEFAULT, DEPS)
50#
51# DEPS is a space-separated listing of required variables that must be
52# `yes'
53
54AC_DEFUN([DOLDA_ENABLE],[dnl
55AC_ARG_ENABLE([$1], [$2])
56if test "[$enable_][$1]" = yes; then
57 for var in [$4]; do
58 if test "${!var}" != yes; then
59 AC_MSG_ERROR([*** cannot enable $1 without $var])
60 fi
61 done
5d374eb0 62elif test -z "[$enable_][$1]"; then
b2ab3796
FT
63 ifelse([$3], yes, [dnl
64 [enable_][$1]=yes
65 for var in [$4]; do
66 if test "${!var}" != yes; then
67 [enable_][$1]=no
68 break
69 fi
70 done
71], [dnl
72 [enable_][$1]=no
73])
74fi
75])