tcl-rivet-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Zeinert, Holger" <Holger.Zein...@lms-gmbh.de>
Subject RE: Built rivet on Windows using MinGW
Date Thu, 02 Jan 2003 17:47:11 GMT
Hi,

> > 4. I had to modify "make.tcl". Unfortunately, some manual changes
> > will be needed for compiling on Windows to reflect the environment.
>  
> > Run
> 
> Do you think you could send a 'diff -u' of that?  Here's an easy way
> to do it with CVS:
> 
> cvs diff -u make.tcl > my.diff
> 
> That will diff your version against the latest from CVS.

here it is (I did a "cvs diff -ub make.tcl", because some whitespace also
changed...):

vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
Index: make.tcl
===================================================================
RCS file: /home/cvspublic/tcl-rivet/src/make.tcl,v
retrieving revision 1.27
diff -u -b -r1.27 make.tcl
--- make.tcl	11 Nov 2002 19:10:37 -0000	1.27
+++ make.tcl	2 Jan 2003 17:09:38 -0000
@@ -8,6 +8,17 @@
 #
 # This file is responsible for the top-level "make" style processing.
 
+
+#
+# set a global flag for compiling on Windows using MinGW
+#
+if {[info exists env(OSTYPE)] && ($env(OSTYPE)=="msys")} {
+    set MINGW 1
+} else {
+    set MINGW 0
+}
+
+
 set scripts {
     helpers.tcl
     graph.tcl
@@ -30,40 +41,78 @@
 
 ## Add variables
 
-##
-## Set this variable to the location of your apxs script if it cannot be
-## found by make.tcl
-##
-set APXS "apxs"
+if {$MINGW} {
+    # the APXS tool on Windows is a Perl script! Also, it's only installed
together with
+    # sources!
+    #
+    # so, without sources you have to enter those by hand:
+    #
+    # include directory of Apache
+    set PREFIX "c:/programme/apache group/apache"
+    set INCLUDEDIR "[file join $PREFIX include]"
+    set LIBEXECDIR "[file join $PREFIX libexec]"
+} else {
+
+    ##
+    ## Set this variable to the location of your apxs script if it cannot
be
+    ## found by make.tcl
+    ##
+    set APXS "apxs"
 
-## Try to find the Apache apxs script.
-set APXS [FindAPXS $APXS]
+    ## Try to find the Apache apxs script.
+    set APXS [FindAPXS $APXS]
 
-if { ![string length $APXS] } {
+    if { ![string length $APXS] } {
     puts stderr "Could not find Apache apxs script."
     append err "You need to edit 'make.tcl' to supply the location of "
     append err "Apache's apxs tool."
     puts stderr $err
     exit 1
+    }
+    set INCLUDEDIR [exec $APXS -q INCLUDEDIR]
+    set LIBEXECDIR [exec $APXS -q LIBEXECDIR]
+    set PREFIX [exec $APXS -q PREFIX]
 }
 
-set INCLUDEDIR [exec $APXS -q INCLUDEDIR]
-set LIBEXECDIR [exec $APXS -q LIBEXECDIR]
-set PREFIX [exec $APXS -q PREFIX]
 
-set INC "-I$INCLUDEDIR -I$TCL_PREFIX/include"
+# Apache directory on windows includes a blank...
+set INC "\"-I$INCLUDEDIR\" -I$TCL_PREFIX/include"
+
+if {$MINGW} {
+    # to use MinGW, we cannot just use the compiler and linker settings
from Tcl...
+
+    # for GCC < 3.x the flag "-mms-bitfields" must be replaced by
"-fnative-struct"
+    set CC "gcc -O3 -mms-bitfields -shared -mwindows -DSHARED_MODULE"
+    set CFLAGS "-D_AP_OS_IS_PATH_ABS_ -DEAPI=1 $INC $TCL_THREADED"
+    set COMPILE "$CC $CFLAGS -c"
+
+    # using MinGW, the shared extension is .so
+    set sharedext .so
+
+    # using MinGW, the linker command cannot be taken from Tcl
+    set TCL_SHLIB_LD "$CC --dll --kill-at --disable-auto-import"
+    # " --disable-stdcall-fixup"
 
-set COMPILE "$TCL_CC $TCL_CFLAGS_DEBUG $TCL_CFLAGS_OPTIMIZE
$TCL_CFLAGS_WARNING $TCL_SHLIB_CFLAGS $INC  $TCL_EXTRA_CFLAGS $TCL_THREADED
-c"
+    #
+    set TCL_LIB_SPEC ""
+
+    # my Tcl Version is 8.4, so perhapls here "84" has to be replaced by
"83"
+    set TCL_LIBS "\"[file join $LIBEXECDIR ApacheCore.lib]\" \"[file join
$TCL_PREFIX lib tcl84.lib]\""
+
+} else {
+    set COMPILE "$TCL_CC $TCL_CFLAGS_DEBUG $TCL_CFLAGS_OPTIMIZE
$TCL_CFLAGS_WARNING $TCL_SHLIB_CFLAGS $INC  $TCL_EXTRA_CFLAGS $TCL_THREADED
-c"
+    set sharedext [info sharedlibextension]
+    set TCL_LIBS "$TCL_LIBS -lcrypt"
+}
 
 set MOD_STLIB mod_rivet.a
-set MOD_SHLIB mod_rivet[info sharedlibextension]
+set MOD_SHLIB mod_rivet$sharedext
 set MOD_OBJECTS "apache_multipart_buffer.o apache_request.o rivetChannel.o
rivetParser.o rivetCore.o mod_rivet.o TclWebapache.o"
 
 set LIB_STLIB librivet.a
-set LIB_SHLIB librivet[info sharedlibextension]
+set LIB_SHLIB librivet$sharedext
 set LIB_OBJECTS "rivetList.o rivetCrypt.o rivetWWW.o rivetPkgInit.o"
 
-set TCL_LIBS "$TCL_LIBS -lcrypt"
 
 set XML_DOCS [glob [file join .. doc packages * *].xml]
 set HTML_DOCS [string map {.xml .html} $XML_DOCS]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

 ____________________________________________________________________
|
| Holger Zeinert   -   Development Manager CAE Division
|____________________________________________________________________
| LMS Deutschland GmbH      -      tel +49 631 4166-180, fax -166
| Luxemburger Str. 7, 67657 Kaiserslautern, GERMANY
| mailto:holger.zeinert@lms-gmbh.de     http://www.lmsintl.com



---------------------------------------------------------------------
To unsubscribe, e-mail: rivet-dev-unsubscribe@tcl.apache.org
For additional commands, e-mail: rivet-dev-help@tcl.apache.org


Mime
View raw message