summaryrefslogtreecommitdiffstats
path: root/kopete/configure.in.in
blob: 802dd84d3ba52372fe7707e66eb01564e1fc1a08 (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
163
164
165
166
167
#MIN_CONFIG(3.3)
AC_HAVE_GL
KDE_INIT_DOXYGEN
AC_CACHE_CHECK(for tm_gmtoff in struct tm, ac_cv_struct_tm_gmtoff,
        AC_TRY_COMPILE([
                #include <time.h>
        ], [
                struct tm tm;
                tm.tm_gmtoff = 1;
        ], ac_cv_struct_tm_gmtoff=yes, ac_cv_struct_tm_gmtoff=no))
if test $ac_cv_struct_tm_gmtoff = yes; then
        AC_DEFINE(HAVE_TM_GMTOFF, 1, [Define if you have a tm_gmtoff member in struct tm])
fi

KDE_CHECK_HEADERS(knotifydialog.h)

KOPETE_INCLUDES='-I$(top_srcdir)/kopete/libkopete -I$(top_builddir)/kopete/libkopete -I$(top_srcdir)/kopete/libkopete/avdevice -I$(top_srcdir)/kopete/libkopete/ui -I$(top_builddir)/kopete/libkopete/ui'

AC_MSG_CHECKING([for kdelibs newer than 3.3.x])
AC_LANG_SAVE
AC_LANG_CPLUSPLUS
kcompat_save_CXXFLAGS="$CXXFLAGS"
kcompat_safe_LIBS="$LIBS"
LIBS="$LIBS $X_EXTRA_LIBS"
CXXFLAGS="$CXXFLAGS $all_includes"

AC_TRY_COMPILE([
#include <kdeversion.h>
#if !( KDE_IS_VERSION( 3, 3, 90 ) )
#error Kopete compatibility with KDE 3.3 needs to be enabled
#endif
],
[
],
	AC_MSG_RESULT(yes)
,
	KOPETE_COMPAT_INCLUDES='-I$(top_srcdir)/kopete/libkopete/compat'
	KOPETE_INCLUDES=$KOPETE_INCLUDES' $(KOPETE_COMPAT_INCLUDES)'
	LIB_KOPETECOMPAT='$(top_builddir)/kopete/libkopete/libkopete.la'
	AC_MSG_RESULT(no)
)
CXXFLAGS="$kcompat_save_CXXFLAGS"
LIBS="$kcompat_safe_LIBS"
AC_LANG_RESTORE
AM_CONDITIONAL(compile_LIBKOPETE_COMPAT, test -n "$LIB_KOPETECOMPAT")


AC_ARG_ENABLE(smpppd,
[AC_HELP_STRING([--enable-smpppd], [enable support for the SuSE Meta PPP Daemon (smpppd) (default is NO)])],
[
  if test $enableval = yes; then
    AC_DEFINE(USE_SMPPPD, 1, [enable support for the smpppd])
    COMPILESMPPPDCS=true
  else
    COMPILESMPPPDCS=
  fi
],
[ COMPILESMPPPDCS=
])
AM_CONDITIONAL(include_smpppdcs, test -n "$COMPILESMPPPDCS")

KDE_FIND_PATH(xml2-config, XML_CONFIG, [${exec_prefix}/bin ${prefix}/bin], [
  AC_MSG_WARN([libxml2 not found anywhere, check ftp://xmlsoft.org/ for libxml >= 2.4.8. ])
])

if test -n "$XML_CONFIG"; then
  vers=`$XML_CONFIG --version 2>/dev/null | sed -e 's/libxml //' | awk 'BEGIN { FS = "."; } { printf "%d", ($1 * 1000 + $2) * 1000 + $3;}'`
  if test -n "$vers" && test "$vers" -ge 2004008
  then
     LIBXML_LIBS="`$XML_CONFIG --libs`"
     LIBXML_RPATH=
     for args in $LIBXML_LIBS; do
	  case $args in
	    -L*)
	       LIBXML_RPATH="$LIBXML_RPATH $args"
	       ;;
          esac
     done
     LIBXML_RPATH=`echo $LIBXML_RPATH | sed -e "s/-L/-R/g"`
     LIBXML_CFLAGS="`$XML_CONFIG --cflags`"

     KDE_FIND_PATH(xmllint, XMLLINT, [${prefix}/bin ${exec_prefix}/bin /usr/local/bin /opt/local/bin /usr/bin], [XMLLINT=""])
     AC_DEFINE_UNQUOTED(XMLLINT, "$XMLLINT", [Defines the executable of xmllint])
  else
     AC_MSG_WARN([You need at least libxml 2.4.8])
     DO_NOT_COMPILE="$DO_NOT_COMPILE kopete"
  fi
fi


  KDE_FIND_PATH(xslt-config, XSLT_CONFIG, [${prefix}/bin ${exec_prefix}/bin /usr/local/bin /opt/local/bin /usr/bin], [
    AC_MSG_WARN([Could not find libxslt anywhere, check ftp://xmlsoft.org/ for libxslt >= 1.0.7.])
  ])

  if test -n "$XSLT_CONFIG"; then
     vers=`$XSLT_CONFIG --version 2>/dev/null | awk 'BEGIN { FS = "."; } { printf "%d", ($1 * 1000 + $2) * 1000 + $3;}'`
     if test -n "$vers" && test "$vers" -ge 1000007; then
       LIBXSLT_LIBS="`$XSLT_CONFIG --libs`"
       LIBXSLT_RPATH=
       for args in $LIBXSLT_LIBS; do
	  case $args in
	    -L*)
  	       LIBXSLT_RPATH="$LIBXSLT_RPATH $args"
 	       ;;
          esac
       done
       LIBXSLT_RPATH=`echo $LIBXSLT_RPATH | sed -e "s/-L/-R/g"`
       LIBXSLT_CFLAGS="`$XSLT_CONFIG --cflags`"
	   AC_DEFINE(HAVE_XSLT, 1, [Define if you have xslt libraries and header files])
     else
       AC_WARN([You need at least libxslt 1.0.7])
     fi
  fi

if test ! "$USE_RPATH" = "yes"; then
  LIBXSLT_RPATH=
  LIBXML_RPATH=
fi

if test -z "$XML_CONFIG"; then
  DO_NOT_COMPILE="$DO_NOT_COMPILE kopete"
fi

if test -z "$XSLT_CONFIG"; then
  DO_NOT_COMPILE="$DO_NOT_COMPILE kopete"
fi
AC_SUBST(LIBXSLT_LIBS)
AC_SUBST(LIBXSLT_CFLAGS)
AC_SUBST(LIBXSLT_RPATH)

AC_SUBST(LIBXML_LIBS)
AC_SUBST(LIBXML_CFLAGS)
AC_SUBST(LIBXML_RPATH)

AC_SUBST(KOPETE_INCLUDES)
AC_SUBST(KOPETE_COMPAT_INCLUDES)
AC_SUBST(LIB_KOPETECOMPAT)

# -- Check for installed Valgrind headers --------------------

AC_MSG_CHECKING([for valgrind.h])

AC_TRY_COMPILE([
#define __VALGRIND_SOMESKIN_H
#include <valgrind/valgrind.h>
],
[
],
	ac_have_valgrind_h=yes
,
	ac_have_valgrind_h=no
)

if test $ac_have_valgrind_h = yes; then
	AC_DEFINE(HAVE_VALGRIND_H, 1, [Define if you have valgrind.h installed])
fi

AC_MSG_RESULT($ac_have_valgrind_h)

# -- End valgrind ----------------------------------------------

# -- Determine pointer size for sqlite -------------------------

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

# -- End sqlite ------------------------------------------------