Check-in [f92c42c849]
Bounty program for improvements to Tcl and certain Tcl packages.
Overview
Comment:MSVC Win maker (WIP, got wiped out, re-constitution in progress)
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | readd-win-msvc
Files: files | file ages | folders
SHA3-256: f92c42c8495681bf0c39b2997afd9027ec0d177bf25227945a9fe1bea3882b62
User & Date: rkeene on 2019-11-12 17:48:27
Other Links: branch diff | manifest | tags
Context
2019-11-12
17:48
MSVC Win maker (WIP, got wiped out, re-constitution in progress) Leaf check-in: f92c42c849 user: rkeene tags: readd-win-msvc
17:47
Started readding MSVC Windows build support check-in: 8478c7ec08 user: rkeene tags: readd-win-msvc
Changes

Added build/make-msvc-win version [bca2ec86ab].

            1  +#! /usr/bin/env bash
            2  +
            3  +cd "$(dirname "${BASH_SOURCE[0]}")" || exit 1
            4  +
            5  +function make-makefile-vc() {
            6  +	local outDir
            7  +
            8  +	outDir="$1"
            9  +
           10  +	cat << \_EOF_ > "${outDir}/Makefile.vc"
           11  +# Specify OpenSSL and Tcl parameters here
           12  +# -----BEGIN MODIFICATIONS-----
           13  +OPENSSL_DIR        = c:/OpenSSL-Win64
           14  +OPENSSL_LIBS       = c:/OpenSSL-Win64/lib/VC/static/libssl64MT.lib c:/OpenSSL-Win64/lib/VC/static/libcrypto64MT.lib
           15  +OPENSSL_CPPFLAGS   = -DNO_SSL2 -DNO_SSL3
           16  +
           17  +TCL_DIR            = c:/Tcl
           18  +# -----END MODIFICATIONS-----
           19  +_EOF_
           20  +
           21  +AR
           22  +CC
           23  +CFLAGS
           24  +CPPFLAGS
           25  +DEFS
           26  +EXTENSION_TARGET
           27  +GEN_DH_PARAMS_ARGS
           28  +INSTALL
           29  +INSTALL_DATA
           30  +INSTALL_PROGRAM
           31  +LDFLAGS
           32  +LIBS
           33  +PACKAGE_VERSION
           34  +RANLIB
           35  +REMOVESYMS
           36  +SHOBJFLAGS
           37  +SHOBJLDFLAGS
           38  +TCLEXT_BUILD
           39  +TCLSH_PROG
           40  +TCL_DEFS
           41  +TCL_PACKAGE_PATH
           42  +WEAKENSYMS
           43  +exec_prefix
           44  +libdir
           45  +prefix
           46  +srcdir
           47  +--
           48  +CC = @[email protected]
           49  +AR = @[email protected]
           50  +RANLIB = @[email protected]
           51  +CFLAGS = @[email protected] @[email protected]
           52  +CPPFLAGS = @[email protected] [email protected]@ -I. @[email protected] @[email protected]
           53  +LDFLAGS = @[email protected] @[email protected]
           54  +LIBS = @[email protected]
           55  +PACKAGE_VERSION = @[email protected]
           56  +prefix = @[email protected]
           57  +exec_prefix = @[email protected]
           58  +libdir = @[email protected]
           59  +TCL_PACKAGE_PATH = @[email protected]
           60  +PACKAGE_INSTALL_DIR = $(TCL_PACKAGE_PATH)/tcltls$(PACKAGE_VERSION)
           61  +INSTALL = @[email protected]
           62  +INSTALL_PROGRAM = @[email protected]
           63  +INSTALL_DATA = @[email protected]
           64  +VPATH = @[email protected]
           65  +
           66  +all: @[email protected]
           67  +
           68  +@[email protected]: @[email protected]@[email protected]
           69  +	mv @[email protected]@[email protected] @[email protected]
           70  +
           71  +# The shared object target
           72  +[email protected][email protected]: tls.o tlsBIO.o tlsIO.o tlsX509.o Makefile
           73  +	$(CC) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) -o [email protected][email protected] tls.o tlsBIO.o tlsIO.o tlsX509.o $(LIBS)
           74  +	[email protected]@ [email protected][email protected]
           75  +	[email protected]@ [email protected][email protected]
           76  +
           77  +# The static target
           78  +[email protected][email protected]: tls.o tlsBIO.o tlsIO.o tlsX509.o Makefile
           79  +	$(AR) rcu [email protected][email protected] tls.o tlsBIO.o tlsIO.o tlsX509.o
           80  +	-$(RANLIB) [email protected][email protected]
           81  +
           82  +# Dependencies for all our targets
           83  +tls.o: @[email protected]/tls.c @[email protected]/tlsInt.h @[email protected]/tclOpts.h tls.tcl.h dh_params.h Makefile
           84  +	$(CC) $(CPPFLAGS) $(CFLAGS) -o tls.o -c @[email protected]/tls.c
           85  +
           86  +tlsBIO.o: @[email protected]/tlsBIO.c @[email protected]/tlsInt.h Makefile
           87  +	$(CC) $(CPPFLAGS) $(CFLAGS) -o tlsBIO.o -c @[email protected]/tlsBIO.c
           88  +
           89  +tlsIO.o: @[email protected]/tlsIO.c @[email protected]/tlsInt.h Makefile
           90  +	$(CC) $(CPPFLAGS) $(CFLAGS) -o tlsIO.o -c @[email protected]/tlsIO.c
           91  +
           92  +tlsX509.o: @[email protected]/tlsX509.c @[email protected]/tlsInt.h Makefile
           93  +	$(CC) $(CPPFLAGS) $(CFLAGS) -o tlsX509.o -c @[email protected]/tlsX509.c
           94  +
           95  +# Create a C-source-ified version of the script resources
           96  +# for TclTLS so that we only need a single file to enable
           97  +# this extension
           98  +tls.tcl.h: @[email protected]/tls.tcl Makefile
           99  +	od -A n -v -t xC < '@[email protected]/tls.tcl' > tls.tcl.h.new.1
          100  +	sed '[email protected]  *@@g;[email protected]@0x&, @g' < tls.tcl.h.new.1 > tls.tcl.h.new.2
          101  +	rm -f tls.tcl.h.new.1
          102  +	mv tls.tcl.h.new.2 tls.tcl.h
          103  +
          104  +# Create default DH parameters
          105  +dh_params.h: @[email protected]/gen_dh_params Makefile
          106  +	sh @[email protected]/gen_dh_params @[email protected] > dh_params.h.new
          107  +	mv dh_params.h.new dh_params.h
          108  +
          109  +# Install the extension
          110  +install: @[email protected] pkgIndex.tcl
          111  +	$(INSTALL) -d '$(DESTDIR)$(PACKAGE_INSTALL_DIR)'
          112  +	$(INSTALL_PROGRAM) @[email protected] '$(DESTDIR)$(PACKAGE_INSTALL_DIR)'
          113  +	$(INSTALL_DATA)    pkgIndex.tcl '$(DESTDIR)$(PACKAGE_INSTALL_DIR)'
          114  +
          115  +# A convienent helper to undo the installation just done
          116  +uninstall:
          117  +	rm -f '$(DESTDIR)$(PACKAGE_INSTALL_DIR)/@[email protected]'
          118  +	rm -f '$(DESTDIR)$(PACKAGE_INSTALL_DIR)/pkgIndex.tcl'
          119  +	-rmdir '$(DESTDIR)$(PACKAGE_INSTALL_DIR)'
          120  +
          121  +# Test target, run the automated test suite
          122  +test: @[email protected]
          123  +	@[email protected] @[email protected]/tests/all.tcl $(TESTFLAGS) -load "lappend auto_path $(shell pwd)"
          124  +
          125  +# Clean the local build directory for rebuild against the same configuration
          126  +clean:
          127  +	rm -f tls.o tlsBIO.o tlsIO.o tlsX509.o
          128  +	rm -f @[email protected] [email protected][email protected] [email protected][email protected]
          129  +	rm -f [email protected][email protected] [email protected][email protected]
          130  +	rm -f tls.tcl.h tls.tcl.h.new.1 tls.tcl.h.new.2
          131  +
          132  +# Clean the local build directory back to what it was after unpacking the
          133  +# distribution tarball
          134  +distclean: clean
          135  +	rm -f config.log config.status
          136  +	rm -f dh_params.h.new dh_params.h
          137  +	rm -f Makefile pkgIndex.tcl
          138  +	rm -f tcltls.a.linkadd
          139  +
          140  +# Clean the local build directory back to only thing things that exist in
          141  +# version control system
          142  +mrproper: distclean
          143  +	rm -f @[email protected]/configure @[email protected]/config.sub @[email protected]/config.guess @[email protected]/install-sh
          144  +	rm -f @[email protected]/aclocal.m4
          145  +	rm -rf @[email protected]/autom4te.cache
          146  +
          147  +.PHONY: all install uninstall clean distclean mrproper test
          148  +--
          149  +CC = CL
          150  +AR = false
          151  +RANLIB = false
          152  +CFLAGS = $(OPENSSL_CFLAGS) 
          153  +CPPFLAGS = $(OPENSSL_CPPFLAGS) -I$(OPENSSL_DIR)/include -I$(TCL_DIR)/include -DPACKAGE_VERSION="\"$(PACKAGE_VERSION)\"" -I.. -I. -DUSE_TCL_STUBS=1 -DUSE_TCL_STUBS=1
          154  +LDFLAGS =  -LD
          155  +LIBS = $(OPENSSL_LIBS) $(TCL_DIR)/lib/libtclstub86.lib ws2_32.lib advapi32.lib crypt32.lib user32.lib
          156  +PACKAGE_VERSION = 1.7.19
          157  +prefix = /
          158  +exec_prefix = /
          159  +libdir = /lib
          160  +TCL_PACKAGE_PATH = 
          161  +PACKAGE_INSTALL_DIR = $(TCL_PACKAGE_PATH)/tcltls$(PACKAGE_VERSION)
          162  +INSTALL = false
          163  +INSTALL_PROGRAM = false
          164  +INSTALL_DATA = false
          165  +VPATH = ..
          166  +
          167  +all: tcltls.dll
          168  +
          169  +tcltls.dll: shared-tcltls.dll
          170  +	REN shared-tcltls.dll tcltls.dll
          171  +
          172  +# The shared object target
          173  +shared-tcltls.dll: tls.o tlsBIO.o tlsIO.o tlsX509.o Makefile.vc
          174  +	$(CC) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) -Feshared-tcltls.dll tls.o tlsBIO.o tlsIO.o tlsX509.o $(LIBS)
          175  +
          176  +# The static target
          177  +static-tcltls.dll: tls.o tlsBIO.o tlsIO.o tlsX509.o Makefile.vc
          178  +	$(AR) rcu static-tcltls.dll tls.o tlsBIO.o tlsIO.o tlsX509.o
          179  +	-$(RANLIB) static-tcltls.dll
          180  +
          181  +# Dependencies for all our targets
          182  +tls.o: ../tls.c ../tlsInt.h ../tclOpts.h tls.tcl.h dh_params.h Makefile.vc
          183  +	$(CC) $(CPPFLAGS) $(CFLAGS) -Fotls.o -c ../tls.c
          184  +
          185  +tlsBIO.o: ../tlsBIO.c ../tlsInt.h Makefile.vc
          186  +	$(CC) $(CPPFLAGS) $(CFLAGS) -FotlsBIO.o -c ../tlsBIO.c
          187  +
          188  +tlsIO.o: ../tlsIO.c ../tlsInt.h Makefile.vc
          189  +	$(CC) $(CPPFLAGS) $(CFLAGS) -FotlsIO.o -c ../tlsIO.c
          190  +
          191  +tlsX509.o: ../tlsX509.c ../tlsInt.h Makefile.vc
          192  +	$(CC) $(CPPFLAGS) $(CFLAGS) -FotlsX509.o -c ../tlsX509.c
          193  +
          194  +# Create a C-source-ified version of the script resources
          195  +# for TclTLS so that we only need a single file to enable
          196  +# this extension
          197  +# Create default DH parameters
          198  +.c.o:
          199  +
          200  +# Install the extension
          201  +install: tcltls.dll pkgIndex.tcl
          202  +	$(INSTALL) -d '$(DESTDIR)$(PACKAGE_INSTALL_DIR)'
          203  +	$(INSTALL_PROGRAM) tcltls.dll '$(DESTDIR)$(PACKAGE_INSTALL_DIR)'
          204  +	$(INSTALL_DATA)    pkgIndex.tcl '$(DESTDIR)$(PACKAGE_INSTALL_DIR)'
          205  +
          206  +# A convienent helper to undo the installation just done
          207  +uninstall:
          208  +	DEL /F '$(DESTDIR)$(PACKAGE_INSTALL_DIR)/tcltls.dll'
          209  +	DEL /F '$(DESTDIR)$(PACKAGE_INSTALL_DIR)/pkgIndex.tcl'
          210  +	-DEL /F '$(DESTDIR)$(PACKAGE_INSTALL_DIR)'
          211  +
          212  +# Test target, run the automated test suite
          213  +# Clean the local build directory for rebuild against the same configuration
          214  +clean:
          215  +	DEL /F tls.o tlsBIO.o tlsIO.o tlsX509.o
          216  +	DEL /F tcltls.dll shared-tcltls.dll static-tcltls.dll
          217  +	DEL /F shared-tcltls.dll.def shared-tcltls.dll.lib
          218  +
          219  +# Clean the local build directory back to what it was after unpacking the
          220  +# distribution tarball
          221  +distclean: clean
          222  +	DEL /F config.log config.status
          223  +	DEL /F tcltls.a.linkadd
          224  +
          225  +# Clean the local build directory back to only thing things that exist in
          226  +# version control system
          227  +mrproper: distclean
          228  +	DEL /F ../configure ../config.sub ../config.guess ../install-sh
          229  +	DEL /F ../aclocal.m4
          230  +	DEL /F ../autom4te.cache
          231  +
          232  +.PHONY: all install uninstall clean distclean mrproper test
          233  +
          234  +}
          235  +
          236  +mkdir ../win || exit 1
          237  +make-makefile-vc ../win
          238  +cd ../win || exit 1
          239  +
          240  +sed 's|@[email protected]|..|g;s|@[email protected]|fallback|g' < ../Makefile.in > Makefile
          241  +make tls.tcl.h dh_params.h
          242  +rm -f Makefile