[go: up one dir, main page]

File: configure.in

package info (click to toggle)
showimg 0.9.5-1.1
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 21,460 kB
  • ctags: 13,090
  • sloc: ansic: 65,847; cpp: 57,092; sh: 12,591; perl: 2,715; yacc: 2,307; makefile: 549; lex: 286
file content (757 lines) | stat: -rw-r--r-- 23,701 bytes parent folder | download | duplicates (2)
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
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
dnl =======================================================
dnl FILE: ./admin/configure.in.min
dnl =======================================================

dnl    This file is part of the KDE libraries/packages
dnl    Copyright (C) 2001 Stephan Kulow (coolo@kde.org)
 
dnl    This file is free software; you can redistribute it and/or
dnl    modify it under the terms of the GNU Library General Public
dnl    License as published by the Free Software Foundation; either
dnl    version 2 of the License, or (at your option) any later version.
 
dnl    This library is distributed in the hope that it will be useful,
dnl    but WITHOUT ANY WARRANTY; without even the implied warranty of
dnl    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
dnl    Library General Public License for more details.
 
dnl    You should have received a copy of the GNU Library General Public License
dnl    along with this library; see the file COPYING.LIB.  If not, write to
dnl    the Free Software Foundation, Inc., 51 Franklin Steet, Fifth Floor,
dnl    Boston, MA 02110-1301, USA.

# Original Author was Kalle@kde.org
# I lifted it in some mater. (Stephan Kulow)
# I used much code from Janos Farkas

dnl Process this file with autoconf to produce a configure script.

AC_INIT(acinclude.m4) dnl a source file from your sub dir

dnl This is so we can use kde-common
AC_CONFIG_AUX_DIR(admin)

dnl This ksh/zsh feature conflicts with `cd blah ; pwd`
unset CDPATH

dnl Checking host/target/build systems, for make, install etc.
AC_CANONICAL_SYSTEM 
dnl Perform program name transformation
AC_ARG_PROGRAM

dnl Automake doc recommends to do this only here. (Janos)
AM_INIT_AUTOMAKE(showimg-0.9.5, "3.4.89") dnl searches for some needed programs

KDE_SET_PREFIX

dnl generate the config header
AM_CONFIG_HEADER(config.h) dnl at the distribution this done

dnl Checks for programs.
AC_CHECK_COMPILERS
AC_ENABLE_SHARED(yes)
AC_ENABLE_STATIC(no)
KDE_PROG_LIBTOOL

dnl for NLS support. Call them in this order!
dnl WITH_NLS is for the po files
AM_KDE_WITH_NLS

KDE_USE_QT(3.2)
AC_PATH_KDE
dnl =======================================================
dnl FILE: configure.in.in
dnl =======================================================

#MIN_CONFIG(3.2)
CXXFLAGS="$CXXFLAGS $KDE_DEFAULT_CXXFLAGS"
dnl =======================================================
dnl FILE: ./showimg/configure.in.in
dnl =======================================================

#MIN_CONFIG(3.1)

dnl PACKAGE set before

CXXFLAGS="$CXXFLAGS $KDE_DEFAULT_CXXFLAGS"

AC_CHECK_HEADERS(unistd.h sys/param.h floatingpoint.h paths.h)
AC_CHECK_KDEMAXPATHLEN

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

#------------------------------------------------------------------
# Check in .bot if showimg is disabled
#------------------------------------------------------------------
showimg_enabled=yes

#------------------------------------------------------------------
# create showimg_top_srcdir and showimg_top_builddir
#------------------------------------------------------------------
showimg_top_srcdir='$(top_srcdir)/showimg'
showimg_top_builddir='$(top_builddir)/showimg'
AC_SUBST(showimg_top_srcdir)
AC_SUBST(showimg_top_builddir)

#------------------------------------------------------------------
# check for konq_operations.h
#------------------------------------------------------------------
KDE_CHECK_HEADER(konq_operations.h, ,
	AC_MSG_WARN(The file konq_operations.h is needed for ShowImg but is missing. If you use KDE packages please check you have installed the kdebase-devel package.)
	DO_NOT_COMPILE="showimg $DO_NOT_COMPILE"
	showimg_enabled=no
	)
#------------------------------------------------------------------
# check for KIPI
#------------------------------------------------------------------

# check for want_kipi
AC_MSG_CHECKING(if ShowImg should be compiled with KIPI support)
AC_ARG_ENABLE(
	libkipi,
	[  --enable-libkipi        enable KIPI plugin support default=yes],
	[if test "$enableval" = yes; then
		AC_MSG_RESULT(yes)
		want_kipi="yes"
	else
		AC_MSG_RESULT(no)
		want_kipi="no"
		AC_MSG_WARN([KIPI plugin support will not be compiled])
	fi],
	[AC_MSG_RESULT(yes); want_kipi="yes"])

# check for libkipi
if test "$want_kipi" = "yes" ; then
	KDE_CHECK_HEADER(libkipi/interface.h, have_libkipi="yes")
	if test "x$have_libkipi" = "xyes" ;then
		LIBKIPI_CFLAGS=''
		LIBKIPI_LIBS='-lkipi'
		AC_SUBST(LIBKIPI_CFLAGS)
		AC_SUBST(LIBKIPI_LIBS)
		AC_DEFINE(HAVE_KIPI, 1, [If we have enable KIPI])
	fi
fi


#------------------------------------------------------------------
# check for libkexif
#------------------------------------------------------------------
AC_MSG_CHECKING(if ShowImg should be compiled with libkexif support)
AC_ARG_WITH(
	kexif,
	[  --with-kexif            compile the kexif plugins support default=yes],
	[if test "$withval" = yes ; then
		AC_MSG_RESULT(yes)
		want_kexif="yes"
	else
		AC_MSG_RESULT(no)
		want_kexif="no"
	fi],
	[AC_MSG_RESULT(yes); want_kexif="yes"])




if test $want_kexif="yes" ; then
	have_libkexif=no

	#check libkexi >=0.2
	if test "$PKGCONFIGFOUND" = "yes" ; then
		KDE_PKG_CHECK_MODULES(LIBKEXIF, libkexif >= 0.2,
					have_libkexif=yes, have_libkexif=no)
	fi
	
	if test "x$have_libkexif" = "xno"; then
		LIBKEXIF_CFLAGS=""
		LIBKEXIF_LIBS=""
		AC_MSG_RESULT([0.2 not found])
	else
		AC_DEFINE(HAVE_LIBKEXIF, 1, [If we have libkexif])
		AC_DEFINE_UNQUOTED([LIBKEXIF_VERSION], 020, [If we have libkexif 0.2])
		libkexif_version="0.2"
		AC_MSG_RESULT([0.2 found])
	fi

	#check 0.1 <= libkexi <0.2
	if test "x$have_libkexif" = "xno"; then
		KDE_CHECK_HEADER(libkexif/kexif.h, have_libkexif="yes")
		if test "x$have_libkexif" = "xyes"; then
			LIBKEXIF_CFLAGS=""
			LIBKEXIF_LIBS="-lkexif"
			AC_DEFINE(HAVE_LIBKEXIF, 1, [If we have libkexif])
			AC_DEFINE_UNQUOTED([LIBKEXIF_VERSION], 010, [If we have libkexif 0.1])
			libkexif_version="0.1"
			AC_MSG_RESULT([0.1 found])
		else
			LIBKEXIF_CFLAGS=""
			LIBKEXIF_LIBS=""
			AC_MSG_RESULT([0.1 not found])
		fi
	fi
else
	AC_MSG_WARN([libkexif support will not be compiled])
fi

AC_SUBST(LIBKEXIF_CFLAGS)
AC_SUBST(LIBKEXIF_LIBS)


#---------------------------------------------------------
# libexif detection
#---------------------------------------------------------
PKG_CHECK_MODULES([LIBEXIF], [libexif >= 0.5.7],
        have_libexif=yes ,
        have_libexif=no
)

if test "x$have_libexif" = "xyes" ; then
	AC_DEFINE_UNQUOTED([HAVE_LIBEXIF], 1, [If we have libkexif])
fi

AC_SUBST(LIBEXIF_LIBS)
AC_SUBST(LIBEXIF_CFLAGS)


#---------------------------------------------------------
# check for libkexi
#---------------------------------------------------------
AC_MSG_CHECKING(if ShowImg should be compiled with showimgdb support)
AC_ARG_WITH(
	showimgdb,
	[  --with-showimgdb        compile the showimgdb support [default=yes]],
	[if test "$withval" = yes ; then
		AC_MSG_RESULT(yes)
		want_showimgdb="yes"
	else
		AC_MSG_RESULT(no)
		want_showimgdb="no"
	fi],
	[AC_MSG_RESULT(yes); want_showimgdb="yes"])

compile_showimgdb="yes"
if test "x$want_showimgdb" != "xyes" ; then
  compile_showimgdb="no"
fi
AM_CONDITIONAL(compile_showimgdb, test "$compile_showimgdb" = "yes")

if test "x$want_showimgdb" = "xyes" ; then
	LIBKEXIDB_LDDADD='$(showimg_top_builddir)/kexi/kexidb/libshowimgkexidb.la $(showimg_top_builddir)/kexi/kexidb/parser/libshowimgkexidbparser.la $(showimg_top_builddir)/kexi/kexiutils/libshowimgkexiutils.la $(showimg_top_builddir)/showimgdb/libshowimgdb.la'
	LIBKEXIDB_LIBS=''
	LIBKEXIDB_CPPFLAGS='-I$(showimg_top_srcdir)/kexi -I$(showimg_top_srcdir)/showimgdb'
	AC_DEFINE(WANT_LIBKEXIDB, 1, [If we want kexidb support])
else
	AC_MSG_WARN([kexidb/showimgdb support will not be compiled])
fi
AC_SUBST(LIBKEXIDB_LDDADD)
AC_SUBST(LIBKEXIDB_LIBS)
AC_SUBST(LIBKEXIDB_CPPFLAGS)
dnl =======================================================
dnl FILE: ./showimg/kexi/3rdparty/configure.in.in
dnl =======================================================

dnl This is copied from gpsim-0.21.1/acinclude.m4, which was itself
dnl copied from the NcFTP distribution. 
dnl Modified by David Faure <faure@kde.org> for kexi's purposes.
dnl
dnl  Original author Mike Gleason mgleason@NcFTP.com
dnl
dnl
AC_DEFUN([kexi_LIB_READLINE], [
AC_MSG_CHECKING([for Readline library])

kexi_cv_lib_readline=no
ac_save_LIBS="$LIBS"
# Note: $LIBCURSES is permitted to be empty.
for LIBREADLINE in "-lreadline" "-lreadline $LIBCURSES" "-lreadline -ltermcap" "-lreadline -lncurses" "-lreadline -lcurses"
do
	LIBS="$ac_save_LIBS $LIBREADLINE"
	AC_TRY_RUN([
	/* program */
#include <stdio.h>
#include <stdlib.h>
#include <readline/readline.h>
 
main(int argc, char **argv)
{
	/* Note:  don't actually call readline, since it may block;
	 * We just want to see if it (dynamic) linked in okay.
	 */
	if (argc == 0)	/* never true */
		readline(0);
	exit(0);
}
],[
	# action if true
	kexi_cv_lib_readline=yes
],[
	# action if false
	kexi_cv_lib_readline=no
],[
	# action if cross compiling
	kexi_cv_lib_readline=no
])

	if test "$kexi_cv_lib_readline" = yes ; then break ; fi
done
# restore LIBS
LIBS="$ac_save_LIBS"

if test "$kexi_cv_lib_readline" = no ; then
	LIBREADLINE=""
	AC_MSG_RESULT("not found - kexisql will not be compiled")
else
	AC_MSG_RESULT($LIBREADLINE)
	AC_DEFINE(HAVE_READLINE, 1, [define if you have libreadline available])
fi

AM_CONDITIONAL(have_readline, test "$kexi_cv_lib_readline" = "yes")
AC_SUBST(LIBREADLINE)
])

kexi_LIB_READLINE
dnl =======================================================
dnl FILE: ./showimg/kexi/kexidb/configure.in.in
dnl =======================================================

if test "x$want_showimgdb" != "xyes" ; then
	DO_NOT_COMPILE="kexidb $DO_NOT_COMPILE"
fi
dnl =======================================================
dnl FILE: ./showimg/kexi/kexidb/drivers/configure.in.in
dnl =======================================================

dnl ========================================
dnl checks for MySQL
dnl taken form KDEDB
dnl ========================================

AC_ARG_ENABLE(mysql,
	AC_HELP_STRING([--enable-mysql],[build MySQL-plugin [default=yes]]),
              mysql_plugin=$enableval, mysql_plugin=yes)

AC_ARG_WITH(mysql_includes,
AC_HELP_STRING([--with-mysql-includes=DIR],[use MySQL-includes installed in this directory]),
[
  ac_mysql_incdir=$withval
], ac_mysql_incdir=/usr/local/include
)

AC_ARG_WITH(mysql_libraries,
AC_HELP_STRING([--with-mysql-libraries=DIR],[use MySQL-libs installed in this directory ]),
[
  ac_mysql_libdir=$withval
], ac_mysql_libdir=/usr/local/lib
)

dnl ==============================================
dnl check for MySQL should be compiled
dnl and where headers and libraries are installed
dnl if present compile mysql-plugin
dnl ==============================================

AC_MSG_CHECKING([for MySQL])

compile_mysql_plugin="yes"

if test "x$mysql_plugin" != "xyes"; then
  compile_mysql_plugin="no"
fi

KDE_FIND_PATH(mysql_config, MYSQL_CONFIG, [${prefix}/bin ${exec_prefix}/bin /usr/local/bin /opt/local/b\
in /usr/bin /opt/mysql/bin /usr/local/mysql/bin ], [
  AC_MSG_WARN([Could not find MySQL anywhere, check http://www.mysql.com/])
])

if test -n "$MYSQL_CONFIG"; then
	mysql_incdir=`$MYSQL_CONFIG --cflags| $SED -e "s,-I,,g" | cut -d " " -f 1`
	mysql_libdir=`$MYSQL_CONFIG --libs| $SED -e "s,',,g"`
	MYSQL_INC=$mysql_incdir
	MYSQL_LIBS=$mysql_libdir
	AC_SUBST(MYSQL_INC)
	AC_SUBST(MYSQL_LIBS)
else
	compile_mysql_plugin="no"
fi

if test "$compile_mysql_plugin" = "yes"; then
  AC_MSG_RESULT([libraries $mysql_libdir, headers $mysql_incdir])
else
  AC_MSG_RESULT(not found)
fi

AM_CONDITIONAL(compile_mysql_plugin, test "$compile_mysql_plugin" = "yes")



dnl ========================================
dnl Checks for PostgreSQL
dnl ========================================

dnl ========================================
dnl libpq
dnl   Add configure-args
dnl ========================================

dnl Assume we're building until something fails, unless explicitly disabled
AC_ARG_ENABLE(pgsql,
AC_HELP_STRING([--enable-pgsql],[build PostgreSQL-plugin [default=yes]]),
 pgsql_plugin=$enableval, pgsql_plugin=yes)

if test "x$pgsql_plugin" = "xyes"; then
  compile_pgsql_plugin="yes"
else
  compile_pgsql_plugin="no"
fi

AC_ARG_WITH(pgsqlincdir,
AC_HELP_STRING([--with-pgsqlincdir=DIR],[use PostgreSQL(libpq)-includes installed in this directory ]),
[
  ac_pgsql_incdir=$withval
], ac_pgsql_incdir=
)

AC_ARG_WITH(pgsqllibdir,
AC_HELP_STRING([  --with-pgsqllibdir=DIR],[use PostgreSQL(libpq)-libraries installed in this directory ]),
[
  ac_pgsql_libdir=$withval
], ac_pgsql_libdir=
)


dnl ========================================
dnl   header/library directories
dnl ========================================

if test "$compile_pgsql_plugin" = "yes" -a \
        ! -n "$ac_pgsql_incdir" -a ! -n "$ac_pgsql_libdir"; then
dnl *** No configure arguments for includes or libs given ***
dnl *** and not explicitly disabled.                      ***
  KDE_FIND_PATH(pg_config, PG_CONFIG, 
    [${prefix}/bin ${exec_prefix}/bin /usr/local/bin \
     /opt/local/bin /usr/bin ], [
    AC_MSG_RESULT([not found])
  ])

  if test -n "$PG_CONFIG"; then
    pg_incdir=`$PG_CONFIG --includedir`
    pg_libdir=`$PG_CONFIG --libdir`
    PG_INCDIR=$pg_incdir
    PG_LIBDIR=$pg_libdir
    AC_SUBST(PG_LIBDIR)
    compile_pgsql_plugin="yes"
  else
    compile_pgsql_plugin="no"
  fi
elif test "$compile_pgsql_plugin" = "yes"; then
dnl *** Configure arguments for includes or libs given    ***
dnl *** and not explicitly disabled.                      ***
dnl *** Check that the paths given to configure are valid ***
  AC_MSG_CHECKING([for PostgreSQL C API headers])
  if test -r $ac_pgsql_incdir/libpq-fe.h; then
    PG_INCDIR=$ac_pgsql_incdir
    AC_MSG_RESULT([$PG_INCDIR])
    AC_SUBST(PG_INCDIR)
  else
    AC_MSG_RESULT([not found])
    compile_pgsql_plugin="no"
  fi

  AC_MSG_CHECKING([for PostgreSQL C API libraries])
  if test -r $ac_pgsql_libdir/libpq.so; then
    PG_LIBDIR=$ac_pgsql_libdir
    AC_MSG_RESULT([$PG_LIBDIR])
    AC_SUBST(PG_LIBDIR)
  else
    compile_pgsql_plugin="no"
    AC_MSG_RESULT([not found])
  fi
else
dnl *** PostgreSQL plugin explicitly disabled.            ***
dnl *** Show that we are doing as requested.              ***
  AC_MSG_NOTICE([Not attempting to configure PostgreSQL as requested])
fi

AM_CONDITIONAL(compile_pgsql_plugin, test "$compile_pgsql_plugin" = "yes")


dnl ========================================
dnl libpqxx checks
dnl ========================================

AC_ARG_WITH(pqxxincdir,
AC_HELP_STRING([--with-pqxxincdir=DIR],[use PostgreSQL(libpqxx)-includes installed in this directory ]),
[
  ac_pqxx_incdir=$withval
], ac_pqxx_incdir=/usr/local/pqxx/include/pqxx
)

AC_ARG_WITH(pqxxlibdir,
AC_HELP_STRING([--with-pqxxlibdir=DIR],[use PostgreSQL(libpqxx)-libraries installed in this directory ]),
[
  ac_pqxx_libdir=$withval
], ac_pqxx_libdir=/usr/local/lib
)


dnl ========================================
dnl   libpqxx headers
dnl ========================================
if test "$compile_pgsql_plugin" = "yes"; then
  AC_MSG_CHECKING([for PostgreSQL C++ includes])
  pqxx_incdirs="$ac_pqxx_incdir /usr/include /usr/local/pqxx/include /usr/local/include"
  AC_FIND_FILE(pqxx/pqxx, $pqxx_incdirs, pqxx_incdir)
  if test ! -r $pqxx_incdir/pqxx/pqxx; then
    compile_pgsql_plugin="no"
    AC_MSG_RESULT([not found])
  else
    PQXX_INCDIR=$pqxx_incdir
    AC_MSG_RESULT([$PQXX_INCDIR])
    AC_SUBST(PQXX_INCDIR)
  fi
fi

dnl ========================================
dnl   libpqxx libraries
dnl ========================================
if test "$compile_pgsql_plugin" = "yes"; then
  AC_MSG_CHECKING([for PostgreSQL C++ libraries])
  pqxx_libdirs="$ac_pqxx_libdir /usr/lib /usr/local/lib /usr/local/pqxx/lib"
  AC_FIND_FILE(libpqxx.so, $pqxx_libdirs, pqxx_libdir)
  if test ! -r $pqxx_libdir/libpqxx.so; then
    compile_pgsql_plugin="no"
    AC_MSG_RESULT([not found])
  else
    PQXX_LIBDIR=$pqxx_libdir
    AC_MSG_RESULT([$PQXX_LIBDIR])
    AC_SUBST(PQXX_LIBDIR)
  fi
fi

AM_CONDITIONAL(compile_pgsql_plugin, test "$compile_pgsql_plugin" = "yes")
dnl =======================================================
dnl FILE: ./showimg/showimg/configure.in.in
dnl =======================================================

AC_FUNC_MALLOC
AC_FUNC_ERROR_AT_LINE
AC_FUNC_MEMCMP
AC_FUNC_MKTIME
AC_FUNC_STAT
AC_FUNC_STRFTIME
AC_FUNC_UTIME_NULL

AC_CHECK_FUNCS([floor])
AC_CHECK_FUNCS([gettimeofday])
AC_CHECK_FUNCS([memmove])
AC_CHECK_FUNCS([memset])
AC_CHECK_FUNCS([mkdir])
AC_CHECK_FUNCS([rmdir])
AC_CHECK_FUNCS([strdup])
AC_CHECK_FUNCS([strncasecmp])
AC_CHECK_FUNCS([utime])
AC_CHECK_FUNCS([strstr])

AC_CHECK_HEADERS([fcntl.h])
AC_CHECK_HEADERS([sys/time.h])
AC_CHECK_HEADERS([utime.h])

AC_CHECK_TYPES([ptrdiff_t])

AC_C_CONST
AC_C_INLINE
AC_HEADER_TIME
AC_PATH_X
AC_PROG_RANLIB
AC_STRUCT_TM
AC_TYPE_SIZE_T

KDE_CREATE_SUBDIRSLIST
AC_CONFIG_FILES([ Makefile ])
AC_CONFIG_FILES([ doc/Makefile ])
AC_CONFIG_FILES([ doc/da/Makefile ])
AC_CONFIG_FILES([ doc/es/Makefile ])
AC_CONFIG_FILES([ doc/et/Makefile ])
AC_CONFIG_FILES([ doc/fr/Makefile ])
AC_CONFIG_FILES([ doc/it/Makefile ])
AC_CONFIG_FILES([ doc/pt/Makefile ])
AC_CONFIG_FILES([ doc/ru/Makefile ])
AC_CONFIG_FILES([ doc/showimg/Makefile ])
AC_CONFIG_FILES([ doc/sv/Makefile ])
AC_CONFIG_FILES([ po/Makefile ])
AC_CONFIG_FILES([ po/bg/Makefile ])
AC_CONFIG_FILES([ po/br/Makefile ])
AC_CONFIG_FILES([ po/bs/Makefile ])
AC_CONFIG_FILES([ po/ca/Makefile ])
AC_CONFIG_FILES([ po/cs/Makefile ])
AC_CONFIG_FILES([ po/cy/Makefile ])
AC_CONFIG_FILES([ po/da/Makefile ])
AC_CONFIG_FILES([ po/de/Makefile ])
AC_CONFIG_FILES([ po/el/Makefile ])
AC_CONFIG_FILES([ po/en_GB/Makefile ])
AC_CONFIG_FILES([ po/es/Makefile ])
AC_CONFIG_FILES([ po/et/Makefile ])
AC_CONFIG_FILES([ po/fr/Makefile ])
AC_CONFIG_FILES([ po/ga/Makefile ])
AC_CONFIG_FILES([ po/hi/Makefile ])
AC_CONFIG_FILES([ po/hu/Makefile ])
AC_CONFIG_FILES([ po/it/Makefile ])
AC_CONFIG_FILES([ po/ja/Makefile ])
AC_CONFIG_FILES([ po/lt/Makefile ])
AC_CONFIG_FILES([ po/mt/Makefile ])
AC_CONFIG_FILES([ po/nl/Makefile ])
AC_CONFIG_FILES([ po/pl/Makefile ])
AC_CONFIG_FILES([ po/pt/Makefile ])
AC_CONFIG_FILES([ po/pt_BR/Makefile ])
AC_CONFIG_FILES([ po/ru/Makefile ])
AC_CONFIG_FILES([ po/sk/Makefile ])
AC_CONFIG_FILES([ po/sr/Makefile ])
AC_CONFIG_FILES([ po/sv/Makefile ])
AC_CONFIG_FILES([ po/ta/Makefile ])
AC_CONFIG_FILES([ po/tr/Makefile ])
AC_CONFIG_FILES([ po/zh_CN/Makefile ])
AC_CONFIG_FILES([ showimg/Makefile ])
AC_CONFIG_FILES([ showimg/kexi/Makefile ])
AC_CONFIG_FILES([ showimg/kexi/3rdparty/Makefile ])
AC_CONFIG_FILES([ showimg/kexi/3rdparty/kexisql/Makefile ])
AC_CONFIG_FILES([ showimg/kexi/3rdparty/kexisql/src/Makefile ])
AC_CONFIG_FILES([ showimg/kexi/3rdparty/kexisql3/Makefile ])
AC_CONFIG_FILES([ showimg/kexi/3rdparty/kexisql3/src/Makefile ])
AC_CONFIG_FILES([ showimg/kexi/kexidb/Makefile ])
AC_CONFIG_FILES([ showimg/kexi/kexidb/drivers/Makefile ])
AC_CONFIG_FILES([ showimg/kexi/kexidb/drivers/mySQL/Makefile ])
AC_CONFIG_FILES([ showimg/kexi/kexidb/drivers/odbc/Makefile ])
AC_CONFIG_FILES([ showimg/kexi/kexidb/drivers/pqxx/Makefile ])
AC_CONFIG_FILES([ showimg/kexi/kexidb/drivers/sqlite/Makefile ])
AC_CONFIG_FILES([ showimg/kexi/kexidb/drivers/sqlite2/Makefile ])
AC_CONFIG_FILES([ showimg/kexi/kexidb/parser/Makefile ])
AC_CONFIG_FILES([ showimg/kexi/kexiutils/Makefile ])
AC_CONFIG_FILES([ showimg/showimg/Makefile ])
AC_CONFIG_FILES([ showimg/showimg/icons/Makefile ])
AC_CONFIG_FILES([ showimg/showimg/khexedit/Makefile ])
AC_CONFIG_FILES([ showimg/showimg/kipiplugins/Makefile ])
AC_CONFIG_FILES([ showimg/showimg/mimetypes/Makefile ])
AC_CONFIG_FILES([ showimg/showimg/misc/Makefile ])
AC_CONFIG_FILES([ showimg/showimg/pics/Makefile ])
AC_CONFIG_FILES([ showimg/showimgapp/Makefile ])
AC_CONFIG_FILES([ showimg/showimgdb/Makefile ])
AC_CONFIG_FILES([ showimg/showimgdb/test/Makefile ])
AC_CONFIG_FILES([ showimg/showimgpart/Makefile ])
AC_OUTPUT
echo ""
echo ""
echo "------"
if test "x$showimg_enabled" = "xyes" ; then
	if test "x$want_kipi" = "xyes" ; then
		if test "x$have_libkipi" = "xyes"; then
			echo "kipi plugin support for ShowImg:      yes"
		else
			echo "kipi plugin support for ShowImg:       no"
			echo "    You are missing the kipi headers and libraries"
			echo "    The kipi plugin support won't be compiled."
		fi
	else
		echo "kipi plugin support for ShowImg:       no"
	fi

	if test "x$want_kexif" = "xyes" ; then
		if test "x$have_libkexif" = "xyes"; then
			echo "libkexif support for ShowImg:         yes ($libkexif_version)"
		else
			echo "libkexif support for ShowImg:          no"
			echo "    You are missing the libkexif headers and libraries"
			echo "    The libkexif support won't be compiled."
		fi
	else
		echo "libkexif support for ShowImg:          no"
	fi
	
	if test "x$want_showimgdb" = "xyes" ; then
		echo "kexidb/showimgdb support for ShowImg: yes"
	else
		echo "kexidb/showimgdb support for ShowImg:  no"
	fi
else
	echo "ShowImg will not be compiled (missing konq_operations.h)."
fi
echo ""
echo "Installation direcory is $prefix"
echo ""
if test -z "$PG_INCDIR" -o -z "$PG_LIBDIR" -o \
        -z "$PQXX_INCDIR" -o -z "$PQXX_LIBDIR"; then

# LIBPQ messages
  if test -z "$PG_INCDIR"; then
    echo "  + The PostgreSQL C-API (libpq) headers were not found."
  fi

  if test -z "$PG_LIBDIR"; then
    echo "  + The PostgreSQL C-API (libpq) libraries were not found."
  fi

  if test -z "$PG_INCDIR" -a -z "$PG_LIBDIR" ; then
      pglib_parts_missing="HEADER or the libpq LIBRARY"
  elif test -z "$PG_INCDIR" ; then
      pglib_parts_missing="HEADER"
  elif test -z "$PG_LIBDIR" ; then
      pglib_parts_missing="LIBRARY"
  fi

  if test -z "$PG_INCDIR" -o -z "$PG_LIBDIR" ; then
    cat <<EOS
    Could not find the libpq $pglib_parts_missing files.
    These are required by the libpqxx C++ library, which is used by
    Kexi's PostgreSQL drivers.

    The PostgreSQL C-API usually ship with PostgreSQL, but if you've
    installed from a distros package then these files may be part of
    a package called postgresql-devel or libpq-devel"

EOS
  fi

# LIBPQXX messages
  if test -z "$PQXX_INCDIR" -a -z "$PQXX_LIBDIR" ; then
      pqxx_parts_missing="HEADER or the libpqxx LIBRARY"
  elif test -z "$PQXX_INCDIR" ; then
      pqxx_parts_missing="HEADER"
  elif test -z "$PQXX_LIBDIR" ; then
      pqxx_parts_missing="LIBRARY"
  fi

  all_tests=bad
fi
dnl Put here things to be done at the very end - telling users
dnl about additional packages to install. Better yet is giving
dnl each project / subdr its own configure.in.bot.

# Check if KDE_SET_PREFIX was called, and --prefix was passed to configure
if test -n "$kde_libs_prefix" -a -n "$given_prefix"; then
  # And if so, warn when they don't match
  if test "$kde_libs_prefix" != "$given_prefix"; then
    # And if kde doesn't know about the prefix yet
    echo ":"`kde-config --path exe`":" | grep ":$given_prefix/bin/:" 2>&1 >/dev/null
    if test $? -ne 0; then
      echo ""
      echo "Warning: you chose to install this package in $given_prefix,"
      echo "but KDE was found in $kde_libs_prefix."
      echo "For this to work, you will need to tell KDE about the new prefix, by ensuring"
      echo "that KDEDIRS contains it, e.g. export KDEDIRS=$given_prefix:$kde_libs_prefix"
      echo "Then restart KDE."
      echo ""
    fi
  fi
fi

if test "$all_tests" = "bad"; then
  if test ! "$cache_file" = "/dev/null"; then
    echo ""
    echo "Please remove the file $cache_file after changing your setup"
    echo "so that configure will find the changes next time."
    echo ""
  fi
else
  echo ""
  echo "Good - your configure finished. Start make now"
  echo ""
fi