Index: Makefile.in ================================================================== --- Makefile.in +++ Makefile.in @@ -41,11 +41,11 @@ tcc/libtcc.a: tcc/config.h $(MAKE) -C tcc libtcc.a tcc/libtcc1.a: tcc/config.h - -if [ '@build@' = '@host@' ]; then $(MAKE) -C tcc tcc; fi + -$(MAKE) -C tcc tcc@EXEEXT@ $(MAKE) -C tcc libtcc1.a tcc4tcl.o: $(srcdir)/tcc4tcl.c $(srcdir)/tcc/tcc.h $(srcdir)/tcc/libtcc.h tcc/config.h $(CC) $(CPPFLAGS) $(CFLAGS) -o tcc4tcl.o -c $(srcdir)/tcc4tcl.c @@ -95,11 +95,11 @@ sed 's/@@VERS@@/0.0/g' "$${file}" > "$${file}.new"; \ cat "$${file}.new" > "$${file}"; \ rm -f "$${file}.new"; \ done \ ); fi - $(TCLSH) $(srcdir)/test.tcl __TMP__ + if [ '@build@' = '@host@' ]; then TCC4TCL_TEST_RUN_NATIVE=1; export TCC4TCL_TEST_RUN_NATIVE; fi; $(TCLSH) $(srcdir)/test.tcl __TMP__ echo Tests Completed OK > TEST-STATUS rm -rf __TMP__ clean: rm -f tcc4tcl.o Index: test.tcl ================================================================== --- test.tcl +++ test.tcl @@ -77,18 +77,20 @@ ## Delete without performing set handle [tcc4tcl::new] $handle delete # External functions (requires .a files) -set handle [tcc4tcl::new] -$handle ccode {const char *curl_version(void);} -$handle cproc curl_version {} vstring -$handle add_library_path /usr/lib64 -$handle add_library_path /usr/lib -$handle add_library curl -$handle go -puts [curl_version] +if {[info exists ::env(TCC4TCL_TEST_RUN_NATIVE)]} { + set handle [tcc4tcl::new] + $handle ccode {const char *curl_version(void);} + $handle cproc curl_version {} vstring + $handle add_library_path /usr/lib64 + $handle add_library_path /usr/lib + $handle add_library curl + $handle go + puts [curl_version] +} # wide values set handle [tcc4tcl::new] $handle cproc wideTest {Tcl_WideInt x} Tcl_WideInt { return(x); @@ -95,16 +97,18 @@ } $handle go puts [wideTest 30] # Produce a loadable object -set tmpfile "/tmp/DELETEME_tcc4tcl_test_exec[expr rand()].so" -file delete $tmpfile -set handle [tcc4tcl::new $tmpfile "myPkg 0.1"] -$handle cproc ext_add {int a int b} long { return(a+b); } -$handle add_library_path /usr/lib64 -$handle add_library_path /usr/lib -$handle add_library tclstub8.5 -$handle go -load $tmpfile myPkg -puts [ext_add 1 42] -file delete $tmpfile +if {[info exists ::env(TCC4TCL_TEST_RUN_NATIVE)]} { + set tmpfile "/tmp/DELETEME_tcc4tcl_test_exec[expr rand()].so" + file delete $tmpfile + set handle [tcc4tcl::new $tmpfile "myPkg 0.1"] + $handle cproc ext_add {int a int b} long { return(a+b); } + $handle add_library_path /usr/lib64 + $handle add_library_path /usr/lib + $handle add_library tclstub8.5 + $handle go + load $tmpfile myPkg + puts [ext_add 1 42] + file delete $tmpfile +}