@@ -526,11 +526,16 @@ sub compile_lib {
526
526
if ($^O eq ' MSWin32' && $Config {cc } =~ / ^cl/ ) {
527
527
die " plugins are not available under MSVC" ;
528
528
}
529
- elsif ($^O eq ' MSWin32' && $Config {cc } =~ / ^ gcc/ ) {
529
+ elsif ($^O eq ' MSWin32' && $Config {cc } =~ / gcc/ ) {
530
530
push @args , " -Wl,--out-implib,${name} .a" ;
531
531
push @args , ' -Wl,--major-image-version,0.0.9' ;
532
532
push @args , ' -Wl,--minor-image-version,0.0.9' ;
533
533
}
534
+ # add explicit path to libsass lib
535
+ # needed to resolve lib from plugins
536
+ unless ($^O eq ' MSWin32' && $Config {cc } =~ / ^cl/ ) {
537
+ push @args , ' -Wl,-rpath,$(INSTALLARCHLIB)' ;
538
+ }
534
539
# -static-libgcc -static-libstdc++
535
540
return join (' ' , @args , @libs );
536
541
}
@@ -552,9 +557,10 @@ sub libsass_sassc
552
557
else {
553
558
# create the sassc executable by linking against sassc and libsass
554
559
push @ret , " \t " . ' $(LD) -o $(SASSC_EXE) $(LDFLAGS) $(SASSC_OBJ) $(LIBS)'
555
- . ' ' . ($static ? ' $(LIBSASS_OBJ)' : ' -L$(INST_LIB ) -lsass' )
560
+ . ' ' . ($static ? ' $(LIBSASS_OBJ)' : ' -L$(INST_ARCHLIB ) -lsass' )
556
561
. ' $(OPTIMIZE) -lstdc++ -std=c++0x ' . join (" " , @libs )
557
- . ($^O eq " linux" ? ' -ldl' : ' ' );
562
+ . ($^O eq " linux" ? ' -ldl' : ' ' )
563
+ . ' -Wl,-rpath,$(INSTALLARCHLIB)' ;
558
564
}
559
565
# add target to virtual "pure_all"
560
566
push @cleanups , ' $(SASSC_OBJ)' ;
@@ -569,7 +575,7 @@ sub libsass_lib
569
575
# register our source and object files
570
576
my @ret = ' LIBSASS_OBJ = ' . join (" " , @SOURCES );
571
577
# location of the created object
572
- push @ret , ' LIBSASS_LIB = $(INST_LIB )/libsass.$(SO)' ;
578
+ push @ret , ' LIBSASS_LIB = $(INST_ARCHLIB )/libsass.$(SO)' ;
573
579
# create the target for the makefile
574
580
push @ret , ' $(LIBSASS_LIB): $(LIBSASS_OBJ)' ;
575
581
# create the libsass shared library by linking against all objects
@@ -593,7 +599,7 @@ sub libsass_plugin_math
593
599
push @ret , " \t " . ' $(MKPATH) $(INST_ARCHAUTODIR)/plugins/math' ;
594
600
# create the libsass shared library by linking against all objects
595
601
push @ret , " \t " . compile_lib(' $(MATH_LIB)' ) . ' $(MATH_OBJ)'
596
- . ' ' . ($static ? ' $(LIBSASS_OBJ)' : ' -L$(INST_LIB ) -lsass' );
602
+ . ' ' . ($static ? ' $(LIBSASS_OBJ)' : ' -L$(INST_ARCHLIB ) -lsass' );
597
603
# add target to virtual "pure_all"
598
604
push @cleanups , ' $(MATH_OBJ)' ;
599
605
push @cleanups , ' $(MATH_LIB)' ;
@@ -613,7 +619,7 @@ sub libsass_plugin_img_size
613
619
push @ret , " \t " . ' $(MKPATH) $(INST_ARCHAUTODIR)/plugins/img-size' ;
614
620
# create the libsass shared library by linking against all objects
615
621
push @ret , " \t " . compile_lib(' $(IMG_SIZE_LIB)' ) . ' $(IMG_SIZE_OBJ)'
616
- . ' ' . ($static ? ' $(LIBSASS_OBJ)' : ' -L$(INST_LIB ) -lsass' );
622
+ . ' ' . ($static ? ' $(LIBSASS_OBJ)' : ' -L$(INST_ARCHLIB ) -lsass' );
617
623
# add target to virtual "pure_all"
618
624
push @cleanups , ' $(IMG_SIZE_OBJ)' ;
619
625
push @cleanups , ' $(IMG_SIZE_LIB)' ;
@@ -638,7 +644,7 @@ sub libsass_plugin_digest
638
644
push @ret , " \t " . ' $(MKPATH) $(INST_ARCHAUTODIR)/plugins/digest' ;
639
645
# create the libsass shared library by linking against all objects
640
646
push @ret , " \t " . compile_lib(' $(DIGEST_LIB)' ) . ' $(DIGEST_OBJ)'
641
- . ' ' . ($static ? ' $(LIBSASS_OBJ)' : ' -L$(INST_LIB ) -lsass' );
647
+ . ' ' . ($static ? ' $(LIBSASS_OBJ)' : ' -L$(INST_ARCHLIB ) -lsass' );
642
648
# add target to virtual "pure_all"
643
649
push @cleanups , ' $(DIGEST_OBJ)' ;
644
650
push @cleanups , ' $(DIGEST_LIB)' ;
@@ -663,7 +669,7 @@ sub libsass_plugin_glob
663
669
push @ret , " \t " . ' $(MKPATH) $(INST_ARCHAUTODIR)/plugins/glob' ;
664
670
# create the libsass shared library by linking against all objects
665
671
push @ret , " \t " . compile_lib(' $(GLOB_LIB)' ) . ' $(GLOB_OBJ)'
666
- . ' ' . ($static ? ' $(LIBSASS_OBJ)' : ' -L$(INST_LIB ) -lsass' );
672
+ . ' ' . ($static ? ' $(LIBSASS_OBJ)' : ' -L$(INST_ARCHLIB ) -lsass' );
667
673
# add target to virtual "pure_all"
668
674
push @cleanups , ' $(GLOB_OBJ)' ;
669
675
push @cleanups , ' $(GLOB_LIB)' ;
0 commit comments