File: configure.in

package info (click to toggle)
capi4hylafax 1:01.03.00.99.svn.300-16
  • links: PTS
  • area: main
  • in suites: squeeze
  • size: 3,044 kB
  • ctags: 3,085
  • sloc: cpp: 20,823; sh: 9,412; makefile: 226; perl: 36
file content (101 lines) | stat: -rw-r--r-- 2,677 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
dnl Process this file with autoconf to produce a configure script.

AC_INIT
AC_CONFIG_SRCDIR([src/defaults.h.in])
AC_CONFIG_AUX_DIR(src/scripts)
AM_INIT_AUTOMAKE(capi4hylafax,01.03.01svn)
AM_MAINTAINER_MODE

CXXFLAGS="-Wall -W -O2 $CXXFLAGS -D_GNU_SOURCE -DDONT_USE_PROTECT_FEATURE"

AC_LANG([C++])

dnl Checks for programs.
AC_PROG_CXX
AC_PROG_MAKE_SET
AC_PROG_INSTALL
AC_PROG_LIBTOOL

dnl Check for va_copy in stdarg.h
AC_CACHE_CHECK([for va_copy],ac_func_va_copy,[
AC_LINK_IFELSE([AC_LANG_PROGRAM([
#include <stdarg.h>
void x(va_list args)
{
    va_list copy;
    va_copy(copy,args);
}
], []) ], [ac_func_va_copy=yes], [ac_func_va_copy=no])
])

if test $ac_func_va_copy = no; then
    AC_CACHE_CHECK([for __va_copy],ac_func___va_copy,[
        AC_LINK_IFELSE([AC_LANG_PROGRAM([
        #include <stdarg.h>
        void x(va_list args)
        {
           va_list copy;
           __va_copy(copy,args);
        }
    ], [])], [ac_func___va_copy=yes], [ac_func___va_copy=no])
    ])
    if test $ac_func___va_copy = no; then
       AC_DEFINE(va_copy(d,s),(d)=(s))
    else
       AC_DEFINE(va_copy(d,s),__va_copy(d,s))
    fi
fi

AC_SUBST(LIBTOOL_DEPS)

dnl Optional hylafax spool directory
AC_ARG_WITH(hylafax-spooldir,
    AC_HELP_STRING([--with-hylafax-spooldir=DIR],
                   [Set dir where hylafax spool is installed. (/var/spool/hylafax)]),
    hylafaxspooldir="$withval",
    hylafaxspooldir="/var/spool/hylafax"
)

dnl Optional debug
AC_ARG_ENABLE(debug,
    AC_HELP_STRING([--enable-debug],[Turn debugging on (default=no)]),
    [case "$enableval" in
        yes | true) debugflags=-g ;;
        no | false) debugflags=-DNDEBUG ;;
        *)          AC_MSG_ERROR(bad value $enableval for --enable-debug) ;;
     esac],
    [debugflags=-DNDEBUG]
)
CXXFLAGS="$CXXFLAGS $debugflags"
dnl AM_CONDITIONAL(NDEBUG, test x$debug = xfalse)

dnl Checks for header files.
AC_HEADER_STDC
AC_CHECK_HEADERS(string.h memory.h)
AC_CHECK_HEADERS(capi20.h)

AC_CHECK_LIB(capi20, capi20_register, , AC_MSG_ERROR(libcapi20 not found))
AC_CHECK_LIB(tiff, TIFFGetVersion, , AC_MSG_ERROR(libtiff not found))
AC_CHECK_LIB(pthread, pthread_create, , AC_MSG_ERROR(libpthread not found))

AC_CHECK_SIZEOF(void *)

dnl Read the libtool configuration
dnl rm -f conftest
dnl ./libtool --config > conftest
dnl . ./conftest
dnl rm -f conftest

CFLAGS=$CXXFLAGS

AC_SUBST(INSTALL)
AC_SUBST(hylafaxbindir)
AC_SUBST(hylafaxspooldir)
AC_SUBST(CFLAGS)
AC_SUBST(CXXFLAGS)
AC_CONFIG_FILES([Makefile src/Makefile src/defaults.h
          src/standard/Makefile src/capi/Makefile
          src/convert/Makefile src/linuxdep/Makefile
          src/faxrecv/Makefile src/faxsend/Makefile])
AC_OUTPUT