forked from Qalculate/qalculate-gtk
-
Notifications
You must be signed in to change notification settings - Fork 0
/
configure.ac
188 lines (152 loc) · 4.56 KB
/
configure.ac
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
dnl
dnl configure.in for qalculate-gtk
dnl
dnl ----------------------
dnl | initialize autotools |---------------------------------------------------
dnl ----------------------
AC_INIT([Qalculate! (GTK UI)],[3.18.0],[],[qalculate-gtk])
AC_CONFIG_SRCDIR([src/callbacks.cc])
AM_INIT_AUTOMAKE
AC_CONFIG_HEADERS(config.h)
AM_MAINTAINER_MODE
AC_CONFIG_MACRO_DIR(m4)
dnl -------------------------------
dnl | check for neccessary programs |------------------------------------------
dnl -------------------------------
AC_PROG_CC
AC_PROG_CXX
AC_PROG_LN_S
AC_PROG_EGREP
IT_PROG_INTLTOOL
LT_INIT
dnl ------------------------------------
dnl | check for compiler characteristics |-------------------------------------
dnl ------------------------------------
dnl Replace -Os with -O2 to stop segfault on startup
if test "x$GCC" = "xyes"; then
case $CFLAGS in
*-Os*)
CFLAGS="$CFLAGS -O2"
;;
esac
case $CXXFLAGS in
*-Os*)
CXXFLAGS="$CXXFLAGS -O2"
;;
esac
fi
dnl Use -Wall if we have gcc.
changequote(,)dnl
if test "x$GCC" = "xyes"; then
case " $CFLAGS " in
*[\ \ ]-Wall[\ \ ]*) ;;
*) CFLAGS="$CFLAGS -Wall" ;;
esac
fi
changequote([,])dnl
AC_CANONICAL_HOST
case "${host_os}" in
linux*)
build_linux=yes
;;
mingw*)
build_windows=yes
;;
darwin*)
build_mac=yes
;;
esac
AM_CONDITIONAL(PLATFORM_LINUX, test "$build_linux" = "yes")
AM_CONDITIONAL(PLATFORM_WIN32, test "$build_windows" = "yes")
dnl --------------------------------
dnl | check for neccessary libraries |-----------------------------------------
dnl --------------------------------
AC_CHECK_LIB(pthread, pthread_create, [LIBS="$LIBS -lpthread"])
AC_LANG([C++])
AC_CHECK_HEADERS([unordered_map])
PKG_CHECK_MODULES(GLIB, [
glib-2.0 >= 2.4
libxml-2.0
])
AC_SUBST(GLIB_CFLAGS)
AC_SUBST(GLIB_LIBS)
QALCULATE_GTK="qalculate-gtk${EXEEXT}"
PKG_CHECK_MODULES(GTK, [
gtk+-3.0 >= 3.10
gdk-pixbuf-2.0
])
AC_SUBST(GTK_CFLAGS)
AC_SUBST(GTK_LIBS)
GTK_LIBS="-export-dynamic $GTK_LIBS"
AC_ARG_WITH([webkitgtk], AS_HELP_STRING([--with-webkitgtk], [use WebKitGTK for display of the user manual]))
AS_IF([test "x$with_webkitgtk" = "xyes"], [
PKG_CHECK_MODULES([WEBKITGTK], [webkit2gtk-4.0])
AC_DEFINE([USE_WEBKITGTK], [1], [Use WebKitGTK])
AC_SUBST(WEBKITGTK_CFLAGS)
AC_SUBST(WEBKITGTK_LIBS)
])
AC_ARG_ENABLE([gnome_search], AS_HELP_STRING([--disable-gnome-search], [disable Gnome shell search provider]))
if test -z $enable_gnome_search && (test "$build_windows" = "yes" || test "$build_mac" = "yes"); then
enable_gnome_search=no
fi
AS_IF([test "x$enable_gnome_search" != "xno"], [
PKG_CHECK_MODULES([GIOUNIX], [gio-unix-2.0])
AC_SUBST(GIOUNIX_CFLAGS)
AC_SUBST(GIOUNIX_LIBS)
])
AM_CONDITIONAL(ENABLE_SEARCH_PROVIDER, [test "x$enable_gnome_search" != "xno"])
AC_ARG_WITH([local_help], AS_HELP_STRING([--without-local-help], [use online manual instead of local help files]))
AS_IF([test "x$with_local_help" != "xno"], [
AC_DEFINE([LOCAL_HELP], [1], [Use local help files])
])
AM_CONDITIONAL(ENABLE_LOCAL_HELP, [test "x$with_local_help" != "xno"])
PKG_CHECK_MODULES(QALCULATE, [
libqalculate >= 3.18.0
])
AC_SUBST(QALCULATE_CFLAGS)
AC_SUBST(QALCULATE_LIBS)
AC_SUBST(QALCULATE_GTK)
dnl -------------------------------------
dnl | internationalization (i18n) support |------------------------------------
dnl -------------------------------------
GETTEXT_PACKAGE=qalculate-gtk
AC_SUBST(GETTEXT_PACKAGE)
AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE,"$GETTEXT_PACKAGE",[The package name for gettext])
dnl Please keep this in alphabetical order
ALL_LINGUAS="es fr nl pt_BR ru sl sv zh_CN"
AM_GNU_GETTEXT(external)
AM_GNU_GETTEXT_VERSION([0.21])
if test "$USE_NLS" = yes; then
AC_DEFINE([ENABLE_NLS], [1], [Define to 1 if translation of program messages to the user's native language is requested.])
fi
dnl AM_GLIB_GNU_GETTEXT sets $DATADIRNAME
AC_MSG_CHECKING(locale directory)
if test "x$prefix" = "xNONE"; then
PACKAGE_LOCALE_DIR=$ac_default_prefix/share/locale
else
PACKAGE_LOCALE_DIR=$prefix/share/locale
fi
AC_DEFINE_UNQUOTED(PACKAGE_LOCALE_DIR, "$PACKAGE_LOCALE_DIR",
[The directory in which qalculate's locale data will be stored])
AC_MSG_RESULT("$PACKAGE_LOCALE_DIR")
dnl --------
dnl | output |-----------------------------------------------------------------
dnl --------
AC_CONFIG_FILES([
Makefile
data/Makefile
data/icons/Makefile
data/icons/16x16/Makefile
data/icons/22x22/Makefile
data/icons/24x24/Makefile
data/icons/32x32/Makefile
data/icons/48x48/Makefile
data/icons/64x64/Makefile
data/icons/128x128/Makefile
data/icons/256x256/Makefile
data/icons/scalable/Makefile
doc/Makefile
src/Makefile
po/Makefile.in
])
AC_OUTPUT