From: Matt Birkholz Date: Thu, 16 Dec 2010 23:08:56 +0000 (-0700) Subject: Moved src/microcode/prgtkio.c to src/gtk/gtkio.c. X-Git-Tag: 20101221-Gtk~1 X-Git-Url: https://birchwood-abbey.net/git?a=commitdiff_plain;h=dd961f11d5b6e544805df67f58575facaed77e0a;p=mit-scheme.git Moved src/microcode/prgtkio.c to src/gtk/gtkio.c. This simplifies the configuration of src/microcode/, removing conditional references to the Gtks. * doc/gtk/gtk.texinfo: Fixed the "make clean" suggestion to the proper "make distclean". Simplified the build instructions, then made them more novice-friendly, avoiding cautions about writable /usr/local/bin, etc. * src/configure.ac: Moved the --with-gtk support back from microcode/achost.ac, where it is no longer needed. * src/gtk/.gitignore: Added gtkio.c, a product of gtkio.c.stay. * src/gtk/Clean.sh: Removed prgtkio.so; added gtkio.c. * src/gtk/Makefile-fragment: Added gtkio.c, which is not compiled like a regular shim. It uses the machine's OS interface, and narrowly avoids including scheme.h. * src/gtk/gtk-shim.h: Added extern declarations for functions that used to be Gtk primitives. * src/gtk/gtk.cdecl: Declare the new functions. * src/gtk/gtk.sf: There is no prgtkio module, nor gtkio primitives anymore. * src/gtk/gtkio.c.stay: This is src/microcode/prgtkio.c with the primitives turned into simple C functions. * src/gtk/: main.scm, thread.scm: Replace Gtk primitives with callouts to their equivalent C functions. * src/microcode/: configure.ac, achost.ac: Punted --with-gtk. * src/microcode/makegen/: Makefile.in.in, files-optional.scm: Punted prgtkio. * src/microcode/prgtkio.c: Moved to src/gtk/gtkio.c.stay. * src/microcode/: pruxffi.c, pruxffi.h: Added abort_to_c(), so gtkio.c does not need prim.h, scheme.h and everything. --- diff --git a/doc/gtk/gtk.texinfo b/doc/gtk/gtk.texinfo index 0bb19ff3c..be4d042b5 100644 --- a/doc/gtk/gtk.texinfo +++ b/doc/gtk/gtk.texinfo @@ -1804,39 +1804,38 @@ If @var{trace?} is #t, turns on tracing of Scheme's GSource. @node Installation, Implementation Notes, API Reference, Top @chapter Installation -If you have a recent version of MIT-Scheme (with C/Unix FFI) -installed, you can build the snapshot with +If you have a recent version of MIT Scheme (with C/Unix FFI) +installed, you can build and install the snapshot (in +@file{$HOME/}) with these three commands. @smallexample - ./configure; make + ./configure --prefix=$HOME + make + make install @end smallexample -If your MIT-Scheme does not include the FFI, you will need to install -a version that does, like this: - -@smallexample -./configure --without-gtk -make -make install -@end smallexample - -Depending on configuration options and file-system permissions, you -may need super-user privileges to do the installation step. +If your MIT Scheme does not include the FFI, you will need to install +a version that does. Use the same three commands (above) and you will +have built and installed the requisite MIT Scheme, in @file{$HOME}. To verify your install, check that your @code{mit-scheme} command -invokes a Scheme with the FFI. Execute the following command line. +invokes a Scheme with FFI. If you used a configure option like +@code{--prefix=$HOME}, you might use these commands: @smallexample - echo "(load-option 'FFI)" | mit-scheme --batch-mode + export MIT_SCHEME_EXE=$HOME/bin/mit-scheme + echo "(load-option 'FFI)" | $MIT_SCHEME_EXE --batch-mode @end smallexample -If that command completes without complaint, you are ready to +If that command completes without complaint, you have a host for the +Gtk system, which can now be built and installed like this: @smallexample - make clean; ./configure; make + export MIT_SCHEME_EXE=$HOME/bin/mit-scheme + (cd src && make && make install) @end smallexample -If this process falters, please feel free to contact the author. +If you have trouble, please feel free to contact the author. @node Implementation Notes, GNU Free Documentation License, Installation, Top @chapter Implementation Notes diff --git a/src/configure.ac b/src/configure.ac index 3e8fb8a9e..172e5f56c 100644 --- a/src/configure.ac +++ b/src/configure.ac @@ -103,6 +103,33 @@ directory, which is usually \`/usr/local/lib/mit-scheme-${mit_scheme_native_code AC_MSG_RESULT([yes]) fi +AC_CHECK_PROG([PKG_CONFIG], [pkg-config], [yes]) +AC_MSG_CHECKING([for gtk]) +if test "${with_gtk}" = "yes"; then + AC_MSG_RESULT([by request: yes]) +fi +if test "${with_gtk}" = "auto"; then + if test "${PKG_CONFIG}" != yes; then + AC_MSG_RESULT([no pkg-config: no]) + with_gtk=no + elif ! pkg-config --exists gtk+-2.0; then + AC_MSG_RESULT([! pkg-config --exists gtk+-2.0: no]) + with_gtk=no + elif test "${mit_scheme_native_code}" == "c" \ + -a -f ffi/syntax.c; then + # The LIARC boot compiler will have an FFI. + AC_MSG_RESULT([FFI in liarc boot: yes]) + with_gtk=yes + elif "${MIT_SCHEME_EXE}" --eval "(load-option'FFI)" \ + /dev/null 2>&1; then + AC_MSG_RESULT([FFI in host: yes]) + with_gtk=yes + else + AC_MSG_RESULT([no FFI: no]) + with_gtk=no + fi +fi + AC_SUBST([ALL_TARGET]) AC_SUBST([FFIS]) AC_SUBST([INSTALL_COM]) @@ -126,10 +153,6 @@ AC_CONFIG_SUBDIRS([microcode]) m4_include(microcode/achost.ac) -if test "${with_gtk}" = "yes"; then :; -elif test "${with_gtk}" = "no"; then :; -else echo "Warning: with_gtk is not yes|no: ${with_gtk}"; fi - AC_SUBST([CCLD]) AC_SUBST([DEFS]) AC_SUBST([CFLAGS]) diff --git a/src/gtk/.gitignore b/src/gtk/.gitignore index 83b7298da..393d9ee2a 100644 --- a/src/gtk/.gitignore +++ b/src/gtk/.gitignore @@ -4,4 +4,5 @@ gtk-const.scm gtk-shim.c gtk-shim.so scmwidget.c +gtkio.c swat-pole-zero.scm diff --git a/src/gtk/Clean.sh b/src/gtk/Clean.sh index 2775a1d74..bbd312a5e 100755 --- a/src/gtk/Clean.sh +++ b/src/gtk/Clean.sh @@ -12,6 +12,6 @@ fi maybe_rm gtk-shim.c gtk-const* gtk-types* swat-pole-zero* maybe_rm ../lib/conses.png -maybe_rm ../lib/gtk-* ../lib/prgtkio.so -# And, just because the maintainer- and c-clean targets nail this one anyway: -maybe_rm scmwidget.c +maybe_rm ../lib/gtk-* +# And, just because the maintainer- and c-clean targets nail these anyway: +maybe_rm scmwidget.c gtkio.c diff --git a/src/gtk/Makefile-fragment b/src/gtk/Makefile-fragment index 0d25bf679..b4399242e 100644 --- a/src/gtk/Makefile-fragment +++ b/src/gtk/Makefile-fragment @@ -40,7 +40,7 @@ install: $(INSTALL_DATA) gtk-types.bin $(DESTDIR)$(AUXDIR)/. $(INSTALL_DATA) gtk-const.bin $(DESTDIR)$(AUXDIR)/. -gtk-shim.so: gtk-shim.o scmwidget.o +gtk-shim.so: gtk-shim.o scmwidget.o gtkio.o $(LINK_SHIM) $^ `pkg-config --libs gtk+-2.0` scmwidget.o: scmwidget.c @@ -49,6 +49,14 @@ scmwidget.o: scmwidget.c scmwidget.c: scmwidget.c.stay cp -p scmwidget.c.stay scmwidget.c +# $(COMPILE) will not do. Its DEFS conflict (cause warnings) with config.h. +gtkio.o: gtkio.c + $(CC) $(CPPFLAGS) $(CFLAGS) `pkg-config --cflags gtk+-2.0` \ + -I../microcode -c $< + +gtkio.c: gtkio.c.stay + cp -p gtkio.c.stay gtkio.c + gtk-shim.o: gtk-shim.c gtk-shim.h ../lib/mit-scheme.h $(COMPILE_SHIM) `pkg-config --cflags gtk+-2.0` -o $@ -c $< diff --git a/src/gtk/gtk-shim.h b/src/gtk/gtk-shim.h index ef00c526e..5c94c3b18 100644 --- a/src/gtk/gtk-shim.h +++ b/src/gtk/gtk-shim.h @@ -39,12 +39,6 @@ typedef struct _ScmWidget ScmWidget; struct _ScmWidgetClass { GtkWidgetClass parent_class; - - /* Padding for future expansion */ - void (*_gtk_reserved1) (void); - void (*_gtk_reserved2) (void); - void (*_gtk_reserved3) (void); - void (*_gtk_reserved4) (void); }; struct _ScmWidget @@ -53,3 +47,11 @@ struct _ScmWidget }; extern GtkWidget* scm_widget_new (void); + +extern void gtk_main_plus (void); +extern void gtk_main_plus_quit (void); +extern void run_gtk (ulong registry, double time); +extern gboolean gtk_time_slice_window_p (void); +extern void gtk_time_slice_window (gboolean open_p); +extern gboolean gtk_select_trace_p (void); +extern void gtk_select_trace (gboolean trace_p); diff --git a/src/gtk/gtk.cdecl b/src/gtk/gtk.cdecl index 8d1f06e24..eb82b476a 100644 --- a/src/gtk/gtk.cdecl +++ b/src/gtk/gtk.cdecl @@ -32,6 +32,16 @@ USA. ;;(include "Includes/cairo-xlib") Needs definitions for Drawable, Display... (include "Includes/pangocairo") +;;; GtkIO + +(extern void gtk_main_plus) +(extern void gtk_main_plus_quit) +(extern void run_gtk (registry ulong) (time double)) +(extern gboolean gtk_time_slice_window_p) +(extern void gtk_time_slice_window (open_p gboolean)) +(extern gboolean gtk_select_trace_p) +(extern void gtk_select_trace (trace_p gboolean)) + ;;; ScmWidget (typedef ScmWidget diff --git a/src/gtk/gtk.sf b/src/gtk/gtk.sf index 5fb530e22..03b1a6077 100644 --- a/src/gtk/gtk.sf +++ b/src/gtk/gtk.sf @@ -7,9 +7,6 @@ (load-option 'SOS) (load-option 'FFI)) -;; Load the gtkio primitives too, so SF can check their arity(?). -(load-library-object-file "prgtkio" #t) - (sf-package-set "gtk-new") (cref/generate-constructors "gtk" 'ALL) \ No newline at end of file diff --git a/src/microcode/prgtkio.c b/src/gtk/gtkio.c.stay similarity index 73% rename from src/microcode/prgtkio.c rename to src/gtk/gtkio.c.stay index 11a84501d..7f58d017e 100644 --- a/src/microcode/prgtkio.c +++ b/src/gtk/gtkio.c.stay @@ -23,19 +23,16 @@ USA. /* SchemeSource -- the custom GSource that runs Scheme in an idle task. */ -#include "scheme.h" -#include "prims.h" -#include "pruxffi.h" - #include "osio.h" #include "osenv.h" -#include "ux.h" -#include "uxio.h" -#include "uxproc.h" - +#include "osproc.h" +#include "osscheme.h" #include #include +extern void Interpret (int pop_return_p); +extern void abort_to_c (void); + struct _SchemeSource { GSource source; @@ -58,18 +55,17 @@ static gboolean scheme_source_prepare (GSource * source, gint * timeout); static gboolean scheme_source_check (GSource * source); static int pending_io (SchemeSource * source); static gboolean scheme_source_dispatch (GSource * source, GSourceFunc callback, gpointer user_data); -SchemeSource * scheme_source_new (void); -void scheme_source_destroy (SchemeSource * source); +static SchemeSource * scheme_source_new (void); +static void scheme_source_destroy (SchemeSource * source); static void clear_registry (SchemeSource * source); static void set_registry (SchemeSource * source, GSList * new, double time); -static SchemeSource * scheme_source; -extern int cstack_depth; /* in pruxffi.c */ -static SCHEME_OBJECT tracing_gtk_select; +static SchemeSource * scheme_source = NULL; +static gboolean tracing_gtk_select = 0; static GSList * gtk_registry (select_registry_t registry); static int slice_counter = 0; -static GtkWidget * slice_window; +static GtkWidget * slice_window = NULL; static GtkWidget * slice_label; static GtkWidget * status_label; static void open_slice_window (void); @@ -91,7 +87,7 @@ scheme_source_prepare (GSource * source, gint * timeout) || pending_interrupts_p () || OS_process_any_status_change ()) { - if (tracing_gtk_select == SHARP_T) + if (tracing_gtk_select) { if (timeo > 0) { @@ -110,7 +106,7 @@ scheme_source_prepare (GSource * source, gint * timeout) return (TRUE); /* Ready for immediate dispatch. */ } - if (tracing_gtk_select == SHARP_T) + if (tracing_gtk_select) { outf_console (";scheme_source_prepare: polling for %dmsec\n", timeo); outf_flush_console (); @@ -131,7 +127,7 @@ scheme_source_check (GSource * source) || pending_interrupts_p () || OS_process_any_status_change ()) { - if (tracing_gtk_select == SHARP_T + if (tracing_gtk_select && (time > src->time_limit || pending_interrupts_p () || OS_process_any_status_change ())) @@ -153,7 +149,7 @@ pending_io (SchemeSource * src) { GSList * scan; - if (tracing_gtk_select == SHARP_T) + if (tracing_gtk_select) { scan = src->gpollfds; while (scan != NULL) @@ -205,14 +201,14 @@ scheme_source_dispatch (GSource * source, gtk_label_set_text (GTK_LABEL (status_label), text); g_free (text); } - if (tracing_gtk_select == SHARP_T) + if (tracing_gtk_select) { outf_console (";scheme_source_dispatch: running time slice %d\n", slice_counter); outf_flush_console (); } Interpret (1); - if (tracing_gtk_select == SHARP_T) + if (tracing_gtk_select) { outf_console (";scheme_source_dispatch: finished time slice %d\n", slice_counter); @@ -231,7 +227,7 @@ GSourceFuncs scheme_source_funcs = NULL }; -SchemeSource * +static SchemeSource * scheme_source_new (void) { GSource * source = g_source_new (&scheme_source_funcs, sizeof (SchemeSource)); @@ -245,7 +241,7 @@ scheme_source_new (void) return (src); } -void +static void scheme_source_destroy (SchemeSource * source) { clear_registry (source); @@ -303,41 +299,37 @@ set_registry (SchemeSource * source, GSList * new, double time) /* Invoking main_loop_run. */ -DEFINE_PRIMITIVE ("GTK-MAIN+", Prim_gtk_main_plus, 0, 0, 0) +gboolean +gtk_main_plus (void) { - /* Runs a GMainLoop with scheme_source attached. */ + /* Runs a GMainLoop with scheme_source attached. Returns 1 when + successful. */ - PRIMITIVE_HEADER (0); + if (scheme_source != NULL) + return (FALSE); - canonicalize_primitive_context (); - { - if (scheme_source != NULL) - error_external_return (); - - scheme_source = scheme_source_new (); - g_main_loop_run (scheme_source->main_loop); - /* Heap may have been GCed! Luckily we don't need it. */ - scheme_source_destroy (scheme_source); - scheme_source = NULL; - } - PRIMITIVE_RETURN (SHARP_T); + scheme_source = scheme_source_new (); + g_main_loop_run (scheme_source->main_loop); + /* Heap may have been GCed! Luckily we don't need it. */ + scheme_source_destroy (scheme_source); + scheme_source = NULL; + return (TRUE); } -DEFINE_PRIMITIVE ("GTK-MAIN+-QUIT", Prim_gtk_main_plus_quit, 0, 0, 0) +gboolean +gtk_main_plus_quit (void) { - PRIMITIVE_HEADER (0); + /* Returns TRUE when successful. */ - canonicalize_primitive_context (); - { - if (scheme_source == NULL) - error_external_return (); + if (scheme_source == NULL) + return (FALSE); - g_main_loop_quit (scheme_source->main_loop); - } - PRIMITIVE_RETURN (SHARP_F); + g_main_loop_quit (scheme_source->main_loop); + return (TRUE); } -DEFINE_PRIMITIVE ("RUN-GTK", Prim_run_gtk, 2, 2, 0) +void +run_gtk (select_registry_t r, double time) { /* Return to the toolkit with the scheme_source set up to dispatch to Scheme again when I/O is ready, or a certain TIME has passed. @@ -345,28 +337,22 @@ DEFINE_PRIMITIVE ("RUN-GTK", Prim_run_gtk, 2, 2, 0) Scheme is ready to run again immediately. If I/O is empty, the simulated poll should not re-enter Scheme until TIME. */ - PRIMITIVE_HEADER (2); - canonicalize_primitive_context (); - { - select_registry_t r = arg_select_registry (1); - double time = arg_real_number (2); - set_registry (scheme_source, gtk_registry (r), time); - if (tracing_gtk_select == SHARP_T) - { - GSList * gpollfds = scheme_source->gpollfds; - gchar * fdstr = gpollfds_string (gpollfds); - outf_console (";run_gtk%s%s until %.1f\n", - gpollfds == NULL ? "" : " waiting on", fdstr, time); - outf_flush_console (); - if (fdstr[0] != '\0') - g_free (fdstr); - } - POP_PRIMITIVE_FRAME (2); - SET_EXP (SHARP_F); - PRIMITIVE_ABORT (PRIM_RETURN_TO_C); - /*NOTREACHED*/ - PRIMITIVE_RETURN (UNSPECIFIC); - } + set_registry (scheme_source, gtk_registry (r), time); + if (tracing_gtk_select) + { + GSList * gpollfds = scheme_source->gpollfds; + gchar * fdstr = gpollfds_string (gpollfds); + outf_console (";run_gtk%s%s until %.1f\n", + gpollfds == NULL ? "" : " waiting on", fdstr, time); + outf_flush_console (); + if (fdstr[0] != '\0') + g_free (fdstr); + } + + /* The c-call primitive has arranged for c-call-continue to run (and + thus Scm_run_gtk_continue) when Scheme continues. */ + abort_to_c (); + /*NOTREACHED*/ } @@ -458,67 +444,35 @@ close_slice_window (void) slice_label = NULL; } -DEFINE_PRIMITIVE ("GTK-TIME-SLICE-WINDOW?", Prim_gtk_time_slice_window_p, 0,0,0) +gboolean +gtk_time_slice_window_p (void) { - PRIMITIVE_HEADER (0); - - PRIMITIVE_RETURN (slice_window == NULL ? SHARP_F : SHARP_T); + return (slice_window == NULL ? 0 : 1); } -DEFINE_PRIMITIVE ("GTK-TIME-SLICE-WINDOW!", Prim_gtk_time_slice_window, 1, 1, 0) -{ - PRIMITIVE_HEADER (1); - { - SCHEME_OBJECT arg = (ARG_REF (1)); - if (arg == SHARP_F) - { - if (slice_window != NULL) - close_slice_window (); - } - else - { - if (slice_window == NULL) - open_slice_window (); - } - PRIMITIVE_RETURN (arg); - } -} - -DEFINE_PRIMITIVE ("GTK-SELECT-TRACE?", Prim_gtk_select_trace_p, 0, 0, 0) +void +gtk_time_slice_window (gboolean open_p) { - PRIMITIVE_HEADER (0); - - PRIMITIVE_RETURN (tracing_gtk_select); + if (!open_p) + { + if (slice_window != NULL) + close_slice_window (); + } + else + { + if (slice_window == NULL) + open_slice_window (); + } } -DEFINE_PRIMITIVE ("GTK-SELECT-TRACE!", Prim_gtk_select_trace, 1, 1, 0) +gboolean +gtk_select_trace_p (void) { - PRIMITIVE_HEADER (1); - { - SCHEME_OBJECT arg = (ARG_REF (1)); - tracing_gtk_select = (arg == SHARP_F ? SHARP_F : SHARP_T); - PRIMITIVE_RETURN (arg); - } + return (tracing_gtk_select); } - -#ifdef COMPILE_AS_MODULE - -char * -dload_initialize_file (void) +void +gtk_select_trace (gboolean trace_p) { - scheme_source = NULL; - slice_window = NULL; - tracing_gtk_select = SHARP_F; - - declare_primitive ("GTK-MAIN+", Prim_gtk_main_plus, 0, 0, 0); - declare_primitive ("GTK-MAIN+-QUIT", Prim_gtk_main_plus_quit, 0, 0, 0); - declare_primitive ("RUN-GTK", Prim_run_gtk, 2, 2, 0); - declare_primitive ("GTK-TIME-SLICE-WINDOW?", Prim_gtk_time_slice_window_p, 0, 0, 0); - declare_primitive ("GTK-TIME-SLICE-WINDOW!", Prim_gtk_time_slice_window, 1, 1, 0); - declare_primitive ("GTK-SELECT-TRACE?", Prim_gtk_select_trace_p, 0, 0, 0); - declare_primitive ("GTK-SELECT-TRACE!", Prim_gtk_select_trace, 1, 1, 0); - return ("#prgtkio"); + tracing_gtk_select = trace_p; } - -#endif /* COMPILE_AS_MODULE */ diff --git a/src/gtk/main.scm b/src/gtk/main.scm index 6e893112d..199a00a10 100644 --- a/src/gtk/main.scm +++ b/src/gtk/main.scm @@ -82,10 +82,9 @@ USA. (define (gtk-main+) ;; Establishes a GMainLoop in which scheme is an idle task. - (load-library-object-file "prgtkio" #t) (without-interrupts (lambda () - ((ucode-primitive gtk-main+)) + (C-call "gtk_main_plus") (create-gtk-thread)))) (define (gtk-main+-quit) @@ -93,11 +92,18 @@ USA. (without-interrupts (lambda () (kill-gtk-thread) - ((ucode-primitive gtk-main+-quit))))) + (C-call "gtk_main_plus_quit")))) -(define gtk-time-slice-window? (ucode-primitive gtk-time-slice-window? 0)) -(define gtk-time-slice-window! (ucode-primitive gtk-time-slice-window! 1)) -(define gtk-select-trace? (ucode-primitive gtk-select-trace? 0)) -(define gtk-select-trace! (ucode-primitive gtk-select-trace! 1)) +(define (gtk-time-slice-window?) + (C-call "gtk_time_slice_window_p")) + +(define (gtk-time-slice-window! open?) + (C-call "gtk_time_slice_window" open?)) + +(define (gtk-select-trace?) + (C-call "gtk_select_trace_p")) + +(define (gtk-select-trace! on?) + (C-call "gtk_select_trace" (if on? 1 0))) (initialize-package!) \ No newline at end of file diff --git a/src/gtk/thread.scm b/src/gtk/thread.scm index c9aefac23..74ac3181a 100644 --- a/src/gtk/thread.scm +++ b/src/gtk/thread.scm @@ -25,6 +25,7 @@ USA. ;;; package: (gtk thread) ;;; parent: (runtime thread) +(c-include "gtk") (define gtk-thread #f) @@ -59,8 +60,9 @@ USA. (or next-scheduled-timeout (no-threads-nor-timers))))) (trace ";run-gtk until "time"\n") - ((ucode-primitive run-gtk 2) - (select-registry-handle io-registry) time) + (C-call "run_gtk" + (select-registry-handle io-registry) + time) (trace ";run-gtk done at "(real-time-clock)"\n")) (maybe-signal-io-thread-events))) (yield-current-thread) diff --git a/src/microcode/achost.ac b/src/microcode/achost.ac index 019fd797e..f61ea2ad9 100644 --- a/src/microcode/achost.ac +++ b/src/microcode/achost.ac @@ -217,28 +217,3 @@ if test "${DO_GCC_TESTS}" = yes; then ], [AC_MSG_RESULT([no])]) fi - -AC_CHECK_PROG([PKG_CONFIG], [pkg-config], [yes]) -AC_MSG_CHECKING([for gtk]) -if test "${with_gtk}" = "yes"; then - AC_MSG_RESULT([by request: yes]) -fi -if test "${with_gtk}" = "auto"; then - if test "${PKG_CONFIG}" != yes; then - AC_MSG_RESULT([no pkg-config: no]) - with_gtk=no - elif ! "${MIT_SCHEME_EXE}" --eval "(load-option'FFI)" \ - /dev/null 2>&1; then - AC_MSG_RESULT([no FFI in ${MIT_SCHEME_EXE}: no]) - with_gtk=no - elif ! pkg-config --exists gtk+-2.0; then - AC_MSG_RESULT([! pkg-config --exists gtk+-2.0: no]) - with_gtk=no - else - AC_MSG_RESULT([yes]) - with_gtk=yes - fi -fi -if test "${with_gtk}" = "yes"; then - MODULE_TARGETS="${MODULE_TARGETS} prgtkio.so" -fi diff --git a/src/microcode/configure.ac b/src/microcode/configure.ac index a9654c073..ccb107d26 100644 --- a/src/microcode/configure.ac +++ b/src/microcode/configure.ac @@ -174,11 +174,6 @@ AC_ARG_WITH([module-loader], [Pathname of the Scheme executable, for building modules only])) : ${with_module_loader='yes'} -AC_ARG_WITH([gtk], - AS_HELP_STRING([--with-gtk], - [Support the GNOME Toolkit if available [[yes]]])) -: ${with_gtk='yes'} - dnl Substitution variables to be filled in below. AS_FLAGS= GC_HEAD_FILES="gccode.h cmpgc.h cmpintmd-config.h cmpintmd.h" diff --git a/src/microcode/makegen/Makefile.in.in b/src/microcode/makegen/Makefile.in.in index 2f47fc1f9..89824c892 100644 --- a/src/microcode/makegen/Makefile.in.in +++ b/src/microcode/makegen/Makefile.in.in @@ -216,14 +216,8 @@ prx11.so: prx11.o x11base.o x11color.o x11graph.o x11term.o @MODULE_LOADER@ $(LINK_MODULE) prx11.o x11base.o x11color.o x11graph.o x11term.o \ -lX11 $(MODULE_LIBS) -prgtkio.so: prgtkio.o scheme - $(LINK_MODULE) prgtkio.o `pkg-config --libs gtk+-2.0` $(MODULE_LIBS) - @MODULE_RULES@ -prgtkio.o: prgtkio.c - $(COMPILE_MODULE) `pkg-config --cflags gtk+-2.0` -c $< - tags: TAGS TAGS: etags -r '/^DEF[A-Z0-9_]*[ \t]*(\("[^"]+"\|[a-zA-Z_][a-zA-Z0-9_]*\)/' \ diff --git a/src/microcode/makegen/files-optional.scm b/src/microcode/makegen/files-optional.scm index bd8435df6..81bf608a6 100644 --- a/src/microcode/makegen/files-optional.scm +++ b/src/microcode/makegen/files-optional.scm @@ -36,7 +36,6 @@ USA. "pruxdld" "pruxffi" "prx11" -"prgtkio" "svm1-interp" "termcap" "terminfo" diff --git a/src/microcode/pruxffi.c b/src/microcode/pruxffi.c index 02c1df3a2..61f201759 100644 --- a/src/microcode/pruxffi.c +++ b/src/microcode/pruxffi.c @@ -594,6 +594,15 @@ DEFINE_PRIMITIVE ("RETURN-TO-C", Prim_return_to_c, 0, 0, 0) } } +/* This is mainly for src/gtk/gtkio.c, so it does not need to include + prim.h, scheme.h and everything. */ +void +abort_to_c (void) +{ + PRIMITIVE_ABORT (PRIM_RETURN_TO_C); + /* NOTREACHED */ +} + char * callback_lunseal (CallbackKernel expected) { diff --git a/src/microcode/pruxffi.h b/src/microcode/pruxffi.h index a8ef3c09f..fd2d74451 100644 --- a/src/microcode/pruxffi.h +++ b/src/microcode/pruxffi.h @@ -54,6 +54,7 @@ extern void callout_unseal (CalloutTrampIn expected); extern void callout_continue (CalloutTrampIn tramp); extern char* callout_lunseal (CalloutTrampIn expected); extern void callout_pop (char* tos); +extern void abort_to_c (void); typedef void (*CallbackKernel)(void); extern void callback_run_kernel (long callback_id, CallbackKernel kernel);