Commit 36835488 by kollo

improved the configuration system

now several options can be configured with the configure script
the flavour of X11-Basic will be diplayed in the splash message.

fixed error in Makefile
little error in Makefile fixed (defs in debug version)
parent 87695ba2
......@@ -28,7 +28,7 @@ RELEASE=46
# Register variables (-ffixed-reg) -Wall
REGS= @regs@ -Wall
REGS= @regs@
# Optimization and debugging options
OPT=@copt@
......@@ -38,8 +38,7 @@ INC=@X_CFLAGS@ -I.
WININC=-I./WINDOWS -I./WINDOWS/include -I./WINDOWS/include/GMP
TINEINC=@X_CFLAGS@ -I/usr/include/tine -I/usr/include/doocs -I.
# X11 library path
XLIBS=@X_LIBS@ @X_EXTRA_LIBS@
# defines for special flavours
DEF= @def@
......@@ -360,11 +359,11 @@ DOOCSDIST=$(DIST) src/Extensions/doocs-wrapper.cc ../doc/doocs-xbasic.html \
LINKFLAGS =
WINLINKFLAGS = -L./WINDOWS/lib
LIBS = @libs@ @xtra@
LIBS = @libs@ @xlibs@ @xtra@
# fuer Version ohne X
LIBS1 = @libs@
LIBS2 = -L. -ldl -lm -lncurses TomTom.extension/contrib/readline-5.2/libreadline.a
CONSOLELIBS= @libs@ @xtra@
WINLIBS = -lm -lgdi32 -lkernel32 -luser32 -lole32 -luuid -lwsock32 -lSDL
TOSLIBS = -lm -lgem
......@@ -400,8 +399,8 @@ config.h: config.h.in
libx11basic.so: libx11basic.so.$(LIBNO)
ln -s -f $< libx11basic.so.1
ln -s -f libx11basic.so.1 libx11basic.so
libx11basic.so.$(LIBNO) : $(LIBCSRC)
$(CCSHARED) $(OPT) -Wl,-soname,$@ -o $@ $(LIBCSRC) $(LIBS) $(XLIBS)
libx11basic.so.$(LIBNO) : $(LIBCSRC) Makefile
$(CCSHARED) $(OPT) $(DEF) -Wl,-soname,$@ -o $@ $(LIBCSRC) $(LIBS)
strip $@
# Make the (static) library
......@@ -412,7 +411,7 @@ x11basic.a : $(LIBOBJS)
# Make the (dynamically linked) X11-Basic excecutable
xbasic : libx11basic.so main.o
$(CC) -L. $(LINKFLAGS) -o $@ main.o $(LIBS) -lx11basic $(XLIBS)
$(CC) -L. $(LINKFLAGS) -o $@ main.o $(LIBS) -lx11basic
strip $@
# Make th X11-Basic compiler manager xbc
......@@ -424,24 +423,24 @@ xbc : xbasic libx11basic.so examples/compiler/xbc.bas
# Make the bytecode compiler xbbc
xbbc : bytecode.h bytecode.o xbbc.o
$(CC) -o $@ xbbc.o bytecode.o -L . $(LIBS) -lx11basic -L /usr/X11/lib/ -lX11
$(CC) -o $@ xbbc.o bytecode.o -L . $(LIBS) -lx11basic
strip $@
xbbc.static : xbbc.o bytecode.o x11basic.a
$(CC) -o $@ xbbc.o bytecode.o x11basic.a -lm -L /usr/X11/lib/ -lX11 $(LIBS)
$(CC) -o $@ xbbc.o bytecode.o x11basic.a $(LIBS)
strip $@
xbbc.debug : xbbc.c bytecode.c $(LIBCSRC)
$(CCDEBUG) -o $@ xbbc.c bytecode.c $(LIBCSRC) -lm -L /usr/X11/lib/ -lX11 $(LIBS)
$(CCDEBUG) -o $@ xbbc.c bytecode.c $(LIBCSRC) $(LIBS)
# Make the virtual machine for interpreting the bytecode
xbvm : bytecode.h xbvm.c
$(CC) -o $@ xbvm.c -L . $(LIBS) -lx11basic -L /usr/X11/lib/ -lX11
$(CC) -o $@ xbvm.c -L . $(LIBS) -lx11basic
strip $@
xbvm.static : xbvm.o x11basic.a
$(CC) -o $@ xbvm.o x11basic.a -lm -L /usr/X11/lib/ $(LIBS) -lX11
$(CC) -o $@ xbvm.o x11basic.a $(LIBS)
strip $@
xbvm.debug : xbvm.c $(LIBCSRC)
$(CCDEBUG) -o $@ xbvm.c $(LIBCSRC) -lm -L /usr/X11/lib/ $(LIBS) -lX11
$(CCDEBUG) -o $@ xbvm.c $(LIBCSRC) $(LIBS)
###################################################
#### Fundamentals for X11-Basic (MS WINDOWS) ######
......@@ -530,10 +529,10 @@ xbasic.framebuffer : main.c $(LIBCSRCFB)
# therefor can be used without the .so file
xbasic.static : x11basic.a main.o
$(CC) $(OPT) $(LINKFLAGS) -o $@ main.o x11basic.a $(LIBS) $(XLIBS)
$(CC) $(OPT) $(LINKFLAGS) -o $@ main.o x11basic.a $(LIBS)
strip $@
xbasic.debug : main.c $(LIBCSRC)
$(CCDEBUG) $(OPT) $(LINKFLAGS) -o $@ main.c $(LIBCSRC) $(LIBS) $(XLIBS)
$(CCDEBUG) $(OPT) $(LINKFLAGS) -o $@ main.c $(DEF) $(LIBCSRC) $(LIBS)
static : xbasic.static xbbc.static xbvm.static xb2c.static
......@@ -656,19 +655,19 @@ X11-Basic-examples-$(LIBNO).tar.gz:
# Fuer die Control System Varianten
tinexbasic.dyn : $(LIBOBJS) main.o
$(CC) -DTINE $(LINKFLAGS) -o $@ $(AOBJS) $(LIBS) -ltine $(XLIBS)
$(CC) -DTINE $(LINKFLAGS) -o $@ $(AOBJS) $(LIBS) -ltine
strip $@
tinexbasic : $(LIBOBJS) main.o
$(CC) -DTINE $(OPT) $(LINKFLAGS) -o $@ $(AOBJS) $(LIBS) /usr/lib/libtine.a $(XLIBS)
$(CC) -DTINE $(OPT) $(LINKFLAGS) -o $@ $(AOBJS) $(LIBS) /usr/lib/libtine.a
strip $@
doocsxbasic.dyn : $(LIBOBJS) main.o doocs-wrapper.o
$(CC) -DTINE -DDOOCS $(LINKFLAGS) -o $@ $(AOBJS) doocs-wrapper.o \
$(LIBS) $(XLIBS) -ltine -lDOOCSclient -lDOOCSserver
$(LIBS) -ltine -lDOOCSclient -lDOOCSserver
strip $@
doocsxbasic : $(LIBOBJS) main.o doocs-wrapper.o
g++ -DTINE -DDOOCS $(OPT) $(LINKFLAGS) -o $@ $(AOBJS) \
$(LIBS) /usr/lib/libtine.a /usr/lib/libDOOCSclient.a \
/usr/lib/libDOOCSserver.a doocs-wrapper.o $(XLIBS)
/usr/lib/libDOOCSserver.a doocs-wrapper.o
strip $@
lib: libx11basic.so x11basic.a
......@@ -701,13 +700,13 @@ xb2c_d.o: xb2c.c
# make the X11-Basic to C translator
xb2c : xb2c.o
$(CC) -o $@ xb2c.o -L . $(LIBS) -lx11basic -L /usr/X11/lib/ -lX11
$(CC) -o $@ xb2c.o -L . $(LIBS) -lx11basic
strip $@
xb2c.static : xb2c_d.o file.o functions_d.o io_basic.o tools.o afunctions_d.o svariablen_d.o sfunctions_d.o kommandos_d.o
$(CC) -o $@ xb2c_d.o functions_d.o tools.o afunctions_d.o svariablen_d.o file.o io_basic.o sfunctions_d.o kommandos_d.o -lm -L /usr/X11/lib/ -lX11 $(LIBS)
$(CC) -o $@ xb2c_d.o functions_d.o tools.o afunctions_d.o svariablen_d.o file.o io_basic.o sfunctions_d.o kommandos_d.o $(LIBS)
strip $@
xb2c.debug : xb2c.c $(LIBCSRC)
$(CCDEBUG) -o $@ xb2c.c $(LIBCSRC) -lm -L /usr/X11/lib/ -lX11 $(LIBS)
$(CCDEBUG) -o $@ xb2c.c $(LIBCSRC) $(LIBS)
x11basic.tga: logo/x11basic-logo-1999.pov
povray +I$< +O$@ +FT +W512 +H400 +V -D +X +MV3.0 +L/usr/share/fonts/truetype/msttcorefonts/
......
......@@ -329,8 +329,8 @@
/* Date of actual compilation */
#undef VERSION_DATE
/* Define to 1 if the X Window System is missing or not being used. */
#undef X_DISPLAY_MISSING
/* Define to 1 if the X Window System is usable. */
#undef HAVE_X11
/* Define to empty if `const' does not conform to ANSI C. */
#undef const
......
......@@ -4,6 +4,9 @@
AC_INIT([X11-Basic], [1.25], [kollo@users.sourceforge.net])
version=$PACKAGE_VERSION
vdate=`date`
# for debugging we want all warnings
regs=-Wall
AC_REVISION($Revision: 0.12 $)
AC_SUBST(version)
AC_CONFIG_HEADERS([config.h])
......@@ -41,6 +44,83 @@ then
fi
# enable the arguments for different flavors of X11-Basic
AC_ARG_ENABLE(cryptography, AS_HELP_STRING([--enable-cryptography],
[enable cryptographic features @<:@default=no@:>@]), [with_crypto=$enableval], [with_crypto=no])
AC_ARG_ENABLE(static, AS_HELP_STRING([--enable-static],
[only produce static libraries @<:@default=no@:>@]), [with_static=$enableval], [with_static=no])
AC_ARG_ENABLE(smallram, AS_HELP_STRING([--enable-smallram],
[make version siutable for systems with small RAM @<:@default=no@:>@]), [with_smallram=$enableval], [with_smallram=no])
AC_ARG_ENABLE(german, AS_HELP_STRING([--enable-german],
[make german version @<:@default=no@:>@]), [with_german=$enableval], [with_german=no])
AC_ARG_WITH(bluetooth, AS_HELP_STRING([--with-bluetooth],
[support blutooth @<:@default=yes@:>@]), [with_bluetooth=$withval], [with_bluetooth=yes])
AC_ARG_WITH(usb, AS_HELP_STRING([--with-usb],
[support USB @<:@default=yes@:>@]), [with_usb=$withval], [with_usb=yes])
AC_ARG_WITH(readline, AS_HELP_STRING([--with-readline],
[support readline library @<:@default=yes@:>@]), [with_readline=$withval], [with_readline=yes])
AC_ARG_WITH(framebuffer, AS_HELP_STRING([--with-framebuffer],
[support framebuffer @<:@default=no@:>@]), [with_framebuffer=$withval], [with_framebuffer=no])
AC_ARG_WITH(sdl, AS_HELP_STRING([--with-sdl],
[support SDL library @<:@default=no@:>@]), [with_sdl=$withval], [with_sdl=no])
AC_ARG_WITH(x, AS_HELP_STRING([--with-x],
[use the X Window System @<:@default=yes@:>@]), [with_x=$withval], [with_x=yes])
echo
echo "Configuring X11-Basic with following features:"
echo "Install prefix: " $prefix
echo "Cryptographic features = " $with_crypto
echo "Small RAM version = " $with_smallram
echo "German version = " $with_german
echo "Produce only static libraries = " $with_static
echo "Use X Window system = " $with_x
echo "Use SDL library = " $with_sdl
echo "Use framebuffer = " $with_framebuffer
echo "Use readline library = " $with_readline
echo "Support USB = " $with_usb
echo "Support bluetooth = " $with_bluetooth
echo
if test "n$with_sdl" = nno && test "n$with_x" = nno && test "n$with_framebuffer" = nno; then
cat <<'EOF'
WARNING: You seem to have specified no graphics engine! So a version of X11-Basic will be
produced, which only uses the commandline and no graphics at all. Please note that this version
will be incompatible in bytecode to other versions since the graphics commands are completely
taken out and will result in a syntax error.
EOF
fi
if test "n$with_smallram" = nyes; then
def="$def -DSAVE_RAM"
fi
if test "n$with_framebuffer" = nyes; then
def="$def -DFRAMEBUFFER"
fi
if test "n$with_sdl" = nyes; then
def="$def -DUSE_SDL"
fi
if test "n$with_x" = nyes; then
def="$def -DUSE_X11"
fi
if test "n$with_german" = nyes; then
def="$def -DGERMAN"
fi
#### PROGRAMS
# Checks for programs.
......@@ -54,7 +134,7 @@ xbasic -e version
fi
AC_PROG_CC
#AC_PROG_INSTALL
# AC_PROG_INSTALL
AC_PROG_LN_S
AC_PROG_CPP
......@@ -87,21 +167,37 @@ EOF
fi
#### LIBRARIES
if test "n$with_x" = nyes || test "n$with_sdl" = nyes; then
AC_PATH_XTRA
if test "x$no_x" = yes; then
echo "Sorry, I can't find any trace of the X Window installation (X11) on your"
echo "system! Please use --x-includes=DIR and --x-libraries=DIR if you have them."
exit 1
fi
fi
AC_HEADER_DIRENT
AC_HEADER_STDC
AC_CHECK_HEADERS([sys/kd.h complex.h png.h jpeglib.h pty.h errno.h fcntl.h limits.h netdb.h netinet/in.h stddef.h stdlib.h string.h sys/file.h sys/ioctl.h sys/param.h sys/socket.h sys/time.h sys/timeb.h termios.h unistd.h utime.h])
AC_CHECK_HEADERS([sys/kd.h complex.h png.h jpeglib.h pty.h errno.h limits.h sys/file.h sys/param.h sys/timeb.h utime.h])
AC_CHECK_HEADERS([fcntl.h inttypes.h malloc.h memory.h netdb.h netinet/in.h stddef.h stdint.h stdlib.h string.h strings.h sys/ioctl.h sys/socket.h sys/time.h termios.h unistd.h utmp.h])
# Checks for libraries.
if test "n$with_x" = nyes || test "n$with_sdl" = nyes; then
# `-lX11':
AC_CHECK_LIB([X11], [XOpenDisplay], xlibs="${xlibs} -lX11",,[$X_LIBS])
AC_CHECK_LIB([X11], [XOpenDisplay], [
xlibs="$xlibs -lX11"
AC_DEFINE(HAVE_X11,1,[X11lib])
])
fi
# `-ldl':
AC_CHECK_LIB([dl], [dlopen], [
libs="$libs -ldl"
......@@ -152,12 +248,13 @@ libs="$libs -lutil"
AC_DEFINE(HAVE_FORKPTY,1,[forkpty in libutil])
],,[$libs])
if test "n$with_readline" = nyes; then
# `-lreadline':
AC_CHECK_LIB([readline], [readline], [
libs="$libs -lreadline"
AC_DEFINE(HAVE_READLINE,1,[readline in readline])
],,[$libs])
fi
# `-llapack':
AC_CHECK_LIB([lapack], [dgelss_], [
......@@ -177,45 +274,55 @@ libs="$libs -lgmp"
AC_DEFINE(HAVE_PRIMORIAL_UI,1,[mpz_primorial_ui in gmp])
],,[$libs])
if test "n$with_usb" = nyes; then
# `-lusb':
AC_CHECK_LIB([usb], [usb_open], [
libs="$libs -lusb"
AC_DEFINE(HAVE_USB,1,[usb_open in lusb])
],,[$libs])
# `-lusb-1.0':
#AC_CHECK_LIB([usb-1.0], [libusb_control_transfer], [
#libs="$libs -lusb-1.0"
#AC_DEFINE(HAVE_LIBUSB,1,[libusb_control_transfer in lusb-1.0])
#],,[$libs])
fi
if test "n$with_bluetooth" = nyes; then
# `-lbluetooth':
AC_CHECK_LIB([bluetooth], [hci_get_route], [
libs="$libs -lbluetooth"
AC_DEFINE(HAVE_BLUETOOTH,1,[hci_get_route in lbluetooth])
],,[$libs])
fi
if test "n$with_crypto" = nyes; then
# `-lgcrypt':
#AC_CHECK_LIB([gcrypt], [gcry_check_version], [
#libs="$libs -lgcrypt"
#AC_DEFINE(HAVE_GCRYPT,1,[gcry_check_version in lgcrypt])
#],,[$libs])
AC_CHECK_LIB([gcrypt], [gcry_check_version], [
libs="$libs -lgcrypt"
AC_DEFINE(HAVE_GCRYPT,1,[gcry_check_version in lgcrypt])
],,[$libs])
fi
if test "n$with_sdl" = nyes; then
# `-lSDL':
AC_CHECK_LIB([SDL], [SDL_MapRGB], AC_DEFINE(HAVE_SDL,1,[Simple Direct Media present]))
AC_CHECK_LIB([SDL_gfx], [hlineRGBA], AC_DEFINE(HAVE_SDL_GFX,1,[Simple Direct Media GFX]))
AC_CHECK_LIB([SDL], [SDL_MapRGB], [
libs="$libs -lSDL"
AC_DEFINE(HAVE_SDL,1,[Simple Direct Media present])
])
AC_CHECK_LIB([SDL_gfx], [hlineRGBA], [
libs="$libs -lSDL_gfx"
AC_DEFINE(HAVE_SDL_GFX,1,[Simple Direct Media GFX])
])
fi
# `-lx11basic':
#AC_CHECK_LIB([x11basic], [programmlauf],,,[$X_LIBS $libs -$xlibs])
# `-ltine':
AC_CHECK_LIB([tine], [_SystemCycle],AC_DEFINE(HAVE_TINE,1,[_SystemCycle in dynamical TINE lib]),,[ -lm])
#AC_CHECK_LIB([tine], [_SystemCycle],AC_DEFINE(HAVE_TINE,1,[_SystemCycle in dynamical TINE lib]),,[ -lm])
# `-lDOOCSclient':
AC_CHECK_LIB([DOOCSclient], [eq_int],AC_DEFINE(HAVE_DOOCS,1,[eq_int in dynamical DOOCS lib]),,[ -lm -lpthread -ltine])
#AC_CHECK_LIB([DOOCSclient], [eq_int],AC_DEFINE(HAVE_DOOCS,1,[eq_int in dynamical DOOCS lib]),,[ -lm -lpthread -ltine])
# `-lvgagl -lvga':
AC_CHECK_LIB([vga], [main],vgalibs="-lvgagl -lvga",,[$VGA_LIBS])
libs="$libs $xlibs"
#AC_CHECK_LIB([vga], [main],vgalibs="-lvgagl -lvga",,[$VGA_LIBS])
AC_SUBST(inc)
AC_SUBST(X_CFLAGS)
......@@ -401,11 +508,15 @@ AC_FUNC_FORK
AC_PROG_GCC_TRADITIONAL
AC_FUNC_MALLOC
AC_FUNC_MEMCMP
AC_FUNC_MMAP
AC_FUNC_REALLOC
AC_TYPE_SIGNAL
AC_FUNC_STAT
AC_FUNC_UTIME_NULL
AC_CHECK_FUNCS([nanosleep inotify_init alarm atexit getcwd gethostbyname gettimeofday inet_ntoa])
AC_CHECK_FUNCS([memmove memfrob select socket strchr strdup strstr utime execvp execvpe futimens])
AC_CHECK_FUNCS([nanosleep inotify_init memfrob utime execvp execvpe futimens])
AC_CHECK_FUNCS([alarm atexit bzero dup2 getcwd gethostbyname gettimeofday])
AC_CHECK_FUNCS([inet_ntoa localtime_r memmove memset mkdir munmap rmdir select])
AC_CHECK_FUNCS([socket strchr strdup strerror strstr])
# Versioning
......@@ -417,6 +528,7 @@ AC_SUBST(mandir)
AC_SUBST(regs)
AC_SUBST(def)
AC_SUBST(libs)
AC_SUBST(xlibs)
AC_SUBST(xtra)
AC_SUBST(copt)
AC_SUBST(static)
......
......@@ -12,10 +12,6 @@
#include "config.h"
#include "options.h"
#ifdef SMALL
#define SAVE_RAM 1
#endif
#ifdef SAVE_RAM
#define MAXSTRLEN 1024 /* in Bytes */
#define MAXLINELEN 1024 /* in Bytes */
......
......@@ -83,7 +83,15 @@ static void intro() {
printf("**********************************************************\n"
"* %10s V.%5s *\n"
"* by Markus Hoffmann 1997-2016 (c) *\n"
#ifdef NOGRAPHICS
"* ====> Version without graphics support <==== *\n"
#elif defined USE_SDL
"* sdl *\n"
#elif defined FRAMEBUFFER
"* fb *\n"
#else
"* *\n"
#endif
#ifdef GERMAN
"* Programmversion vom %30s *\n"
"* Library V. %s vom %30s *\n"
......
......@@ -14,6 +14,13 @@
/*#define SAVE_RAM*/
/* If you want to compile a versin of X11-basic which uses the SDL library
also on unix systems, you can uncomment following line. This is useful
to have a version which is more compatible with the WINDOWS version of
X11-Basic.*/
/*#define USE_SDL*/
#ifdef WINDOWS
#undef HAVE_READLINE
......@@ -28,7 +35,6 @@
#undef HAVE_INOTIFY_INIT
#undef HAVE_USB
#undef HAVE_PRIMORIAL_UI
#define X_DISPLAY_MISSING
#define USE_SDL
#define HAVE_SDL 1
#define HAVE_SDL_GFX 1
......@@ -43,66 +49,52 @@
#undef HAVE_EXECVPE
#undef HAVE_GMP
#undef HAVE_CACOS
#define X_DISPLAY_MISSING
#undef USE_X11
// #define USE_SDL
// #define HAVE_SDL 1
#define HAVE_GEM 1
#define USE_GEM 1
#else
#define USE_X11
#define SAVE_RAM 1
#endif
#if defined FRAMEBUFFER
#define X_DISPLAY_MISSING
#ifndef HAVE_SDL
#undef USE_SDL
#endif
#ifdef NOGRAPHICS
#undef HAVE_SDL
#ifndef HAVE_SDL_GFX
#undef USE_SDL
#undef FRAMEBUFFER
#define X_DISPLAY_MISSING
#endif
#if defined USE_SDL
#ifndef HAVE_X11
#undef USE_X11
#endif
#ifndef WINDOWS
# ifndef CONTROL
/*#define CONTROL*/
# endif
#ifndef HAVE_GEM
#undef USE_GEM
#endif
#ifndef TINE
// #define TINE
#endif
#ifndef DOOCS
//# define TINE
//# define DOOCS
#if !defined FRAMEBUFFER && !defined USE_SDL && !defined USE_X11 && !defined USE_GEM
/* die NOGRAPHICS version ist aber inkompatibel, da einige Kommandos ganz ausgelassen
werden.*/
#define NOGRAPHICS
#endif
#ifndef HAVE_SDL
#undef USE_SDL
#ifndef HAVE_TINE
#undef TINE
#undef DOOCS
#endif
#ifndef HAVE_SDL_GFX
#undef USE_SDL
#ifndef HAVE_DOOCS
#undef DOOCS
#endif
/* If you want to compile a versin of X11-basic which uses the SDL library
also on unix systems, you can uncomment following line. This is useful
to have a version which is more compatible with the WINDOWS version of
X11-Basic.*/
#ifdef X_DISPLAY_MISSING
#undef USE_X11
#endif
#ifdef HAVE_ALSA
#ifndef USE_SDL
#define USE_ALSA
#endif
#endif
/*Systems with small Memory Layout*/
#ifdef SMALL
#define SAVE_RAM
#endif
#endif /* OPTIONS_H */
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment