@@ -7,7 +7,7 @@ dnl This program is distributed under the terms of the GPL v2.0
7
7
dnl Download the GNU Public License (GPL) from www.gnu.org
8
8
dnl
9
9
10
- AC_INIT ( [ smallbasic] , [ 0.11.16 ] )
10
+ AC_INIT ( [ smallbasic] , [ 0.11.17 ] )
11
11
AC_CONFIG_SRCDIR ( [ configure.ac] )
12
12
13
13
AC_CANONICAL_TARGET
@@ -55,13 +55,14 @@ function checkForWindows() {
55
55
*mingw* | pw32* | cygwin*)
56
56
win32="yes"
57
57
AC_CHECK_TOOL ( WINDRES , windres , : )
58
+ ;;
59
+ *darwin*)
60
+ ;;
61
+ *)
62
+ dnl backlinking support for modules
63
+ LDFLAGS="${LDFLAGS} -export-dynamic"
58
64
esac
59
65
AM_CONDITIONAL(WITH_WIN32, test x"$win32" = "xyes")
60
-
61
- dnl backlinking support for modules
62
- if test $win32 = no; then
63
- LDFLAGS="${LDFLAGS} -export-dynamic"
64
- fi
65
66
}
66
67
67
68
function checkDebugMode() {
@@ -138,7 +139,7 @@ function buildFLTK() {
138
139
PACKAGE_CFLAGS="${PACKAGE_CFLAGS} -D__USE_MINGW_ANSI_STDIO"
139
140
esac
140
141
141
- FLTK_CXXFLAGS="${PACKAGE_CFLAGS} `fltk2-config --cxxflags` -Wall -Wunused - fno-exceptions"
142
+ FLTK_CXXFLAGS="${PACKAGE_CFLAGS} `fltk2-config --cxxflags` -fno-exceptions"
142
143
PACKAGE_LIBS="${PACKAGE_LIBS} `fltk2-config --ldflags --use-images`"
143
144
144
145
dnl do not depend on cygwin.dll under cygwin build
@@ -163,17 +164,12 @@ function buildFLTK() {
163
164
dnl preconfigured values for FLTK build
164
165
AC_DEFINE ( _UnixOS , 1 , [ Building under Unix like systems.] )
165
166
AC_DEFINE ( _FLTK , 1 , [ Defined for FLTK build.] )
166
- AC_DEFINE ( USE_TERM_IO , 0 , [ Does not use terminal-io functions.] )
167
167
AC_DEFINE ( USE_CLIB , 1 , [ Implements clibmgr.] )
168
168
AC_DEFINE ( DEV_EVENTS_OSD , 1 , [ dev_events() implemented using osd_events().] )
169
- AC_DEFINE ( IMPL_IMAGE , 1 , [ Driver implements image commands] )
170
- AC_DEFINE ( IMPL_DEV_GETS , 1 , [ Driver implements dev_gets()] )
171
169
AC_DEFINE ( IMPL_DEV_DELAY , 1 , [ Driver implements dev_delay()] )
172
170
AC_DEFINE ( IMPL_DEV_ENV , 1 , [ Driver implements dev_env funcs] )
173
171
AC_DEFINE ( IMPL_LOG_WRITE , 1 , [ Driver implements lwrite()] )
174
172
AC_DEFINE ( OS_PREC64 , 1 , [ 64 bit variables] )
175
- AC_DEFINE ( DRV_BEEP , 1 , [ Use the driver based beep function] )
176
- AC_DEFINE ( IMPL_OSD_SOUND , 1 , [ Driver implements osd_sound()] )
177
173
178
174
BUILD_SUBDIRS="src/common src/platform/fltk"
179
175
AC_SUBST ( BUILD_SUBDIRS )
@@ -200,39 +196,47 @@ function buildSDL() {
200
196
AC_MSG_ERROR ( [ libfreetype6-dev not installed: configure failed.] )
201
197
fi
202
198
203
- AC_MSG_CHECKING ( for SDL_image )
204
- AC_COMPILE_IFELSE ( [ AC_LANG_PROGRAM ( [ [
205
- #include "SDL2/SDL_image.h"
206
- ] ] , [ [ ] ] ) ] ,
207
- [ AC_MSG_RESULT ( [ yes] ) ] ,
208
- [ AC_MSG_ERROR ( [ libsdl2-image-dev not installed: configure failed] ) ] )
199
+ case "${host_os}" in
200
+ *mingw* | cygwin*)
201
+ dnl avoid using MSCRT versions of printf for long double
202
+ PACKAGE_CFLAGS="${PACKAGE_CFLAGS} -D__USE_MINGW_ANSI_STDIO"
209
203
210
- # Check fontconfig configuration
211
- PKG_CHECK_MODULES(FONTCONFIG, fontconfig >= 2.2)
212
- AC_SUBST ( FONTCONFIG_CFLAGS )
213
- AC_SUBST ( FONTCONFIG_LIBS )
204
+ dnl do not depend on cygwin.dll under cygwin build
205
+ PACKAGE_CFLAGS="-I`cygpath -m /usr/local/include` ${PACKAGE_CFLAGS} -mms-bitfields"
206
+ PACKAGE_LIBS="-L`cygpath -m /usr/local/lib` ${PACKAGE_LIBS} -lwsock32 -static-libgcc -static-libstdc++"
207
+ AC_DEFINE ( _Win32 , 1 , [ Windows build] )
208
+ AC_DEFINE ( __addr_t_defined , 1 , [ Avoid conflict in cygwin/types.h] )
209
+ FONTCONFIG_CFLAGS=""
210
+ FONTCONFIG_LIBS=""
211
+ ;;
212
+
213
+ *)
214
+ # Unix - Check fontconfig configuration
215
+ PKG_CHECK_MODULES(FONTCONFIG, fontconfig >= 2.2)
216
+ AC_SUBST ( FONTCONFIG_CFLAGS )
217
+ AC_SUBST ( FONTCONFIG_LIBS )
218
+
219
+ dnl backlinking support for modules
220
+ PACKAGE_LIBS="${PACKAGE_LIBS} -ldl"
221
+ esac
214
222
215
223
PACKAGE_CFLAGS="${PACKAGE_CFLAGS} ${FONTCONFIG_CFLAGS} `sdl2-config --cflags` `freetype-config --cflags`"
216
- PACKAGE_LIBS="${PACKAGE_LIBS} ${FONTCONFIG_LIBS} `sdl2-config --libs` `freetype-config --libs` -ldl "
224
+ PACKAGE_LIBS="${PACKAGE_LIBS} ${FONTCONFIG_LIBS} `sdl2-config --libs` `freetype-config --libs`"
217
225
218
226
dnl preconfigured values for SDL build
219
227
AC_DEFINE ( _SDL , 1 , [ Defined when building SDL version] )
220
228
AC_DEFINE ( _UnixOS , 1 , [ Building under Unix like systems.] )
221
- AC_DEFINE ( USE_TERM_IO , 0 , [ Does not use terminal-io functions.] )
222
229
AC_DEFINE ( DEV_EVENTS_OSD , 1 , [ dev_events() implemented using osd_events().] )
223
- AC_DEFINE ( IMPL_DEV_GETS , 1 , [ Driver implements dev_gets()] )
224
230
AC_DEFINE ( IMPL_DEV_DELAY , 1 , [ Driver implements dev_delay()] )
225
231
AC_DEFINE ( IMPL_LOG_WRITE , 1 , [ Driver implements lwrite()] )
226
232
AC_DEFINE ( IMPL_DEV_READ , 1 , [ Implement dev_read()] )
227
- AC_DEFINE ( IMPL_OSD_SOUND , 1 , [ Driver implements osd_sound()] )
228
233
AC_DEFINE ( IMPL_LOG_WRITE , 1 , [ Driver implements lwrite()] )
229
- AC_DEFINE ( IMPL_IMAGE , 1 , [ Driver implements image commands] )
230
234
AC_DEFINE ( OS_PREC64 , 1 , [ 64 bit variables] )
231
- AC_DEFINE ( DRV_BEEP , 1 , [ Use the driver based beep function] )
232
235
233
236
BUILD_SUBDIRS="src/common src/platform/sdl"
234
237
AC_SUBST ( BUILD_SUBDIRS )
235
238
(cd ide/android/assets && xxd -i main.bas > ../../../src/platform/sdl/main_bas.h)
239
+ (cd ide/android/res/drawable-hdpi && xxd -i ic_launcher.png > ../../../../src/platform/sdl/icon.h)
236
240
}
237
241
238
242
function buildTizen() {
@@ -243,16 +247,10 @@ function buildTizen() {
243
247
AC_DEFINE ( _UnixOS , 1 , [ Building under Unix like systems.] )
244
248
AC_DEFINE ( _TIZEN , 1 , [ Defined for Tizen build.] )
245
249
AC_DEFINE ( IMPL_DEV_READ , 1 , [ Implement dev_read()] )
246
- AC_DEFINE ( HAVE_SEARCH_H , 1 , [ Found GNU search.h] )
247
- AC_DEFINE ( HAVE_TDESTROY , 1 , [ Found GNU search.h] )
248
250
AC_DEFINE ( DEV_EVENTS_OSD , 1 , [ dev_events() implemented using osd_events().] )
249
- AC_DEFINE ( IMPL_DEV_GETS , 1 , [ Driver implements dev_gets()] )
250
251
AC_DEFINE ( IMPL_DEV_DELAY , 1 , [ Driver implements dev_delay()] )
251
- AC_DEFINE ( IMPL_IMAGE , 1 , [ Driver implements image commands] )
252
- AC_DEFINE ( HAVE_MALLOC_USABLE_SIZE , 0 , [ Newlib version causes mosync stack panic] )
253
252
AC_DEFINE ( CPU_BIGENDIAN , 1 , [ Tizen uses big-endian] )
254
253
AC_DEFINE ( IMPL_LOG_WRITE , 1 , [ Driver implements lwrite()] )
255
- AC_DEFINE ( USE_TERM_IO , 0 , [ Does not use terminal-io functions.] )
256
254
257
255
BUILD_SUBDIRS="src/platform/tizen/common"
258
256
AC_SUBST ( BUILD_SUBDIRS )
@@ -265,15 +263,11 @@ function buildAndroid() {
265
263
266
264
AC_DEFINE ( _UnixOS , 1 , [ Building under Unix like systems.] )
267
265
AC_DEFINE ( _ANDROID , 1 , [ Defined for Android build.] )
268
- AC_DEFINE ( IMPL_DEV_READ , 1 , [ Implement dev_read()] )
269
266
AC_DEFINE ( DEV_EVENTS_OSD , 1 , [ dev_events() implemented using osd_events().] )
270
- AC_DEFINE ( IMPL_DEV_GETS , 1 , [ Driver implements dev_gets ()] )
267
+ AC_DEFINE ( IMPL_DEV_READ , 1 , [ Implement dev_read ()] )
271
268
AC_DEFINE ( IMPL_DEV_DELAY , 1 , [ Driver implements dev_delay()] )
272
- AC_DEFINE ( IMPL_IMAGE , 1 , [ Driver implements image commands] )
273
- AC_DEFINE ( HAVE_MALLOC_USABLE_SIZE , 0 , [ Newlib version causes mosync stack panic] )
274
- AC_DEFINE ( CPU_BIGENDIAN , 1 , [ Android uses big-endian] )
275
269
AC_DEFINE ( IMPL_LOG_WRITE , 1 , [ Driver implements lwrite()] )
276
- AC_DEFINE ( USE_TERM_IO , 0 , [ Does not use terminal-io functions. ] )
270
+ AC_DEFINE ( CPU_BIGENDIAN , 1 , [ Android uses big-endian ] )
277
271
278
272
BUILD_SUBDIRS="src/platform/android"
279
273
AC_SUBST ( BUILD_SUBDIRS )
@@ -290,6 +284,7 @@ function buildConsole() {
290
284
esac
291
285
292
286
AM_CONDITIONAL(WITH_CYGWIN_CONSOLE, test $win32 = yes)
287
+ AC_DEFINE ( BUILD_CONSOLE , 1 , [ Building a console based system.] )
293
288
294
289
if test $win32 = yes; then
295
290
dnl test whether to build using mingw
@@ -305,39 +300,32 @@ function buildConsole() {
305
300
if test x$have_cygwin = xyes; then
306
301
dnl preconfigured values for cygwin console build (depends on cygwin.dll)
307
302
TARGET="Building Cygwin console version."
308
- AC_CHECK_HEADER ( ncurses/termcap.h , [ ] , [ AC_MSG_ERROR ( "install libncurses-dev" ) ] )
309
303
AC_DEFINE ( _UnixOS , 1 , [ Building under Unix like systems.] )
310
- AC_DEFINE ( USE_TERM_IO , 1 , [ Uses terminal-io functions.] )
311
304
AC_DEFINE ( DEV_EVENTS_OSD , 0 , [ dev_events() implemented using osd_events().] )
312
305
AC_DEFINE ( _CygWin , 1 , [ Building a minimal dev_null based command-line version.] )
313
306
AC_DEFINE ( __CYGWIN__ , 1 , [ as above] )
314
307
AC_DEFINE ( OS_PREC64 , 1 , [ 64 bit variables] )
315
308
AC_DEFINE ( INET_UNSUP , 1 , [ inet not supported.] )
316
- PACKAGE_LIBS="${PACKAGE_LIBS} -lm -lgcc -lncurses "
317
- BUILD_SUBDIRS="src/common src/platform/cygwin "
309
+ PACKAGE_LIBS="${PACKAGE_LIBS} -lm -lgcc"
310
+ BUILD_SUBDIRS="src/common src/platform/unix "
318
311
else
319
312
dnl preconfigured values for cygwin mingw console build
320
313
TARGET="Building Cygwin MinGW console version."
321
314
AC_DEFINE ( __MINGW32__ , 1 , [ as above] )
322
315
AC_DEFINE ( _UnixOS , 1 , [ Building under Unix like systems.] )
323
- AC_DEFINE ( USE_TERM_IO , 0 , [ Does not use terminal-io functions.] )
324
- AC_DEFINE ( IMPL_EMPTY_TERM_EVENTS , 1 , [ Implement a dummy term_events()] )
325
- PACKAGE_LIBS="${PACKAGE_LIBS} -mconsole -lmingw32"
326
- BUILD_SUBDIRS="src/common src/platform/mingw"
316
+ PACKAGE_LIBS="${PACKAGE_LIBS} -mconsole -lmingw32 -lwsock32"
317
+ BUILD_SUBDIRS="src/common src/platform/unix"
327
318
fi
328
319
AC_DEFINE ( _Win32 , 1 , [ Windows build] )
329
320
AC_DEFINE ( __addr_t_defined , 1 , [ Avoid conflict in cygwin/types.h] )
330
321
else
331
322
dnl preconfigured values for unix console build
332
323
TARGET="Building Unix console version."
333
324
AC_DEFINE ( _UnixOS , 1 , [ Building under Unix like systems.] )
334
- AC_DEFINE ( USE_TERM_IO , 1 , [ Uses terminal-io functions.] )
325
+ AC_DEFINE ( USE_TERM_IO , 0 , [ Uses terminal-io functions.] )
335
326
AC_DEFINE ( DEV_EVENTS_OSD , 0 , [ dev_events() implemented using osd_events().] )
336
- AC_DEFINE ( DRV_SOUND , 1 , [ Driver implements functions in drvsound.h] )
337
- AC_DEFINE ( UNIX_MEMMGR , 1 , [ Unix memory manager] )
338
327
AC_DEFINE ( OS_PREC64 , 1 , [ 64 bit variables] )
339
- AC_CHECK_HEADER ( readline/readline.h , [ ] , [ AC_MSG_ERROR ( "install libreadline-dev" ) ] )
340
- PACKAGE_LIBS="${PACKAGE_LIBS} -lm -ldl -lpthread -lncurses -lreadline"
328
+ PACKAGE_LIBS="${PACKAGE_LIBS} -lm -ldl -lpthread"
341
329
BUILD_SUBDIRS="src/common src/platform/unix"
342
330
TEST_DIR="src/platform/unix"
343
331
AC_SUBST ( TEST_DIR )
@@ -352,17 +340,10 @@ function buildDist() {
352
340
BUILD_SUBDIRS="src/common src/platform/gtk/src src/platform/gtk/data src/platform/gtk/icons"
353
341
BUILD_SUBDIRS="${BUILD_SUBDIRS} src/platform/fltk"
354
342
BUILD_SUBDIRS="${BUILD_SUBDIRS} src/platform/sdl"
355
- BUILD_SUBDIRS="${BUILD_SUBDIRS} src/platform/cygwin"
356
343
BUILD_SUBDIRS="${BUILD_SUBDIRS} src/platform/unix"
357
- BUILD_SUBDIRS="${BUILD_SUBDIRS} src/platform/mingw"
358
344
AC_SUBST ( BUILD_SUBDIRS )
359
345
}
360
346
361
- OS_NAME=`uname -a`
362
-
363
- AC_DEFINE_UNQUOTED ( OS_NAME , "${OS_NAME}" , [ SB system variable] )
364
- AC_DEFINE ( HAVE_C_MALLOC , 1 , [ allocate memory with regular malloc calls] )
365
-
366
347
if test x$ac_build_dist = xyes; then
367
348
buildDist
368
349
elif test x$ac_build_fltk = xyes; then
@@ -381,6 +362,8 @@ checkPCRE
381
362
checkDebugMode
382
363
checkForWindows
383
364
365
+ PACKAGE_CFLAGS="${PACKAGE_CFLAGS} -Wall -Wno-unused-result"
366
+
384
367
AC_SUBST ( PACKAGE_CFLAGS )
385
368
AC_SUBST ( PACKAGE_LIBS )
386
369
@@ -389,8 +372,6 @@ Makefile
389
372
src/common/Makefile
390
373
src/platform/fltk/Makefile
391
374
src/platform/sdl/Makefile
392
- src/platform/cygwin/Makefile
393
- src/platform/mingw/Makefile
394
375
src/platform/unix/Makefile
395
376
src/platform/tizen/common/Makefile
396
377
src/platform/android/Makefile
0 commit comments