This repository has been archived by the owner on Dec 20, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
configure.ac
155 lines (120 loc) · 3.64 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
dnl
dnl configure.in for qalculate-gtk
dnl
dnl ----------------------
dnl | initialize autotools |---------------------------------------------------
dnl ----------------------
AC_INIT([Qalculate! (GTK+ UI)], [0.9.11],[],[qalculate-gtk])
AC_CONFIG_SRCDIR([src/callbacks.cc])
AM_INIT_AUTOMAKE
AC_CONFIG_MACRO_DIR([m4])
AM_CONFIG_HEADER(config.h)
AM_MAINTAINER_MODE
dnl -------------------------------
dnl | check for neccessary programs |------------------------------------------
dnl -------------------------------
AC_ISC_POSIX
AC_PROG_CC
AC_PROG_CXX
AM_PROG_CC_STDC
AC_PROG_LN_S
AC_HEADER_STDC
AC_PROG_INTLTOOL
AM_PROG_LIBTOOL
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
if test "$host_os" = "mingw32"; then
AC_DEFINE([_WIN32_WINNT], 0x501, [Target Windows version])
fi
AM_CONDITIONAL(PLATFORM_LINUX, test "$host_os" = "linux")
AM_CONDITIONAL(PLATFORM_WIN32, test "$host_os" = "mingw32")
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.12
gdk-pixbuf-2.0
])
AC_SUBST(GTK_CFLAGS)
AC_SUBST(GTK_LIBS)
GTK_LIBS="-export-dynamic $GTK_LIBS"
PKG_CHECK_MODULES(QALCULATE, [
libqalculate >= 0.9.11
])
AC_SUBST(QALCULATE_CFLAGS)
AC_SUBST(QALCULATE_LIBS)
PKG_CHECK_MODULES(CLN, [ cln >= 1.2 ],
[have_recent_cln=yes], [have_recent_cln=no])
AC_SUBST(CLN_CPPFLAGS)
AC_SUBST(CLN_LIBS)
if test "$have_recent_cln" = "yes" ; then
AC_DEFINE(HAVE_LIBCLN12, 1, [Define if CLN can be used])
LIBS="$LIBS $CLN_LIBS"
CPPFLAGS="$CPPFLAGS $CLN_CPPFLAGS"
fi
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="nl sv"
AM_GLIB_GNU_GETTEXT
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")
INTLTOOL_QALCULATE_DEFINITIONS_RULE='%.xml: %.xml.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po-defs/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -x -u -c $(top_builddir)/po-defs/.intltool-merge-cache $(top_srcdir)/po-defs $< [$]@'
AC_SUBST(INTLTOOL_QALCULATE_DEFINITIONS_RULE)
dnl --------
dnl | output |-----------------------------------------------------------------
dnl --------
AC_OUTPUT([
Makefile
data/Makefile
doc/Makefile
src/Makefile
po/Makefile.in
])