summaryrefslogtreecommitdiffstats
path: root/configure.in.in
blob: 055c2225bdca834815f9ede51fb84eb88a7a42c3 (plain)
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
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
#MIN_CONFIG(3.3.5)

AM_INIT_AUTOMAKE(klamav, 0.1)
AC_C_BIGENDIAN
AC_CHECK_KDEMAXPATHLEN

###############################################################################
# BEGIN PKG-CONFIG CHECK
###############################################################################

AC_ARG_VAR(PKGCONFIGFOUND, [Path to pkg-config])
AC_CHECK_PROG(PKGCONFIGFOUND, pkg-config, [yes])

###############################################################################
# END PKG-CONFIG CHECK
###############################################################################

###############################################################################
# BEGIN SQLITE CHECK
###############################################################################

LIB_SQLITE=""

AC_ARG_WITH(included-sqlite,
    AC_HELP_STRING([--without-included-sqlite],[build KlamAV using system sqlite library]),
    [included_sqlite=$withval],
    [included_sqlite=yes]
)

if test x$included_sqlite = xno; then
    if test x$PKGCONFIGFOUND = xyes; then
        PKG_CHECK_MODULES(SQLITE, sqlite3 >= 3.0, have_sqlite=yes,have_sqlite=no)

        if test x$have_sqlite = xyes; then
            LIB_SQLITE=`pkg-config --libs sqlite3`
        else
            AC_MSG_ERROR(Can't find sqlite database library. Check your installation of sqlite or use included sqlite.)
        fi
    fi
fi

AC_SUBST(LIB_SQLITE)
AM_CONDITIONAL(with_included_sqlite, [test x$included_sqlite = xyes])

# Determine pointer size for sqlite
KDE_CHECK_TYPES
AC_DEFINE(SQLITE_PTR_SZ, SIZEOF_CHAR_P, [Determine pointer size for SQLite])

###############################################################################
# END SQLITE CHECK
###############################################################################


# ---- Taken from KOffice ----------------------
# --- Check for KDE 3.2 or 3.3 or 3.4 or 3.5 ---

AC_MSG_CHECKING([for KDE version])

AC_LANG_SAVE
AC_LANG_CPLUSPLUS
tdeversion_save_CXXFLAGS="$CXXFLAGS"
tdeversion_safe_LIBS="$LIBS"
LIBS="$LIBS $X_EXTRA_LIBS"
CXXFLAGS="$CXXFLAGS $all_includes"

AC_COMPILE_IFELSE([
#include <tdeversion.h>
#if ! ( KDE_IS_VERSION( 3, 2, 90 ) )
#error KDE 3.2
#endif
],
        need_kde32_compat="no"
,
        need_kde32_compat="yes"
)

AC_COMPILE_IFELSE([
#include <tdeversion.h>
#if ! ( KDE_IS_VERSION( 3, 3, 90 ) )
#error KDE 3.3
#endif
],
        need_kde33_compat="no"
,
        need_kde33_compat="yes"
)

AC_COMPILE_IFELSE([
#include <tdeversion.h>
#if ! ( KDE_IS_VERSION( 3, 4, 90 ) )
#error KDE 3.4
#endif
],
        need_kde34_compat="no"
,
        need_kde34_compat="yes"
)

AC_COMPILE_IFELSE([
#include <tdeversion.h>
#if ! ( KDE_IS_VERSION( 3, 5, 2 ) )
#error KDE 3.5.x (x < 2)
#endif
],
        need_kde351_compat="no"
,
        need_kde351_compat="yes"
)
CXXFLAGS="$tdeversion_save_CXXFLAGS"
LIBS="$tdeversion_safe_LIBS"
AC_LANG_RESTORE

if test "$need_kde32_compat" = "yes"; then
        AC_MSG_ERROR([You have KDE 3.2.x. KlamAV needs KDE 3.5.2 or greater.])
else
        if test "$need_kde33_compat" = "yes"; then
                AC_MSG_ERROR([You have KDE 3.3.x KlamAV needs KDE 3.5.2 or greater.])
        else 
                if test "$need_kde34_compat" = "yes"; then
                        AC_MSG_ERROR([You have KDE 3.4.x KlamAV needs KDE 3.5.2 or greater.])
                else
                        if test "$need_kde351_compat" = "yes"; then
                                AC_MSG_ERROR([You have KDE 3.5.1. KlamAV needs KDE 3.5.2 or greater.])
                        else
                                AC_MSG_RESULT([KDE 3.5.x (x >=2) or SVN trunk])
                        fi
                fi
        fi
fi


# --- End KDE 3.2 check ---




AC_CHECK_LIB(clamav, cl_scanfile, [LIB_CLAM=" -lclamav";],AC_MSG_ERROR(Can't find ClamAV's libraries. Please check your installation of ClamAV.))
AC_SUBST(LIB_CLAM)

AC_CHECK_LIB(clamav, cl_free, [ tempres="no" ],tempres="yes")
if test "$tempres" = "yes"; then
  AC_DEFINE([SUPPORT_CLAMAV_V095],[],[Support ClamAV 0.95])
fi

dnl disable updates

# Whether we should use the disableupdates memory allocation debugging library.
AC_MSG_CHECKING(whether to use disable-updates (build KlamAV with GUI updates disabled ))
AC_ARG_WITH(disableupdates,
[  --with-disableupdates          build KlamAV with GUI updates disabled . ],
[if [[ "$withval" = "yes" ]]; then
  disableupdates=1
  AC_MSG_RESULT(yes)
else
  disableupdates=1
  AC_MSG_RESULT(no)
fi], [ disableupdates=0; AC_MSG_RESULT(no) ]
)

if [[ $disableupdates -eq 1 ]]; then
  AC_DEFINE(DISABLE_UPDATES, 1, "Define to disable gui updates")
fi