forked from wxMEdit/wxMEdit
-
Notifications
You must be signed in to change notification settings - Fork 0
/
configure.ac
151 lines (124 loc) · 4.12 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
# -*- Autoconf -*-
# Process this file with autoconf to produce a configure script.
AC_PREREQ(2.63)
AC_INIT([wxmedit], [3.2], [[email protected]])
AC_CONFIG_SRCDIR([src/wxmedit_app.cpp])
AC_CONFIG_HEADER([config.h])
AC_PREFIX_DEFAULT([/usr])
AM_INIT_AUTOMAKE([subdir-objects])
AC_USE_SYSTEM_EXTENSIONS
ALL_LINGUAS="de_DE es fr_FR it_IT ja_JP pl_PL ru_RU zh_CN zh_TW"
AM_GNU_GETTEXT([external])
AC_SUBST(ALL_LINGUAS)
# Checks for programs.
AC_PROG_CXX
AC_PROG_INSTALL
AC_LANG(C++)
#CXXFLAGS="-O2"
my_cxxflags_bak="$CXXFLAGS"
CXXFLAGS="$CXXFLAGS -std=c++11"
AC_MSG_CHECKING([whether -std=c++11 is supported])
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([])],
[AC_MSG_RESULT([yes])]
[my_cxx11_suported="x"],
[AC_MSG_RESULT([no])]
[CXXFLAGS="$my_cxxflags_bak"]
)
if test "x$my_cxx11_suported" == "x"; then
my_cxxflags_bak="$CXXFLAGS"
CXXFLAGS="$CXXFLAGS -std=c++0x"
AC_MSG_CHECKING([whether -std=c++0x is supported])
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([])],
[AC_MSG_RESULT([yes])],
[AC_MSG_RESULT([no])]
[CXXFLAGS="$my_cxxflags_bak"]
)
fi
# Checks for MacOS
IS_MACOS=
case "${host}" in
*-*-darwin* | powerpc-apple-macos* )
IS_MACOS=1
;;
esac
PKG_CHECK_MODULES(curl, [libcurl >= 7.15.5])
PKG_CHECK_MODULES(icu, [icu-i18n >= 50])
CPPFLAGS="$CPPFLAGS $icu_CFLAGS"
LIBS="$LIBS $icu_LIBS"
# option for additional Boost lib
AC_ARG_WITH(boost,
[ --with-boost=PATH use additional Boost library path,
otherwise use system include path],
[CXXFLAGS="$CXXFLAGS -I$withval"])
# Checks for wxWidgets library
WX_LIBS_set="0"
if test "x$WX_LIBS" != "x"; then
WX_LIBS_set="1"
fi
AM_OPTIONS_WXCONFIG
WX_CONFIG_CHECK(2.8.0, wxWin=1, ,[core,aui])
if test "$wxWin" != 1; then
AC_MSG_ERROR([
wxWidgets must be installed on your system
but wx-config script couldn''t be found.
Please check that wx-config is in path, the directory
where wxWidgets libraries are installed (returned by
'wx-config --libs' command) is in LD_LIBRARY_PATH or
equivalent variable and wxWidgets version is 2.8.0.
])
fi
CPPFLAGS="$CPPFLAGS $WX_CPPFLAGS"
CXXFLAGS="$CXXFLAGS $WX_CXXFLAGS_ONLY"
#CFLAGS="$CFLAGS $WX_CFLAGS_ONLY"
if test "$WX_LIBS_set" != 1; then
LIBS="$LIBS $WX_LIBS"
fi
UNICODE_FLAG=$(test ! $($WX_CONFIG_WITH_ARGS --unicode=yes >/dev/null 2>&1))
AC_MSG_CHECKING([if wxWidgets was built with UNICODE enabled])
if test "$UNICODE_FLAG" != "0"; then
AC_MSG_RESULT([yes])
else
AC_MSG_RESULT([no])
AC_MSG_ERROR([wxWidgets must be built with UNICODE enabled.])
fi
# Checks for glib2, gtk2/3 libraries
WX_BASENAME=$($WX_CONFIG_WITH_ARGS --basename)
if test "$WX_BASENAME" = "wx_gtk2u"; then
PKG_CHECK_MODULES(glib_gtk, [
glib-2.0 >= 2.28.0
gtk+-2.0 >= 2.24.0
], [
AC_MSG_RESULT([... GTK+ 2.x])
])
else
PKG_CHECK_MODULES(glib_gtk, [
glib-2.0 >= 2.28.0
gtk+-3.0 >= 3.0.0
], [
AC_MSG_RESULT([... GTK+ 3.x])
])
fi
CPPFLAGS="$CPPFLAGS $glib_gtk_CFLAGS"
LIBS="$LIBS $glib_gtk_LIBS"
WX_RELEASE=$($WX_CONFIG_WITH_ARGS --release)
if test "$WX_RELEASE" = "2.8"; then
LIBS="$LIBS -lX11"
fi
# Checks for header files.
AC_CHECK_HEADERS([boost/config.hpp], [], AC_MSG_ERROR([cannot find required header boost/config.hpp]))
AC_CHECK_HEADERS([boost/xpressive/xpressive_dynamic.hpp], [], AC_MSG_ERROR([cannot find required header boost/xpressive/xpressive_dynamic.hpp]))
AC_CHECK_HEADERS([boost/foreach.hpp], [], AC_MSG_ERROR([cannot find required header boost/foreach.hpp]))
AC_CHECK_HEADERS([unicode/uchar.h], [], AC_MSG_ERROR([cannot find required header unicode/uchar.h]))
AC_CHECK_HEADERS([unicode/unistr.h], [], AC_MSG_ERROR([cannot find required header unicode/unistr.h]))
AC_CHECK_HEADERS([wx/aui/aui.h], [], AC_MSG_ERROR([cannot find required header wx/aui/aui.h]))
# Checks for typedefs, structures, and compiler characteristics.
#AC_HEADER_STDBOOL
AC_C_CONST
AC_C_INLINE
AC_TYPE_SIZE_T
# Checks for library functions.
#AC_FUNC_MALLOC
#AC_HEADER_STDC
AC_CHECK_FUNCS([dup2])
AC_CONFIG_FILES([Makefile syntax/Makefile po/Makefile.in])
AC_OUTPUT