-
Notifications
You must be signed in to change notification settings - Fork 0
/
configure.in
144 lines (117 loc) · 4 KB
/
configure.in
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
dnl Process this file with autoconf to produce a configure script.
AC_PREREQ(2.13)
AC_INIT(src/RefWindow.C)
AM_CONFIG_HEADER(config.h)
dnl -----------------------------------------------
dnl Package name and version number (user defined)
dnl -----------------------------------------------
PACKAGE=referencer
VERSION=1.1.6
dnl -----------------------------------------------
dnl Package name and version number (DO NOT MODIFY)
dnl -----------------------------------------------
AM_INIT_AUTOMAKE($PACKAGE, $VERSION)
AC_CONFIG_MACRO_DIR([m4])
GNOME_COMMON_INIT
GNOME_DOC_INIT
AC_LANG_CPLUSPLUS
dnl Checks for programs.
AC_PROG_CXX
AC_PROG_RANLIB
dnl Checks for libraries.
PKG_CHECK_MODULES(DEPS, [
libgnomeuimm-2.6 >= 2.12.0
gtkmm-2.4 >= 2.8.0
dnl TODO: make dbus-glib and tracker optional
dnl dbus-glib-1 >= 0.74
dnl tracker >= 0.6.3
libglademm-2.4 >= 2.6.0
gconfmm-2.6 >= 2.12.0
gnome-vfsmm-2.6 >= 2.12.0
poppler-glib >= 0.5.0
])
AC_CHECK_LIB(boost_regex, [main], , [
AC_CHECK_LIB(boost_regex-mt, [main], ,
AC_MSG_ERROR([boost_regex not found. Stopped]))
])
AC_CHECK_HEADERS(boost/regex.hpp)
AC_SUBST(DEPS_CFLAGS)
AC_SUBST(DEPS_LIBS)
dnl Special case for poppler-glib < 0.6
case $($PKG_CONFIG --modversion poppler-glib) in
0.5.*)
AC_DEFINE(OLD_POPPLER,"1","Using poppler < 0.6");;
esac
dnl I18n
GETTEXT_PACKAGE=$PACKAGE
AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE,"$GETTEXT_PACKAGE",GETTEXT_PACKAGE)
AC_SUBST(GETTEXT_PACKAGE)
AM_GLIB_GNU_GETTEXT
AC_PROG_INTLTOOL
dnl Add flag to disable updating of mime database
AC_ARG_ENABLE(update-mime-database,
AC_HELP_STRING([--disable-update-mime-database],
[do not run the update-mime-database utility (mostly useful for package maintainers) ]))
AM_CONDITIONAL(UPDATE_MIME_DATABASE, test "$enable_update_mime_database" != "no")
dnl ================================================================
dnl Python
dnl ================================================================
AC_MSG_CHECKING([whether Python support is requested])
AC_ARG_ENABLE([python],
AS_HELP_STRING([--enable-python],[Enable python support]),
[enable_python=$enableval have_python=$enableval],
[enable_python=autodetect have_python=yes])
AC_MSG_RESULT([$enable_python])
if test "x$have_python" != "xno"; then
AM_PATH_PYTHON([2.3],[],[no])
if test "x$PYTHON" = "x:"; then
have_python=no
fi
fi
if test "x$have_python" != "xno"; then
AM_CHECK_PYTHON_HEADERS([],[have_python=no])
fi
if test "x$have_python" != "xno"; then
PY_PREFIX=`$PYTHON -c 'import sys ; print sys.prefix'`
PY_EXEC_PREFIX=`$PYTHON -c 'import sys ; print sys.exec_prefix'`
PYTHON_LIBS="-lpython$PYTHON_VERSION"
PYTHON_LIB_LOC="-L$PY_EXEC_PREFIX/lib/python$PYTHON_VERSION/config"
PYTHON_CFLAGS="-I$PY_PREFIX/include/python$PYTHON_VERSION"
PYTHON_MAKEFILE="$PY_EXEC_PREFIX/lib/python$PYTHON_VERSION/config/Makefile"
PYTHON_LOCALMODLIBS=`sed -n -e 's/^LOCALMODLIBS=\(.*\)/\1/p' $PYTHON_MAKEFILE`
PYTHON_BASEMODLIBS=`sed -n -e 's/^BASEMODLIBS=\(.*\)/\1/p' $PYTHON_MAKEFILE`
PYTHON_OTHER_LIBS=`sed -n -e 's/^LIBS=\(.*\)/\1/p' $PYTHON_MAKEFILE`
PYTHON_EXTRA_LIBS="$PYTHON_LOCALMODLIBS $PYTHON_BASEMODLIBS $PYTHON_OTHER_LIBS"
AC_SUBST([PYTHON_LIBS])
AC_SUBST([PYTHON_LIB_LOC])
AC_SUBST([PYTHON_CFLAGS])
AC_SUBST([PYTHON_EXTRA_LIBS])
fi
if test "x$have_python" != "xyes"; then
if test "x$enable_python" = "xyes"; then
AC_MSG_ERROR([Python not found])
elif test "x$enable_python" = "xautodetect"; then
enable_python=no
AC_MSG_WARN([Python not found, disabling python support])
fi
fi
if test "x$have_python" != "xno" -a "x$enable_python" != "xno"; then
enable_python=yes
AC_DEFINE([ENABLE_PYTHON],[1],[Define to compile with python support])
fi
AM_CONDITIONAL([ENABLE_PYTHON],[test "x$enable_python" = "xyes"])
dnl This allows the bug-report script to know whether python has been enabled
AC_SUBST(enable_python)
dnl Create makefiles
AC_OUTPUT(
Makefile
libbibutils/Makefile
src/Makefile
data/Makefile
data/referencer.desktop.in
plugins/Makefile
help/Makefile
devhelp/Makefile
po/Makefile.in
referencer.spec
)