diff options
-rw-r--r-- | ltmain.sh | 50 |
1 files changed, 50 insertions, 0 deletions
@@ -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 |