1#!/bin/sh 2 3# 4# Remove the '-g' debug flag from Makefiles to build release versions 5# of the libraries in one go. 6# 7# Run after './configure' and before 'make'. 8# 9 10echo "Removing debug flags from Makefile." 11echo 12 13TARGET="Makefile" 14 15if [ "$1" != "" ]; then 16 TARGET="$1" 17fi 18 19for i in `find . -name "$TARGET" -print`; do 20 echo "Patching $i ..." 21 cat $i | sed 's/-g -O2/-O -Wl,-s/' | sed 's/-shared/-shared -Wl,-s/' >$i.new 22 cp -f $i.new $i 23done 24