-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathconfigure.in
210 lines (171 loc) · 7.16 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
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
dnl Process this file with autoconf to produce a configure script.
AC_PREREQ(2.59)
AC_INIT(mdhome, 2.4.0, [email protected])
AC_CONFIG_HEADER(mdhomeconfig.h)
dnl ========================================================================
dnl needed for cross-compiling
AC_CANONICAL_SYSTEM
dnl ========================================================================
dnl Checks for programs.
AC_PROG_MAKE_SET
AC_PROG_CXX
AC_PROG_CC
AC_PROG_LIBTOOL
AM_INIT_AUTOMAKE(mdhome, 2.4.0)
dnl ========================================================================
dnl Checks for typedefs, structures, and compiler characteristics.
AC_C_CONST
dnl ========================================================================
dnl Checks for header files.
AC_HEADER_STDC
AC_HEADER_SYS_WAIT
AC_HEADER_TIME
AC_CHECK_HEADERS(sys/time.h unistd.h)
dnl ========================================================================
dnl check for libminigui
have_libminigui="no"
AC_CHECK_HEADERS(minigui/common.h, have_libminigui=yes, foo=bar)
dnl ========================================================================
dnl check for non-UNIX system
unix="yes"
AC_CHECK_DECLS(__NOUNIX__, unix="no", foo=bar)
dnl ========================================================================
dnl check for run-time mode of MiniGUI
dnl ========================================================================
threads_version="no"
AC_CHECK_DECLS(_MGRM_THREADS, threads_version="yes", foo=bar, [#include <minigui/common.h>])
custom_version="no"
AC_CHECK_DECLS(_MGIAL_CUSTOM, custom_version="yes", foo=bar, [#include <minigui/common.h>])
procs_version="no"
AC_CHECK_DECLS(_MGRM_PROCESSES, procs_version="yes", foo=bar, [#include <minigui/common.h>])
standalone_version="no"
AC_CHECK_DECLS(_MGRM_STANDALONE, standalone_version="yes", foo=bar, [#include <minigui/common.h>])
AC_ARG_WITH(lang,
[ --with-lang=[en/zhcn/zhtw]])
case "$with_lang" in
zhcn)
AC_DEFINE(_LANG_ZHCN, 1,
[Use text strings for locale zh_CN in GB2312])
;;
zhtw)
AC_DEFINE(_LANG_ZHTW, 1,
[Use text strings for locale zh_TW in BIG5])
;;
*)
AC_DEFINE(_LANG_EN, 1,
[Use text strings for locale en_US in ISO8859-1])
;;
esac
dnl ========================================================================
dnl Write Output
if test "$ac_cv_prog_gcc" = "yes"; then
CFLAGS="$CFLAGS -Wall -Wstrict-prototypes -pipe"
fi
AC_CHECK_DECLS(_MGLIB_SUFFIX, build_minigui_v3="yes", foo=bar, [[#include <minigui/common.h>]] )
AM_CONDITIONAL(MINIGUI_V3, test "x$build_minigui_v3" = "xyes")
dnl ========================================================================
dnl check for libmdolphin
have_libmdolphin="no"
AC_CHECK_HEADERS(mdolphin/mdconfig.h, have_libmdolphin=yes, foo=bar)
LIBS="$LIBS -lmdolphin"
if test "x$build_minigui_v3" = "xyes"; then
if test "x$threads_version" = "xyes"; then
if test "x$custom_version" = "xyes"; then
LIBS="$LIBS -lminigui_ths -lpthread"
else
LIBS="$LIBS -lminigui_ths -lpthread"
fi
else
if test "x$standalone_version" = "xyes"; then
CFLAGS="$CFLAGS -D_REENTRANT"
if test "x$custom_version" = "xyes"; then
LIBS="$LIBS -lminigui_sa"
else
LIBS="$LIBS -lminigui_sa"
fi
else
if test "x$custom_version" = "xyes"; then
LIBS="$LIBS -lminigui_procs"
else
LIBS="$LIBS -lminigui_procs"
fi
fi
lib_pthread="yes"
AC_CHECK_DECLS(_MGGAL_SHADOW, LIBS="$LIBS -lpthread", lib_pthread="no", [#include <minigui/common.h>])
if test "x$lib_pthread" = "xno"; then
AC_CHECK_DECLS(_MGGAL_MLSHADOW, LIBS="$LIBS -lpthread", no_pthread="no", [#include <minigui/common.h>])
fi
fi
else
if test "x$threads_version" = "xyes"; then
CFLAGS="$CFLAGS -D_REENTRANT"
LIBS="$LIBS -lpthread -lminigui"
else
LIBS="$LIBS -lminigui"
fi
fi
build_download="no"
AC_ARG_ENABLE(download,
[ --enable-download build download support <default=no>],
build_download=$enableval)
if test "x$build_download" = "xyes"; then
AC_DEFINE(ENABLE_DOWNLOAD, 1, [Define if download is supported.])
fi
if test "x$build_minigui_v3" = "xyes"; then
AC_CHECK_DECLS(_MGFONT_TTF, LIBS="$LIBS -lttf", foo=bar, [#include <minigui/common.h>])
AC_CHECK_DECLS(_MGFONT_FT2, LIBS="$LIBS -lfreetype", foo=bar, [#include <minigui/common.h>])
AC_CHECK_DECLS(_MGFONT_SEF, LIBS="$LIBS -lscripteasy", foo=bar, [#include <minigui/common.h>])
AC_CHECK_DECLS(_HAVE_MATH_LIB, LIBS="$LIBS -lm", foo=bar, [#include <minigui/common.h>])
AC_CHECK_DECLS(_MGIMAGE_PNG, LIBS="$LIBS -lpng", foo=bar, [#include <minigui/common.h>])
AC_CHECK_DECLS(_MGIMAGE_JPG, LIBS="$LIBS -ljpeg", foo=bar, [#include <minigui/common.h>])
AC_CHECK_DECLS(_MGIAL_TSLIB, LIBS="$LIBS -lts", foo=bar, [#include <minigui/common.h>])
AC_CHECK_DECLS(_MGIAL_DLCUSTOM, LIBS="$LIBS -ldl", foo=bar, [#include <minigui/common.h>])
else
AC_CHECK_DECLS(_HAVE_MATH_LIB, LIBS="$LIBS -lm", foo=bar, [#include <minigui/common.h>])
AC_CHECK_DECLS(_PNG_FILE_SUPPORT, LIBS="$LIBS -lpng", foo=bar, [#include <minigui/common.h>])
AC_CHECK_DECLS(_PNG_FILE_SUPPORT, LIBS="$LIBS -lpthread", foo=bar, [#include <minigui/common.h>])
AC_CHECK_DECLS(_JPG_FILE_SUPPORT, LIBS="$LIBS -ljpeg", foo=bar, [#include <minigui/common.h>])
AC_CHECK_DECLS(_TYPE1_SUPPORT, LIBS="$LIBS -lt1", foo=bar, [#include <minigui/common.h>])
AC_CHECK_DECLS(_TTF_SUPPORT, LIBS="$LIBS -lttf", foo=bar, [#include <minigui/common.h>])
AC_CHECK_DECLS(_FT2_SUPPORT, LIBS="$LIBS -lfreetype", foo=bar, [#include <minigui/common.h>])
fi
AM_CONDITIONAL(MGRM_PROCESSES, test "x$procs_version" = "xyes")
# add curl to build option
CFLAGS="$CFLAGS `curl-config --cflags`"
CXXFLAGS="$CXXFLAGS `curl-config --cflags`"
LIBS="$LIBS `curl-config --libs`"
# add xml2 to build option
#AC_CHECK_DECLS(ENABLE_XML, LIBS="$LIBS `xml2-config --libs`", foo=bar, [#include <mdolphin/mdconfig.h>])
# add xslt to build option
#AC_CHECK_DECLS(ENABLE_XSLT, LIBS="$LIBS `xslt-config --libs`", foo=bar, [#include <mdolphin/mdconfig.h>])
#if test "x$disable_download" = "xyes"; then
# AC_DEFINE(DISABLE_DOWNLOAD, 1, [Define if download is disabled.])
#fi
#AM_CONDITIONAL(MD_DISABLE_DOWNLOAD, test "x$disable_download" = "xyes")
CFLAGS="$CFLAGS -Wall -pipe"
CXXFLAGS="$CXXFLAGS -Wall -Wno-strict-aliasing -pipe"
LIBS="$LIBS -lpthread"
AC_OUTPUT(
Makefile
src/Makefile
src/mgi/Makefile
src/mgi/softkeyboard/Makefile
src/mgi/softkeyboard/softkeyboard/Makefile
src/mgi/softkeyboard/softkeyboard/240-320/Makefile
src/mgi/softkeyboard/softkeyboard/320-240/Makefile
src/mgi/softkeyboard/softkeyboard/480-272/Makefile
)
if test "x$have_libminigui" != "xyes"; then
AC_MSG_WARN([
MiniGUI is not properly installed on the system. You need
MiniGUI Ver 3.0.6 or later for building this package.
Please configure and install MiniGUI Ver 3.0.6 first.
])
fi
if test "x$have_libmdolphin" != "xyes"; then
AC_MSG_WARN([
MDolphin is not properly installed on the system. You need
MDolphin Ver 2.0.6 or later for building this package.
Please configure and install MDolphin Ver 2.0.6 first.
])
fi