summaryrefslogtreecommitdiffstats
path: root/krecipes/configure.in.in
blob: ee700aa3a61dc4011014997073de6f94e10c3fbf (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
#MIN_CONFIG(3.1)

AM_INIT_AUTOMAKE(krecipes, 0.8)

#KDE_USE_QT(3.1)

AC_C_BIGENDIAN
AC_CHECK_KDEMAXPATHLEN

AC_ARG_WITH(sqlite, AC_HELP_STRING([--without-sqlite], [Don't compile SQLite backend support]), , with_sqlite=yes)
AC_ARG_WITH(mysql, AC_HELP_STRING([--without-mysql], [Don't compile MySQL backend support]), , with_mysql=yes)
AC_ARG_WITH(postgresql, AC_HELP_STRING([--without-postgresql], [Don't compile PostgreSQL backend support]), , with_postgresql=yes)

dnl ----- Check if we should enable MySQL ------

if test "x$with_mysql" != "xno"; then
  AC_DEFINE(HAVE_MYSQL, 1, [have MySQL])
  have_mysql="true"
else
  AC_DEFINE(HAVE_MYSQL, 0, [have MySQL])
  have_mysql="false"
fi


dnl ----- Check if we should enable PostgreSQL ------

if test "x$with_postgresql" != "xno"; then
  AC_DEFINE(HAVE_POSTGRESQL, 1, [have PostgreSQL])
  have_postgresql="true"
else
  AC_DEFINE(HAVE_POSTGRESQL, 0, [have PostgreSQL])
  have_postgresql="false"
fi


dnl ------ Check for the SQLite headers -----

AC_DEFUN([AC_HAVE_SQLITE],
[
        AC_DEFINE(HAVE_SQLITE, 1, [have SQLite])
        have_sqlite=true
	SQLITE_LIB="-lsqlite"
	AC_SUBST(SQLITE_LIB)
])

AC_DEFUN([AC_NO_SQLITE],
[
        AC_DEFINE(HAVE_SQLITE, 0, [have SQLite])
        have_sqlite=false
])

AC_DEFUN([AC_HAVE_SQLITE3],
[
        AC_DEFINE(HAVE_SQLITE3, 1, [have SQLite3])
        have_sqlite3=true
	AC_NO_SQLITE
	SQLITE_LIB="-lsqlite3"
	AC_SUBST(SQLITE_LIB)
])

AC_DEFUN([AC_NO_SQLITE3],
[
        AC_DEFINE(HAVE_SQLITE3, 0, [have SQLite3])
        have_sqlite3=false
])

if test "x$with_sqlite" != "xno"; then
  KDE_CHECK_HEADER(sqlite3.h,
           AC_HAVE_SQLITE3,
           AC_NO_SQLITE3
  )
 
  if test "x$have_sqlite3" = "xfalse"; then
  KDE_CHECK_HEADER(sqlite.h,
           AC_HAVE_SQLITE,
           AC_NO_SQLITE
  )
  fi

else
  AC_NO_SQLITE
  AC_NO_SQLITE3
fi

dnl ----------- Should I link or should I not link? ---------
AM_CONDITIONAL(link_lib_MYSQL, test x$have_mysql = xtrue)
AM_CONDITIONAL(link_lib_POSTGRESQL, test x$have_postgresql = xtrue)
AM_CONDITIONAL(link_lib_SQLITE, test x$have_sqlite = xtrue || test x$have_sqlite3 = xtrue)

dnl ----------- Should Krecipes be built at all? ------------
if test "x$have_mysql" = "xfalse" && test "x$have_postgresql" = "xfalse"; then
        if test "x$have_sqlite" = "xfalse" && test "x$have_sqlite3" = "xfalse"; then
        DO_NOT_COMPILE="$DO_NOT_COMPILE krecipes"
        will_not_build_krecipes=true
        fi
fi