Ticket #276: tt276-msvc-linking.patch
File tt276-msvc-linking.patch, 6.1 KB (added by rurban, 13 years ago) |
---|
-
config/gen/makefiles/dynpmc_pl.in
old new 85 85 $extraLibs =~ s/blib/..\\blib/g; 86 86 $extraLibs =~ s/\Q$(A)\E/.lib/g; 87 87 $liblist .= ' ' . $extraLibs; 88 89 # Also note that we may need to look in the Parrot blib directory.90 if ($CC =~ /gcc/i) {91 $liblist .= qq{ -Wl,-L "@build_dir@/blib/lib"};92 }93 else {94 $liblist .= qq{ /LIBPATH:"@build_dir@/blib/lib"};95 }96 88 } 97 89 else { 98 90 $liblist = join( ' ', map { "-l$_" } keys %$libs ); -
config/gen/makefiles/root.in
old new 479 479 # Libraries 480 480 LIBPARROT_STATIC = @blib_dir@/@libparrot_static@ 481 481 #IF(darwin):export DYLD_LIBRARY_PATH := @blib_dir@:$(DYLD_LIBRARY_PATH) 482 #IF(win32 ):LIBPARROT_SHARED = @libparrot_shared@482 #IF(win32 or cygwin):LIBPARROT_SHARED = @libparrot_shared@ 483 483 #ELSE:LIBPARROT_SHARED = @blib_dir@/@libparrot_shared@ 484 #IF(win32):IMPORTLIB = @blib_dir@/libparrot.lib 485 #ELSIF(cygwin):IMPORTLIB = @blib_dir@/libparrot.dll.a 484 486 485 487 # This line controls whether a static or shared library is built 486 488 LIBPARROT = @libparrot@ … … 848 850 $(LIBPARROT_SHARED) : $(O_FILES) 849 851 $(MKPATH) @blib_dir@ 850 852 $(LD) $(LD_SHARE_FLAGS) $(LDFLAGS) @ld_out@$@ @libparrot_soname@ \ 851 #IF(cygwin): -Wl,--out-implib=libparrot.dll.a \ 852 #IF(win32 and cc==gcc): -Wl,--out-implib=libparrot.lib \ 853 #IF(cygwin): -Wl,--out-implib=$(IMPORTLIB) \ 854 #IF(win32 and cc==gcc): -Wl,--out-implib=$(IMPORTLIB) \ 855 #IF(win32 and cc==cl): -implib:$(IMPORTLIB) \ 853 856 $(O_FILES) $(C_LIBS) $(ICU_SHARED) 854 857 #IF(win32): if exist $@.manifest mt.exe -nologo -manifest $@.manifest -outputresource:$@;2 855 858 #IF(libparrot_shared_alias): ( cd @blib_dir@ ; ln -sf @libparrot_shared@ @libparrot_shared_alias@ ) … … 1587 1590 $(PARROT) \ 1588 1591 $(MINIPARROT) \ 1589 1592 $(LIBPARROT) \ 1593 $(IMPORTLIB) \ 1590 1594 $(INSTALLABLEPARROT) \ 1591 1595 $(INSTALLABLEDIS) \ 1592 1596 $(INSTALLABLEPDUMP) \ 1593 1597 $(INSTALLABLEPINFO) \ 1594 1598 $(INSTALLABLEPBCMERGE) \ 1595 1599 $(INSTALLABLEPDB) \ 1600 $(INSTALLABLECONFIG) \ 1596 1601 pbc_to_exe.pbc pbc_to_exe.c pbc_to_exe$(O) pbc_to_exe$(EXE) \ 1602 parrot_config$(O) parrot_config.pbc parrot_config.c parrot_config$(EXE) \ 1597 1603 $(IMCC_DIR)/main$(O) \ 1598 1604 $(PDUMP) $(SRC_DIR)/pbc_dump$(O) $(SRC_DIR)/packdump$(O) \ 1599 1605 $(SRC_DIR)/pbc_info$(O) $(PINFO) \ … … 1664 1670 $(RM_F) \ 1665 1671 "$(DYNEXT_DIR)/*$(LOAD_EXT)" \ 1666 1672 "$(DYNEXT_DIR)/*$(SHARE_EXT)" \ 1667 "$(DYNEXT_DIR)/*.lib" \1668 "*.pdb" "$(DYNEXT_DIR)/*.pdb" \1669 "*.ilk" "$(DYNEXT_DIR)/*.ilk" \1670 "*.exp" "$(DYNEXT_DIR)/*.exp" \1671 "*.def" "$(DYNEXT_DIR)/*.def" \1672 "*.manifest" "$(DYNEXT_DIR)/*.manifest"1673 #IF(win32): "$(DYNEXT_DIR)/*.lib" \ 1674 #IF(win32): "*.pdb" "$(DYNEXT_DIR)/*.pdb" \ 1675 #IF(win32): "*.ilk" "$(DYNEXT_DIR)/*.ilk" \ 1676 #IF(win32): "*.exp" "$(DYNEXT_DIR)/*.exp" \ 1677 #IF(win32): "*.def" "$(DYNEXT_DIR)/*.def" \ 1678 #IF(win32): "*.manifest" "$(DYNEXT_DIR)/*.manifest" 1673 1679 1674 1680 # Remove files generated by the test suite 1675 1681 # XXX Is there a danger of too long command lines in the $(RM_F) commands, … … 1681 1687 "t/compilers/*/*.pbc" \ 1682 1688 "t/compilers/*/*_pbcexe*" \ 1683 1689 "t/compilers/*/*.pir" \ 1684 "t/compilers/*/*.stabs.s"1690 #IF(!win32): "t/compilers/*/*.stabs.s" 1685 1691 $(RM_F) \ 1686 1692 "t/compilers/*/*/*.out" \ 1687 1693 "t/compilers/*/*/*.pasm" \ 1688 1694 "t/compilers/*/*/*.pbc" \ 1689 1695 "t/compilers/*/*/*_pbcexe*" \ 1690 1696 "t/compilers/*/*/*.pir" \ 1691 "t/compilers/*/*/*.stabs.s"1697 #IF(!win32): "t/compilers/*/*/*.stabs.s" 1692 1698 $(RM_F) \ 1693 1699 "t/*/*$(O)" \ 1694 1700 "t/*/*.out" \ 1695 1701 "t/*/*.pasm" \ 1696 1702 "t/*/*_pbcexe*" \ 1697 1703 "t/*/*.pir" \ 1698 "t/*/*.stabs.s"1704 #IF(!win32): "t/*/*.stabs.s" 1699 1705 $(RM_F) \ 1700 1706 "t/library/*.pbc" \ 1701 1707 "t/dynoplibs/*.pbc" \ … … 1706 1712 "t/tools/*.pbc" 1707 1713 $(RM_F) \ 1708 1714 "t/src/*.c" \ 1709 "t/src/*.pdb" \1710 "t/src/*.manifest"1715 #IF(win32): "t/src/*.pdb" \ 1716 #IF(win32): "t/src/*.manifest" 1711 1717 $(RM_F) \ 1712 1718 "t/tools/pmc2c.t_*" \ 1713 1719 "t/tools/pmc2c.pmc_t_*" \ … … 1715 1721 $(RM_F) \ 1716 1722 "test$(EXE)" \ 1717 1723 "test.*" 1724 #IF(cygwin or (win32 and cc==gcc)): $(RM_F) *.exe.stackdump 1718 1725 $(RM_F) \ 1719 1726 "parrot_test_run.tar.gz" 1720 1727 -
config/init/hints/mswin32.pm
old new 86 86 ld_out => '-out:', 87 87 ldflags => '-nologo -nodefaultlib', 88 88 libs => 'kernel32.lib ws2_32.lib msvcrt.lib oldnames.lib ', 89 libparrot_static => 'libparrot' . $conf->data->get('a'),90 89 libparrot_shared => 'libparrot$(SHARE_EXT)', 90 libparrot_ldflags => "-libpath:\"$build_dir\\blib\\lib\" libparrot.lib", 91 91 ar_flags => '', 92 92 ar_out => '-out:', 93 93 slash => '\\', … … 103 103 104 104 # If we are building shared, need to include dynamic libparrot.lib, otherwise 105 105 # the static libparrot.lib. 106 $conf->data->set( libparrot_ldflags => "\"$build_dir\\libparrot.lib\"" ); 106 if ($conf->data->get('parrot_is_shared')) { 107 $conf->data->set( has_static_linking => 0, 108 libparrot_static => 'blib\\lib\\libparrots' . $conf->data->get('a')); 109 } 110 else { 111 $conf->data->set( has_dynamic_linking => 0, 112 libparrot_static => 'blib\\lib\\libparrot' . $conf->data->get('a')); 113 } 107 114 108 115 # 'link' needs to be link.exe, not cl.exe. 109 116 # This makes 'link' and 'ld' the same.