11dnl
22dnl Configure script for SmallBASIC
33dnl
4- dnl Copyright(C) 2001-2020 Chris Warren-Smith.
4+ dnl Copyright(C) 2001-2025 Chris Warren-Smith.
55dnl
66dnl 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] , [ 12.28 ] )
10+ AC_INIT ( [ smallbasic] , [ 12.29 ] )
1111AC_CONFIG_SRCDIR ( [ configure.ac] )
1212
1313AC_CANONICAL_TARGET
@@ -81,8 +81,10 @@ function checkDebugMode() {
8181 AC_MSG_RESULT ( [ $with_debug] )
8282 if test "$with_debug" = "yes" || test "$with_debug" = "full"
8383 then
84- CFLAGS="${CFLAGS} -g -O0 -fstack-protector-all"
85- CXXFLAGS="${CXXFLAGS} -g -O0 -fstack-protector-all"
84+ DEBUG_FLAGS="-g -O1 -fstack-protector-all -fno-omit-frame-pointer"
85+ # -fsanitize=address,undefined"
86+ CFLAGS="${DEBUG_FLAGS}"
87+ CXXFLAGS="${DEBUG_FLAGS}"
8688 AC_DEFINE ( _DEBUG , 1 , [ debugging build enabled] )
8789 fi
8890 AC_SUBST ( CFLAGS )
@@ -170,10 +172,7 @@ function buildSDL() {
170172 TARGET="Building SDL version."
171173 defaultConditionals
172174
173- AC_CHECK_PROG ( have_sdl , sdl2-config , [ yes] , [ no] )
174- if test "${have_sdl}" = "no" ; then
175- AC_MSG_ERROR ( [ libsdl2-dev not installed: configure failed.] )
176- fi
175+ PKG_CHECK_MODULES([ SDL3] , [ sdl3] )
177176
178177 SAVED_CPPFLAGS="$CPPFLAGS"
179178 CPPFLAGS="$CPPFLAGS `pkg-config freetype2 --cflags`"
@@ -197,7 +196,7 @@ function buildSDL() {
197196 PACKAGE_CFLAGS="${PACKAGE_CFLAGS} -mms-bitfields"
198197 PACKAGE_LIBS="${PACKAGE_LIBS} -lwsock32 -lws2_32 -static-libgcc -static-libstdc++"
199198 PACKAGE_LIBS="${PACKAGE_LIBS} -Wl,-Bstatic -Wl,-Map=output.map"
200- PACKAGE_LIBS="${PACKAGE_LIBS} `sdl2-config --static-libs` `pkg-config freetype2 --libs --static`"
199+ PACKAGE_LIBS="${PACKAGE_LIBS} ${SDL3_LIBS} `pkg-config freetype2 --libs --static`"
201200 AC_DEFINE ( _Win32 , 1 , [ Windows build] )
202201 ;;
203202
@@ -212,7 +211,7 @@ function buildSDL() {
212211 dnl backlinking support for modules
213212 PACKAGE_LIBS="${PACKAGE_LIBS} -ldl"
214213 PACKAGE_LIBS="${PACKAGE_LIBS} ${FONTCONFIG_LIBS}"
215- PACKAGE_LIBS="${PACKAGE_LIBS} `sdl2-config --libs` `pkg-config freetype2 --libs`"
214+ PACKAGE_LIBS="${PACKAGE_LIBS} ${SDL3_LIBS} `pkg-config freetype2 --libs`"
216215 ;;
217216
218217 *)
@@ -225,32 +224,25 @@ function buildSDL() {
225224
226225 (cd images && xxd -i sb-desktop-128x128.png > ../src/platform/sdl/icon.h)
227226
228- HAVE_SDL2_STATIC=yes
229- AC_MSG_CHECKING ( [ if installed SDL2 supports static libs] )
230- AC_PATH_PROGS_FEATURE_CHECK ( [ SDL2_STATIC_TMP] , [ sdl2-config] ,
231- AS_IF ( [ `"$ac_path_SDL2_STATIC_TMP" --static-libs 2>&1 | sed '/Usage/!{q1};' > /dev/null`] , [ HAVE_SDL2_STATIC=no] ) )
232- AC_MSG_RESULT ( [ $HAVE_SDL2_STATIC] )
233-
234- if test "x$HAVE_SDL2_STATIC" = "xno"; then
235- SDL_LIBS=`sdl2-config --libs`
236- else
237- SDL_LIBS=`sdl2-config --static-libs`
238- fi
227+ AC_MSG_CHECKING ( [ for SDL3 library linking] )
228+ SDL3_LIBS=`pkg-config sdl3 --libs --static`
229+ AC_MSG_RESULT ( [ $SDL3_LIBS] )
239230
240231 dnl backlinking support for modules
241232 PACKAGE_LIBS="${PACKAGE_LIBS} -ldl -no-pie"
242233 PACKAGE_LIBS="${PACKAGE_LIBS} ${FONTCONFIG_LIBS}"
243-
244- PACKAGE_LIBS="-static-libgcc ${PACKAGE_LIBS} ${SDL_LIBS} `pkg-config freetype2 --libs`"
234+ PACKAGE_LIBS="-static-libgcc ${PACKAGE_LIBS} ${SDL3_LIBS} `pkg-config freetype2 --libs`"
245235 esac
246236
247- PACKAGE_CFLAGS="${PACKAGE_CFLAGS} `sdl2-config --cflags` `pkg-config freetype2 --cflags` -fno-exceptions"
237+ SDL3_CFLAGS=`pkg-config sdl3 --cflags`
238+ PACKAGE_CFLAGS="${PACKAGE_CFLAGS} ${SDL3_CFLAGS} `pkg-config freetype2 --cflags` -fno-exceptions"
248239 CXXFLAGS="${CXXFLAGS} -fno-rtti -std=c++14"
249240
250241 dnl preconfigured values for SDL build
251- AC_DEFINE_UNQUOTED ( [ _SDL_VERSION] , [ "`sdl2-config --version` "] , [ SDL library version] )
242+ SDL3_VERSION=`pkg-config sdl3 --modversion`
243+ AC_DEFINE_UNQUOTED ( [ _SDL_VERSION] , [ "${SDL3_VERSION} "] , [ SDL library version] )
252244 AC_DEFINE ( _SDL , 1 , [ Defined when building SDL version] )
253- AC_DEFINE ( _UnixOS , 1 , [ Building under Unix like systems.] )
245+ AC_DEFINE ( _UnixOS , 1 , [ Building under Unix- like systems.] )
254246 AC_DEFINE ( IMPL_DEV_READ , 1 , [ Implement dev_read()] )
255247 AC_DEFINE ( IMPL_LOG_WRITE , 1 , [ Driver implements lwrite()] )
256248
@@ -529,8 +521,8 @@ echo "PACKAGE_LIBS=${PACKAGE_LIBS}"
529521
530522if test x$ac_build_sdl = xyes; then
531523 echo
532- echo "sdl2 : `sdl2 -config --version `"
533- echo "freetype: `pkg-config --version freetype2 `"
524+ echo "sdl3 : `pkg -config sdl3 --modversion `"
525+ echo "freetype: `pkg-config freetype2 --modversion `"
534526fi
535527
536528echo
0 commit comments