From 2b2708841295e72ba245da8b355676a682033d1e Mon Sep 17 00:00:00 2001 From: sam Date: Fri, 26 Sep 2003 17:54:52 +0000 Subject: [PATCH] * Merged the *-xt.la and *-widgets.la module pairs into one *.la to avoid undefined symbols. git-svn-id: svn://svn.zoy.org/elk/trunk@205 55e467fa-43c5-0310-a8a2-de718669efc6 --- configure.ac | 7 +- lib/xwidgets/Makefile.am | 142 +++++++++++++++++++++++++++++---- lib/xwidgets/mkwidget.scm | 12 ++- lib/xwidgets/motif/Makefile.am | 76 ------------------ lib/xwidgets/motif/init.c | 35 -------- lib/xwidgets/xaw/Makefile.am | 72 ----------------- lib/xwidgets/xaw/init.c | 35 -------- lib/xwidgets/xtinit.c | 7 +- scm/xwidgets.scm | 3 +- 9 files changed, 147 insertions(+), 242 deletions(-) delete mode 100644 lib/xwidgets/motif/Makefile.am delete mode 100644 lib/xwidgets/motif/init.c delete mode 100644 lib/xwidgets/xaw/Makefile.am delete mode 100644 lib/xwidgets/xaw/init.c diff --git a/configure.ac b/configure.ac index f51bdcd..54961e8 100644 --- a/configure.ac +++ b/configure.ac @@ -375,6 +375,11 @@ AC_CHECK_HEADERS(utime.h sys/utime.h sys/wait.h sys/times.h dirent.h netdb.h) AC_CHECK_FUNCS(waitpid wait3 wait4 vfork uname gethostname gettimeofday ftime) AC_CHECK_FUNCS(mktemp tmpnam tempnam getcwd getwd rename regcomp environ) AC_MSG_CHECKING(for environ in unistd.h) +AC_EGREP_HEADER(__environ, unistd.h, + [AC_MSG_RESULT(yes) + AC_DEFINE(__ENVIRON_IN_UNISTD_H, 1, Define if defines __environ)], + [AC_MSG_RESULT(no)]) +AC_MSG_CHECKING(for environ in unistd.h) AC_EGREP_HEADER(environ, unistd.h, [AC_MSG_RESULT(yes) AC_DEFINE(ENVIRON_IN_UNISTD_H, 1, Define if defines environ)], @@ -540,8 +545,6 @@ 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 1074525..f9cd45e 100644 --- a/lib/xwidgets/Makefile.am +++ b/lib/xwidgets/Makefile.am @@ -1,34 +1,35 @@ -SUBDIRS = xaw motif . - NULL = -#include ../xlib/Include.am +AUTOMAKE_OPTIONS = subdir-objects +EXTRA_DIST = MISSING mkwidget.scm $(SOURCES_XAW_D) $(SOURCES_MOTIF_D) +CLEANFILES = $(SOURCES_XAW_C) $(SOURCES_MOTIF_C) -EXTRA_DIST = MISSING mkwidget.scm - -pkglib_LTLIBRARIES = $(xaw_xt_la) $(motif_xt_la) +pkglib_LTLIBRARIES = $(xaw_la) $(motif_la) if HAVE_XAW -xaw_xt_la = xaw-xt.la +xaw_la = xaw.la endif if HAVE_MOTIF -motif_xt_la = motif-xt.la +motif_la = motif.la endif -xaw_xt_la_SOURCES = $(SOURCES_XT) -xaw_xt_la_CFLAGS = -I$(srcdir)/../xlib @XAW_CFLAGS@ -xaw_xt_la_LDFLAGS = -module -avoid-version -no-undefined -xaw_xt_la_LIBADD = $(top_builddir)/src/libelk.la @XAW_LIBS@ +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_xt_la_SOURCES = $(SOURCES_XT) -motif_xt_la_CFLAGS = -I$(srcdir)/../xlib @MOTIF_CFLAGS@ -motif_xt_la_LDFLAGS = -module -avoid-version -no-undefined -motif_xt_la_LIBADD = $(top_builddir)/src/libelk.la @MOTIF_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@ 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 \ @@ -48,3 +49,112 @@ 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 1d0e797..0c8471c 100644 --- a/lib/xwidgets/mkwidget.scm +++ b/lib/xwidgets/mkwidget.scm @@ -129,14 +129,20 @@ (define (feature-name fn) (let ((i (substring? ".d" fn))) +(display "filename: ") (display fn) (newline) (if (not i) (error 'mkwidget "bad filename suffix in ~a (expected .d)" fn)) (string->symbol (substring fn 0 i)))) (define args (command-line-args)) -(if (not (= (length args) 3)) - (error 'mkwidget "expected three arguments")) -(define widget-set (string->symbol (caddr 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))) (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 deleted file mode 100644 index 8701eae..0000000 --- a/lib/xwidgets/motif/Makefile.am +++ /dev/null @@ -1,76 +0,0 @@ -NULL = - -EXTRA_DIST = $(SOURCES_D) -CLEANFILES = $(SOURCES_C) - -pkglib_LTLIBRARIES = $(motif_widgets_la) - -if HAVE_MOTIF -motif_widgets_la = motif-widgets.la -endif - -nodist_motif_widgets_la_SOURCES = $(SOURCES_C) -motif_widgets_la_SOURCES = init.c -motif_widgets_la_CFLAGS = -I$(srcdir)/../../xlib @MOTIF_CFLAGS@ -motif_widgets_la_LDFLAGS = -module -avoid-version -no-undefined -u XmIsMotifWMRunning -motif_widgets_la_LIBADD = $(top_builddir)/src/libelk.la @MOTIF_LIBS@ - -.d.c: - $(top_builddir)/src/elk -g -p .:$(top_srcdir)/scm:$(srcdir)/.. -l mkwidget.scm $< $@ motif - -SOURCES_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_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 deleted file mode 100644 index ee29af3..0000000 --- a/lib/xwidgets/motif/init.c +++ /dev/null @@ -1,35 +0,0 @@ -/* 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 "scheme.h" - -void elk_init_motif_init () { - P_Provide (Intern ("motif-widgets.la")); -} diff --git a/lib/xwidgets/xaw/Makefile.am b/lib/xwidgets/xaw/Makefile.am deleted file mode 100644 index a64abc7..0000000 --- a/lib/xwidgets/xaw/Makefile.am +++ /dev/null @@ -1,72 +0,0 @@ -NULL = - -EXTRA_DIST = $(SOURCES_D) -CLEANFILES = $(SOURCES_C) - -pkglib_LTLIBRARIES = $(xaw_widgets_la) - -if HAVE_XAW -xaw_widgets_la = xaw-widgets.la -endif - -nodist_xaw_widgets_la_SOURCES = $(SOURCES_C) -xaw_widgets_la_SOURCES = init.c -xaw_widgets_la_CFLAGS = -I$(srcdir)/../../xlib @XAW_CFLAGS@ -xaw_widgets_la_LDFLAGS = -module -avoid-version -no-undefined -xaw_widgets_la_LIBADD = $(top_builddir)/src/libelk.la @XAW_LIBS@ - -.d.c: - $(top_builddir)/src/elk -g -p .:$(top_srcdir)/scm:$(srcdir)/.. -l mkwidget.scm $< $@ xaw - -SOURCES_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_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 deleted file mode 100644 index 7c312bb..0000000 --- a/lib/xwidgets/xaw/init.c +++ /dev/null @@ -1,35 +0,0 @@ -/* 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 "scheme.h" - -void elk_init_xaw_init () { - P_Provide (Intern ("xaw-widgets.la")); -} diff --git a/lib/xwidgets/xtinit.c b/lib/xwidgets/xtinit.c index bf0142a..46c8acb 100644 --- a/lib/xwidgets/xtinit.c +++ b/lib/xwidgets/xtinit.c @@ -73,5 +73,10 @@ void elk_init_xt_init () { Define_Primitive (P_Xt_Release_6_Or_Laterp, "xt-release-6-or-later?", 0, 0, EVAL); XtToolkitInitialize (); - P_Provide (Intern ("xt.la")); +#ifdef USING_MOTIF + P_Provide (Intern ("motif.la")); +#endif +#ifdef USING_XAW + P_Provide (Intern ("xaw.la")); +#endif } diff --git a/scm/xwidgets.scm b/scm/xwidgets.scm index cafc653..f9949d6 100644 --- a/scm/xwidgets.scm +++ b/scm/xwidgets.scm @@ -5,8 +5,7 @@ (define widgets (if (feature? 'motif) 'motif 'xaw)) (require 'xlib) -(require 'xt.la (string->symbol (format #f "~a-xt.la" widgets))) -(require (string->symbol (format #f "~a-widgets.la" widgets))) +(require 'xt.la (string->symbol (format #f "~a.la" widgets))) (provide 'xwidgets)