eserte / perl-tk

the perl module Tk
https://metacpan.org/release/Tk
Other
44 stars 31 forks source link

Complie on msys2/mingw64 #26

Closed USeebi closed 7 years ago

USeebi commented 7 years ago

Attempted to compile Tk-804.033 on perl -V Summary of my perl5 (revision 5 version 22 subversion 0) configuration:

Platform: osname=MSWin32, osvers=6.1, archname=MSWin32-x64-multi-thread uname='' config_args='undef' hint=recommended, useposix=true, d_sigaction=undef useithreads=define, usemultiplicity=define use64bitint=define, use64bitall=undef, uselongdouble=undef usemymalloc=n, bincompat5005=undef Compiler: cc='gcc', ccflags =' -s -O2 -DWIN32 -DWIN64 -DCONSERVATIVE -DPERL_TEXTMODE_SCRIPTS -DPERL_IMPLICIT_CONTEXT -DPERL_IMPLICIT_SYS -fwrapv -fno-strict-aliasing -mms-bitfields', optimize='-s -O2', cppflags='-DWIN32' ccversion='', gccversion='5.2.0', gccosandvers='' intsize=4, longsize=4, ptrsize=8, doublesize=8, byteorder=12345678, doublekind=3 d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=8, longdblkind=3 ivtype='long long', ivsize=8, nvtype='double', nvsize=8, Off_t='long long', lseeksize=8 alignbytes=8, prototype=define Linker and Libraries: ld='g++', ldflags ='-s -L"G:\msys64\mingw64\lib\perl5\core_perl\CORE" -L"G:\msys64\mingw64\lib"' libpth=G:\msys64\mingw64\lib\perl5\core_perl libs=-lmoldname -lkernel32 -luser32 -lgdi32 -lwinspool -lcomdlg32 -ladvapi32 -lshell32 -lole32 -loleaut32 -lnetapi32 -luuid -lws2_32 -lmpr -lwinmm -lversion -lodbc32 -lodbccp32 -lcomctl32 perllibs=-lmoldname -lkernel32 -luser32 -lgdi32 -lwinspool -lcomdlg32 -ladvapi32 -lshell32 -lole32 -loleaut32 -lnetapi32 -luuid -lws2_32 -lmpr -lwinmm -lversion -lodbc32 -lodbccp32 -lcomctl32 libc=, so=dll, useshrplib=true, libperl=libperl522.a gnulibc_version='' Dynamic Linking: dlsrc=dl_win32.xs, dlext=dll, d_dlsymun=undef, ccdlflags=' ' cccdlflags=' ', lddlflags='-mdll -s -L"G:\msys64\mingw64\lib\perl5\core_perl\CORE" -L"G:\msys64\mingw64\lib"'

Characteristics of this binary (from libperl): Compile-time options: HAS_TIMES HAVE_INTERP_INTERN MULTIPLICITY PERLIO_LAYERS PERL_DONT_CREATE_GVSV PERL_HASH_FUNC_ONE_AT_A_TIME_HARD PERL_IMPLICIT_CONTEXT PERL_IMPLICIT_SYS PERL_MALLOC_WRAP PERL_NEW_COPY_ON_WRITE PERL_PRESERVE_IVUV USE_64_BIT_INT USE_ITHREADS USE_LARGE_FILES USE_LOCALE USE_LOCALE_COLLATE USE_LOCALE_CTYPE USE_LOCALE_NUMERIC USE_LOCALE_TIME USE_PERLIO USE_PERL_ATOF Built under MSWin32 Compiled at Aug 6 2015 23:37:29 @INC: G:/msys64/mingw64/lib/perl5/site_perl G:/msys64/mingw64/lib/perl5/vendor_perl G:/msys64/mingw64/lib/perl5/core_perl .

I got stuck at

g++ -o ..\blib\arch\auto\Tk\JPEG\JPEG.dll -Wl,--base-file -Wl,dll.base -mdll -s -L"G:\msys64\mingw64\lib\perl5\core_perl\CORE" -L"G:\msys64\mingw64\lib" JPEG.o imgJPEG.o "G:\msys64\mingw64\lib\perl5\core_perl\CORE\libperl522.a" -lmoldname -lkernel32 -luser32 -lgdi32 -lwinspool -lcomdlg32 -ladvapi32 -lshell32 -lole32 -loleaut32 -lnetapi32 -luuid -lws2_32 -lmpr -lwinmm -lversion -lodbc32 -lodbccp32 -lcomctl32 dll.exp imgJPEG.o:imgJPEG.c:(.text+0x26d): undefined reference to jpeg_set_defaults' imgJPEG.o:imgJPEG.c:(.text+0x384): undefined reference tojpeg_set_quality' imgJPEG.o:imgJPEG.c:(.text+0x424): undefined reference to `jpeg_simple_progression' . . . . . . . . . collect2.exe: error: ld returned 1 exit status dmake: Error code 129, while making '..\blib\arch\auto\Tk\JPEG\JPEG.dll' dmake: Error code 255, while making 'subdirs' SREZIC/Tk-804.033.tar.gz dmake -- NOT OK

as there is no EXTRALIBS defined in the Makefile for JPEG and I got

. . . Using system's -ljpeg . . . Warning (mostly harmless): No library found for -ljpeg . . . . . . Finding dependencies for JPEG.xs Finding dependencies for imgJPEG.c . . .

while mingw-w64-x86_64-libjpeg-turbo package was installed through pacman.

I noticed that unlike Tk::PNG, Tk::JPEG did not use pkg-config in Makefile.PL, any hints on workarounds for this?

USeebi commented 7 years ago

Figured out to remove the mingw-w64-x86_64-libjpeg-turbo package so that dmake is forced to build libjepg that came with the distribution but then bump into a similar problem in linking Tk.dll

g++ -o blib\arch\auto\Tk\Tk.dll -Wl,--base-file -Wl,dll.base -mdll -s -L"G:\msys 64\mingw64\lib\perl5\core_perl\CORE" -L"G:\msys64\mingw64\lib" Tk.o chnGlue. o encGlue.o evtGlue.o objGlue.o tixGlue.o tkGlue.o tkGlue_f.o tkWin32Dll.o pTk\tkres.o pTk/libpTk.a "G:\msys64\min gw64\lib\perl5\core_perl\CORE\libperl522.a" -lmoldname -lkernel32 -luser32 -lgdi32 -lwinspool -lcomdlg32 -ladvapi32 -lshell32 -lole32 -loleaut32 -lnetapi32 -luuid -lws2_32 -lmpr -lwinmm -lversion -lodbc32 -lodbccp32 -lcomctl32 dll.exp

Finding the post http://www.perlmonks.org/?node_id=1122066 help identified the missing libimm32.a lib and completed the installation manually as suggested.

Have the same problem to install Tk::Zinc and the missing links are also in msys64\mingw64\x86_64-w64-mingw32\lib. Is there a bug and where it originated?