diff --git a/configure.in b/configure.in index cae1dd2..dab1bfb 100644 --- a/configure.in +++ b/configure.in @@ -23,20 +23,6 @@ scsh_includes=/usr/local/include) AC_SUBST(scsh_includes) - AC_ARG_WITH(scsh-libraries, - AC_HELP_STRING([--with-scsh-libraries=DIR], - [scsh libraries are in DIR [/usr/local/lib/scsh]]), - scsh_libraries=$withval, - scsh_libraries=/usr/local/lib/scsh) - AC_SUBST(scsh_libraries) - - AC_ARG_WITH(scsh-modules, - AC_HELP_STRING([--with-scsh-modules=DIR], - [scsh modules are in DIR [/usr/local/lib/scsh/modules]]), - scsh_modules=$withval, - scsh_modules=/usr/local/lib/scsh/modules) - AC_SUBST(scsh_modules) - AC_ARG_WITH(xft, AC_HELP_STRING([--with-xft], [Compile with Xft support]), @@ -62,14 +48,10 @@ AC_SUBST(load_xft_packages, yes) fi - #AC_MSG_CHECKING(scsh installation) - #AC_CHECK_HEADER(scheme48.h) - #AC_CHECK_LIB(scsh/libscsh.a, scsh_access) - - - #if no_x == 'yes' fail ... - schemedir="${prefix}/scheme" - libsysdir="${prefix}/lib/`uname -m`-`uname -s`" + schemedir='${prefix}'"/scheme" + libdir='${prefix}'"/lib" + libsysdir=${libdir}"/`scsh -lm ${srcdir}/scheme/configure.scm -o configure -c '(display (host))'`" + AC_SUBST(libdir) AC_SUBST(libsysdir) AC_SUBST(schemedir) AC_SUBST(LIBS) diff --git a/scheme/Makefile.am b/scheme/Makefile.am index 2c1f6b1..e15a7d6 100644 --- a/scheme/Makefile.am +++ b/scheme/Makefile.am @@ -37,17 +37,18 @@ nobase_scheme_SCRIPTS= \ xlib/xlib-packages.scm \ xt/resource-types.scm \ xt/widget-type.scm \ - xt/widget.scm + xt/widget.scm \ + configure.scm -EXTRA_DIST= $(scheme_SCRIPTS) $(nobase_scheme_SCRIPTS) +EXTRA_DIST= load-scx.scm.in $(nobase_scheme_SCRIPTS) CLEANFILES= load-scx.scm load-scx.scm: $(srcdir)/load-scx.scm.in sed -e "s|@scxschemedir@|`pwd`/$(srcdir)|g" \ - -e "s|@scxlibsysdir@|`pwd`/../c/xlib/.libs|g" $< > $@ + -e "s|@scxlibdir@|`pwd`/../c/xlib/.libs|g" $< > $@ #won't work install-data-hook: sed -e "s|@scxschemedir@|$(schemedir)|g" \ - -e "s|@scxlibsysdir@|$(libsysdir)|g" \ + -e "s|@scxlibdir@|$(libdir)|g" \ $(srcdir)/load-scx.scm.in \ > $(DESTDIR)/$(schemedir)/load-scx.scm diff --git a/scheme/configure.scm b/scheme/configure.scm new file mode 100644 index 0000000..ecac456 --- /dev/null +++ b/scheme/configure.scm @@ -0,0 +1,24 @@ +(define-structure configure (export host) + (open scheme-with-scsh) + (begin + (define (canonical-machine uname-record) + (let* ((machine (uname:machine uname-record)) + (os (uname:os-name uname-record))) + (case machine + (("i386" "i486" "i586" "i686") "i386") + (("Power Machintosh") "powerpc") + (else (cond ((and (string=? os "AIX") + (regexp-search? (rx (: "00" (= 6 digit) any any "00")) machine)) + "powerpc") + (else machine)))))) + + (define (canonical-os-name uname-record) + (uname:os-name uname-record)) + + (define (host) + (let ((uname-record (uname))) + (string-append (canonical-machine uname-record) + "-" + (canonical-os-name uname-record)))))) + + \ No newline at end of file diff --git a/scheme/load-scx.scm.in b/scheme/load-scx.scm.in index cdf9d29..ce45136 100644 --- a/scheme/load-scx.scm.in +++ b/scheme/load-scx.scm.in @@ -1,9 +1,13 @@ +(config) +(load "@scxschemedir@/configure.scm") (user) (load-package 'dynamic-externals) (open 'dynamic-externals) (open 'external-calls) +(load-package 'configure) +(open 'configure) (run '(let ((initializer-name "scx_init_xlib") - (module-file "@scxlibsysdir@/libscx.so")) + (module-file (string-append "@scxlibdir@/" (host) "/libscx.so"))) (dynamic-load module-file) (call-external (get-external initializer-name)))) (config)