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     55   
    56     56   tcc4tcl-static.a: tcc4tcl.o tcc/libtcc.a
    57     57   	cp tcc/libtcc.a tcc4tcl-static.new.a
    58     58   	$(AR) rcu tcc4tcl-static.new.a tcc4tcl.o
    59     59   	-$(RANLIB) tcc4tcl-static.new.a
    60     60   	mv tcc4tcl-static.new.a tcc4tcl-static.a
    61     61   
    62         -install: $(TARGET) pkgIndex.tcl $(srcdir)/tcc4tcl.tcl tcc/libtcc1.a $(shell echo $(srcdir)/tcc/include/*) $(srcdir)/headers.awk $(srcdir)/patch-headers.sh
           62  +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
    63     63   	$(INSTALL) -d "$(DESTDIR)$(PACKAGE_INSTALL_DIR)"
    64     64   	$(INSTALL) -d "$(DESTDIR)$(PACKAGE_INSTALL_DIR)/lib"
    65     65   	$(INSTALL) -d "$(DESTDIR)$(PACKAGE_INSTALL_DIR)/include"
    66     66   	$(INSTALL) -m 0755 $(TARGET) "$(DESTDIR)$(PACKAGE_INSTALL_DIR)"
    67     67   	$(INSTALL) -m 0644 pkgIndex.tcl "$(DESTDIR)$(PACKAGE_INSTALL_DIR)"
    68     68   	$(INSTALL) -m 0644 $(srcdir)/tcc4tcl.tcl "$(DESTDIR)$(PACKAGE_INSTALL_DIR)"
    69     69   	$(INSTALL) -m 0644 tcc/libtcc1.a "$(DESTDIR)$(PACKAGE_INSTALL_DIR)/lib"
           70  +	$(INSTALL) -m 0644 $(shell echo $(srcdir)/tcc/win32/lib/*.c) "$(DESTDIR)$(PACKAGE_INSTALL_DIR)/lib"
    70     71   	$(INSTALL) -m 0644 $(shell echo $(srcdir)/tcc/include/*) "$(DESTDIR)$(PACKAGE_INSTALL_DIR)/include"
    71     72   	@if ! echo "_WIN32" | $(CPP) $(CPPFLAGS) - | grep '^_WIN32$$' >/dev/null; then \
    72     73   		echo cp -r $(srcdir)/tcc/win32/include/* "$(DESTDIR)$(PACKAGE_INSTALL_DIR)/include/"; \
    73     74   		cp -r $(srcdir)/tcc/win32/include/* "$(DESTDIR)$(PACKAGE_INSTALL_DIR)/include/"; \
    74     75   		echo cp -r $(srcdir)/tcc/win32/lib/*.def "$(DESTDIR)$(PACKAGE_INSTALL_DIR)/lib/"; \
    75     76   		cp -r $(srcdir)/tcc/win32/lib/*.def "$(DESTDIR)$(PACKAGE_INSTALL_DIR)/lib/"; \
    76     77   	fi

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

    71     71   	foreach lib $libs {
    72     72   		$handle add_library $lib
    73     73   	}
    74     74   
    75     75   	if {$::tcl_platform(platform) eq "windows"} {
    76     76   		$handle define DLL_EXPORT {__declspec(dllexport)} 
    77     77   
    78         -		set f [open [file join $::tcc4tcl::dir c dllcrt1.c]]
           78  +		set f [open [file join $::tcc4tcl::dir lib dllcrt1.c]]
    79     79   		$handle compile [read $f]
    80     80   		close $f
    81     81   
    82         -		set f [open [file join $::tcc4tcl::dir c dllmain.c]]
           82  +		set f [open [file join $::tcc4tcl::dir lib dllmain.c]]
    83     83   		$handle compile [read $f]
    84     84   		close $f
    85     85   	} else {
    86     86   		$handle define DLL_EXPORT ""
    87     87   	}
    88     88   
    89     89   	$handle compile $code
    90     90   	$handle output_file $dll
    91     91   
    92     92   	rename $handle {}
    93     93   }
           94  +
    94     95   proc ::tcc4tcl::Log {args} {
    95     96   	# puts $args
    96     97   }
           98  +
    97     99   proc ::tcc4tcl::reset {} {
    98    100   	variable tcc
    99    101   	set tcc(code)   ""
   100    102   	set tcc(cfiles) [list]
   101    103   	set tcc(tk) 0
   102    104   }
          105  +
   103    106   # Custom helpers
   104    107   proc ::tcc4tcl::checkname {n} {expr {[regexp {^[a-zA-Z0-9_]+$} $n] > 0}}
   105    108   proc ::tcc4tcl::cleanname {n} {regsub -all {[^a-zA-Z0-9_]+} $n _}
   106    109   
   107    110   proc ::tcc4tcl::ccode {code} {
   108    111   	variable tcc
   109    112