2008-05-08 22:26:51 +00:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
|
|
EXCLUSIONS="--exclude=ibmsdk --exclude=Jamfile --exclude=Makefile.am --exclude=CMakeLists.txt --exclude=Doxyfile"
|
|
|
|
|
|
|
|
|
|
pushd libraries/bullet
|
|
|
|
|
|
|
|
|
|
if [ "$#" -ne "1" ]
|
|
|
|
|
then
|
|
|
|
|
echo usage: $0 \<bullet_source_tarball\> >&2
|
|
|
|
|
exit 1
|
|
|
|
|
fi
|
|
|
|
|
tar xvzf "$1" ${EXCLUSIONS} bullet-2.??/src
|
|
|
|
|
|
2008-05-28 17:01:51 +00:00
|
|
|
rsync -av bullet-2.??/src/* .
|
2008-05-08 22:26:51 +00:00
|
|
|
rm -rf bullet-2.??
|
|
|
|
|
|
2008-05-28 17:01:51 +00:00
|
|
|
DIRS=`find . -type d ! -name CVS ! -name .deps`
|
2008-05-08 22:26:51 +00:00
|
|
|
MAKEFILES=""
|
|
|
|
|
|
|
|
|
|
for dir in ${DIRS}
|
|
|
|
|
do
|
|
|
|
|
SUBDIRS=""
|
|
|
|
|
SOURCES=""
|
|
|
|
|
MAKEFILE="${dir}/Makefile.am"
|
2008-05-28 17:01:51 +00:00
|
|
|
# Build a list of subdirectories and sources
|
2008-05-08 22:26:51 +00:00
|
|
|
for entry in $dir/*
|
|
|
|
|
do
|
|
|
|
|
filename=`basename ${entry}`
|
2008-05-09 15:35:53 +00:00
|
|
|
if [ -d ${entry} ] && [ ${filename} != "CVS" ]
|
2008-05-08 22:26:51 +00:00
|
|
|
then
|
|
|
|
|
SUBDIRS="${SUBDIRS} ${filename}"
|
|
|
|
|
fi
|
2008-05-28 17:01:51 +00:00
|
|
|
if [ -f ${entry} ] && [ ${filename: -4:4} == ".cpp" -o ${filename: -2:2} == ".h" ]
|
2008-05-08 22:26:51 +00:00
|
|
|
then
|
|
|
|
|
SOURCES="${SOURCES} ${filename}"
|
|
|
|
|
fi
|
|
|
|
|
done
|
2008-05-28 17:01:51 +00:00
|
|
|
# Create a temporary file to contain the new Makefile.am
|
|
|
|
|
echo > ${MAKEFILE}_tmp
|
|
|
|
|
# Add the subdirectories to the new Makefile.am
|
2008-05-08 22:26:51 +00:00
|
|
|
if [ -n "${SUBDIRS}" ]
|
|
|
|
|
then
|
2008-05-28 17:01:51 +00:00
|
|
|
echo -e "SUBDIRS = ${SUBDIRS}\n" >> ${MAKEFILE}_tmp
|
2008-05-08 22:26:51 +00:00
|
|
|
fi
|
2008-05-28 17:01:51 +00:00
|
|
|
# Add the sources to the new Makefile.am
|
2008-05-08 22:26:51 +00:00
|
|
|
if [ -n "${SOURCES}" ]
|
|
|
|
|
then
|
2008-05-28 17:01:51 +00:00
|
|
|
# The top level directory of bullet has only headers.
|
2008-05-09 15:35:53 +00:00
|
|
|
if [ ${dir} = "." ]
|
|
|
|
|
then
|
2008-05-28 17:01:51 +00:00
|
|
|
echo -e "noinst_HEADERS = ${SOURCES}\n" >> ${MAKEFILE}_tmp
|
2008-05-09 15:35:53 +00:00
|
|
|
else
|
|
|
|
|
libname="lib`basename ${dir}`"
|
2008-05-28 17:01:51 +00:00
|
|
|
echo -e "noinst_LIBRARIES = ${libname}.a\n" >> ${MAKEFILE}_tmp
|
|
|
|
|
echo -e "INCLUDES = -I\$(top_srcdir)/libraries/bullet\n" >> ${MAKEFILE}_tmp
|
|
|
|
|
echo -e "${libname}_a_SOURCES = ${SOURCES}\n" >> ${MAKEFILE}_tmp
|
2008-05-09 15:35:53 +00:00
|
|
|
fi
|
2008-05-08 22:26:51 +00:00
|
|
|
fi
|
2008-05-28 17:01:51 +00:00
|
|
|
# If Makefile.am is new or changed, move it to the right name.
|
|
|
|
|
if [ ! -f ${MAKEFILE} ] || ! cmp ${MAKEFILE}_tmp ${MAKEFILE}
|
|
|
|
|
then
|
|
|
|
|
mv -f ${MAKEFILE}_tmp ${MAKEFILE}
|
|
|
|
|
else
|
|
|
|
|
echo ${MAKEFILE} unchanged.
|
|
|
|
|
rm -f ${MAKEFILE}_tmp
|
|
|
|
|
fi
|
|
|
|
|
# Strip off the leading ./ and add the filename to the list to
|
|
|
|
|
# be checked against the contents of configure.ac
|
|
|
|
|
if [ ${MAKEFILE:0:2} = "./" ]
|
|
|
|
|
then
|
|
|
|
|
MAKEFILE=${MAKEFILE:2}
|
|
|
|
|
fi
|
|
|
|
|
MAKEFILES="${MAKEFILES}\tlibraries/bullet/${MAKEFILE%%.*}\n"
|
2008-05-08 22:26:51 +00:00
|
|
|
done
|
|
|
|
|
|
2008-05-28 17:01:51 +00:00
|
|
|
echo Check the following files are in configure.ac:
|
2008-05-08 22:26:51 +00:00
|
|
|
echo -e ${MAKEFILES}
|