From db460f5cfa435089333fd8e76ddc74164b43b502 Mon Sep 17 00:00:00 2001 From: midipix Date: Sat, 21 Mar 2015 18:46:22 -0400 Subject: ltmain.sh: add import library handling for the midipix targets. signed-off by Z. Gilboa; see copying.midipix (9cd0746c) for additional information. --- ltmain.sh | 50 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) (limited to 'ltmain.sh') diff --git a/ltmain.sh b/ltmain.sh index a03433f17..ff28f7854 100644 --- a/ltmain.sh +++ b/ltmain.sh @@ -2305,6 +2305,49 @@ func_mode_install () # Do each command in the postinstall commands. lib="$destdir/$realname" + + case $host_os in + midipix*) + implib_ver_def_name=$dir/`echo "$realname" | sed -E 's/[^\.]+$/so.def/'` + implib_def_name=`mktemp` + implib_exp_def_name=`mktemp` + implib_name=$dir/`echo "$realname" | sed -E 's/(\.[0-9]+)+$//;s/^(.+)\.[^\.]+$/\1.lib.a/'` + dso_name=$dir/`echo "$realname" | sed -E 's/(\.[0-9]+)+$//;s/^(.+)\.[^\.]+$/\1.so/'` + excluded_symbols='\ __EH_FRAME_BEGIN__ \ |\ __dso_handle\ |\ _init\ |\ _fini\ |\ _so_entry_point\ |\ dso_main_routine\ ' + + # echo; echo; + # echo 'midimark:' + # echo '--------:' + # echo $implib_ver_def_name + # echo $implib_def_name + # echo $implib_exp_def_name + # echo $implib_name + # echo $excluded_symbols + # echo; echo + + # grep -v '\.' is here since dlltool rejects names that contain a period; + # this is surprising, since the 'versioned' import library (the one + # produced by ld) both accepts these symbols and exports them. + + # this only affects symbols prefixed by __emutls_[vt], which presumably + # are only marked for export due to --export-all-symbols being the default. + + grep -n 'IMPORTS' "$implib_ver_def_name" || imp_lines='all' + + if [ "$imp_lines"x = allx ]; then + cp "$implib_ver_def_name" "$implib_exp_def_name" + else + grep -vE '"$excluded_symbols"' "$implib_ver_def_name" | grep -v '\.' > "$implib_def_name" + imp_lines=`grep -n 'IMPORTS' "$implib_def_name" | cut -d':' -f1` + imp_lines=`expr $imp_lines - 1` + head -n$imp_lines "$implib_def_name" > "$implib_exp_def_name" + fi + + "$host"-dlltool -d "$implib_exp_def_name" -D "$dso_name" -l "$implib_name" + cp -t "$destdir" "$implib_name" + ;; + esac + func_execute_cmds "$postinstall_cmds" 'exit $?' fi @@ -8355,6 +8398,13 @@ EOF fi ;; esac + + case $host_os in + midipix*) + unset dependency_libs + ;; + esac + $ECHO > $output "\ # $outputname - a libtool library file # Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION -- cgit v1.2.3