Ticket #276: tt276-msvc-linking.patch

File tt276-msvc-linking.patch, 6.1 KB (added by rurban, 13 years ago)

target against #276 + #313

  • config/gen/makefiles/dynpmc_pl.in

    old new  
    8585        $extraLibs =~ s/blib/..\\blib/g; 
    8686        $extraLibs =~ s/\Q$(A)\E/.lib/g; 
    8787        $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         } 
    9688    } 
    9789    else { 
    9890        $liblist = join( ' ', map { "-l$_" } keys %$libs ); 
  • config/gen/makefiles/root.in

    old new  
    479479# Libraries 
    480480LIBPARROT_STATIC    = @blib_dir@/@libparrot_static@ 
    481481#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@ 
    483483#ELSE:LIBPARROT_SHARED  = @blib_dir@/@libparrot_shared@ 
     484#IF(win32):IMPORTLIB           = @blib_dir@/libparrot.lib 
     485#ELSIF(cygwin):IMPORTLIB           = @blib_dir@/libparrot.dll.a 
    484486 
    485487# This line controls whether a static or shared library is built 
    486488LIBPARROT           = @libparrot@ 
     
    848850$(LIBPARROT_SHARED) : $(O_FILES) 
    849851        $(MKPATH) @blib_dir@ 
    850852        $(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) \ 
    853856                $(O_FILES) $(C_LIBS) $(ICU_SHARED) 
    854857#IF(win32):     if exist $@.manifest mt.exe -nologo -manifest $@.manifest -outputresource:$@;2 
    855858#IF(libparrot_shared_alias):    ( cd @blib_dir@ ; ln -sf @libparrot_shared@ @libparrot_shared_alias@ ) 
     
    15871590    $(PARROT) \ 
    15881591    $(MINIPARROT) \ 
    15891592    $(LIBPARROT) \ 
     1593    $(IMPORTLIB) \ 
    15901594    $(INSTALLABLEPARROT) \ 
    15911595    $(INSTALLABLEDIS) \ 
    15921596    $(INSTALLABLEPDUMP) \ 
    15931597    $(INSTALLABLEPINFO) \ 
    15941598    $(INSTALLABLEPBCMERGE) \ 
    15951599    $(INSTALLABLEPDB) \ 
     1600    $(INSTALLABLECONFIG) \ 
    15961601    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) \ 
    15971603    $(IMCC_DIR)/main$(O) \ 
    15981604    $(PDUMP) $(SRC_DIR)/pbc_dump$(O) $(SRC_DIR)/packdump$(O) \ 
    15991605    $(SRC_DIR)/pbc_info$(O) $(PINFO) \ 
     
    16641670        $(RM_F) \ 
    16651671    "$(DYNEXT_DIR)/*$(LOAD_EXT)" \ 
    16661672    "$(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" 
    16731679 
    16741680# Remove files generated by the test suite 
    16751681# XXX Is there a danger of too long command lines in the $(RM_F) commands, 
     
    16811687    "t/compilers/*/*.pbc" \ 
    16821688    "t/compilers/*/*_pbcexe*" \ 
    16831689    "t/compilers/*/*.pir" \ 
    1684     "t/compilers/*/*.stabs.s" 
     1690#IF(!win32):    "t/compilers/*/*.stabs.s" 
    16851691        $(RM_F) \ 
    16861692    "t/compilers/*/*/*.out" \ 
    16871693    "t/compilers/*/*/*.pasm" \ 
    16881694    "t/compilers/*/*/*.pbc" \ 
    16891695    "t/compilers/*/*/*_pbcexe*" \ 
    16901696    "t/compilers/*/*/*.pir" \ 
    1691     "t/compilers/*/*/*.stabs.s" 
     1697#IF(!win32):    "t/compilers/*/*/*.stabs.s" 
    16921698        $(RM_F) \ 
    16931699    "t/*/*$(O)" \ 
    16941700    "t/*/*.out" \ 
    16951701    "t/*/*.pasm" \ 
    16961702    "t/*/*_pbcexe*" \ 
    16971703    "t/*/*.pir" \ 
    1698     "t/*/*.stabs.s" 
     1704#IF(!win32):    "t/*/*.stabs.s" 
    16991705        $(RM_F) \ 
    17001706    "t/library/*.pbc" \ 
    17011707    "t/dynoplibs/*.pbc" \ 
     
    17061712    "t/tools/*.pbc" 
    17071713        $(RM_F) \ 
    17081714    "t/src/*.c" \ 
    1709     "t/src/*.pdb" \ 
    1710     "t/src/*.manifest" 
     1715#IF(win32):    "t/src/*.pdb" \ 
     1716#IF(win32):    "t/src/*.manifest" 
    17111717        $(RM_F) \ 
    17121718     "t/tools/pmc2c.t_*" \ 
    17131719     "t/tools/pmc2c.pmc_t_*" \ 
     
    17151721        $(RM_F) \ 
    17161722     "test$(EXE)" \ 
    17171723     "test.*" 
     1724#IF(cygwin or (win32 and cc==gcc)):     $(RM_F) *.exe.stackdump 
    17181725        $(RM_F) \ 
    17191726     "parrot_test_run.tar.gz" 
    17201727 
  • config/init/hints/mswin32.pm

    old new  
    8686            ld_out              => '-out:', 
    8787            ldflags             => '-nologo -nodefaultlib', 
    8888            libs                => 'kernel32.lib ws2_32.lib msvcrt.lib oldnames.lib ', 
    89             libparrot_static    => 'libparrot' . $conf->data->get('a'), 
    9089            libparrot_shared    => 'libparrot$(SHARE_EXT)', 
     90            libparrot_ldflags   => "-libpath:\"$build_dir\\blib\\lib\" libparrot.lib", 
    9191            ar_flags            => '', 
    9292            ar_out              => '-out:', 
    9393            slash               => '\\', 
     
    103103 
    104104        # If we are building shared, need to include dynamic libparrot.lib, otherwise 
    105105        # 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        } 
    107114 
    108115        # 'link' needs to be link.exe, not cl.exe. 
    109116        # This makes 'link' and 'ld' the same.