Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
2014-08-22
Fix HASH var crash
Fix HASH var handling of mixed types
Fix illegal UDS field variable names
Unitfy HASH and UDS

2014-08-15
Improved runtime performance
Fixed memory leak with UDS variables
Fixed FUNC call with parenthesis

2014-08-14
Added SHOWPAGE. code cleanup

2014-08-11
Cleanup system var handling, removed os_ver

Expand Down
200 changes: 5 additions & 195 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,6 @@ PKG_PROG_PKG_CONFIG
TARGET=""

dnl define build arguments
AC_ARG_ENABLE(gtk,
AS_HELP_STRING([--enable-gtk],[build gtk version(default=no)]),
[ac_build_gtk="yes"],
[ac_build_gtk="no"])

AC_ARG_ENABLE(fltk,
AS_HELP_STRING([--enable-fltk],[build fltk version(default=no)]),
[ac_build_fltk="yes"],
Expand All @@ -39,11 +34,6 @@ AC_ARG_ENABLE(sdl,
[ac_build_sdl="yes"],
[ac_build_sdl="no"])

AC_ARG_ENABLE(qt,
AS_HELP_STRING([--enable-qt],[build QT version(default=no)]),
[ac_build_qt="yes"],
[ac_build_qt="no"])

AC_ARG_ENABLE(mosync,
AS_HELP_STRING([--enable-mosync],[build common library for Mosync(default=no)]),
[ac_build_mosync="yes"],
Expand Down Expand Up @@ -91,9 +81,6 @@ function checkDebugMode() {
CFLAGS="${CFLAGS} -g -O0"
CXXFLAGS="${CXXFLAGS} -g -O0"
AC_DEFINE(_DEBUG, 1, [debugging build enabled])
else
CFLAGS="${CFLAGS} -O3 -Os"
CXXFLAGS="${CXXFLAGS} -O3 -Os"
fi
AC_SUBST(CFLAGS)
}
Expand Down Expand Up @@ -124,135 +111,9 @@ function checkPCRE() {
}

function defaultConditionals() {
AM_CONDITIONAL(WITH_HILDON, false)
AM_CONDITIONAL(WITH_CYGWIN_CONSOLE, false)
}

function checkHILDON() {
# copied from
# https://stage.maemo.org/svn/maemo/projects/tools/branches/maemopad/chinook/configure.ac

# Hildon library dependsncies
PKG_CHECK_MODULES(HILDON, hildon-1 hildon-fm-2 hildon-help conbtdialogs)
AC_SUBST(HILDON_LIBS)
AC_SUBST(HILDON_CFLAGS)

# Only used for the .service file path
PKG_CHECK_MODULES(DBUS, dbus-glib-1 >= 0.60)

# OSSO application framework dependencies
PKG_CHECK_MODULES(OSSO, osso-af-settings >= 0.8.5 libosso >= 0.9.17
gnome-vfs-2.0 >= 2.8.4.11 gnome-vfs-module-2.0 >= 2.8.4.11)
AC_SUBST(OSSO_LIBS)
AC_SUBST(OSSO_CFLAGS)

# To make application visible in maemo Task Navigator it needs a Desktop
# file for the application.
# D-BUS service file is needed to be able to launch the maemo application
# and connect it to D-BUS services.
# The following line defines install directories for these files.
desktopentrydir=`$PKG_CONFIG osso-af-settings --variable=desktopentrydir`
serviceentrydir=`$PKG_CONFIG osso-af-settings --variable=dbusservicedir`

# Application locale install directory
localedir=`$PKG_CONFIG osso-af-settings --variable=localedir`

# Application pixmaps install directory
pixmapdir=`$PKG_CONFIG osso-af-settings --variable=hildonpixmapdir`

# Application icon install directories
icon_26x26dir=$datadir/icons/hicolor/26x26/hildon
icon_34x34dir=$datadir/icons/hicolor/34x34/hildon
icon_40x40dir=$datadir/icons/hicolor/40x40/hildon
icon_50x50dir=$datadir/icons/hicolor/50x50/hildon
icon_scalabledir=$datadir/icons/hicolor/scalable/hildon

# Hildon control panel plugin install directories
pluginlibdir=`$PKG_CONFIG hildon-control-panel --variable=plugindir`
plugindesktopentrydir=`$PKG_CONFIG hildon-control-panel --variable=plugindesktopentrydir`

# Define as variables in Makefiles
AC_SUBST(desktopentrydir)
AC_SUBST(serviceentrydir)
AC_SUBST(localedir)
AC_SUBST(pixmapdir)
AC_SUBST(icon_26x26dir)
AC_SUBST(icon_34x34dir)
AC_SUBST(icon_40x40dir)
AC_SUBST(icon_50x50dir)
AC_SUBST(icon_scalabledir)
AC_SUBST(pluginlibdir)
AC_SUBST(plugindesktopentrydir)

AC_DEFINE_UNQUOTED([LOCALEDIR], "${localedir}", [Runtime locale catalog files path])
AC_DEFINE_UNQUOTED([PIXMAPDIR], "${pixmapdir}", [Runtime pixmap files path])

PACKAGE_CFLAGS="${PACKAGE_CFLAGS} ${HILDON_CFLAGS} ${OSSO_CFLAGS}"
PACKAGE_LIBS="${PACKAGE_LIBS} ${HILDON_LIBS} ${OSSO_LIBS}"
ln -s src/gtk/debian
}

function buildGTK() {
TARGET="Building GTK version."

dnl disable build for hildon
AC_ARG_ENABLE(hildon,
AS_HELP_STRING([--enable-hildon],[disable hildon build (default=yes)]),
[ac_hildon_build="yes"],
[ac_hildon_build="no"])

AM_CONDITIONAL(WITH_HILDON, test "x$ac_hildon_build" = "xyes")
AM_CONDITIONAL(WITH_CYGWIN_CONSOLE, false)

if test "x$ac_hildon_build" = "xyes"; then
AC_DEFINE(USE_HILDON, 1, [Define if building for hildon/maemo/n770.])
checkHILDON
else
dnl check for gtk libraries
pkg_modules="gtk+-2.0 >= 2.0.0"
PKG_CHECK_MODULES(PACKAGE, [$pkg_modules])

dnl Checks for glade-2
AC_CHECK_PROG(have_glade, glade-2, [yes], [no])

if test "${have_glade}" = "yes" ; then
dnl build the user interface
glade-2 -w src/platform/gtk/sbgtk.glade
AC_DEFINE(gtk_widget_unref, g_object_unref, [hack for glade-2.])
else
AC_MSG_ERROR([
glade-2 not found: configure failed.
])
fi

dnl check for dbus
PKG_CHECK_MODULES(DBUS, [dbus-1 >= 0.35 dbus-glib-1 >= 0.35], [
PACKAGE_CFLAGS="${PACKAGE_CFLAGS} ${DBUS_CFLAGS}"
PACKAGE_LIBS="${PACKAGE_LIBS} ${DBUS_LIBS}"
AC_DEFINE(USE_DBUS, 1, [use dbus-glib])
])
fi

dnl preconfigured values for GTK build
AC_DEFINE(_UnixOS, 1, [Building under Unix like systems.])
AC_DEFINE(USE_TERM_IO, 0, [Does not use terminal-io functions.])
AC_DEFINE(DEV_EVENTS_OSD, 1, [dev_events() implemented using osd_events().])
AC_DEFINE(KBHIT_PWR_CONSERVE, 1, [Conserve power in dev_kbhit()])
AC_DEFINE(DRV_SOUND, 1, [Driver implements functions in drvsound.h])
AC_DEFINE(IMPL_IMAGE, 1, [Driver implements image commands])
AC_DEFINE(IMPL_DEV_GETS, 1, [Driver implements dev_gets()])
AC_DEFINE(IMPL_DEV_DELAY, 1, [Driver implements dev_delay()])
AC_DEFINE(GTK_DISABLE_DEPRECATED, 1, [avoid building obsolete code)])
AC_DEFINE(HILDON_DISABLE_DEPRECATED, 1, [avoid building obsolete code)])
AC_DEFINE(IMPL_HTML, 1, [Driver implements the html command])
AC_DEFINE(OS_PREC64, 1, [64 bit variables])
AC_DEFINE(NO_SCAN_ERROR_PROMPT, 1, [No prompt for detailed scan report])
AC_DEFINE(DRV_BEEP, 1, [Use the driver based beep function])

BUILD_SUBDIRS="src/common src/platform/gtk/src src/platform/gtk/data src/platform/gtk/icons"
AC_SUBST(BUILD_SUBDIRS)
}

function buildFLTK() {
TARGET="Building FLTK version."

Expand Down Expand Up @@ -384,50 +245,6 @@ function buildSDL() {
(cd ide/android/assets && xxd -i main.bas > ../../../src/platform/sdl/main_bas.h)
}

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

dnl Checks for qmake
AC_CHECK_PROG(have_qt, qmake, [yes], [no])
if test "${have_qt}" = "no" ; then
AC_MSG_ERROR([You need QT version 4.* configure failed.])
fi

dnl avoid using MSCRT versions of printf for long double
case "${host_os}" in
cygwin*)
PACKAGE_CFLAGS="${PACKAGE_CFLAGS} -D__USE_MINGW_ANSI_STDIO"
esac

defaultConditionals

dnl preconfigured values for QT build
AC_DEFINE(_UnixOS, 1, [Building under Unix like systems.])
AC_DEFINE(_QT, 1, [Defined for QT build.])
AC_DEFINE(USE_TERM_IO, 0, [Does not use terminal-io functions.])
AC_DEFINE(DEV_EVENTS_OSD, 1, [dev_events() implemented using osd_events().])
AC_DEFINE(IMPL_IMAGE, 1, [Driver implements image commands])
AC_DEFINE(IMPL_DEV_GETS, 1, [Driver implements dev_gets()])
AC_DEFINE(IMPL_DEV_DELAY, 1, [Driver implements dev_delay()])
AC_DEFINE(IMPL_DEV_ENV, 1, [Driver implements dev_env funcs])
AC_DEFINE(IMPL_LOG_WRITE, 1, [Driver implements lwrite()])
AC_DEFINE(OS_PREC64, 1, [64 bit variables])
AC_DEFINE(NO_SCAN_ERROR_PROMPT, 1, [No prompt for detailed scan report])
AC_DEFINE(DRV_BEEP, 1, [Use the driver based beep function])
AC_DEFINE(IMPL_OSD_SOUND, 1, [Driver implements osd_sound()])
AC_DEFINE(IMPL_DEV_RUN, 1, [Driver implements dev_run()])
AC_DEFINE(IMPL_DEV_CIRCLE, 1, [Driver implements circle/elipse funcs])

BUILD_SUBDIRS="src/common src/platform/qt"
AC_SUBST(BUILD_SUBDIRS)

desktopentrydir='$(datarootdir)'/applications
AC_SUBST(desktopentrydir)

dnl generate qt project files
(cd src/platform/qt && qmake -o Makefile.qt)
}

function buildMosync() {
TARGET="Building common library for Mosync."

Expand Down Expand Up @@ -534,7 +351,6 @@ function buildConsole() {
win32="yes"
esac

AM_CONDITIONAL(WITH_HILDON, false)
AM_CONDITIONAL(WITH_CYGWIN_CONSOLE, test $win32 = yes)

if test $win32 = yes; then
Expand Down Expand Up @@ -601,7 +417,6 @@ function buildDist() {
BUILD_SUBDIRS="${BUILD_SUBDIRS} src/platform/cygwin"
BUILD_SUBDIRS="${BUILD_SUBDIRS} src/platform/unix"
BUILD_SUBDIRS="${BUILD_SUBDIRS} src/platform/mingw"
BUILD_SUBDIRS="${BUILD_SUBDIRS} src/platform/qt"
AC_SUBST(BUILD_SUBDIRS)
}

Expand All @@ -612,14 +427,10 @@ AC_DEFINE(HAVE_C_MALLOC, 1, [allocate memory with regular malloc calls])

if test x$ac_build_dist = xyes; then
buildDist
elif test x$ac_build_gtk = xyes; then
buildGTK
elif test x$ac_build_fltk = xyes; then
buildFLTK
elif test x$ac_build_sdl = xyes; then
buildSDL
elif test x$ac_build_qt = xyes; then
buildQT
elif test x$ac_build_mosync = xyes; then
buildMosync
elif test x$ac_build_tizen = xyes; then
Expand All @@ -634,17 +445,14 @@ checkPCRE
checkDebugMode
checkForWindows

AC_SUBST(PACKAGE_CFLAGS)
AC_SUBST(PACKAGE_LIBS)

AC_CONFIG_FILES([
Makefile
src/common/Makefile
src/platform/gtk/src/Makefile
src/platform/gtk/data/sbasic.desktop
src/platform/gtk/data/com.nokia.sbasic.service
src/platform/gtk/data/Makefile
src/platform/gtk/icons/Makefile
src/platform/fltk/Makefile
src/platform/sdl/Makefile
src/platform/qt/Makefile
src/platform/cygwin/Makefile
src/platform/mingw/Makefile
src/platform/unix/Makefile
Expand All @@ -656,6 +464,8 @@ AC_OUTPUT

echo
echo ${TARGET}
echo "CFLAGS=${CFLAGS}"
echo "CXXFLAGS=${CXXFLAGS}"
echo

if test x$ac_build_dist = xyes; then
Expand Down
44 changes: 44 additions & 0 deletions samples/distro-examples/graphics/plasma2.bas
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
DIM r(256)
DIM g(256)
DIM b(256)
LET f=0
CLS

FOR x=0 TO 255
LET r(x)=255-CEIL((SIN(PI*2*x/255)+1)*127)
LET g(x)=CEIL((SIN(PI*2*x/127)+1)*64)
LET b(x)=255-r(x)
NEXT x

bw=xmax/3
bh=ymax/3
t1=timer

while 1
t=TICKS
FOR y=0 TO bh
FOR x=0 TO bw
LET c1=SIN(x/50+f+y/200)
LET c2=SQR((SIN(0.8*f)*400-x+400)*(SIN(0.8*f)*400-x+400)+(COS(1.2*f)*240-y+240)*(COS(1.2*f)*240-y+240))
LET c2=SIN(c2/50)
LET c3=(c1+c2)/2
LET res=(c3+1)*127

color RGB(r(res),g(res),b(res))
pset x,y
NEXT x
NEXT y

fps=TICKSPERSEC/(TICKS-t)
iter++
at bw+10,0
print format("Fps: ###.##", fps)
at bw+10,20
print format("Cnt: ###", iter)
at bw+10,40
print format("Elap: ###", timer-t1)

SHOWPAGE
f += 0.1
wend

18 changes: 18 additions & 0 deletions samples/distro-examples/tests/call_tau.bas
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,22 @@ tau.build_ta
rem check system-variables
predef.prsys

x=PI
dim foyer
foyer.name= "my name is PI"
? "test"
? foyer("NAME")
? foyer("name")
? foyer.Name
? foyer.name

? "end"

tau.addRoom(foyer,x)


sub addRoom(the_thing, d)
print the_thing.name, d
end

addRoom(foyer,x)
1 change: 1 addition & 0 deletions samples/distro-examples/tests/hash.bas
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ dim foo
key="blah"
foo(key) = "something"
foo("other") = 123
foo(100) = "cats"

? foo(key)
? foo("other")
Expand Down
7 changes: 7 additions & 0 deletions samples/distro-examples/tests/output/call_tau.out
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,10 @@ message from tau
[1,2,3,4]
Predefined Variables
PI =3.14159265358979
test
my name is PI
my name is PI
my name is PI
my name is PI
end
my name is PI 3.14159265358979
3 changes: 3 additions & 0 deletions samples/distro-examples/tests/output/hash.out
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
something
123
[blah=something,other=123,100=cats]
2 changes: 2 additions & 0 deletions samples/distro-examples/tests/output/short-circuit.out
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
start of test
end of test
Loading