Use configure.scm to determine $host
This commit is contained in:
parent
fff8292341
commit
a8b0bdd72a
26
configure.in
26
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)
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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))))))
|
||||
|
||||
|
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue