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)
|
scsh_includes=/usr/local/include)
|
||||||
AC_SUBST(scsh_includes)
|
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_ARG_WITH(xft,
|
||||||
AC_HELP_STRING([--with-xft],
|
AC_HELP_STRING([--with-xft],
|
||||||
[Compile with Xft support]),
|
[Compile with Xft support]),
|
||||||
|
@ -62,14 +48,10 @@
|
||||||
AC_SUBST(load_xft_packages, yes)
|
AC_SUBST(load_xft_packages, yes)
|
||||||
fi
|
fi
|
||||||
|
|
||||||
#AC_MSG_CHECKING(scsh installation)
|
schemedir='${prefix}'"/scheme"
|
||||||
#AC_CHECK_HEADER(scheme48.h)
|
libdir='${prefix}'"/lib"
|
||||||
#AC_CHECK_LIB(scsh/libscsh.a, scsh_access)
|
libsysdir=${libdir}"/`scsh -lm ${srcdir}/scheme/configure.scm -o configure -c '(display (host))'`"
|
||||||
|
AC_SUBST(libdir)
|
||||||
|
|
||||||
#if no_x == 'yes' fail ...
|
|
||||||
schemedir="${prefix}/scheme"
|
|
||||||
libsysdir="${prefix}/lib/`uname -m`-`uname -s`"
|
|
||||||
AC_SUBST(libsysdir)
|
AC_SUBST(libsysdir)
|
||||||
AC_SUBST(schemedir)
|
AC_SUBST(schemedir)
|
||||||
AC_SUBST(LIBS)
|
AC_SUBST(LIBS)
|
||||||
|
|
|
@ -37,17 +37,18 @@ nobase_scheme_SCRIPTS= \
|
||||||
xlib/xlib-packages.scm \
|
xlib/xlib-packages.scm \
|
||||||
xt/resource-types.scm \
|
xt/resource-types.scm \
|
||||||
xt/widget-type.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
|
CLEANFILES= load-scx.scm
|
||||||
|
|
||||||
load-scx.scm: $(srcdir)/load-scx.scm.in
|
load-scx.scm: $(srcdir)/load-scx.scm.in
|
||||||
sed -e "s|@scxschemedir@|`pwd`/$(srcdir)|g" \
|
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:
|
install-data-hook:
|
||||||
sed -e "s|@scxschemedir@|$(schemedir)|g" \
|
sed -e "s|@scxschemedir@|$(schemedir)|g" \
|
||||||
-e "s|@scxlibsysdir@|$(libsysdir)|g" \
|
-e "s|@scxlibdir@|$(libdir)|g" \
|
||||||
$(srcdir)/load-scx.scm.in \
|
$(srcdir)/load-scx.scm.in \
|
||||||
> $(DESTDIR)/$(schemedir)/load-scx.scm
|
> $(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)
|
(user)
|
||||||
(load-package 'dynamic-externals)
|
(load-package 'dynamic-externals)
|
||||||
(open 'dynamic-externals)
|
(open 'dynamic-externals)
|
||||||
(open 'external-calls)
|
(open 'external-calls)
|
||||||
|
(load-package 'configure)
|
||||||
|
(open 'configure)
|
||||||
(run '(let ((initializer-name "scx_init_xlib")
|
(run '(let ((initializer-name "scx_init_xlib")
|
||||||
(module-file "@scxlibsysdir@/libscx.so"))
|
(module-file (string-append "@scxlibdir@/" (host) "/libscx.so")))
|
||||||
(dynamic-load module-file)
|
(dynamic-load module-file)
|
||||||
(call-external (get-external initializer-name))))
|
(call-external (get-external initializer-name))))
|
||||||
(config)
|
(config)
|
||||||
|
|
Loading…
Reference in New Issue