Open hakonhagland opened 3 years ago
It sounds like Liblist
would need to gain knowledge about -framework
. To do so would be platform-specific, which could either be crowbarred in as-is, or be done after a somewhat-needed restructuring of Liblist to fit with (and probably be incorporated into) the MM_*
modules.
It sounds like Liblist would need to gain knowledge about -framework.
Yeah. Liblist keeps being a PITA.
Workaround:
Add a library (e.g. -lm
) that can be found and increment $found
so @extralibs
are returned.
LIBS => "-lm -framework ApplicationServices"
Gaining knowledge:
It might be that the standard paths get searched - from Including Frameworks
/System/Library/Frameworks directory and the /Library/Frameworks directory
and possibly $DYLD_FRAMEWORK_PATH
.
diff --git a/lib/ExtUtils/Liblist/Kid.pm b/lib/ExtUtils/Liblist/Kid.pm
index 5eb8a8a0..3fd56e4b 100644
--- a/lib/ExtUtils/Liblist/Kid.pm
+++ b/lib/ExtUtils/Liblist/Kid.pm
@@ -97,6 +97,12 @@ sub _unix_os2_ext {
}
if ( $thislib =~ m!^-Wl,! ) {
+ if (@extralibs && $extralibs[$#extralibs] eq '-Wl,-framework') {
+ (my $framework = $thislib) =~ s/^-Wl,//;
+ for (qw(/System/Library/Frameworks /Library/Frameworks), split(/:/, $ENV{DYLD_FRAMEWORK_PATH})) {
+ $found++ if (-d File::Spec->catdir($_, "$framework.framework"));
+ }
+ }
push( @extralibs, $thislib );
push( @ldloadlibs, $thislib );
next;
See this question on stackoverflow. In order to compile the following C program on macOS :
the following command line can be used:
But passing
LIBS => " -framework ApplicationServices"
toWriteMakefile()
does not work. For example:However, passing
LDDLFLAGS => "$Config{lddlflags} -framework ApplicationServices"
does work, but shouldn't it be possible to useLIBS
here ?