Skip to content

Instantly share code, notes, and snippets.

@mcg1969
Created January 7, 2014 16:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mcg1969/8302195 to your computer and use it in GitHub Desktop.
Save mcg1969/8302195 to your computer and use it in GitHub Desktop.
This is a patch to the auto-generated libtool script that allows it to treat "-F*" arguments identically to "-L*" arguments. -F is used by Mac OSX to specify the path to frameworks that are not on the system path, in the same way that -L is used to specify paths to shared libraries.
--- libtool 2014-01-07 07:56:47.000000000 -0600
+++ libtool.mcg 2014-01-07 07:55:00.000000000 -0600
@@ -5982,13 +5982,17 @@
continue
;;
- -L*)
- func_stripname "-L" '' "$arg"
+ -L*|-F*)
+ case $arg in
+ -F*) lf_prefix="-F" ;;
+ -*) lf_prefix="-L" ;;
+ esac
+ func_stripname "$lf_prefix" '' "$arg"
if test -z "$func_stripname_result"; then
if test "$#" -gt 0; then
- func_fatal_error "require no space between \`-L' and \`$1'"
+ func_fatal_error "require no space between \`-[LF]' and \`$1'"
else
- func_fatal_error "need path for \`-L' option"
+ func_fatal_error "need path for \`-[LF]' option"
fi
fi
func_resolve_sysroot "$func_stripname_result"
@@ -6004,14 +6008,14 @@
;;
esac
case "$deplibs " in
- *" -L$dir "* | *" $arg "*)
+ *" $lf_prefix$dir "* | *" $arg "*)
# Will only happen for absolute or sysroot arguments
;;
*)
# Preserve sysroot, but never include relative directories
case $dir in
[\\/]* | [A-Za-z]:[\\/]* | =*) deplibs+=" $arg" ;;
- *) deplibs+=" -L$dir" ;;
+ *) deplibs+=" $lf_prefix$dir" ;;
esac
lib_search_path+=" $dir"
;;
@@ -6698,13 +6702,17 @@
fi
continue
;;
- -L*)
+ -L*|-F*)
+ case $deplib in
+ -F*) lf_prefix="-F" ;;
+ *) lf_prefix="-L" ;;
+ esac
case $linkmode in
lib)
deplibs="$deplib $deplibs"
test "$pass" = conv && continue
newdependency_libs="$deplib $newdependency_libs"
- func_stripname '-L' '' "$deplib"
+ func_stripname "$lf_prefix" '' "$deplib"
func_resolve_sysroot "$func_stripname_result"
newlib_search_path+=" $func_resolve_sysroot_result"
;;
@@ -6719,12 +6727,12 @@
compile_deplibs="$deplib $compile_deplibs"
finalize_deplibs="$deplib $finalize_deplibs"
fi
- func_stripname '-L' '' "$deplib"
+ func_stripname "$lf_prefix" '' "$deplib"
func_resolve_sysroot "$func_stripname_result"
newlib_search_path+=" $func_resolve_sysroot_result"
;;
*)
- func_warning "\`-L' is ignored for archives/objects"
+ func_warning "\`-[LF]' is ignored for archives/objects"
;;
esac # linkmode
continue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment