kburtch / SparForte

Bourne shell, template engine, scripting language reliable, scalable projects. Based a ISO standard proven effective for large, mission-critical projects, SparForte is designed for fast development while, at the same time, providing easier designing, maintenance and bug removal. About 130.000 lines of code.
https://www.sparforte.com
GNU General Public License v2.0
50 stars 6 forks source link

Unable to build without SDL? #11

Closed specing closed 2 years ago

specing commented 6 years ago

Hi, upon doing ./configure --prefix=/data/users/specing/install/spar --without-bdb --without-mysql --without-opengl --without-postgres --without-readline --without-sound and fixing configure enough to make it pass, then running gmake all greets me with:

gmake -C src
gmake[1]: Entering directory '/data/users/specing/programs/SparForte/src'

---------------------------------------------------------------
  Compiling C Wrappers on Kernel and OS Library Functions
  To Make SparForte Portable
---------------------------------------------------------------

gcc  -I./adacgi-1.6/  -I./pegasock/  -I/usr/include/SDL  -I./areadline/ -Wall -Werror -fstack-check -fstack-protector -O1 -D_FORTIFY_SOURCE=2 -c c_os.c
c_os.c:372:21: fatal error: SDL/SDL.h: No such file or directory
 #include <SDL/SDL.h>
                     ^
compilation terminated.
gmake[1]: *** [GNUmakefile:133: c_os.o] Error 1
gmake[1]: Leaving directory '/data/users/specing/programs/SparForte/src'
gmake: *** [GNUmakefile:12: all] Error 2

For reference, my configure fixes were the following:

diff --git a/configure b/configure
index f16d8fb..333ac6b 100755
--- a/configure
+++ b/configure
@@ -271,7 +271,7 @@ echo -n "checking for architecture (\$ARCH)... "
 if [ -z "$ARCH" ] ; then
    echo "no"
    echo -n "checking for architecture (uname -p and -m)... "
-   ARCH=`uname -p 2>/dev/null`
+   ARCH=`uname -m 2>/dev/null`
    if [ $? -ne 0 ] ; then   # Cygwin runs but says unknown
       ARCH="unknown"
    fi
@@ -353,6 +353,7 @@ CPU_FLAG="-march"
 # support -march=native but this is not yet supported on the Raspberry
 # Pi.  Apparently there are several different Debian flavours for the
 # Pi.  I've only tested it on the one using armv6l.
+printf "OS: %s, CPU_ARCH: %s\n" "$OS" "$CPU_ARCH"
 if [ "$OS" = "Linux" -a "$CPU_ARCH" = "armv6" ] ; then
    echo -n "Linux/ARM6 (assuming Raspberry Pi)"
    if test -r spar_os.ads ; then
@@ -560,6 +561,7 @@ fi

 echo -n "checking for libgnat (ldconfig -p, Linux)... "
 TMP=`$LDCONFIG_SUDO /sbin/ldconfig -p 2>/dev/null | grep libgnat`
+TMP="dwdwdw"
 if [ -z "$TMP" ] ; then
    echo "no"
    echo -n "checking for libgnat (ldconfig -r, FreeBSD)... "
@@ -849,6 +851,7 @@ SDLINCLTYPE=`echo "$SDLINCL" | sed 's/\ /\\\ /g;s/\//\\\\\//g'`
 # Bytes are aligned differently between 32-bit and 64-bit SDL data structures.
 # Default to 64-bit else use 32-bit.

+# copied manually
 echo -n "selecting SDL binding... "
 if test -r spar_os-sdl.ads ; then
    echo " (cached, make distclean to remove)";

1) uname -p prints processor product and not architecture 2) GNAT is not installed system-wide (but is at start of PATH) 3) Is SDL not obsolete and superseeded by SDL2?

OS is Gentoo GNU/Linux on amd64

specing commented 6 years ago

4) the manual copy was cp src/spar_os-sdl-64bit.ads src/spar_os-sdl.ads

Looking into c_os.c I find redundant #ifdef on the first mention of SDL:

#ifdef FREEBSD
#include <SDL/SDL.h>
#include <SDL/SDL_video.h>
#else
#include <SDL/SDL.h>
#include <SDL/SDL_video.h>
#endif
kburtch commented 6 years ago

That is correct.

The current version of the source code can be compiled without OpenGL (the Mesa library) but not without the SDL library (Simple Direct media Layer). I've not yet isolated the uses of SDL so it can be disabled using the configuration script. You will need to install SDL and SDL image version 1.2, if I remember correctly, first.

The redundant ifdef likely dates to a time when SDL was in a different location on FreeBSD but was later moved to the standard location, probably FreeBSD 9 or earlier.

specing commented 6 years ago

I see.

Blady-Com commented 4 years ago

If it may help, I made some rough changes to be able to build SparForte without SDL and SDL_Image, see commit changes on specific branch.

kburtch commented 2 years ago

Merged Blady-Com changes to build without SDL.