;;;; qt.setup -*- Scheme -*- (use files utils) (define QTDIR (or (getenv "QTDIR") (error "please set the QTDIR environment variable") ) ) (define prefix (installation-prefix)) (define libpath (make-pathname prefix "lib")) (define incpath (make-pathname prefix "include")) (define binpath (make-pathname prefix "bin")) (define csc (make-pathname binpath "csc")) (with-output-to-file "qt.pro" (lambda () (let ((csc (qs (normalize-pathname csc))) (libdir (qs (normalize-pathname libpath))) (incdir (qs (normalize-pathname incpath)))) (print #<#EOF SOURCES=main.cpp qt-base.c HEADERS=prototypes.h CONFIG+=uitools qt debug TEMPLATE=lib TARGET=qtb unix:QMAKE_LFLAGS_DEBUG+=`#{csc} -libs -ldflags` -L#{libdir} unix:QMAKE_CFLAGS_DEBUG+=-Wno-unused `#{csc} -cflags` -I#{incdir} unix:QMAKE_CXXFLAGS_DEBUG+=-Wno-unused `#{csc} -cflags` -I#{incdir} win32:QMAKE_LFLAGS_DEBUG+=-L#{libdir} win32:QMAKE_CFLAGS_DEBUG+=-Wno-unused -I#{incdir} -DHAVE_CHICKEN_CONFIG_H -DPIC win32:QMAKE_CXXFLAGS_DEBUG+=-Wno-unused -I#{incdir} -DHAVE_CHICKEN_CONFIG_H -DPIC win32:LIBS+=-lchicken -lm -lws2_32 QT+=opengl EOF ) ) )) (make (("Makefile" ("qt.pro") (run (,(normalize-pathname (make-pathname QTDIR "bin/qmake")) qt.pro))) ("qt.so" ("prototypes.h" "main.cpp" "qt-base.c" "Makefile") (run (,(cond-expand (mingw32 "mingw32-make") (else "make")) clean all)) (run (,(cond-expand (mingw32 "copy /Y debug\\qtb.dll qt.so") (else "cp libqtb.so.1.0.0 qt.so"))))) ("qt.import.so" ("qt-base.c") (run (,csc -s -O3 -d0 qt.import.scm))) ("qt-base.c" ("qt-base.scm" "prototypes.h") (run (,csc -t qt-base.scm -O3 -d1 -X easyffi -C -g -j qt)))) '("qt.so" "qt.import.so")) (install-extension 'qt `("qt.so" "qt.import.so") '((version 0.91)))