2014-07-29 Ed Smith-Rowland <3dw4rd@verizon.net>
[official-gcc.git] / libjava / contrib / rebuild-gcj-db.in
blob39861ff55f9b64fd5dd523f96761bbbb40f1cf1d
1 #!/bin/bash
2 # rebuild-gcj-db
4 ## Copyright (C) 2000, 2002, 2003, 2008 Free Software Foundation
5 ##
6 ## This file is part of libgcj.
7 ##
8 ## This software is copyrighted work licensed under the terms of the
9 ## Libgcj License. Please consult the file "LIBGCJ_LICENSE" for
10 ## details.
12 # Rebuild all the standard databases.
13 for i in `@prefix@/bin/gcc --print-multi-lib 2>/dev/null`; do
14 multilib=`echo $i | sed -e 's/^.*;//' | sed -e 's/\@/ -/g'`
15 dirname=`@prefix@/bin/gcc -print-multi-os-directory $multilib 2>/dev/null`
16 base=@prefix@/lib/$dirname
17 dbLocation=`@prefix@/bin/gcj-dbtool -p $base`
18 libdir=$base/gcj
19 if ! test -d $libdir; then
20 # No shared libraries here.
21 continue
23 dirname $dbLocation | xargs mkdir -p
24 @prefix@/bin/gcj-dbtool -n $dbLocation 64
25 find $libdir -follow -name '*.db' -print0 | \
26 @prefix@/bin/gcj-dbtool -0 -m $dbLocation $dbLocation
27 done