Skip to content

Commit 1b13303

Browse files
committed
Merge pull request #11 from chrisws/android
Android version 0.11.8 + SDL update
2 parents d37914f + 2d2dc08 commit 1b13303

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

70 files changed

+1979
-1357
lines changed

ChangeLog

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
2014-07-07
2+
Update SDL to use SDL2 and common widget
3+
14
2014-06-14
25
Fix crash evaluating "a \\ b"
36
Fix INPUT command in FLTK for scrolled display
@@ -32,7 +35,7 @@
3235
for PalmOS to appear correctly on modern mobile screen resolutions.
3336

3437
2012-12-09
35-
Released 0.11.1 android version to google play
38+
Released 0.11.2 android version to google play
3639
Added the ability to change the font size
3740

3841
2012-12-01

configure.ac

Lines changed: 36 additions & 71 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
dnl
22
dnl Configure script for SmallBASIC
33
dnl
4-
dnl Copyright(C) 2001-2012 Chris Warren-Smith.
4+
dnl Copyright(C) 2001-2014 Chris Warren-Smith.
55
dnl
66
dnl This program is distributed under the terms of the GPL v2.0
77
dnl Download the GNU Public License (GPL) from www.gnu.org
88
dnl
99

10-
AC_INIT([smallbasic], [0.11.6])
10+
AC_INIT([smallbasic], [0.11.8])
1111
AC_CONFIG_SRCDIR([configure.ac])
1212

1313
AC_CANONICAL_TARGET
@@ -347,94 +347,58 @@ function buildSDL() {
347347
TARGET="Building SDL version."
348348
defaultConditionals
349349

350-
dnl The following code was taken from the SDL test/configure.ac
351-
dnl Figure out which math library to use
352-
MATHLIB=""
353-
SYS_GL_LIBS=""
354-
355-
case "$host" in
356-
*-*-cygwin* | *-*-mingw32*)
357-
SYS_GL_LIBS="-lopengl32"
358-
PACKAGE_CFLAGS="${PACKAGE_CFLAGS} -mms-bitfields -mno-cygwin"
359-
PACKAGE_LIBS="${PACKAGE_LIBS} -lwsock32"
360-
;;
361-
*)
362-
MATHLIB="-lm"
363-
SYS_GL_LIBS="-lGL"
364-
;;
365-
esac
366-
367-
PACKAGE_CFLAGS="${PACKAGE_CFLAGS} `sdl-config --cflags`"
368-
PACKAGE_LIBS="${PACKAGE_LIBS} `sdl-config --libs` ${MATHLIB}"
350+
AC_CHECK_PROG(have_sdl, sdl2-config, [yes], [no])
351+
if test "${have_sdl}" = "no" ; then
352+
AC_MSG_ERROR([libsdl2-dev not installed: configure failed.])
353+
fi
369354

370-
dnl Check for OpenGL
371-
AC_MSG_CHECKING(for OpenGL support)
372-
have_opengl=no
373-
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
374-
#include "SDL/SDL_opengl.h"
375-
]], [[
376-
]])],[
377-
have_opengl=yes
378-
],[])
379-
AC_MSG_RESULT($have_opengl)
380-
if test x$have_opengl = xyes; then
381-
PACKAGE_CFLAGS="${PACKAGE_CFLAGS} -DHAVE_OPENGL "
382-
PACKAGE_LIBS="${PACKAGE_LIBS} ${SYS_GL_LIBS}"
355+
AC_CHECK_PROG(have_freetype2, freetype-config, [yes], [no])
356+
if test "${have_freetype2}" = "no" ; then
357+
AC_MSG_ERROR([libfreetype6-dev not installed: configure failed.])
383358
fi
384359

385-
dnl Check for SDL_Image
386-
AC_MSG_CHECKING(for SDL_Image support)
387-
have_sdl_image=no
360+
AC_MSG_CHECKING(for SDL_image)
388361
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
389-
#include "SDL/SDL_image.h"
390-
]], [[
391-
]])],[
392-
have_sdl_image=yes
393-
],[])
394-
AC_MSG_RESULT($have_sdl_image)
395-
if test x$have_sdl_image = xyes; then
396-
AC_DEFINE(HAVE_SDL_IMAGE, 1, [SDL Image header is present.])
397-
AC_DEFINE(IMPL_IMAGE, 1, [Driver implements image commands])
398-
PACKAGE_LIBS="${PACKAGE_LIBS} -lSDL_image"
399-
fi
362+
#include "SDL2/SDL_image.h"
363+
]], [[]])],
364+
[AC_MSG_RESULT([yes])],
365+
[AC_MSG_ERROR([libsdl2-image-dev not installed: configure failed])])
400366

401-
dnl Check for guichan.hpp
402-
dnl see http://guichan.sourceforge.net/wiki/index.php"
403-
AC_MSG_CHECKING(for guichan forms support)
404-
have_guichan="maybe"
405-
AC_LANG_PUSH(C++)
406-
AC_CHECK_HEADER(guichan.hpp, [have_guichan="yes"], [have_guichan="no"])
407-
AC_LANG_POP(C++)
408-
AC_MSG_RESULT($have_guichan)
409-
if test x$have_guichan = xyes && test x$have_sdl_image = xyes; then
410-
dnl need SDL_Image as well
411-
AC_DEFINE(IMPL_UI, 1, [Guichan forms support found])
412-
PACKAGE_CFLAGS="${PACKAGE_CFLAGS} -DGUICHAN_BUILD -I/usr/local/include"
413-
PACKAGE_LIBS="-lguichan_sdl -lguichan ${PACKAGE_LIBS}"
414-
fi
367+
# Check fontconfig configuration
368+
PKG_CHECK_MODULES(FONTCONFIG, fontconfig >= 2.2)
369+
AC_SUBST(FONTCONFIG_CFLAGS)
370+
AC_SUBST(FONTCONFIG_LIBS)
371+
372+
PACKAGE_CFLAGS="${PACKAGE_CFLAGS} ${FONTCONFIG_CFLAGS} `sdl2-config --cflags` `freetype-config --cflags`"
373+
PACKAGE_LIBS="${PACKAGE_LIBS} ${FONTCONFIG_LIBS} `sdl2-config --libs` `freetype-config --libs` -ldl"
415374

416375
dnl preconfigured values for SDL build
417-
AC_DEFINE(KBHIT_PWR_CONSERVE, 1, [Conserve power in dev_kbhit()])
376+
AC_DEFINE(_SDL, 1, [Defined when building SDL version])
418377
AC_DEFINE(_UnixOS, 1, [Building under Unix like systems.])
419378
AC_DEFINE(USE_TERM_IO, 0, [Does not use terminal-io functions.])
420379
AC_DEFINE(DEV_EVENTS_OSD, 1, [dev_events() implemented using osd_events().])
421-
AC_DEFINE(_SDL, 1, [Defined when building SDL version])
380+
AC_DEFINE(IMPL_DEV_GETS, 1, [Driver implements dev_gets()])
381+
AC_DEFINE(IMPL_DEV_DELAY, 1, [Driver implements dev_delay()])
382+
AC_DEFINE(IMPL_LOG_WRITE, 1, [Driver implements lwrite()])
383+
AC_DEFINE(IMPL_DEV_READ, 1, [Implement dev_read()])
384+
AC_DEFINE(IMPL_OSD_SOUND, 1, [Driver implements osd_sound()])
385+
AC_DEFINE(IMPL_LOG_WRITE, 1, [Driver implements lwrite()])
386+
AC_DEFINE(NO_SCAN_ERROR_PROMPT, 1, [No prompt for detailed scan report])
387+
AC_DEFINE(OS_PREC64, 1, [64 bit variables])
388+
AC_DEFINE(DRV_BEEP, 1, [Use the driver based beep function])
422389

423390
BUILD_SUBDIRS="src/common src/platform/sdl"
424391
AC_SUBST(BUILD_SUBDIRS)
392+
(cd ide/android/assets && xxd -i main.bas > ../../../src/platform/sdl/main_bas.h)
425393
}
426394

427395
function buildQT() {
428396
TARGET="Building QT version."
429397

430398
dnl Checks for qmake
431399
AC_CHECK_PROG(have_qt, qmake, [yes], [no])
432-
433-
if test "${HAVE_API_VERSION}" = "no" ; then
434-
AC_MSG_ERROR([
435-
You need QT version 4.*
436-
configure failed.
437-
])
400+
if test "${have_qt}" = "no" ; then
401+
AC_MSG_ERROR([You need QT version 4.* configure failed.])
438402
fi
439403

440404
dnl avoid using MSCRT versions of printf for long double
@@ -494,6 +458,7 @@ function buildMosync() {
494458
AC_DEFINE(IMPL_LOG_WRITE, 1, [Driver implements lwrite()])
495459
AC_DEFINE(NONSTANDARD_PORT, 1, [sys.h should include portdefs.h])
496460
AC_DEFINE(USE_TERM_IO, 0, [Does not use terminal-io functions.])
461+
AC_DEFINE(_MOSYNC, 1, [Defined for Mosync build.])
497462

498463
dnl Checks for mosync
499464
AC_CHECK_PROG(have_mosync, pipe-tool, [yes], [no])
@@ -558,7 +523,7 @@ function buildAndroid() {
558523
AC_DEFINE(IMPL_DEV_DELAY, 1, [Driver implements dev_delay()])
559524
AC_DEFINE(IMPL_IMAGE, 1, [Driver implements image commands])
560525
AC_DEFINE(HAVE_MALLOC_USABLE_SIZE, 0, [Newlib version causes mosync stack panic])
561-
AC_DEFINE(CPU_BIGENDIAN, 1, [Tizen uses big-endian])
526+
AC_DEFINE(CPU_BIGENDIAN, 1, [Android uses big-endian])
562527
AC_DEFINE(NO_SCAN_ERROR_PROMPT, 1, [No prompt for detailed scan report])
563528
AC_DEFINE(IMPL_LOG_WRITE, 1, [Driver implements lwrite()])
564529
AC_DEFINE(USE_TERM_IO, 0, [Does not use terminal-io functions.])

ide/android/AndroidManifest.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
33
package="net.sourceforge.smallbasic"
44
android:installLocation="preferExternal"
5-
android:versionCode="6"
6-
android:versionName="0.11.6">
5+
android:versionCode="10"
6+
android:versionName="0.11.8">
77
<!-- This is the platform API where NativeActivity was introduced. -->
88
<uses-sdk android:minSdkVersion="9" />
99

ide/android/assets/main.bas

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ sub about()
3030
print "(_ ._ _ _.|||_) /\ (_ |/ "
3131
print "__)| | |(_||||_)/--\__)|\_"
3232
print
33-
print "Version 0.11.6"
33+
print "Version 0.11.8"
3434
print
3535
print "Copyright (c) 2002-2014 Chris Warren-Smith"
3636
print "Copyright (c) 2000-2006 Nic Christopoulos" + chr(10)
@@ -56,7 +56,7 @@ sub setup()
5656
print boldOn + "Setup web service port number."
5757
print boldOff
5858
print "Enter a port number to allow web browser or desktop IDE access. ";
59-
print "Enter -1 to diable this feature, or press <enter> to leave ";
59+
print "Enter -1 to disable this feature, or press <enter> to leave ";
6060
print "this screen without making any changes."
6161
print "The current setting is: " + env("serverSocket")
6262
print

src/common/bc.h

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ typedef struct {
4343
* @param fmt the printf's format
4444
* @param ... format's parameters
4545
*/
46-
void sc_raise(const char *fmt, ...) SEC(BCSCAN);
46+
void sc_raise(const char *fmt, ...);
4747

4848
/**
4949
* @ingroup scan
@@ -52,7 +52,7 @@ void sc_raise(const char *fmt, ...) SEC(BCSCAN);
5252
*
5353
* @param bc the bc structure
5454
*/
55-
void bc_create(bc_t * bc) SEC(BCSCAN);
55+
void bc_create(bc_t * bc);
5656

5757
/**
5858
* @ingroup scan
@@ -61,7 +61,7 @@ void bc_create(bc_t * bc) SEC(BCSCAN);
6161
*
6262
* @param bc the bc structure
6363
*/
64-
void bc_destroy(bc_t * bc) SEC(BCSCAN);
64+
void bc_destroy(bc_t * bc);
6565

6666
/**
6767
* @ingroup scan
@@ -71,7 +71,7 @@ void bc_destroy(bc_t * bc) SEC(BCSCAN);
7171
* @param bc the bc structure
7272
* @param newsize the new size
7373
*/
74-
void bc_resize(bc_t * bc, dword newsize) SEC(BCSCAN);
74+
void bc_resize(bc_t * bc, dword newsize);
7575

7676
/**
7777
* @ingroup scan
@@ -81,7 +81,7 @@ void bc_resize(bc_t * bc, dword newsize) SEC(BCSCAN);
8181
* @param bc the bc structure
8282
* @param code the byte
8383
*/
84-
void bc_add1(bc_t * bc, byte code) SEC(BCSCAN);
84+
void bc_add1(bc_t * bc, byte code);
8585

8686
/**
8787
* @ingroup scan
@@ -91,7 +91,7 @@ void bc_add1(bc_t * bc, byte code) SEC(BCSCAN);
9191
* @param bc the bc structure
9292
* @param code the byte
9393
*/
94-
void bc_store1(bc_t * bc, addr_t offset, byte code) SEC(BCSCAN);
94+
void bc_store1(bc_t * bc, addr_t offset, byte code);
9595

9696
/**
9797
* @ingroup scan
@@ -101,7 +101,7 @@ void bc_store1(bc_t * bc, addr_t offset, byte code) SEC(BCSCAN);
101101
* @param bc the bc structure
102102
* @param code the word
103103
*/
104-
void bc_add_word(bc_t * bc, word code) SEC(BCSCAN);
104+
void bc_add_word(bc_t * bc, word code);
105105

106106
/**
107107
* @ingroup scan
@@ -111,7 +111,7 @@ void bc_add_word(bc_t * bc, word code) SEC(BCSCAN);
111111
* @param bc the bc structure
112112
* @param code the dword
113113
*/
114-
void bc_add_dword(bc_t * bc, dword code) SEC(BCSCAN);
114+
void bc_add_dword(bc_t * bc, dword code);
115115

116116
/**
117117
* @ingroup scan
@@ -122,7 +122,7 @@ void bc_add_dword(bc_t * bc, dword code) SEC(BCSCAN);
122122
* @param str the raw-string. the string must starts with \". the string must also contains the ending \".
123123
* @return a pointer of src to the next character after the second \"
124124
*/
125-
char *bc_store_string(bc_t * bc, char *src) SEC(BCSCAN);
125+
char *bc_store_string(bc_t * bc, char *src);
126126

127127
/**
128128
* @ingroup scan
@@ -133,7 +133,7 @@ char *bc_store_string(bc_t * bc, char *src) SEC(BCSCAN);
133133
* @param str the raw-string. the string must starts with `. the string must also contains the ending `.
134134
* @return a pointer of src to the next character after the second `
135135
*/
136-
char *bc_store_macro(bc_t * bc, char *src) SEC(BCSCAN);
136+
char *bc_store_macro(bc_t * bc, char *src);
137137

138138
/**
139139
* @ingroup scan
@@ -142,7 +142,7 @@ char *bc_store_macro(bc_t * bc, char *src) SEC(BCSCAN);
142142
*
143143
* @param bc the bc structure
144144
*/
145-
void bc_eoc(bc_t * bc) SEC(BCSCAN);
145+
void bc_eoc(bc_t * bc);
146146

147147
/**
148148
* @ingroup scan
@@ -152,7 +152,7 @@ void bc_eoc(bc_t * bc) SEC(BCSCAN);
152152
* @param dest the destination
153153
* @param src the code to be appended to dest
154154
*/
155-
void bc_append(bc_t * dest, bc_t * src) SEC(BCSCAN);
155+
void bc_append(bc_t * dest, bc_t * src);
156156

157157
/**
158158
* @ingroup scan
@@ -163,7 +163,7 @@ void bc_append(bc_t * dest, bc_t * src) SEC(BCSCAN);
163163
* @param src the code to be appended to dest
164164
* @param n the size of the src to be copied
165165
*/
166-
void bc_add_n(bc_t * dest, byte * src, dword n) SEC(BCSCAN);
166+
void bc_add_n(bc_t * dest, byte * src, dword n);
167167

168168
/**
169169
* @ingroup scan
@@ -179,7 +179,7 @@ void bc_add_n(bc_t * dest, byte * src, dword n) SEC(BCSCAN);
179179
* @param dest the bc segment
180180
* @param idx the index of the function
181181
*/
182-
void bc_add_fcode(bc_t * dest, long idx) SEC(BCSCAN);
182+
void bc_add_fcode(bc_t * dest, long idx);
183183

184184
/**
185185
* @ingroup scan
@@ -189,7 +189,7 @@ void bc_add_fcode(bc_t * dest, long idx) SEC(BCSCAN);
189189
* @param dest the bc segment
190190
* @param idx the index of the procedure
191191
*/
192-
void bc_add_pcode(bc_t * dest, long idx) SEC(BCSCAN);
192+
void bc_add_pcode(bc_t * dest, long idx);
193193

194194
/**
195195
* @ingroup scan
@@ -200,7 +200,7 @@ void bc_add_pcode(bc_t * dest, long idx) SEC(BCSCAN);
200200
* @param lib the index of the library
201201
* @param idx the index of the function
202202
*/
203-
void bc_add_extfcode(bc_t * dest, int lib, long idx) SEC(BCSCAN);
203+
void bc_add_extfcode(bc_t * dest, int lib, long idx);
204204

205205
/**
206206
* @ingroup scan
@@ -211,7 +211,7 @@ void bc_add_extfcode(bc_t * dest, int lib, long idx) SEC(BCSCAN);
211211
* @param lib the index of the library
212212
* @param idx the index of the procedure
213213
*/
214-
void bc_add_extpcode(bc_t * dest, int lib, long idx) SEC(BCSCAN);
214+
void bc_add_extpcode(bc_t * dest, int lib, long idx);
215215

216216
/**
217217
* @ingroup scan
@@ -221,7 +221,7 @@ void bc_add_extpcode(bc_t * dest, int lib, long idx) SEC(BCSCAN);
221221
* @param bc the bc segment
222222
* @param idx the address
223223
*/
224-
void bc_add_addr(bc_t * bc, addr_t idx) SEC(BCSCAN);
224+
void bc_add_addr(bc_t * bc, addr_t idx);
225225

226226
/**
227227
* @ingroup scan
@@ -233,7 +233,7 @@ void bc_add_addr(bc_t * bc, addr_t idx) SEC(BCSCAN);
233233
* @param true_ip the jump-address when on true
234234
* @param false_ip the jump-address when on false
235235
*/
236-
void bc_add_ctrl(bc_t * bc, code_t code, addr_t true_ip, addr_t false_ip) SEC(BCSCAN);
236+
void bc_add_ctrl(bc_t * bc, code_t code, addr_t true_ip, addr_t false_ip);
237237

238238
/**
239239
* @ingroup scan
@@ -243,7 +243,7 @@ void bc_add_ctrl(bc_t * bc, code_t code, addr_t true_ip, addr_t false_ip) SEC(BC
243243
* @param bc the bc segment
244244
* @param v the number
245245
*/
246-
void bc_add_creal(bc_t * bc, var_num_t v) SEC(BCSCAN);
246+
void bc_add_creal(bc_t * bc, var_num_t v);
247247

248248
/**
249249
* @ingroup scan
@@ -253,6 +253,6 @@ void bc_add_creal(bc_t * bc, var_num_t v) SEC(BCSCAN);
253253
* @param bc the bc segment
254254
* @param v the number
255255
*/
256-
void bc_add_cint(bc_t * bc, var_int_t v) SEC(BCSCAN);
256+
void bc_add_cint(bc_t * bc, var_int_t v);
257257

258258
#endif

0 commit comments

Comments
 (0)