Check-in [9d947ddc1d]
Overview
Comment:Updated to include Tcl runtime in lib search path
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 9d947ddc1db21e305eb72150b19a614b7cf52a24
User & Date: rkeene on 2014-07-16 14:32:46
Other Links: manifest | tags
Context
2014-07-16
14:44
Updated to create a proc if we are operating in an existing interpreter, to avoid setting local variables check-in: 500057b0ea user: rkeene tags: trunk
14:32
Updated to include Tcl runtime in lib search path check-in: 9d947ddc1d user: rkeene tags: trunk
13:41
Updated to link against stubs library for current version of Tcl check-in: 15ac59fd14 user: rkeene tags: trunk
Changes

Modified test.tcl from [7be1937b09] to [907e91664c].

    78     78   set handle [tcc4tcl::new]
    79     79   $handle delete
    80     80   
    81     81   # External functions
    82     82   if {[info exists ::env(TCC4TCL_TEST_RUN_NATIVE)]} {
    83     83   	set handle [tcc4tcl::new]
    84     84   	$handle cwrap curl_version {} vstring
           85  +	$handle add_library_path [::tcl::pkgconfig get libdir,runtime]
    85     86   	$handle add_library_path /usr/lib64
    86     87   	$handle add_library_path /usr/lib
    87     88   	$handle add_library_path /usr/lib32
    88     89   	$handle add_library curl
    89     90   	$handle go
    90     91   	puts [curl_version]
    91     92   }
................................................................................
   101    102   # Produce a loadable object
   102    103   ## Currently doesn't work on Darwin
   103    104   if {[info exists ::env(TCC4TCL_TEST_RUN_NATIVE)] && $::tcl_platform(os) != "Darwin"} {
   104    105   	set tmpfile "/tmp/DELETEME_tcc4tcl_test_exec[expr rand()].so"
   105    106   	file delete $tmpfile
   106    107   	set handle [tcc4tcl::new $tmpfile "myPkg 0.1"]
   107    108   	$handle cproc ext_add {int a int b} long { return(a+b); }
          109  +	$handle add_library_path [::tcl::pkgconfig get libdir,runtime]
   108    110   	$handle add_library_path /usr/lib64
   109    111   	$handle add_library_path /usr/lib
   110    112   	$handle add_library_path /usr/lib32
   111    113   	$handle add_library tclstub${::tcl_version}
   112    114   	$handle go
   113    115   	load $tmpfile myPkg
   114    116   	puts [ext_add 1 42]
................................................................................
   133    135   
   134    136   		curl_easy_setopt(handle, CURLOPT_URL, url);
   135    137   		curl_easy_perform(handle);
   136    138   
   137    139   		return(TCL_OK);
   138    140   	}
   139    141   	$handle add_include_path /usr/include
          142  +	$handle add_library_path [::tcl::pkgconfig get libdir,runtime]
   140    143   	$handle add_library_path /usr/lib64
   141    144   	$handle add_library_path /usr/lib
   142    145   	$handle add_library_path /usr/lib32
   143    146   	$handle add_library curl
   144    147   	$handle go
   145    148       
   146    149   	curl_fetch http://rkeene.org/
................................................................................
   155    158   $handle cwrap callToTcl {Tcl_Interp* ip int a int b} int
   156    159   $handle go
   157    160   if {[callToTcl 3 5] != 8} {
   158    161   	error "3 + 5 is 8, not [callToTcl 3 5]"
   159    162   }
   160    163   
   161    164   set handle [tcc4tcl::new]
   162         -$handle proc callToTcl1 {} float {
          165  +$handle proc callToTcl1 {int x} float {
   163    166   	return 0.1
   164    167   }
   165         -$handle cwrap callToTcl1 {} float
          168  +$handle cwrap callToTcl1 {int x} float
   166    169   $handle go
   167         -puts [callToTcl1]
          170  +puts [callToTcl1 3]