~ubuntu-branches/debian/squeeze/ffcall/squeeze

« back to all changes in this revision

Viewing changes to vacall/asmsparc64.sh

  • Committer: Bazaar Package Importer
  • Author(s): Christoph Egger
  • Date: 2010-06-26 15:29:30 UTC
  • mfrom: (5.1.1 experimental)
  • Revision ID: james.westby@ubuntu.com-20100626152930-c09y01gk3szcnykn
Tags: 1.10+cvs20100619-2
Ship to unstable

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/bin/sh
 
2
# Translate the assembler syntax of sparc64 assembler programs
 
3
# Usage: asmsparc < sparclinux-asm-file > portable-asm-file
 
4
# The portable-asm-file has to be
 
5
#   1. preprocessed,
 
6
#   2. grep -v '^ *#line' | grep -v '^#'
 
7
#   3. sed -e 's,% ,%,g' -e 's,//.*$,,' -e 's,\$,#,g'
 
8
 
 
9
tmpscript1=sed$$tmp1
 
10
tmpscript2=sed$$tmp2
 
11
tmpremove='rm -f $tmpscript1 $tmpscript2'
 
12
trap "$tmpremove" 1 2 15
 
13
 
 
14
cat > $tmpscript1 << \EOF
 
15
# ----------- Remove gcc self-identification
 
16
/gcc2_compiled/d
 
17
/gnu_compiled_c/d
 
18
EOF
 
19
 
 
20
cat > $tmpscript2 << \EOF
 
21
# ----------- Turn # into $, to avoid trouble in preprocessing
 
22
s,#,\$,g
 
23
# ----------- Declare global symbols as functions (we have no variables)
 
24
s/\.global \([A-Za-z0-9_]*\)$/.global \1\
 
25
        DECLARE_FUNCTION(\1)/
 
26
EOF
 
27
 
 
28
sed -f $tmpscript1 | \
 
29
sed -f $tmpscript2
 
30
 
 
31
eval "$tmpremove"