summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormidipix <writeonce@midipix.org>2015-03-21 18:46:22 -0400
committermidipix <writeonce@midipix.org>2015-03-21 18:46:22 -0400
commitdb460f5cfa435089333fd8e76ddc74164b43b502 (patch)
tree4adb1c204695aa43760449a3eea76a3fefa96d94
parenta8c1364acc09a6bcdf982ee7eaae8cb4ea47e616 (diff)
downloadcbb-gcc-4.6.4-db460f5cfa435089333fd8e76ddc74164b43b502.tar.bz2
cbb-gcc-4.6.4-db460f5cfa435089333fd8e76ddc74164b43b502.tar.xz
ltmain.sh: add import library handling for the midipix targets.
signed-off by Z. Gilboa; see copying.midipix (9cd0746c) for additional information.
-rw-r--r--ltmain.sh50
1 files changed, 50 insertions, 0 deletions
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