summaryrefslogtreecommitdiffstats
path: root/configure.in.in
blob: c0ab3941bca59d4ad79ff44e0453046d79364c91 (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
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
#MIN_CONFIG(3.3)
dnl If the quanta executable name and the data dirs are changed from the default "quanta",
dnl the following changes are needed:
dnl  - change the quanta_datadir
dnl  - change the QUANTA_PACKAGE and QUANTA_VERSION in quanta/src/quanta.h
dnl  - change the KDE_ICON in quanta/data/icons/Makefile.am
dnl  - create a .desktop file and the corresponding icons
dnl  - make sure the .desktop file is installed in the quanta/src/Makefile.am
dnl    (kdelnk_DATA = quanta.desktop line)
dnl  - change the bin_PROGRAMS and the _SOURCES, _LDADD, _METASOURCES, _LDFLAGS
dnl    below it in the quanta/src/Makefile.am, so it reflects the new executable name

AM_INIT_AUTOMAKE(@MODULENAME@, @VERSION@)
KDE_ENABLE_HIDDEN_VISIBILITY

quanta_datadir='${kde_datadir}/quanta'
package="quanta"
AC_SUBST(package)
AC_SUBST(quanta_datadir)
AM_CONDITIONAL(QUANTAUIRC_HOOK, test "x$package" != "xquanta")

dnl These are common macros that you might or might not want to use

dnl Checks for header files.
AC_HEADER_DIRENT
AC_HEADER_STDC
AC_HEADER_TIME
AC_CHECK_HEADERS(fcntl.h sys/time.h unistd.h stdlib.h paths.h sys/statvfs.h sys/statfs.h sys/vfs.h sys/mount.h sys/param.h stdarg.h)
AC_CHECK_FUNCS(usleep)
AC_CHECK_FUNCS(statvfs)

AC_DEFINE_UNQUOTED(PREFIX,"$prefix",[Define the PREFIX to be used later])

dnl
dnl The following new parameters were added to offer
dnl the ability to specify the location of the libxml
dnl library during linking and compilation.
dnl Mathieu Lacage 30/03/2000
dnl
LIBXML_PREFIX=""
AC_ARG_WITH(libxml-prefix,
        [  --with-libxml-prefix=[PFX]     Specify location of libxml],
   LIBXML_PREFIX="$withval"
)

if test "x${LIBXML_PREFIX}" != "x"
then
  AC_MSG_RESULT(Using a libxml prefix of ${LIBXML_PREFIX})
fi


AC_SUBST(LIBXML_LIBS)

dnl Test for libxml2 version
XML_CONFIG="xml2-config"
AC_MSG_CHECKING(for libxml libraries >= "2.6.0")
XML_WARNING=""
if test "x$LIBXML_PREFIX" != "x"
then
  if ${LIBXML_PREFIX}/bin/xml2-config --libs print > /dev/null 2>&1
  then
    XML_CONFIG=${LIBXML_PREFIX}/bin/xml2-config
  else
    XML_WARNING="1"
    XML_CONFIG=xml2-config
  fi
fi

AC_DEFUN([VERSION_TO_NUMBER],
[`$1 | sed -e 's/libxml //' | $AWK 'BEGIN { FS = "."; } { printf "%d",
 ([$]1* 1000 + [$]2) * 1000 + [$]3;}'`])

dnl
dnl test version and init our variables
dnl
if test "x$XML_CONFIG" != "x"
then
  vers=VERSION_TO_NUMBER($XML_CONFIG --version)
  if test "$vers" -lt VERSION_TO_NUMBER(echo "2.6.0")
  then
    CXXFLAGS="$CXXFLAGS -DLIBXML_2_5"
    AC_MSG_RESULT(not found - assuming 2.5.x)
  else
    AC_MSG_RESULT(found)
  fi
  LIBXML_LIBS="`$XML_CONFIG --libs`"
  LIBXML_CFLAGS="`$XML_CONFIG --cflags`"
  LIBXML_PREFIX="$XML_CONFIG --prefix"
else
  AC_MSG_ERROR(Could not find libxml2 anywhere, check ftp://xmlsoft.org/.)
fi

if test "x${XML_WARNING}" != "x"
then
   AC_MSG_RESULT(
!!Warning!! using xml2-config in default path
)
fi

LIBXML_PREFIX_DIR="`$XML_CONFIG --prefix`"

AC_SUBST(XML_CONFIG)
AC_SUBST(LIBXML_PREFIX)
AC_SUBST(LIBXML_LIBS)
AC_SUBST(LIBXML_CFLAGS)

LIBXSLT_PREFIX=""
AC_ARG_WITH(libxslt-prefix,
        [  --with-libxslt-prefix=[PFX]    Specify location of libxslt],
   LIBXSLT_PREFIX="$withval"
)

if test "x${LIBXSLT_PREFIX}" != "x"
then
  AC_MSG_RESULT(Using a libxslt prefix of ${LIBXSLT_PREFIX})
fi

dnl
dnl find libxslt
dnl
XSLT_CONFIG="xslt-config"
XSLT_WARNING=""
AC_SUBST(LIBXSLT_REQUIRED_VERSION)
AC_MSG_CHECKING(for libxslt libraries >= $LIBXSLT_REQUIRED_VERSION)
if test "x$LIBXSLT_PREFIX" != "x"
then
  if ${LIBXSLT_PREFIX}/bin/xslt-config --libs print > /dev/null 2>&1
  then
    XSLT_CONFIG=${LIBXSLT_PREFIX}/bin/xslt-config
  else
          XSLT_WARNING="1"
    XSLT_CONFIG=xslt-config
  fi
fi


AC_DEFUN([VERSION_TO_NUMBER],
[`$1 | sed -e 's/libxslt //' | $AWK 'BEGIN { FS = "."; } { printf "%d",
 ([$]1  * 1000 + [$]2) * 1000 + [$]3;}'`])

dnl
dnl test version and init our variables
dnl
if test "x$XSLT_CONFIG" != "x"
then
  vers=VERSION_TO_NUMBER($XSLT_CONFIG --version)
  if test "$vers" -ge VERSION_TO_NUMBER(echo $LIBXSLT_REQUIRED_VERSION)
  then
    LIBXSLT_LIBS="-lexslt `$XSLT_CONFIG --libs`"
    LIBXSLT_CFLAGS="`$XSLT_CONFIG --cflags`"
    AC_MSG_RESULT(found)
          if test "x$LIBXSLT_PREFIX" != "x"
     then
       AC_MSG_RESULT(
Don't forget to make sure that ${LIBXSLT_PREFIX}/lib has been added
  to your LD_LIBRARY_PATH environment variable)
    else
      LIBXSLT_PREFIX="$XSLT_CONFIG --prefix"
          fi
  else
    AC_MSG_ERROR(You need at least libxslt $LIBXSLT_REQUIRED_VERSION for this
  version of xsldbg)
  fi
else
  AC_MSG_ERROR(Could not find libxslt anywhere, check
 ftp://xmlsoft.org/XSLT/.)
fi

if test "x${XSLT_WARNING}" != "x"
then
   AC_MSG_RESULT(
!!Warning!! using xslt-config in default path
)
fi

AC_SUBST(XSLT_CONFIG)
AC_SUBST(LIBXSLT_PREFIX)
AC_SUBST(LIBXSLT_LIBS)
AC_SUBST(LIBXSLT_CFLAGS)


dnl  **********
dnl  check whether we need the qextmdi lib
dnl  (Shamlesly stolen from gideon souorces and
dnl  modified for quanta by fredi)
dnl  **********

AC_DEFUN([QUANTA_CHECK_MDI],
[
  AC_MSG_CHECKING(whether to use kmdi lib from kdelibs)
  AC_CACHE_VAL(ac_cv_mdi_setup,
  [
    AC_LANG_SAVE
    AC_LANG_CPLUSPLUS
    save_CXXFLAGS="$CXXFLAGS"
    CXXFLAGS="$KDE_INCLUDES $QT_INCLUDES"

    AC_TRY_LINK([
      #include <kdeversion.h>
    ],
    [
      #if TDE_VERSION < ((3<<16) | (3<<8) | (92))
         KDE_choke me
      #endif
    ],
      ac_cv_mdi_setup=yes,
      ac_cv_mdi_setup=no
    )
    CXXFLAGS="$save_CXXFLAGS"
    AC_LANG_RESTORE
   ])

  if test "$ac_cv_mdi_setup" = "yes"; then
    LIB_KMDI="-lkmdi"
    QEXTMDI_SUBDIR=""
    KMDI_INCLUDES=""
    AC_MSG_RESULT(yes)
  else
    LIB_KMDI='$(top_builddir)/lib/compatibility/kmdi/libquantakmdi.la'
    QEXTMDI_SUBDIR="kmdi"
    KMDI_INCLUDES='-I$(top_srcdir)/lib/compatibility/kmdi/qextmdi'
    CXXFLAGS="$CXXFLAGS -DCOMPAT_KMDI"
    AC_MSG_RESULT(no)
  fi

  AC_SUBST(LIB_KMDI)
  AC_SUBST(KMDI_INCLUDES)
  AC_SUBST(QEXTMDI_SUBDIR)
  AM_CONDITIONAL(include_qextmdi, test -n "$QEXTMDI_SUBDIR")
])

dnl Check if kmdi is present, if not use giden's one
QUANTA_CHECK_MDI

KDE_CHECK_HEADER(cvsservice_stub.h, [cvsservice_stub_h="found"], [cvsservice_stub_h="none"])
AM_CONDITIONAL(include_cvsservice, test "$cvsservice_stub_h" = "found")
if test "$cvsservice_stub_h" = "found"; then
  CXXFLAGS="$CXXFLAGS -DENABLE_CVSSERVICE"
fi

#check for KNewStuffSecure headers
KNEWSTUFF_INCLUDES=""
LIB_KNEWSTUFF="-lknewstuff"
KDE_CHECK_HEADER(knewstuff/knewstuffsecure.h, [knewstuffsecure_h="found"], [knewstuffsecure_h="none"])
AM_CONDITIONAL(include_knewstuff, test "$knewstuffsecure_h" != "found")
if test "$knewstuffsecure_h" != "found"; then
  KNEWSTUFF_INCLUDES='-I$(top_srcdir)/lib/compatibility'
  LIB_KNEWSTUFF='$(top_builddir)/lib/compatibility/knewstuff/libknewstuff.la'
fi
AC_SUBST(KNEWSTUFF_INCLUDES)
AC_SUBST(LIB_KNEWSTUFF)



AC_ARG_ENABLE(editors, [  --enable-editors        Enable selection of other editors aside of Kate],
[enable_editors=$enableval], [enable_editors="no"])

if test "$enable_editors" = "yes"; then
  CXXFLAGS="$CXXFLAGS -DENABLE_EDITORS"
fi
AC_SUBST(enable_editors)

AC_CHECK_PROGS(TAR, gnutar gtar tar, [AM_MISSING_PROG(tar)])
AC_CHECK_PROG(GZIP_COMMAND, gzip, gzip)