@@ -7,7 +7,7 @@ dnl This program is distributed under the terms of the GPL v2.0
77dnl  Download the GNU Public License (GPL) from www.gnu.org
88dnl 
99
10- AC_INIT ( [ smallbasic]  , [ 0.11.16 ] ) 
10+ AC_INIT ( [ smallbasic]  , [ 0.11.17 ] ) 
1111AC_CONFIG_SRCDIR ( [ configure.ac] ) 
1212
1313AC_CANONICAL_TARGET 
@@ -55,13 +55,14 @@ function checkForWindows() {
5555     *mingw* | pw32* | cygwin*)
5656     win32="yes"
5757     AC_CHECK_TOOL ( WINDRES , windres , : ) 
58+      ;;
59+      *darwin*)
60+      ;;
61+      *)
62+      dnl  backlinking support for modules
63+      LDFLAGS="${LDFLAGS} -export-dynamic"
5864   esac
5965   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
6566}
6667
6768function checkDebugMode() {
@@ -138,7 +139,7 @@ function buildFLTK() {
138139     PACKAGE_CFLAGS="${PACKAGE_CFLAGS} -D__USE_MINGW_ANSI_STDIO"
139140   esac
140141
141-    FLTK_CXXFLAGS="${PACKAGE_CFLAGS} `fltk2-config --cxxflags` -Wall -Wunused - fno-exceptions"
142+    FLTK_CXXFLAGS="${PACKAGE_CFLAGS} `fltk2-config --cxxflags` -fno-exceptions"
142143   PACKAGE_LIBS="${PACKAGE_LIBS} `fltk2-config --ldflags --use-images`"
143144
144145   dnl  do not depend on cygwin.dll under cygwin build
@@ -163,17 +164,12 @@ function buildFLTK() {
163164   dnl  preconfigured values for FLTK build
164165   AC_DEFINE ( _UnixOS , 1 , [ Building under Unix like systems.] ) 
165166   AC_DEFINE ( _FLTK , 1 , [ Defined for FLTK build.] ) 
166-    AC_DEFINE ( USE_TERM_IO , 0 , [ Does not use terminal-io functions.] ) 
167167   AC_DEFINE ( USE_CLIB , 1 , [ Implements clibmgr.] ) 
168168   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()] ) 
171169   AC_DEFINE ( IMPL_DEV_DELAY , 1 , [ Driver implements dev_delay()] ) 
172170   AC_DEFINE ( IMPL_DEV_ENV , 1 , [ Driver implements dev_env funcs] ) 
173171   AC_DEFINE ( IMPL_LOG_WRITE , 1 , [ Driver implements lwrite()] ) 
174172   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()] ) 
177173
178174   BUILD_SUBDIRS="src/common src/platform/fltk"
179175   AC_SUBST ( BUILD_SUBDIRS ) 
@@ -200,39 +196,47 @@ function buildSDL() {
200196     AC_MSG_ERROR ( [ libfreetype6-dev not installed: configure failed.] ) 
201197   fi
202198
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"
209203
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
214222
215223   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`"
217225
218226   dnl  preconfigured values for SDL build
219227   AC_DEFINE ( _SDL , 1 , [ Defined when building SDL version] ) 
220228   AC_DEFINE ( _UnixOS , 1 , [ Building under Unix like systems.] ) 
221-    AC_DEFINE ( USE_TERM_IO , 0 , [ Does not use terminal-io functions.] ) 
222229   AC_DEFINE ( DEV_EVENTS_OSD , 1 , [ dev_events() implemented using osd_events().] ) 
223-    AC_DEFINE ( IMPL_DEV_GETS , 1 , [ Driver implements dev_gets()] ) 
224230   AC_DEFINE ( IMPL_DEV_DELAY , 1 , [ Driver implements dev_delay()] ) 
225231   AC_DEFINE ( IMPL_LOG_WRITE , 1 , [ Driver implements lwrite()] ) 
226232   AC_DEFINE ( IMPL_DEV_READ , 1 , [ Implement dev_read()] ) 
227-    AC_DEFINE ( IMPL_OSD_SOUND , 1 , [ Driver implements osd_sound()] ) 
228233   AC_DEFINE ( IMPL_LOG_WRITE , 1 , [ Driver implements lwrite()] ) 
229-    AC_DEFINE ( IMPL_IMAGE , 1 , [ Driver implements image commands] ) 
230234   AC_DEFINE ( OS_PREC64 , 1 , [ 64 bit variables] ) 
231-    AC_DEFINE ( DRV_BEEP , 1 , [ Use the driver based beep function] ) 
232235
233236   BUILD_SUBDIRS="src/common src/platform/sdl"
234237   AC_SUBST ( BUILD_SUBDIRS ) 
235238   (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)
236240}
237241
238242function buildTizen() {
@@ -243,16 +247,10 @@ function buildTizen() {
243247   AC_DEFINE ( _UnixOS , 1 , [ Building under Unix like systems.] ) 
244248   AC_DEFINE ( _TIZEN , 1 , [ Defined for Tizen build.] ) 
245249   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] ) 
248250   AC_DEFINE ( DEV_EVENTS_OSD , 1 , [ dev_events() implemented using osd_events().] ) 
249-    AC_DEFINE ( IMPL_DEV_GETS , 1 , [ Driver implements dev_gets()] ) 
250251   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] ) 
253252   AC_DEFINE ( CPU_BIGENDIAN , 1 , [ Tizen uses big-endian] ) 
254253   AC_DEFINE ( IMPL_LOG_WRITE , 1 , [ Driver implements lwrite()] ) 
255-    AC_DEFINE ( USE_TERM_IO , 0 , [ Does not use terminal-io functions.] ) 
256254
257255   BUILD_SUBDIRS="src/platform/tizen/common"
258256   AC_SUBST ( BUILD_SUBDIRS ) 
@@ -265,15 +263,11 @@ function buildAndroid() {
265263
266264   AC_DEFINE ( _UnixOS , 1 , [ Building under Unix like systems.] ) 
267265   AC_DEFINE ( _ANDROID , 1 , [ Defined for Android build.] ) 
268-    AC_DEFINE ( IMPL_DEV_READ , 1 , [ Implement dev_read()] ) 
269266   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 ()] ) 
271268   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] ) 
275269   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 ] ) 
277271
278272   BUILD_SUBDIRS="src/platform/android"
279273   AC_SUBST ( BUILD_SUBDIRS ) 
@@ -290,6 +284,7 @@ function buildConsole() {
290284   esac
291285
292286   AM_CONDITIONAL(WITH_CYGWIN_CONSOLE, test $win32 = yes)
287+    AC_DEFINE ( BUILD_CONSOLE , 1 , [ Building a console based system.] ) 
293288
294289   if test $win32 = yes; then
295290      dnl  test whether to build using mingw
@@ -305,39 +300,32 @@ function buildConsole() {
305300      if test x$have_cygwin = xyes; then
306301         dnl  preconfigured values for cygwin console build (depends on cygwin.dll)
307302         TARGET="Building Cygwin console version."
308-          AC_CHECK_HEADER ( ncurses/termcap.h , [ ]  , [ AC_MSG_ERROR ( "install  libncurses-dev" ) ] ) 
309303         AC_DEFINE ( _UnixOS , 1 , [ Building under Unix like systems.] ) 
310-          AC_DEFINE ( USE_TERM_IO , 1 , [ Uses terminal-io functions.] ) 
311304         AC_DEFINE ( DEV_EVENTS_OSD , 0 , [ dev_events() implemented using osd_events().] ) 
312305         AC_DEFINE ( _CygWin , 1 , [ Building a minimal dev_null based command-line version.] ) 
313306         AC_DEFINE ( __CYGWIN__ , 1 , [ as above] ) 
314307         AC_DEFINE ( OS_PREC64 , 1 , [ 64 bit variables] ) 
315308         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 "
318311      else
319312         dnl  preconfigured values for cygwin mingw console build
320313         TARGET="Building Cygwin MinGW console version."
321314         AC_DEFINE ( __MINGW32__ , 1 , [ as above] ) 
322315         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"
327318      fi
328319      AC_DEFINE ( _Win32 , 1 , [ Windows build] ) 
329320      AC_DEFINE ( __addr_t_defined , 1 , [ Avoid conflict in cygwin/types.h] ) 
330321   else
331322      dnl  preconfigured values for unix console build
332323      TARGET="Building Unix console version."
333324      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.] ) 
335326      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] ) 
338327      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"
341329      BUILD_SUBDIRS="src/common src/platform/unix"
342330      TEST_DIR="src/platform/unix"
343331      AC_SUBST ( TEST_DIR ) 
@@ -352,17 +340,10 @@ function buildDist() {
352340   BUILD_SUBDIRS="src/common src/platform/gtk/src src/platform/gtk/data src/platform/gtk/icons"
353341   BUILD_SUBDIRS="${BUILD_SUBDIRS} src/platform/fltk"
354342   BUILD_SUBDIRS="${BUILD_SUBDIRS} src/platform/sdl"
355-    BUILD_SUBDIRS="${BUILD_SUBDIRS} src/platform/cygwin"
356343   BUILD_SUBDIRS="${BUILD_SUBDIRS} src/platform/unix"
357-    BUILD_SUBDIRS="${BUILD_SUBDIRS} src/platform/mingw"
358344   AC_SUBST ( BUILD_SUBDIRS ) 
359345}
360346
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- 
366347if test x$ac_build_dist = xyes; then
367348   buildDist
368349elif test x$ac_build_fltk = xyes; then
@@ -381,6 +362,8 @@ checkPCRE
381362checkDebugMode
382363checkForWindows
383364
365+ PACKAGE_CFLAGS="${PACKAGE_CFLAGS} -Wall -Wno-unused-result"
366+ 
384367AC_SUBST ( PACKAGE_CFLAGS ) 
385368AC_SUBST ( PACKAGE_LIBS ) 
386369
@@ -389,8 +372,6 @@ Makefile
389372src/common/Makefile 
390373src/platform/fltk/Makefile 
391374src/platform/sdl/Makefile 
392- src/platform/cygwin/Makefile 
393- src/platform/mingw/Makefile 
394375src/platform/unix/Makefile 
395376src/platform/tizen/common/Makefile 
396377src/platform/android/Makefile 
0 commit comments