From 425060a1b2f7a722ded5321dc982803b099506f9 Mon Sep 17 00:00:00 2001 From: mainzelm Date: Mon, 17 Nov 2003 08:56:57 +0000 Subject: [PATCH] Use automake and build a shared object --- Makefile.am | 16 ++++++++++++++++ c/Makefile.am | 2 ++ c/xlib/Makefile.am | 12 ++++++++++++ c/xlib/init.c | 13 +++++++++++++ c/xlib/xlib.h | 4 +++- configure.in | 17 +++++++++++------ 6 files changed, 57 insertions(+), 7 deletions(-) create mode 100644 Makefile.am create mode 100644 c/Makefile.am create mode 100644 c/xlib/Makefile.am diff --git a/Makefile.am b/Makefile.am new file mode 100644 index 0000000..948da10 --- /dev/null +++ b/Makefile.am @@ -0,0 +1,16 @@ +SUBDIRS = c + +scheme/load-scx.scm: + (echo '(user)'; \ + echo "(open 'dynamic-externals)"; \ + echo "(open 'external-calls)"; \ + echo '(run '; \ + echo " '(let ((initializer-name \"scx_init_xlib\")"; \ + echo ' (module-file "$(prefix)/lib/libscx.so"))'; \ + echo ' (dynamic-load module-file)'; \ + echo ' (call-external (get-external initializer-name))))'; \ + echo '(config)'; \ + echo '(load "xlib/xlib-interfaces.scm")'; \ + echo '(load "xlib/xlib-packages.scm")'; \ + ) > $@ + diff --git a/c/Makefile.am b/c/Makefile.am new file mode 100644 index 0000000..3804250 --- /dev/null +++ b/c/Makefile.am @@ -0,0 +1,2 @@ +SUBDIRS = xlib + diff --git a/c/xlib/Makefile.am b/c/xlib/Makefile.am new file mode 100644 index 0000000..856f4e1 --- /dev/null +++ b/c/xlib/Makefile.am @@ -0,0 +1,12 @@ +INCLUDES = -I@top_srcdir@/c/xlib -I@top_srcdir@/c/libs -I@x_includes@ \ + -I@top_srcdir@/c -I@scsh_includes@ + + +lib_LTLIBRARIES = libscx.la + +libscx_la_SOURCES = \ + client.c colormap.c cursor.c display.c error.c event-types.c \ + event.c extension.c font.c gcontext.c grab.c graphics.c init.c key.c \ + pixmap.c property.c region.c text.c types.c util.c visual.c window.c \ + wm.c xlib.h +#libscx_a_LDFLAGS = -export-dynamic diff --git a/c/xlib/init.c b/c/xlib/init.c index a5b0c90..94b20cd 100644 --- a/c/xlib/init.c +++ b/c/xlib/init.c @@ -45,6 +45,11 @@ extern void scx_init_visual(); extern void scx_init_region(); extern void scx_init_event_types(); +#ifdef WITH_XFT +extern void scx_xft_init(); +extern void scx_xrender_init(); +#endif + void scx_init_xlib(void) { S48_EXPORT_FUNCTION(scx_Xlib_Release_4_Or_Later); S48_EXPORT_FUNCTION(scx_Xlib_Release_5_Or_Later); @@ -71,6 +76,14 @@ void scx_init_xlib(void) { scx_init_util(); scx_init_event_types(); scx_init_region(); + +/*extern void scx_init_xpm();*/ + +#ifdef WITH_XFT + s48_add_external_init(scx_xft_init); + s48_add_external_init(scx_xrender_init); +#endif + } diff --git a/c/xlib/xlib.h b/c/xlib/xlib.h index f15ab2c..6be4ea6 100644 --- a/c/xlib/xlib.h +++ b/c/xlib/xlib.h @@ -3,7 +3,9 @@ #ifndef _SCX_XLIB_H #define _SCX_XLIB_H -#include "c/config.h" +#ifdef HAVE_CONFIG_H +#include +#endif #include #include diff --git a/configure.in b/configure.in index 6103feb..01e680c 100644 --- a/configure.in +++ b/configure.in @@ -2,8 +2,16 @@ define([SCX_PREPEND], [[$2]="$[$2] [$1]"]) - AC_INIT - AC_CONFIG_HEADER(c/config.h) + AC_INIT(scx, 0.1) + AC_CONFIG_SRCDIR(configure.in) + AM_INIT_AUTOMAKE + + AC_CONFIG_HEADERS(c/config.h) + + AC_PROG_LIBTOOL + + + AC_PROG_CC AC_PATH_X @@ -49,9 +57,6 @@ #AC_CHECK_HEADER(scheme48.h) #AC_CHECK_LIB(scsh/libscsh.a, scsh_access) - AC_CHECK_LIB(crypt, crypt) - AC_CHECK_LIB(dl, dlopen) - AC_CHECK_LIB(m, exp) #if no_x == 'yes' fail ... @@ -61,4 +66,4 @@ AC_SUBST(x_libraries) AC_SUBST(extra_objects) -AC_OUTPUT(Makefile) +AC_OUTPUT([Makefile c/Makefile c/xlib/Makefile])