From: "alan buckley" Subject: Re: Updating SDL for RISC OS I've attached a zip file with three diffs to get SDL to build on RISC OS. configure.in.diff and makedeps.sh.diff have been modified so that they can build the assembler file in video/riscos. You may want to double check these as I don't know a lot about unix shell programming. (I've tested them cross-compiling on cygwin). sdlsysthread.diff is the changes required to SDL_systhread.c for RISC OS. As you suspected with these changes in place you can delete the RISC OS specific threading code in thread/riscos. I've also renamed SDL_riscosASM.s to SDL_riscosASM.S, but I'm never quite sure how to rename files in CVS, so if you could to this it would be appreciated. --HG-- extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%401463
82 lines
2 KiB
Bash
Executable file
82 lines
2 KiB
Bash
Executable file
#!/bin/sh
|
|
#
|
|
# Generate dependencies from a list of source files
|
|
|
|
# Check to make sure our environment variables are set
|
|
if test x"$INCLUDE" = x -o x"$SOURCES" = x -o x"$objects" = x -o x"$output" = x; then
|
|
echo "SOURCES, INCLUDE, objects, and output needs to be set"
|
|
exit 1
|
|
fi
|
|
cache_prefix=".#$$"
|
|
|
|
generate_var()
|
|
{
|
|
echo $1 | sed -e 's|^.*/||' -e 's|\.|_|g'
|
|
}
|
|
|
|
search_deps()
|
|
{
|
|
base=`echo $1 | sed 's|/[^/]*$||'`
|
|
grep '#include "' <$1 | sed -e 's|.*"\([^"]*\)".*|\1|' | \
|
|
while read file
|
|
do cache=${cache_prefix}_`generate_var $file`
|
|
if test -f $cache; then
|
|
: # We already ahve this cached
|
|
else
|
|
: >$cache
|
|
for path in $base `echo $INCLUDE | sed 's|-I||g'`
|
|
do dep="$path/$file"
|
|
if test -f "$dep"; then
|
|
echo " $dep \\" >>$cache
|
|
search_deps $dep >>$cache
|
|
break
|
|
fi
|
|
done
|
|
fi
|
|
cat $cache
|
|
done
|
|
}
|
|
|
|
:>${output}.new
|
|
for src in $SOURCES
|
|
do echo "Generating dependencies for $src"
|
|
ext=`echo $src | sed 's|.*\.\(.*\)|\1|'`
|
|
obj=`echo $src | sed "s|^.*/\([^ ]*\)\..*|$objects/\1.lo|g"`
|
|
echo "$obj: $src \\" >>${output}.new
|
|
search_deps $src | sort | uniq >>${output}.new
|
|
case $ext in
|
|
c) cat >>${output}.new <<__EOF__
|
|
|
|
\$(LIBTOOL) --mode=compile \$(CC) \$(CFLAGS) -c $src -o \$@
|
|
|
|
__EOF__
|
|
;;
|
|
cc) cat >>${output}.new <<__EOF__
|
|
|
|
\$(LIBTOOL) --mode=compile \$(CC) \$(CFLAGS) -c $src -o \$@
|
|
|
|
__EOF__
|
|
;;
|
|
m) cat >>${output}.new <<__EOF__
|
|
|
|
\$(LIBTOOL) --mode=compile \$(CC) \$(CFLAGS) -c $src -o \$@
|
|
|
|
__EOF__
|
|
;;
|
|
asm) cat >>${output}.new <<__EOF__
|
|
|
|
\$(LIBTOOL) --tag=CC --mode=compile \$(auxdir)/strip_fPIC.sh \$(NASM) $src -o \$@
|
|
|
|
__EOF__
|
|
;;
|
|
S) cat >>${output}.new <<__EOF__
|
|
|
|
\$(LIBTOOL) --mode=compile \$(CC) -c $src -o \$@
|
|
|
|
__EOF__
|
|
;;
|
|
*) echo "Unknown file extension: $ext";;
|
|
esac
|
|
echo "" >>${output}.new
|
|
done
|
|
mv ${output}.new ${output}
|