04 нояб. 2013 г., в 20:03, Zbigniew Diaczyszyn <[email protected]> написал(а):

> Am 04.11.2013 15:26, schrieb Alexpux:
>> Show how you build tcl/tk
> 
> In general I don't build but I use a binary Community version from 
> ActiveState. Under Unix It provides the libtclstub8.5.a library which offers 
> all the pointers to the Tcl commands used by the C Tcl extension I am trying 
> to build.
> 
> The Windows binary version provides a tclstub8.5.lib but I think I have to 
> link my code on the Linux host with the Unix library, have I?
> 
You need cross-build tcl/tk and you windows version for linking.

> If I had to build a Windows tclsh.exe I would follow the README:
> 
> --- begin ---
> 
> [...]
> 2. Compiling Tcl
> ----------------
> 
> In order to compile Tcl for Windows, you need the following:
> 
>       Tcl 8.5 Source Distribution (plus any patches)
>       and
>       [...]
>       Linux + MinGW-w64 [http://mingw-w64.sourceforge.net/]
>           (win32 or win64)
> [...]
> In practice, this release is built with Visual C++ 6.0 and the TEA
> Makefile.
> 
> [...]
> If you are building with Linux, Cygwin or Msys, you can use the configure 
> script that lives in the win subdirectory. The Linux/Cygwin/Msys based 
> configure/build process works just like the UNIX one, so you will want to 
> refer to ../unix/README for available configure options.
> [...]
> --- end ---
> 
> So in practice I just would type in tcl8.5/win subdirectory:
> 
> ./configure
> make
> make install
> 
> Just looking into the "configure" file for the interesting lines:
> 
> if test "${GCC}" = "yes" ; then
>       SHLIB_LD=""
>       SHLIB_LD_LIBS=""
>       LIBS="-lws2_32"
>       # mingw needs to link ole32 and oleaut32 for [send], but MSVC doesn't
>       LIBS_GUI="-lgdi32 -lcomdlg32 -limm32 -lcomctl32 -lshell32 -luuid 
> -lole32 -loleaut32"
>       STLIB_LD='${AR} cr'
>       RC_OUT=-o
>       RC_TYPE=
>       RC_INCLUDE=--include
>       RC_DEFINE=--define
>       RES=res.o
>       MAKE_LIB="\${STLIB_LD} \$@"
>       POST_MAKE_LIB="\${RANLIB} \$@"
>       MAKE_EXE="\${CC} -o \$@"
>       LIBPREFIX="lib"
> 
>       extra_cflags="-pipe"
>       extra_ldflags="-pipe"
> 
> and some line later the shared configuration:
> 
> if test "${SHARED_BUILD}" = "0" ; then
>           # static
> [...]
>       else
>           # dynamic
> [...]
>           # ad-hoc check to see if CC supports -shared.
> [I think, mingw64 supports this flag, Zbigniew]
> 
>           runtime=
>           # Link with gcc since ld does not link to default libs like
>           # -luser32 and -lmsvcrt by default. Make sure CFLAGS is
>           # included so -mno-cygwin passed the correct libs to the linker.
>           SHLIB_LD='${CC} -shared ${CFLAGS}'
>           SHLIB_LD_LIBS='${LIBS}'
>           # Add SHLIB_LD_LIBS to the Make rule, not here.
>           MAKE_DLL="\${SHLIB_LD} \$(LDFLAGS) -o \$@ ${extra_ldflags} \
>               -Wl,--out-implib,\$(patsubst %.dll,lib%.a,\$@)"
> 
>           LIBSUFFIX="\${DBGX}.a"
>           LIBFLAGSUFFIX="\${DBGX}"
>           EXESUFFIX="\${DBGX}.exe"
>           LIBRARIES="\${SHARED_LIBRARIES}"
>       fi
>       # DLLSUFFIX is separate because it is the building block for
>       # users of tclConfig.sh that may build shared or static.
>       DLLSUFFIX="\${DBGX}.dll"
>       SHLIB_SUFFIX=.dll
> 
>       EXTRA_CFLAGS="${extra_cflags}"
> 
>       CFLAGS_DEBUG=-g
>       CFLAGS_OPTIMIZE="-O2 -fomit-frame-pointer"
>       CFLAGS_WARNING="-Wall"
>       LDFLAGS_DEBUG=
>       LDFLAGS_OPTIMIZE=
> 
>       # Specify the CC output file names based on the target name
>       CC_OBJNAME="-o \$@"
>       CC_EXENAME="-o \$@"
> 
>       # Specify linker flags depending on the type of app being
>       # built -- Console vs. Window.
>       #
>       # ORIGINAL COMMENT:
>       # We need to pass -e _WinMain@16 so that ld will use
>       # WinMain() instead of main() as the entry point. We can't
>       # use autoconf to check for this case since it would need
>       # to run an executable and that does not work when
>       # cross compiling. Remove this -e workaround once we
>       # require a gcc that does not have this bug.
>       #
>       # MK NOTE: Tk should use a different mechanism. This causes
>       # interesting problems, such as wish dying at startup.
>       #LDFLAGS_WINDOW="-mwindows -e _WinMain@16 ${extra_ldflags}"
>       LDFLAGS_CONSOLE="-mconsole ${extra_ldflags}"
>       LDFLAGS_WINDOW="-mwindows ${extra_ldflags}"
> 
> Well, I would only need the console --pipe flag ...
> 
> Uff, too much Windows stuff for me :-(
> 
> 
> -- 
> Zbigniew Diaczyszyn
> Web: http://zdia.de
> PGP Key ID: 0x52052C79
> 
> ------------------------------------------------------------------------------
> Android is increasing in popularity, but the open development platform that
> developers love is also attractive to malware creators. Download this white
> paper to learn more about secure code signing practices that can help keep
> Android apps secure.
> http://pubads.g.doubleclick.net/gampad/clk?id=65839951&iu=/4140/ostg.clktrk
> _______________________________________________
> Mingw-w64-public mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/mingw-w64-public


------------------------------------------------------------------------------
Android is increasing in popularity, but the open development platform that
developers love is also attractive to malware creators. Download this white
paper to learn more about secure code signing practices that can help keep
Android apps secure.
http://pubads.g.doubleclick.net/gampad/clk?id=65839951&iu=/4140/ostg.clktrk
_______________________________________________
Mingw-w64-public mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public

Reply via email to