summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xmkmultiarch12
1 files changed, 7 insertions, 5 deletions
diff --git a/mkmultiarch b/mkmultiarch
index 8f25e48..00671fe 100755
--- a/mkmultiarch
+++ b/mkmultiarch
@@ -42,14 +42,16 @@ function dispatch_includes() {
while read localfile; do
[[ -f "$incdir/$localfile" ]] && dispatch_includes $incdir/$localfile
done
- # dispatch selected include file
- local archincdir=$prefix/$mplat/$suffix
- [[ -d $archincdir ]] || mkdir -p $archincdir
- mv $file $archincdir/
- cat > $file << EOF
+ # dispatch selected include file, provided it's not already dispatched
+ grep -q _MULTIARCH_HEADER $file || {
+ local archincdir=$prefix/$mplat/$suffix
+ [[ -d $archincdir ]] || mkdir -p $archincdir
+ mv $file $archincdir/
+ cat > $file << EOF
#define _MULTIARCH_HEADER $suffix${file##*/}
#include <multiarch-dispatch.h>
EOF
+ }
}
while [[ $# -gt 0 ]]; do