From 2cb0be0ee0a93f9fa6b5a85bc2192fabfb958140 Mon Sep 17 00:00:00 2001 From: ketmar Date: Wed, 24 Nov 2010 17:54:32 +0200 Subject: [PATCH] should be buildable with 0build.sh again --- 0build.sh | 2 +- Jamrules | 8 +++++--- src/main.c | 22 +++++++++++++++++++--- src/primlib/lst_primitives.h | 4 +++- 4 files changed, 28 insertions(+), 8 deletions(-) diff --git a/0build.sh b/0build.sh index e61e276..f0eebe0 100644 --- a/0build.sh +++ b/0build.sh @@ -46,7 +46,7 @@ $CC -c -o ./_build/main.o $OPT $DEFS -Isrc -I./src src/main.c $CC -s -o lst ./_build/main.o ./_build/lib/liblstcore.a ./_build/lib/liblstpl_stdlib.a \ ./_build/lib/liblstpl_ffi.a ./_build/lib/liblstpl_socket.a \ ./_build/lib/liblstpl_relib.a ./_build/lib/libhsrelib.a ./_build/lib/libtrex.a \ - -ldl + -ldl -lrt -lm chmod 755 lst $CC -c -o ./_build/imgbuild.o $OPT $DEFS -Isrc/builder -I./src src/builder/imgbuild.c $CC -s -o imgbuilder ./_build/imgbuild.o diff --git a/Jamrules b/Jamrules index d0b4d6b..b09df1b 100644 --- a/Jamrules +++ b/Jamrules @@ -45,15 +45,17 @@ if $(WINDOZE) { C++LINKFLAGS += -pthread ; } else if $(LST_USE_IUP) { Echo "MSG: adding IUP GUI interface" ; - DEFINES += USE_IUP ; + DEFINES += LST_USE_IUP ; #LINKFLAGS += -L$(TOP)/extlibs ; HDRS += $(TOP)/extincs ; #LINKFLAGS += -liup -liupcontrols -liupimglib ; #LINKLIBS += $(TOP)/extlibs/libiup.a $(TOP)/extlibs/libiupcontrols.a $(TOP)/extlibs/libiupimglib.a ; lib-config "pkg-config gtk+-2.0" ; + } else { + DEFINES += LST_USE_X11 ; + lib-config "pkg-config x11" ; + lib-config "pkg-config xft" ; } - lib-config "pkg-config x11" ; - lib-config "pkg-config xft" ; } diff --git a/src/main.c b/src/main.c index 10ab9a4..71e0809 100644 --- a/src/main.c +++ b/src/main.c @@ -66,7 +66,9 @@ # include "lstfltk.h" #endif -#include "lstiup.h" +#ifdef LST_USE_IUP +# include "lstiup.h" +#endif /* the following defaults must be set */ @@ -227,15 +229,19 @@ static int isKeyHit (void) { static int sigCheck (int *ticksLeft) { -#ifdef USE_IUP +#ifdef LST_USE_IUP guiLoopStep(); #else -# ifndef LST_ON_WINDOWS +# ifdef LST_USE_X11 x11LoopStep(); # endif #endif +#ifdef LST_USE_IUP if (guiHasEvent()) return 1100; /* 1100: GUI event */ +#endif +#ifdef LST_USE_X11 if (x11HasEvent()) return 1200; /* 1200: X11 event */ +#endif if (isKeyHit()) return 1001; /* 1001: has something in input buffer */ if (alarmSignal) { alarmSignal = 0; return 1; } return 0; @@ -440,10 +446,14 @@ int main (int argc, char **argv) { /* lstInitPrimitivesSQLite(); */ +#ifdef LST_USE_IUP lstInitPrimitivesIUP(); +#endif lstRegisterExtPrimitiveTable(primTbl); #ifndef LST_ON_WINDOWS +# ifdef LST_USE_X11 lstInitPrimitivesX11(); +# endif #endif /* read image file */ @@ -472,7 +482,9 @@ int main (int argc, char **argv) { } #ifndef LST_ON_WINDOWS +# ifdef LST_USE_X11 lstInitX11Library(); +# endif #endif #ifdef DEBUG @@ -518,7 +530,9 @@ int main (int argc, char **argv) { lstEventCheck = sigCheck; #endif +#ifdef LST_USE_IUP guiInit(&argc, &argv); +#endif if (optLoadInitSt) { static char initName[8192], *home; FILE *fl = NULL; @@ -598,7 +612,9 @@ doLoadInitSt: } quit: +#ifdef LST_USE_IUP guiShutdown(); +#endif stTime = getTicksMS()-stTime; if (optDoBench && stTime > 0) { printf("method call ratio: %d methods per second\n", diff --git a/src/primlib/lst_primitives.h b/src/primlib/lst_primitives.h index 288fe1f..244be40 100644 --- a/src/primlib/lst_primitives.h +++ b/src/primlib/lst_primitives.h @@ -45,7 +45,9 @@ extern "C" { #include "primlib/relib/lstpl_regexp.h" #ifndef _WIN32 -# include "primlib/x11lib/lstpl_x11.h" +# ifdef LST_USE_X11 +# include "primlib/x11lib/lstpl_x11.h" +# endif #endif -- 2.11.4.GIT