Check-in [e13bdc3fcc]
Overview
Comment:Updated to install DLL source code
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: e13bdc3fcc903172067aabbcd7c1fec0335c4ac9
User & Date: rkeene on 2014-06-16 01:44:05
Other Links: manifest | tags
Context
2014-06-16
04:20
Updated to allow external symbols to be resolved if dlopen() is available check-in: 82e8ebb242 user: rkeene tags: trunk
01:44
Updated to install DLL source code check-in: e13bdc3fcc user: rkeene tags: trunk
2014-06-15
20:11
tcc4tcl 0.18 check-in: a8b14ae0a1 user: rkeene tags: trunk
Changes

Modified Makefile.in from [4f9c45270c] to [a0fe9448ac].

55
56
57
58
59
60
61
62

63
64
65
66
67
68
69

70
71
72
73
74
75
76
55
56
57
58
59
60
61

62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77







-
+







+








tcc4tcl-static.a: tcc4tcl.o tcc/libtcc.a
	cp tcc/libtcc.a tcc4tcl-static.new.a
	$(AR) rcu tcc4tcl-static.new.a tcc4tcl.o
	-$(RANLIB) tcc4tcl-static.new.a
	mv tcc4tcl-static.new.a tcc4tcl-static.a

install: $(TARGET) pkgIndex.tcl $(srcdir)/tcc4tcl.tcl tcc/libtcc1.a $(shell echo $(srcdir)/tcc/include/*) $(srcdir)/headers.awk $(srcdir)/patch-headers.sh
install: $(TARGET) pkgIndex.tcl $(srcdir)/tcc4tcl.tcl tcc/libtcc1.a $(shell echo $(srcdir)/tcc/include/*) $(shell echo $(srcdir)/tcc/win32/lib/*.c) $(srcdir)/headers.awk $(srcdir)/patch-headers.sh
	$(INSTALL) -d "$(DESTDIR)$(PACKAGE_INSTALL_DIR)"
	$(INSTALL) -d "$(DESTDIR)$(PACKAGE_INSTALL_DIR)/lib"
	$(INSTALL) -d "$(DESTDIR)$(PACKAGE_INSTALL_DIR)/include"
	$(INSTALL) -m 0755 $(TARGET) "$(DESTDIR)$(PACKAGE_INSTALL_DIR)"
	$(INSTALL) -m 0644 pkgIndex.tcl "$(DESTDIR)$(PACKAGE_INSTALL_DIR)"
	$(INSTALL) -m 0644 $(srcdir)/tcc4tcl.tcl "$(DESTDIR)$(PACKAGE_INSTALL_DIR)"
	$(INSTALL) -m 0644 tcc/libtcc1.a "$(DESTDIR)$(PACKAGE_INSTALL_DIR)/lib"
	$(INSTALL) -m 0644 $(shell echo $(srcdir)/tcc/win32/lib/*.c) "$(DESTDIR)$(PACKAGE_INSTALL_DIR)/lib"
	$(INSTALL) -m 0644 $(shell echo $(srcdir)/tcc/include/*) "$(DESTDIR)$(PACKAGE_INSTALL_DIR)/include"
	@if ! echo "_WIN32" | $(CPP) $(CPPFLAGS) - | grep '^_WIN32$$' >/dev/null; then \
		echo cp -r $(srcdir)/tcc/win32/include/* "$(DESTDIR)$(PACKAGE_INSTALL_DIR)/include/"; \
		cp -r $(srcdir)/tcc/win32/include/* "$(DESTDIR)$(PACKAGE_INSTALL_DIR)/include/"; \
		echo cp -r $(srcdir)/tcc/win32/lib/*.def "$(DESTDIR)$(PACKAGE_INSTALL_DIR)/lib/"; \
		cp -r $(srcdir)/tcc/win32/lib/*.def "$(DESTDIR)$(PACKAGE_INSTALL_DIR)/lib/"; \
	fi

Modified tcc4tcl.tcl from [c5d45f5bb2] to [c36e097dd3].

71
72
73
74
75
76
77
78

79
80
81
82

83
84
85
86
87
88
89
90
91
92
93

94
95
96

97
98
99
100
101
102

103
104
105
106
107
108
109
71
72
73
74
75
76
77

78
79
80
81

82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112







-
+



-
+











+



+






+







	foreach lib $libs {
		$handle add_library $lib
	}

	if {$::tcl_platform(platform) eq "windows"} {
		$handle define DLL_EXPORT {__declspec(dllexport)} 

		set f [open [file join $::tcc4tcl::dir c dllcrt1.c]]
		set f [open [file join $::tcc4tcl::dir lib dllcrt1.c]]
		$handle compile [read $f]
		close $f

		set f [open [file join $::tcc4tcl::dir c dllmain.c]]
		set f [open [file join $::tcc4tcl::dir lib dllmain.c]]
		$handle compile [read $f]
		close $f
	} else {
		$handle define DLL_EXPORT ""
	}

	$handle compile $code
	$handle output_file $dll

	rename $handle {}
}

proc ::tcc4tcl::Log {args} {
	# puts $args
}

proc ::tcc4tcl::reset {} {
	variable tcc
	set tcc(code)   ""
	set tcc(cfiles) [list]
	set tcc(tk) 0
}

# Custom helpers
proc ::tcc4tcl::checkname {n} {expr {[regexp {^[a-zA-Z0-9_]+$} $n] > 0}}
proc ::tcc4tcl::cleanname {n} {regsub -all {[^a-zA-Z0-9_]+} $n _}

proc ::tcc4tcl::ccode {code} {
	variable tcc