3 # Take a spu executable and turn into into a libtool compatible .lo (and .o) file.
4 # This is needed when you want to embed a SPU executable into a shared library.
6 # The symbol assigned to the embedded executable is the basename of the
7 # output file with an _spx appended. E.g., if the output filename is
8 # my_spe_tricks.lo the symbol name is my_spe_tricks_spx.
9 # ("_spx" stands for SPE executable)
12 echo "usage: gcell-embedspu-libtool spu_executable output_file.lo " 1>&2
18 symbol_name=${lo_file%%.lo}_spx
20 # try to make .libs in case it's not there
21 mkdir .libs >/dev/null 2>/dev/null
23 # generate the .o file that wraps the SPU executable
24 ppu-embedspu -m32 -fpic ${symbol_name} ${spu_executable} .libs/${symbol_name}.o
26 # generate the .lo libtool file that points at all the right places
28 cat >$lo_file.new <<EOF
29 # $lo_file - a libtool object file
30 # Generated by ltmain.sh - GNU libtool 1.5.22 (1.1220.2.365 2005/12/18 22:14:06)
32 # Please DO NOT delete this file!
33 # It is necessary for linking the library.
35 pic_object='.libs/${symbol_name}.o'
39 mv $lo_file.new $lo_file