From 33a9e2da214a3c03f5533370dabe29426a31fb5c Mon Sep 17 00:00:00 2001 From: sam Date: Sun, 28 Sep 2003 09:57:09 +0000 Subject: [PATCH] * Split the common part of the xaw and motif plugins into a separate libelk-xt shared library. git-svn-id: svn://svn.zoy.org/elk/trunk@214 55e467fa-43c5-0310-a8a2-de718669efc6 --- configure.ac | 27 +++++-- lib/xwidgets/Makefile.am | 141 +++------------------------------ lib/xwidgets/mkwidget.scm | 11 +-- lib/xwidgets/motif/Makefile.am | 75 ++++++++++++++++++ lib/xwidgets/motif/init.c | 48 +++++++++++ lib/xwidgets/xaw/Makefile.am | 71 +++++++++++++++++ lib/xwidgets/xaw/init.c | 48 +++++++++++ lib/xwidgets/xt.h | 13 +++ 8 files changed, 287 insertions(+), 147 deletions(-) create mode 100644 lib/xwidgets/motif/Makefile.am create mode 100644 lib/xwidgets/motif/init.c create mode 100644 lib/xwidgets/xaw/Makefile.am create mode 100644 lib/xwidgets/xaw/init.c diff --git a/configure.ac b/configure.ac index f01c396..cd28ffc 100644 --- a/configure.ac +++ b/configure.ac @@ -462,18 +462,27 @@ AM_CONDITIONAL(HAVE_X11, test "${ac_cv_my_have_x11}" = "yes") AC_SUBST(X_CFLAGS) AC_SUBST(X_LIBS) -AC_CHECK_LIB(Xmu, XmuDrawLogo, - [xmu_libraries="-lXmu"], - [xmu_libraries=""], - [[-lXt -lSM -lICE -lXext -lX11 -L${x_libraries}]]) +if test "${cross_compiling}" = "no"; then + AC_CHECK_LIB(Xmu, XmuDrawLogo, + [ac_cv_my_have_xmu=yes + XMU_CFLAGS="-I${x_includes}" + XMU_LIBS="-L${x_libraries} -lXt -lSM -lICE -lXext -lX11"], + [ac_cv_my_have_xmu=no], + [[-lXt -lSM -lICE -lXext -lX11 -L${x_libraries}]]) +else + ac_cv_my_have_xmu="no (cross-compiling)" +fi +AM_CONDITIONAL(HAVE_XMU, test "${ac_cv_my_have_xmu}" = "yes") +AC_SUBST(XMU_CFLAGS) +AC_SUBST(XMU_LIBS) if test "${cross_compiling}" = "no"; then AC_CHECK_LIB(Xaw, XawTextSearch, [ac_cv_my_have_xaw=yes XAW_CFLAGS="-I${x_includes}" - XAW_LIBS="-L${x_libraries} -lXaw ${xmu_libraries} -lXt -lSM -lICE -lXext -lX11"], + XAW_LIBS="-L${x_libraries} -lXaw ${XMU_LIBS}"], [ac_cv_my_have_xaw=no], - [[${xmu_libraries} -lXt -lSM -lICE -lXext -lX11 -L${x_libraries}]]) + [[${XMU_LIBS}]]) else ac_cv_my_have_xaw="no (cross-compiling)" fi @@ -485,9 +494,9 @@ if test "${cross_compiling}" = "no"; then AC_CHECK_LIB(Xm, XmStringConcat, [ac_cv_my_have_motif=yes MOTIF_CFLAGS="-I${x_includes} -I/usr/include/Xm" - MOTIF_LIBS="-L${x_libraries} -lXm ${xmu_libraries} -lXt -lSM -lICE -lXext -lX11"], + MOTIF_LIBS="-L${x_libraries} -lXm ${XMU_LIBS}"], [ac_cv_my_have_motif=no], - [[${xmu_libraries} -lXt -lSM -lICE -lXext -lX11 -L${x_libraries}]]) + [[${XMU_LIBS}]]) else ac_cv_my_have_motif="no (cross-compiling)" fi @@ -545,6 +554,8 @@ AC_OUTPUT([ lib/unix/Makefile lib/xlib/Makefile lib/xwidgets/Makefile + lib/xwidgets/xaw/Makefile + lib/xwidgets/motif/Makefile scm/Makefile src/Makefile diff --git a/lib/xwidgets/Makefile.am b/lib/xwidgets/Makefile.am index f9cd45e..139c20a 100644 --- a/lib/xwidgets/Makefile.am +++ b/lib/xwidgets/Makefile.am @@ -1,35 +1,23 @@ NULL = -AUTOMAKE_OPTIONS = subdir-objects -EXTRA_DIST = MISSING mkwidget.scm $(SOURCES_XAW_D) $(SOURCES_MOTIF_D) -CLEANFILES = $(SOURCES_XAW_C) $(SOURCES_MOTIF_C) +SUBDIRS = . xaw motif -pkglib_LTLIBRARIES = $(xaw_la) $(motif_la) +EXTRA_DIST = MISSING mkwidget.scm -if HAVE_XAW -xaw_la = xaw.la +lib_LTLIBRARIES = $(libelk_xt_la) + +if HAVE_XMU +libelk_xt_la = libelk-xt.la endif -if HAVE_MOTIF -motif_la = motif.la -endif - -xaw_la_SOURCES = $(SOURCES_XT) $(SOURCES_XAW_C) -xaw_la_CFLAGS = -I$(srcdir)/../xlib @XAW_CFLAGS@ -DUSING_XAW -xaw_la_LDFLAGS = -module -avoid-version -no-undefined -xaw_la_LIBADD = $(top_builddir)/src/libelk.la @XAW_LIBS@ - -motif_la_SOURCES = $(SOURCES_XT) $(SOURCES_MOTIF_C) -motif_la_CFLAGS = -I$(srcdir)/../xlib @MOTIF_CFLAGS@ -DUSING_MOTIF -motif_la_LDFLAGS = -module -avoid-version -no-undefined -u XmIsMotifWMRunning -motif_la_LIBADD = $(top_builddir)/src/libelk.la @MOTIF_LIBS@ +libelk_xt_la_SOURCES = $(SOURCES_XT) +libelk_xt_la_CFLAGS = -I$(srcdir)/../xlib @XMU_CFLAGS@ +libelk_xt_la_LDFLAGS = -no-undefined +libelk_xt_la_LIBADD = $(top_builddir)/src/libelk.la ../xlib/libelk-xlib.la @XMU_LIBS@ extensions_HEADERS = xt.h extensionsdir = $(pkgincludedir)/extensions -.d.c: - $(top_builddir)/src/elk -g -p .:$(top_srcdir)/scm:$(srcdir)/.. -l mkwidget.scm $< $@ - SOURCES_XT = \ accelerator.c \ action.c \ @@ -49,112 +37,3 @@ SOURCES_XT = \ xtobjects.c \ $(NULL) -SOURCES_XAW_C = \ - xaw/ascii.c \ - xaw/box.c \ - xaw/command.c \ - xaw/dialog.c \ - xaw/form.c \ - xaw/grip.c \ - xaw/label.c \ - xaw/list.c \ - xaw/menubutton.c \ - xaw/paned.c \ - xaw/panner.c \ - xaw/porthole.c \ - xaw/repeater.c \ - xaw/scrollbar.c \ - xaw/shell.c \ - xaw/simplemenu.c \ - xaw/sme.c \ - xaw/smebsb.c \ - xaw/smeline.c \ - xaw/stripchart.c \ - xaw/toggle.c \ - xaw/tree.c \ - xaw/viewport.c \ - $(NULL) - -SOURCES_XAW_D = \ - xaw/ascii.d \ - xaw/box.d \ - xaw/command.d \ - xaw/dialog.d \ - xaw/form.d \ - xaw/grip.d \ - xaw/label.d \ - xaw/list.d \ - xaw/menubutton.d \ - xaw/paned.d \ - xaw/panner.d \ - xaw/porthole.d \ - xaw/repeater.d \ - xaw/scrollbar.d \ - xaw/shell.d \ - xaw/simplemenu.d \ - xaw/sme.d \ - xaw/smebsb.d \ - xaw/smeline.d \ - xaw/stripchart.d \ - xaw/toggle.d \ - xaw/tree.d \ - xaw/viewport.d \ - $(NULL) - -SOURCES_MOTIF_C = \ - motif/arrow-button.c \ - motif/bulletin-brd.c \ - motif/cascade-btn.c \ - motif/command.c \ - motif/drawing-area.c \ - motif/drawn-button.c \ - motif/file-selectn.c \ - motif/form.c \ - motif/frame.c \ - motif/label.c \ - motif/list.c \ - motif/main-window.c \ - motif/message-box.c \ - motif/paned-window.c \ - motif/push-button.c \ - motif/row-column.c \ - motif/scale.c \ - motif/scroll-bar.c \ - motif/scrolled-win.c \ - motif/selectn-box.c \ - motif/separator.c \ - motif/shell.c \ - motif/support.c \ - motif/text.c \ - motif/toggle-btn.c \ - $(NULL) - -SOURCES_MOTIF_D = \ - motif/arrow-button.d \ - motif/bulletin-brd.d \ - motif/cascade-btn.d \ - motif/command.d \ - motif/drawing-area.d \ - motif/drawn-button.d \ - motif/file-selectn.d \ - motif/form.d \ - motif/frame.d \ - motif/label.d \ - motif/list.d \ - motif/main-window.d \ - motif/message-box.d \ - motif/paned-window.d \ - motif/push-button.d \ - motif/row-column.d \ - motif/scale.d \ - motif/scroll-bar.d \ - motif/scrolled-win.d \ - motif/selectn-box.d \ - motif/separator.d \ - motif/shell.d \ - motif/support.d \ - motif/text.d \ - motif/toggle-btn.d \ - $(NULL) - - diff --git a/lib/xwidgets/mkwidget.scm b/lib/xwidgets/mkwidget.scm index 0c8471c..f2d590e 100644 --- a/lib/xwidgets/mkwidget.scm +++ b/lib/xwidgets/mkwidget.scm @@ -135,14 +135,9 @@ (string->symbol (substring fn 0 i)))) (define args (command-line-args)) -(if (not (= (length args) 2)) - (error 'mkwidget "expected two arguments")) -(define widget-set - (let ((n (substring? "/" (cadr args)))) -(display (cadr args))(newline) - (if n - (string->symbol (substring (cadr args) 0 n)) - 'unknown))) +(if (not (= (length args) 3)) + (error 'mkwidget "expected three arguments")) +(define widget-set (string->symbol (caddr args))) (set! f (open-output-file (cadr args))) (load (car args)) (if (not type-name) diff --git a/lib/xwidgets/motif/Makefile.am b/lib/xwidgets/motif/Makefile.am new file mode 100644 index 0000000..6bf4780 --- /dev/null +++ b/lib/xwidgets/motif/Makefile.am @@ -0,0 +1,75 @@ +NULL = + +EXTRA_DIST = $(SOURCES_MOTIF_D) +CLEANFILES = $(SOURCES_MOTIF_C) + +pkglib_LTLIBRARIES = $(motif_la) + +if HAVE_MOTIF +motif_la = motif.la +endif + +motif_la_SOURCES = init.c $(SOURCES_MOTIF_C) +motif_la_CFLAGS = -I$(srcdir)/../../xlib @MOTIF_CFLAGS@ -DUSING_MOTIF +motif_la_LDFLAGS = -module -avoid-version -no-undefined -u XmIsMotifWMRunning +motif_la_LIBADD = $(top_builddir)/src/libelk.la ../../xlib/libelk-xlib.la ../libelk-xt.la @MOTIF_LIBS@ + +.d.c: + $(top_builddir)/src/elk -g -p .:$(top_srcdir)/scm:$(srcdir)/.. -l mkwidget.scm $< $@ motif + +SOURCES_MOTIF_C = \ + arrow-button.c \ + bulletin-brd.c \ + cascade-btn.c \ + command.c \ + drawing-area.c \ + drawn-button.c \ + file-selectn.c \ + form.c \ + frame.c \ + label.c \ + list.c \ + main-window.c \ + message-box.c \ + paned-window.c \ + push-button.c \ + row-column.c \ + scale.c \ + scroll-bar.c \ + scrolled-win.c \ + selectn-box.c \ + separator.c \ + shell.c \ + support.c \ + text.c \ + toggle-btn.c \ + $(NULL) + +SOURCES_MOTIF_D = \ + arrow-button.d \ + bulletin-brd.d \ + cascade-btn.d \ + command.d \ + drawing-area.d \ + drawn-button.d \ + file-selectn.d \ + form.d \ + frame.d \ + label.d \ + list.d \ + main-window.d \ + message-box.d \ + paned-window.d \ + push-button.d \ + row-column.d \ + scale.d \ + scroll-bar.d \ + scrolled-win.d \ + selectn-box.d \ + separator.d \ + shell.d \ + support.d \ + text.d \ + toggle-btn.d \ + $(NULL) + diff --git a/lib/xwidgets/motif/init.c b/lib/xwidgets/motif/init.c new file mode 100644 index 0000000..b6556b3 --- /dev/null +++ b/lib/xwidgets/motif/init.c @@ -0,0 +1,48 @@ +/* init.c + * + * $Id$ + * + * Copyright 1990, 1991, 1992, 1993, 1994, 1995, Oliver Laumann, Berlin + * Copyright 2002, 2003 Sam Hocevar , Paris + * + * This software was derived from Elk 1.2, which was Copyright 1987, 1988, + * 1989, Nixdorf Computer AG and TELES GmbH, Berlin (Elk 1.2 has been written + * by Oliver Laumann for TELES Telematic Services, Berlin, in a joint project + * between TELES and Nixdorf Microprocessor Engineering, Berlin). + * + * Oliver Laumann, TELES GmbH, Nixdorf Computer AG and Sam Hocevar, as co- + * owners or individual owners of copyright in this software, grant to any + * person or company a worldwide, royalty free, license to + * + * i) copy this software, + * ii) prepare derivative works based on this software, + * iii) distribute copies of this software or derivative works, + * iv) perform this software, or + * v) display this software, + * + * provided that this notice is not removed and that neither Oliver Laumann + * nor Teles nor Nixdorf are deemed to have made any representations as to + * the suitability of this software for any purpose nor are held responsible + * for any defects of this software. + * + * THERE IS ABSOLUTELY NO WARRANTY FOR THIS SOFTWARE. + */ + +#include "../xt.h" + +void elk_init_xaw_init () { + elk_init_xt_accelerator (); + elk_init_xt_action (); + elk_init_xt_callback (); + elk_init_xt_class (); + elk_init_xt_context (); + elk_init_xt_function (); + elk_init_xt_identifier (); + elk_init_xt_popup (); + elk_init_xt_translation (); + elk_init_xt_widget (); + elk_init_xt_error (); + elk_init_xt_init (); + P_Provide (Intern ("motif.la")); +} + diff --git a/lib/xwidgets/xaw/Makefile.am b/lib/xwidgets/xaw/Makefile.am new file mode 100644 index 0000000..d2f0cf7 --- /dev/null +++ b/lib/xwidgets/xaw/Makefile.am @@ -0,0 +1,71 @@ +NULL = + +EXTRA_DIST = $(SOURCES_XAW_D) +CLEANFILES = $(SOURCES_XAW_C) + +pkglib_LTLIBRARIES = $(xaw_la) + +if HAVE_XAW +xaw_la = xaw.la +endif + +xaw_la_SOURCES = init.c $(SOURCES_XAW_C) +xaw_la_CFLAGS = -I$(srcdir)/../../xlib @XAW_CFLAGS@ -DUSING_XAW +xaw_la_LDFLAGS = -module -avoid-version -no-undefined +xaw_la_LIBADD = $(top_builddir)/src/libelk.la ../../xlib/libelk-xlib.la ../libelk-xt.la @XAW_LIBS@ + +.d.c: + $(top_builddir)/src/elk -g -p .:$(top_srcdir)/scm:$(srcdir)/.. -l mkwidget.scm $< $@ xaw + +SOURCES_XAW_C = \ + ascii.c \ + box.c \ + command.c \ + dialog.c \ + form.c \ + grip.c \ + label.c \ + list.c \ + menubutton.c \ + paned.c \ + panner.c \ + porthole.c \ + repeater.c \ + scrollbar.c \ + shell.c \ + simplemenu.c \ + sme.c \ + smebsb.c \ + smeline.c \ + stripchart.c \ + toggle.c \ + tree.c \ + viewport.c \ + $(NULL) + +SOURCES_XAW_D = \ + ascii.d \ + box.d \ + command.d \ + dialog.d \ + form.d \ + grip.d \ + label.d \ + list.d \ + menubutton.d \ + paned.d \ + panner.d \ + porthole.d \ + repeater.d \ + scrollbar.d \ + shell.d \ + simplemenu.d \ + sme.d \ + smebsb.d \ + smeline.d \ + stripchart.d \ + toggle.d \ + tree.d \ + viewport.d \ + $(NULL) + diff --git a/lib/xwidgets/xaw/init.c b/lib/xwidgets/xaw/init.c new file mode 100644 index 0000000..4ad2fd8 --- /dev/null +++ b/lib/xwidgets/xaw/init.c @@ -0,0 +1,48 @@ +/* init.c + * + * $Id$ + * + * Copyright 1990, 1991, 1992, 1993, 1994, 1995, Oliver Laumann, Berlin + * Copyright 2002, 2003 Sam Hocevar , Paris + * + * This software was derived from Elk 1.2, which was Copyright 1987, 1988, + * 1989, Nixdorf Computer AG and TELES GmbH, Berlin (Elk 1.2 has been written + * by Oliver Laumann for TELES Telematic Services, Berlin, in a joint project + * between TELES and Nixdorf Microprocessor Engineering, Berlin). + * + * Oliver Laumann, TELES GmbH, Nixdorf Computer AG and Sam Hocevar, as co- + * owners or individual owners of copyright in this software, grant to any + * person or company a worldwide, royalty free, license to + * + * i) copy this software, + * ii) prepare derivative works based on this software, + * iii) distribute copies of this software or derivative works, + * iv) perform this software, or + * v) display this software, + * + * provided that this notice is not removed and that neither Oliver Laumann + * nor Teles nor Nixdorf are deemed to have made any representations as to + * the suitability of this software for any purpose nor are held responsible + * for any defects of this software. + * + * THERE IS ABSOLUTELY NO WARRANTY FOR THIS SOFTWARE. + */ + +#include "../xt.h" + +void elk_init_xaw_init () { + elk_init_xt_accelerator (); + elk_init_xt_action (); + elk_init_xt_callback (); + elk_init_xt_class (); + elk_init_xt_context (); + elk_init_xt_function (); + elk_init_xt_identifier (); + elk_init_xt_popup (); + elk_init_xt_translation (); + elk_init_xt_widget (); + elk_init_xt_error (); + elk_init_xt_init (); + P_Provide (Intern ("xaw.la")); +} + diff --git a/lib/xwidgets/xt.h b/lib/xwidgets/xt.h index 980aeb1..83ffd57 100644 --- a/lib/xwidgets/xt.h +++ b/lib/xwidgets/xt.h @@ -139,6 +139,19 @@ extern Object Xt_Class_Name P_((WidgetClass)); extern Object Get_Selection_CB P_((ELLIPSIS)); /* xm/support.d */ extern Object Get_Any_CB P_((ELLIPSIS)); /* xm/support.d */ +extern void elk_init_xt_accelerator P_(()); +extern void elk_init_xt_action P_(()); +extern void elk_init_xt_callback P_(()); +extern void elk_init_xt_class P_(()); +extern void elk_init_xt_context P_(()); +extern void elk_init_xt_function P_(()); +extern void elk_init_xt_identifier P_(()); +extern void elk_init_xt_popup P_(()); +extern void elk_init_xt_translation P_(()); +extern void elk_init_xt_widget P_(()); +extern void elk_init_xt_error P_(()); +extern void elk_init_xt_init P_(()); + C_LINKAGE_END #define Encode_Arglist(ac,av,to,widget,class) {\