summaryrefslogtreecommitdiff
path: root/strip_non_asm_libtool_args.sh
diff options
context:
space:
mode:
authorJosh Coalson <jcoalson@users.sourceforce.net>2004-07-29 06:43:23 +0000
committerJosh Coalson <jcoalson@users.sourceforce.net>2004-07-29 06:43:23 +0000
commitc2570659f2a6743fae93b4a8d57b3b297b7f1363 (patch)
treedcb131aee1ac51b44fec94487a2be9bc123ca75c /strip_non_asm_libtool_args.sh
parentcce2f25a10e14d5393c69988b79b6034f5c3a482 (diff)
downloadflac-c2570659f2a6743fae93b4a8d57b3b297b7f1363.tar.gz
rename strip_fPIC.sh to strip_non_asm_libtool_args.sh, as it takes on new duties stripping other arguments for other assemblers
Diffstat (limited to 'strip_non_asm_libtool_args.sh')
-rwxr-xr-xstrip_non_asm_libtool_args.sh19
1 files changed, 19 insertions, 0 deletions
diff --git a/strip_non_asm_libtool_args.sh b/strip_non_asm_libtool_args.sh
new file mode 100755
index 00000000..d5a61f15
--- /dev/null
+++ b/strip_non_asm_libtool_args.sh
@@ -0,0 +1,19 @@
+#!/bin/sh
+#
+# libtool assumes that the compiler can handle the -fPIC flag.
+# This isn't always true (for example, nasm can't handle it).
+# Also, on some versions of OS X it tries to pass -fno-common
+# to 'as' which causes problems.
+command=""
+while [ $1 ]; do
+ if [ "$1" != "-fPIC" ]; then
+ if [ "$1" != "-DPIC" ]; then
+ if [ "$1" != "-fno-common" ]; then
+ command="$command $1"
+ fi
+ fi
+ fi
+ shift
+done
+echo $command
+exec $command