2003-03-28 08:43:22 +01:00
|
|
|
#!/bin/sh
|
2004-05-05 00:19:18 +02:00
|
|
|
cwd=`pwd`
|
|
|
|
dir=`basename ${cwd}`
|
|
|
|
#
|
|
|
|
# When compiling a file that goes into libunwind, we only
|
|
|
|
# need to compile it when we really do support UNW_LOCAL_ONLY.
|
|
|
|
# In contrast, libunwind-tests should always get compiled.
|
|
|
|
#
|
|
|
|
if test $dir = "tests"; then
|
|
|
|
local_only_test=""
|
|
|
|
else
|
|
|
|
local_only_test="defined(UNW_LOCAL_ONLY) && "
|
|
|
|
fi
|
2003-04-23 21:22:42 +02:00
|
|
|
for gname in `ls G*.c G*.cxx G*.S 2>/dev/null`; do
|
2003-03-28 08:43:22 +01:00
|
|
|
lname="L$(expr $gname : '.\(.*\)')"
|
|
|
|
bk edit $lname >/dev/null 2>&1
|
2003-04-23 21:22:42 +02:00
|
|
|
ext=$(expr $gname : '[^.]*[.]\(.*\)')
|
|
|
|
if [ "$ext" = "S" ]; then
|
|
|
|
include=""
|
|
|
|
else
|
|
|
|
include="#include <libunwind.h>"
|
|
|
|
fi
|
2003-04-03 09:59:15 +02:00
|
|
|
echo -e "\
|
|
|
|
#define UNW_LOCAL_ONLY\n\
|
2003-04-23 21:22:42 +02:00
|
|
|
$include\n\
|
2004-05-05 00:19:18 +02:00
|
|
|
#if ${local_only_test}!defined(UNW_REMOTE_ONLY)\n\
|
2003-04-03 09:59:15 +02:00
|
|
|
#include \"$gname\"\n\
|
|
|
|
#endif" > $lname
|
|
|
|
echo created $lname
|
2003-03-28 08:43:22 +01:00
|
|
|
done
|