Overview
| Comment: | Updated to search loaded libraries for symbols on Win32 as we do on UNIX |
|---|---|
| Timelines: | family | ancestors | descendants | both | trunk |
| Files: | files | file ages | folders |
| SHA1: |
adeb3bb79bccce379eee6d885a05e17d |
| User & Date: | rkeene on 2014-05-04 07:03:23.667 |
| Other Links: | manifest | tags |
Context
|
2014-05-04
| ||
| 07:04 | tcc4tcl version 0.3 check-in: df44ccaed5 user: rkeene tags: trunk, 0.3 | |
| 07:03 | Updated to search loaded libraries for symbols on Win32 as we do on UNIX check-in: adeb3bb79b user: rkeene tags: trunk | |
| 07:02 | Removed spurious information from patch check-in: b3f189ad77 user: rkeene tags: trunk | |
Changes
Modified configure.ac
from [77b6918fa2]
to [ed00a008d9].
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | dnl Define ourselves AC_INIT(tcc4tcl, @@VERS@@) dnl Checks for programs. AC_PROG_CC AC_PROG_MAKE_SET AC_PROG_INSTALL AC_GNU_SOURCE dnl Determine system information DC_CHK_OS_INFO dnl Determine if a shared or static build is requested AC_ARG_ENABLE([static], AS_HELP_STRING([--enable-static], [build static library instead of shared library]), [ if test "$enableval" = "no"; then | > | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | dnl Define ourselves AC_INIT(tcc4tcl, @@VERS@@) dnl Checks for programs. AC_PROG_CC AC_PROG_MAKE_SET AC_PROG_INSTALL AC_GNU_SOURCE AC_LANG(C) dnl Determine system information DC_CHK_OS_INFO dnl Determine if a shared or static build is requested AC_ARG_ENABLE([static], AS_HELP_STRING([--enable-static], [build static library instead of shared library]), [ if test "$enableval" = "no"; then |
| ︙ | ︙ | |||
31 32 33 34 35 36 37 |
fi
if test "${TCC4TCL_TARGET}" = "shared"; then
dnl Determine how to make shared objects
DC_GET_SHOBJFLAGS
dnl Only export symbols we wish to expose
| < | > > > > > > | > > > > > > > > > > > > > > > > > > > > > > > > | 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 |
fi
if test "${TCC4TCL_TARGET}" = "shared"; then
dnl Determine how to make shared objects
DC_GET_SHOBJFLAGS
dnl Only export symbols we wish to expose
TARGET="tcc4tcl.${SHOBJEXT}"
AC_CHECK_HEADERS(windows.h)
AC_CHECK_HEADERS(psapi.h,,, [
#ifdef HAVE_WINDOWS_H
# include <windows.h>
#endif
])
AC_MSG_CHECKING([for EnumProcessModules in -lpsapi])
SAVE_LIBS="$LIBS"
LIBS="-lpsapi $LIBS"
AC_LINK_IFELSE([AC_LANG_PROGRAM([
#ifdef HAVE_WINDOWS_H
# include <windows.h>
#endif
#ifdef HAVE_PSAPI_H
# include <psapi.h>
#endif
], [
EnumProcessModules(NULL, NULL, 0, NULL);
])], [
AC_MSG_RESULT([found])
], [
AC_MSG_RESULT([not found])
LIBS="$SAVE_LIBS"
])
else
TARGET="tcc4tcl-static.a"
fi
AC_SUBST(TARGET)
AC_SUBST(TCC4TCL_TARGET)
dnl Find out if we have the functions needed to open shared objects
AC_SEARCH_LIBS(dlopen, dl,, [
AC_SEARCH_LIBS(shl_load, dld dl)
])
AC_CHECK_FUNCS(dlopen shl_load)
dnl Look for appropriate headers
AC_CHECK_HEADERS(unistd.h stdlib.h string.h strings.h dlfcn.h dl.h)
dnl Perform Tcl Extension required stuff
TCLEXT_INIT
dnl This must be done last since it breaks the compilation
if test "${TCC4TCL_TARGET}" = "shared"; then
DC_SETVERSIONSCRIPT([tcc4tcl.syms], [tcc4tcl.vers])
DC_FIND_STRIP_AND_REMOVESYMS([tcc4tcl.syms])
fi
dnl Produce output
AC_OUTPUT(Makefile pkgIndex.tcl tcc4tcl.syms)
|
Modified tcc4tcl.tcl
from [3b40b22f76]
to [271b665fc7].
| ︙ | ︙ | |||
51 52 53 54 55 56 57 |
$handle command $tclcommand $cname
}
return
}
}
proc tcc4tcl::to_dll {code dll {libs {}}} {
tcc4tcl $::tcc4tcl::dir dll tcc_1
| < < | 51 52 53 54 55 56 57 58 59 60 61 62 63 64 |
$handle command $tclcommand $cname
}
return
}
}
proc tcc4tcl::to_dll {code dll {libs {}}} {
tcc4tcl $::tcc4tcl::dir dll tcc_1
foreach lib $libs {tcc_1 add_library $lib}
if {$::tcl_platform(platform) eq "windows"} {
tcc_1 define DLL_EXPORT {__declspec(dllexport)}
set f [open $::tcc4tcl::dir/c/dllcrt1.c]
tcc_1 compile [read $f]
close $f
set f [open $::tcc4tcl::dir/c/dllmain.c]
|
| ︙ | ︙ | |||
92 93 94 95 96 97 98 |
append tcc(code) $code \n
}
proc ::tcc4tcl::cc {code} {
variable tcc
if {![info exists tcc(cc)]} {
set tcc(cc) tcc1
tcc4tcl $::tcc4tcl::dir $tcc(cc)
| < < | 90 91 92 93 94 95 96 97 98 99 100 101 102 103 |
append tcc(code) $code \n
}
proc ::tcc4tcl::cc {code} {
variable tcc
if {![info exists tcc(cc)]} {
set tcc(cc) tcc1
tcc4tcl $::tcc4tcl::dir $tcc(cc)
}
Log code:$code
$tcc(cc) compile $code
}
#----------------------------------------------------------- New DLL API
proc ::tcc4tcl::dll {{name ""}} {
variable count
|
| ︙ | ︙ |