forked from lostcoder/pan2
-
Notifications
You must be signed in to change notification settings - Fork 0
/
configure.in
167 lines (141 loc) · 4.71 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
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
AC_INIT([pan],[0.134pre1],[http://bugzilla.gnome.org/enter_bug.cgi?product=Pan])
AC_DEFINE(VERSION_MAJOR,0,[Major part of version number])
AC_DEFINE(VERSION_MINOR,134pre1,[Minor part of version number])
AC_DEFINE(VERSION_REVISION,0,[Revision part of version number])
AC_DEFINE(VERSION_TITLE,["Wait for Me"],[Release Name])
AC_PREREQ(2.54)
dnl git-dir is used for building outside the src tree
GIT_BRANCH=`git --git-dir=$srcdir/.git symbolic-ref HEAD 2> /dev/null | awk -F/ '{print $NF}'`
GIT_HASH=`git --git-dir=$srcdir/.git log -1 --pretty=format:%h 2> /dev/null`
if test ! -z $GIT_HASH; then
if test -z $GIT_BRANCH; then
GIT_REV="GIT $GIT_HASH"
else
GIT_REV="GIT $GIT_HASH $GIT_BRANCH"
fi
else
dnl expanded by export-archive
GIT_HASH=$Format:%h$
GIT_BRANCH=`echo "$Format:%d$" | awk -F , '{print gensub("[[\(\)]]","","g",$NF)}' 2>/dev/null`
if test -z $GIT_BRANCH; then
GIT_REV="GIT $GIT_HASH"
else
GIT_REV="GIT $GIT_HASH $GIT_BRANCH"
fi
fi
AC_DEFINE_UNQUOTED([GIT_REV],["$GIT_REV"],[Git branch and hash])
AM_CONFIG_HEADER(config.h)
AC_CONFIG_SRCDIR(pan/general/quark.cc)
AM_INIT_AUTOMAKE(AC_PACKAGE_NAME,AC_PACKAGE_VERSION)
AM_MAINTAINER_MODE
m4_ifdef([AM_SILENT_RULES],[AM_SILENT_RULES([yes])])
dnl glib, gmime, and gtk are mandatory prerequisites.
dnl
dnl GtkSpell is optional: GTKSPELL_REQUIRED refers to the minimum version
dnl needed if you want to build Pan with spellchecking in the Post window.
GLIB_REQUIRED=2.14.0
GMIME_REQUIRED=2.4.0
GTK_REQUIRED=2.16.0
GTKSPELL_REQUIRED=2.0.7
AC_SUBST(GLIB_REQUIRED)
AC_SUBST(GMIME_REQUIRED)
AC_SUBST(GTK_REQUIRED)
AC_SUBST(GTKSPELL_REQUIRED)
AC_PROG_CXX
AC_HEADER_STDC
AC_HEADER_TIME
AC_CHECK_FUNCS([localtime_r close])
AC_CXX_HEADER_TR1_UNORDERED_SET
AC_CXX_HAVE_EXT_HASH_SET
AC_PROG_AWK
AC_PROG_INSTALL
AC_PROG_MAKE_SET
AC_PROG_RANLIB
dnl for libuu
AC_CHECK_HEADERS([errno.h fcntl.h])
IT_PROG_INTLTOOL([0.35.5],[no-xml])
GETTEXT_PACKAGE=pan
AC_SUBST(GETTEXT_PACKAGE)
AC_DEFINE_UNQUOTED([GETTEXT_PACKAGE],["$GETTEXT_PACKAGE"],[Gettext package])
AM_GLIB_GNU_GETTEXT
panlocaledir='${prefix}/${DATADIRNAME}/locale'
AM_PATH_GLIB_2_0($GLIB_REQUIRED,,exit 1,gobject gmodule gthread)
PKG_CHECK_MODULES([GMIME], [ gmime-2.6 >= $GMIME_REQUIRED ], [],
[PKG_CHECK_MODULES( [GMIME], [gmime-2.4 >= $GMIME_REQUIRED] )] )
AM_PATH_GTK_2_0($GTK_REQUIRED,,exit 1,gthread)
gtkspell_msg=no
AC_ARG_WITH(gtkspell, AC_HELP_STRING([--with-gtkspell], [Enable gtkspell support]), [want_gtkspell=$withval], [want_gtkspell=yes])
if test "x$want_gtkspell" = "xyes" ; then
PKG_CHECK_MODULES([GTKSPELL], [gtkspell-2.0 >= $GTKSPELL_REQUIRED],
[gtkspell_msg=yes
AC_DEFINE(HAVE_GTKSPELL,[1],[Spellcheck Library])],
[gtkspell_msg=no
AC_MSG_RESULT(no)])
fi
dnl Check to see if strftime supports the use of %l and %k
AC_MSG_CHECKING(for %l and %k support in strftime)
AC_TRY_RUN([
#include <string.h>
#include <time.h>
int main(int argc, char **argv) {
char buf[10];
time_t rawtime = time(0);
struct tm *timeinfo = localtime (&rawtime);
strftime(buf, 10, "%l %k", timeinfo);
exit (strstr(buf, "l") || strstr(buf, "k") || !strcmp(buf," "));
}],[
AC_DEFINE(HAVE_LKSTRFTIME, 1, [strftime supports use of l and k])
ac_cv_lkstrftime=yes
],ac_cv_lkstrftime=no,ac_cv_lkstrftime=no)
AC_MSG_RESULT($ac_cv_lkstrftime)
AC_CANONICAL_HOST
AC_DEFINE_UNQUOTED([PLATFORM_INFO],["$host"],[uname cpu-vendor-platformbuild])
dnl windows-specific stuff.
win32="no"
case $host_os in
*darwin*|*rhapsody*)
AC_DEFINE(G_OS_DARWIN,[1],[Darwin])
;;
*cygwin|*mingw32*)
CXXFLAGS="$CXXFLAGS -mms-bitfields -mwin32"
CPPFLAGS="$CPPFLAGS -DWIN32_LEAN_AND_MEAN"
LIBS="$LIBS -lshell32 -lws2_32"
panlocaledir="locale"
if test -z "$host_alias"; then
hostaliaswindres=
else
hostaliaswindres="$host_alias-windres";
fi
AC_PATH_PROGS([WINDRES], [windres $hostaliaswindres $host_os-windres])
if test "x$WINDRES" = "x"; then
AC_MSG_ERROR([windres could not be found within your path.])
fi
AC_SUBST(WINDRES)
win32="yes"
;;
esac
AM_CONDITIONAL([HAVE_WIN32],[test "$win32" = "yes"])
dnl build the output files
AC_SUBST(panlocaledir)
AC_CONFIG_FILES([Makefile
pan.spec
pan.iss
README.windows
po/Makefile.in
uulib/Makefile
pan/Makefile
pan/general/Makefile
pan/usenet-utils/Makefile
pan/data/Makefile
pan/data/decode-test-cache/Makefile
pan/tasks/Makefile
pan/icons/Makefile
pan/data-impl/Makefile
pan/gui/Makefile])
AC_OUTPUT
echo "
Configuration:
Source code location: ${srcdir}
Compiler: ${CXX}
With GtkSpell: ${gtkspell_msg}
"