summaryrefslogtreecommitdiffstats
path: root/kdevelop.m4.in
blob: 0e062a1987682cc42b9a5f4e551e4b2898df6a08 (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
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
dnl
dnl Check location of Qt documentation
dnl
AC_DEFUN([KDEV_PATH_QTDOC],
[
AC_MSG_CHECKING([for Qt documentation])

ac_qt_docdirs=""
AC_ARG_WITH(qtdoc_dir,
[  --with-qtdoc-dir=DIR    where the Qt documentation is installed ],
ac_qt_docdirs=""
qt_docdirs=""
[
  ac_qt_docdirs=$withval
],
)

dnl
dnl not currently used
dnl
qt_docdirs="/usr/doc/qt-doc/html /usr/local/qt/html /usr/local/lib/qt/html /usr/lib/qt/doc/html /usr/X11/lib/qt/html /usr/X11/lib/qt/doc/html /usr/X11R6/share/doc/qt/html /usr/share/doc/packages/qt/html"
test -n "$QTDIR" && qt_docdirs="$QTDIR/html $QTDIR/doc/html $QTDIR/doc $qt_docdirs"
qt_docdirs="$ac_qt_docdirs $qt_docdirs"
AC_FIND_FILE(classes.html, $qt_docdirs, qt_docdir)
AC_MSG_RESULT($qt_docdir)
if test "$qt_docdir" = NO; then
  qt_docdir=""
fi
AC_DEFINE_UNQUOTED(QT_DOCDIR, "$qt_docdir", [Where the Qt documentation is installed])
])


dnl
dnl Check location of tdelibs documentation generated by Doxygen
dnl
AC_DEFUN([KDEV_PATH_KDELIBSDOXY],
[
AC_MSG_CHECKING([for tdelibs documentation generated by Doxygen])

ac_tdelibs_doxydirs=""
AC_ARG_WITH(tdelibsdoxy_dir,
[  --with-tdelibsdoxy-dir=DIR         where the tdelibs documentation is installed ],
ac_tdelibs_doxydirs=""
tdelibs_doxydirs=""
[
  ac_tdelibs_doxydirs=$withval
],
)

if test "${prefix}" = NONE; then
  ac_kde_htmldir="$ac_default_prefix"/share/doc/HTML
else
  ac_kde_htmldir="$prefix"/share/doc/HTML
fi

tdelibs_doxydirs="$ac_tdelibs_doxydirs $ac_kde_htmldir/default/tdelibs-apidocs $ac_kde_htmldir/en/tdelibs-apidocs"
AC_FIND_FILE(tdecore/html/classKApplication.html, $tdelibs_doxydirs, tdelibs_doxydir)
AC_MSG_RESULT($tdelibs_doxydir)
if test "$tdelibs_doxydir" = NO; then
  tdelibs_doxydir=""
fi
AC_DEFINE_UNQUOTED(KDELIBS_DOXYDIR, "$tdelibs_doxydir", [where KDE documentation is installed])
])
AC_SUBST(tdelibs_doxydir)


dnl
dnl Check location of tdelibs documentation
dnl
AC_DEFUN([KDEV_PATH_KDELIBSDOC],
[
AC_MSG_CHECKING([for tdelibs documentation])

ac_tdelibs_docdirs=""
AC_ARG_WITH(tdelibsdoc_dir,
[  --with-tdelibsdoc-dir=DIR         where the tdelibs documentation is installed ],
ac_tdelibs_docdirs=""
tdelibs_docdirs=""
[
  ac_tdelibs_docdirs=$withval
],
)

if test "${prefix}" = NONE; then
  ac_kde_htmldir="$ac_default_prefix"/share/doc/HTML
else
  ac_kde_htmldir="$prefix"/share/doc/HTML
fi

tdelibs_docdirs="/usr/doc/tdelibs-doc/html"
if test "$ac_kde_htmldir" != ""; then
 tdelibs_docdirs="$tdelibs_docdirs $ac_kde_htmldir/default/tdelibs $ac_kde_htmldir/en/tdelibs"
fi
tdelibs_docdirs="$ac_tdelibs_docdirs $tdelibs_docdirs"
AC_FIND_FILE(tdecore/index.html, $tdelibs_docdirs, tdelibs_docdir)
AC_MSG_RESULT($tdelibs_docdir)
if test "$tdelibs_docdir" = NO; then
  tdelibs_docdir=""
fi
AC_DEFINE_UNQUOTED(KDELIBS_DOCDIR, "$tdelibs_docdir", [where KDE documentation is installed])
])


dnl
dnl Check whether we support Debian docbase
dnl
AC_DEFUN([KDEV_CHECK_DOCBASE],
[
AC_MSG_CHECKING(for docbase)
AC_ARG_ENABLE(docbase,
[  --enable-docbase        enable Debian docbase support],
[if test "$enableval" = yes; then
  enable_docbase=yes
fi],
enable_docbase=no)
AC_MSG_RESULT($enable_docbase)

if test "$enable_docbase" = "yes"; then
  AC_DEFINE_UNQUOTED(WITH_DOCBASE, 1, [If Debian docbase should be supported])
fi
])


dnl
dnl Check whether we support Python scripting
dnl
AC_DEFUN([KDEV_CHECK_SCRIPTING],
[
AC_MSG_CHECKING(if scripting enabled)
AC_ARG_ENABLE(scripting,
[  --enable-scripting      enable python scripting support],
[if test "$enableval" = yes; then
  enable_scripting=yes
fi],
enable_scripting=no)
AC_MSG_RESULT($enable_scripting)

SCRIPTING=
if test "$enable_scripting" = "yes"; then
  KDE_CHECK_PYTHON(1.5, [
	AC_MSG_ERROR([You enabled scripting but have no python installed.])
  ])
  SCRIPTING=scripting
fi
  AC_SUBST(SCRIPTING)
  AM_CONDITIONAL(include_scripting, test -n "$SCRIPTING")
])


dnl
dnl Check for Python documentation dir
dnl
AC_DEFUN([KDEV_PATH_PYTHONDOCDIR],
[
AC_MSG_CHECKING(for Python documentation directory)
AC_ARG_WITH(pythondocdir,
  [  --with-pythondocdir=pythondocdir    where the Python documentation is installed ],
  kdev_pythondocdir=$withval,
  kdev_pythondocdir=/usr/local/python2.0/html
)

AC_CACHE_VAL(kdev_cv_pythondocdir,
[
  pythondocdirs="/usr/share/doc/packages/python/html /usr/share/doc/python-docs-2.0 /usr/share/doc/python/html $kdev_pythondocdir"
  AC_FIND_FILE(ref/comparisons.html, $pythondocdirs, kdev_cv_pythondocdir)
])

AC_MSG_RESULT($kdev_cv_pythondocdir)
PYTHONDOCDIR=$kdev_cv_pythondocdir
AC_SUBST(PYTHONDOCDIR)
])


dnl
dnl Check for Python documentation dir
dnl
AC_DEFUN([KDEV_PATH_PHPDOCDIR],
[
AC_MSG_CHECKING(for PHP documentation directory)
AC_ARG_WITH(phpdocdir,
  [  --with-phpdocdir=phpdocdir          where the PHP documentation is installed ],
  kdev_phpdocdir=$withval,
  kdev_phpdocdir=/usr/local/php/doc/manual
)

AC_CACHE_VAL(kdev_cv_phpdocdir,
[
  phpdocdirs="/usr/share/doc/packages/phpdoc/manual /usr/share/doc/php3-doc/html $kdev_phpdocdir"
  AC_FIND_FILE(ref.ftp.html, $phpdocdirs, kdev_cv_phpdocdir)
])

AC_MSG_RESULT($kdev_cv_phpdocdir)
PHPDOCDIR=$kdev_cv_phpdocdir
AC_SUBST(PHPDOCDIR)
])


dnl
dnl Check for GNUstep documentation
dnl
AC_DEFUN([KDEV_PATH_GNUSTEPDOCDIR],
[
AC_MSG_CHECKING([for GNUstep documentation])
if test -z ${GNUSTEP_SYSTEM_ROOT:-""} ; then
GNUSTEPDOCDIR=
AC_MSG_RESULT(not found)
else
GNUSTEPDOCDIR=$GNUSTEP_SYSTEM_ROOT/Documentation/Developer
AC_MSG_RESULT($GNUSTEPDOCDIR)
fi
AC_SUBST(GNUSTEPDOCDIR)
AM_CONDITIONAL(GNUSTEPDOCS, test x$GNUSTEPDOCDIR != x)
])


dnl
dnl Check for Gtk documentation dirs
dnl
AC_DEFUN([KDEV_PATH_GTKDOCDIR],
[
AC_ARG_WITH(glibdocdir,
  [  --with-glibdocdir=glibdocdir        where the glib documentation is installed ],
  kdev_glibdocdir=$withval,
  kdev_glibdocdir=""
)
AC_ARG_WITH(gdkdocdir,
  [  --with-gdkdocdir=gdkdocdir          where the gdk documentation is installed ],
  kdev_gdkdocdir=$withval,
  kdev_gdkdocdir=""
)
AC_ARG_WITH(gdkpbdocdir,
  [  --with-gdkpbdocdir=gdkpbdocdir      where the gdk-pixbuf documentation is installed ],
  kdev_gdkpbdocdir=$withval,
  kdev_gdkpbdocdir=""
)
AC_ARG_WITH(gtkdocdir,
  [  --with-gtkdocdir=gtkdocdir          where the gtk documentation is installed ],
  kdev_gtkdocdir=$withval,
  kdev_gtkdocdir=""
)
AC_ARG_WITH(gnomedocdir,
  [  --with-gnomedocdir=gnomedocdir      where the gnome documentation is installed ],
  kdev_gnomedocdir=$withval,
  kdev_gnomedocdir=""
)
AC_ARG_WITH(gnomeuidocdir,
  [  --with-gnomeuidocdir=gnomeuidocdir  where the gnomeui documentation is installed ],
  kdev_gnomeuidocdir=$withval,
  kdev_gnomeuidocdir=""
)

AC_MSG_CHECKING(for GLib documentation directory)
AC_CACHE_VAL(kdev_cv_glibdocdir,
[
  glibdocdirs="/usr/share/doc/packages/glib $kdev_glibdocdir"
  AC_FIND_FILE(glib-arrays.html, $glibdocdirs, kdev_cv_glibdocdir)
])
AC_MSG_RESULT($kdev_cv_glibdocdir)
AC_MSG_CHECKING(for Gdk documentation directory)
AC_CACHE_VAL(kdev_cv_gdkdocdir,
[
  gdkdocdirs="/usr/share/doc/packages/gdk $kdev_gdkdocdir"
  AC_FIND_FILE(gdk-events.html, $gdkdocdirs, kdev_cv_gdkdocdir)
])
AC_MSG_RESULT($kdev_cv_gdkdocdir)
AC_MSG_CHECKING(for Gdk-Pixbuf documentation directory)
AC_CACHE_VAL(kdev_cv_gdkpbdocdir,
[
  gdkpbdocdirs="/usr/share/doc/packages/gdk-pixbuf/html $kdev_gdkpbdocdir"
  AC_FIND_FILE(gdk-pixbuf-rendering.html, $gdkpbdocdirs, kdev_cv_gdkpbdocdir)
])
AC_MSG_RESULT($kdev_cv_gdkpbdocdir)
AC_MSG_CHECKING(for Gtk documentation directory)
AC_CACHE_VAL(kdev_cv_gtkdocdir,
[
  gtkdocdirs="/usr/share/doc/packages/gtk $kdev_gtkdocdir"
  AC_FIND_FILE(gtkcombo.html, $gtkdocdirs, kdev_cv_gtkdocdir)
])
AC_MSG_RESULT($kdev_cv_gtkdocdir)
AC_MSG_CHECKING(for libgnome documentation directory)
AC_CACHE_VAL(kdev_cv_gnomedocdir,
[
  gnomedocdirs="/usr/share/doc/packages/gnome-libs-devel/devel-docs/gnome/html $kdev_gnomedocdir"
  AC_FIND_FILE(libgnome.html, $gnomedocdirs, kdev_cv_gnomedocdir)
])
AC_MSG_RESULT($kdev_cv_gnomedocdir)
AC_MSG_CHECKING(for libgnomeui documentation directory)
AC_CACHE_VAL(kdev_cv_gnomeuidocdir,
[
  gnomeuidocdirs="/usr/share/doc/packages/gnome-libs-devel/devel-docs/gnomeui/html $kdev_gnomeuidocdir"
  AC_FIND_FILE(libgnomeui.html, $gnomeuidocdirs, kdev_cv_gnomeuidocdir)
])
AC_MSG_RESULT($kdev_cv_gnomeuidocdir)

dnl We need all directories or none

if test "$kdev_cv_glibdocdir" = NO; then
  kdev_cv_glib_docdir=""
fi
if test "$kdev_cv_gdkdocdir" = NO; then
  kdev_cv_glib_docdir=""
  kdev_cv_gdk_docdir=""
fi
if test "$kdev_cv_gdkpbdocdir" = NO; then
  kdev_cv_glib_docdir=""
  kdev_cv_gdkpb_docdir=""
fi
if test "$kdev_cv_gtkdocdir" = NO; then
  kdev_cv_glib_docdir=""
  kdev_cv_gtk_docdir=""
fi
if test "$kdev_cv_gnomedocdir" = NO; then
  kdev_cv_glib_docdir=""
  kdev_cv_gnome_docdir=""
fi
if test "$kdev_cv_gnomeuidocdir" = NO; then
  kdev_cv_glib_docdir=""
  kdev_cv_gnomeui_docdir=""
fi

GLIBDOCDIR=$kdev_cv_glibdocdir
AC_SUBST(GLIBDOCDIR)
GDKDOCDIR=$kdev_cv_gdkdocdir
AC_SUBST(GDKDOCDIR)
GDKPBDOCDIR=$kdev_cv_gdkpbdocdir
AC_SUBST(GDKPBDOCDIR)
GTKDOCDIR=$kdev_cv_gtkdocdir
AC_SUBST(GTKDOCDIR)
GNOMEDOCDIR=$kdev_cv_gnomedocdir
AC_SUBST(GNOMEDOCDIR)
GNOMEUIDOCDIR=$kdev_cv_gnomeuidocdir
AC_SUBST(GNOMEUIDOCDIR)
AM_CONDITIONAL(GTKDOCS, test x$kdev_cv_glibdocdir != x)
])


dnl
dnl Check whether we support Java
dnl
AC_DEFUN([KDEV_CHECK_JAVA],
[
AC_MSG_CHECKING(if javasupport enabled)
AC_ARG_ENABLE(javasupport,
[  --enable-javasupport    enable java support],
[if test "$enableval" = yes; then
  enable_javasupport=yes
fi],
enable_javasupport=no)
AC_MSG_RESULT($enable_javasupport)

JAVASUPPORT_SUBDIR=
if test "$enable_javasupport" = "yes"; then
  KDE_CHECK_JAVA_DIR
  if test "x$kde_cv_java_bindir" = xno; then
    AC_MSG_RESULT([not found -- parts/javasupport will NOT be built])
    JAVA_SUBDIRS=""
  else
    JAVA_SUBDIRS="javasupport javadebugger"
  fi
fi
AC_SUBST(JAVA_SUBDIRS)
])

dnl  **********
dnl  Simple Check for Berkeley DB >= 3
dnl  **********

AC_DEFUN([KDEV_CHECK_BDB],
[
  ac_db_includedir=""
  ac_db_libdir=""
  ac_db_lib="db"
  AC_ARG_WITH(db_includedir,
[  --with-db-includedir=DIR
                          where the DB4 headers are installed ],
[
  ac_db_includedir="-I$withval"
],
  ac_db_includedir=""
)
  AC_ARG_WITH(db_libdir,
[  --with-db-libdir=DIR    where the DB4 libraries are installed ],
[
  ac_db_libdir="-L$withval"
],
  ac_db_libdir=""
)
  AC_ARG_WITH(db_lib,
[  --with-db-lib=LIB       library name for the DB4 library ],
[
  ac_db_lib=$withval
],
ac_db_lib=db
)

  AC_MSG_CHECKING(for Berkeley DB >= 4.1)

  AC_CACHE_VAL(ac_cv_bdb,
  [
    AC_LANG_SAVE
    AC_LANG_CPLUSPLUS

    save_CXXFLAGS="$CXXFLAGS"
    save_LDFLAGS="$LDFLAGS"

    CXXFLAGS="$CXXFLAGS $QT_INCLUDES $ac_db_includedir $ac_db_libdir -l$ac_db_lib"
    LDFLAGS="$LDFLAGS $LIBQT"

    AC_TRY_LINK([
      #include <db.h>
    ],
    [
      #if DB_VERSION_MAJOR < 4 && DB_VERSION_MINOR < 1
         choke me
      #else
         DB *db;
         db->open( db, 0, 0, NULL, DB_BTREE, DB_CREATE, 0644 );
      #endif
    ],
    ac_cv_bdb=yes,
    ac_cv_bdb=no
    )
    CXXFLAGS="$save_CXXFLAGS"
    LDFLAGS="$save_LDFLAGS"
    AC_LANG_RESTORE
   ])

  if test "$ac_cv_bdb" = "no"; then
    AC_MSG_ERROR(no - please install Berkeley DB >= 4.1)
  else
    AC_MSG_RESULT([yes])
  fi

DB3LIB="$ac_db_lib"
DB3INCLUDES="$ac_db_includedir"
DB3LDFLAGS="$ac_db_libdir"
AC_SUBST(DB3LIB)
AC_SUBST(DB3INCLUDES)
AC_SUBST(DB3LDFLAGS)
])

dnl  **********
dnl  check wether KDE is at least version 3.4.0
dnl  **********
AC_DEFUN([KDEV_CHECK_TDE_VERSION],
[
    AC_MSG_CHECKING(for KDE >= 3.4.0)


    AC_CACHE_VAL(ac_cv_kde_version_check,
    [
        AC_LANG_SAVE
        AC_LANG_CPLUSPLUS

        save_CXXFLAGS="$CXXFLAGS"

        CXXFLAGS="$CXXFLAGS $QT_INCLUDES -I$ac_kde_includes"

        AC_TRY_COMPILE([
            #include <tdeversion.h>
          ],
          [
            #if KDE_IS_VERSION(3,4,0)
	    #else
            KDE_choke me
            #endif
          ],
          ac_cv_kde_version_check=yes,
          ac_cv_kde_version_check=no
        )
        CXXFLAGS="$save_CXXFLAGS"
        AC_LANG_RESTORE
    ])

    if test "$ac_cv_kde_version_check" = "yes"; then
        AC_MSG_RESULT(yes)
    else
        AC_MSG_ERROR(Installed KDE needs to be version 3.4.0 or later)
    fi
])


dnl  **********
dnl  check for new valgrind version (>= 2.1.0)
dnl  **********

AC_DEFUN([KDEV_CHECK_VALGRIND],
[
  AC_CHECK_PROG(ac_have_valgrind, [valgrind], [yes])
  if test "yes" == $ac_have_valgrind; then
    AC_MSG_CHECKING(valgrind version)
    if test "valgrind-20" == `valgrind --version | $AWK -F \. '{print @S|@1@S|@2}'`; then
      ac_valgrind_ver=20
      AC_MSG_RESULT(< 2.1.0)
    elif test "valgrind-1" == `valgrind --version | $AWK -F \. '{print @S|@1}'`; then
      ac_valgrind_ver=20
      AC_MSG_RESULT(< 2.1.0)
    else
      ac_valgrind_ver=21
      AC_MSG_RESULT(>= 2.1.0)
    fi
  fi
  AC_DEFINE_UNQUOTED(VALGRIND_VERSION, $ac_valgrind_ver, [valgrind version number - 20 for older and 21 for newer])
])