]> git.lyx.org Git - features.git/blob - 3rdparty/boost/extract.sh
Cleanup extract.sh
[features.git] / 3rdparty / boost / extract.sh
1 #!/bin/bash
2
3 #
4 # Script to extract only needed boost files using the bcp tool:
5 #
6 # http://www.boost.org/doc/libs/1_47_0/tools/bcp/doc/html/index.html
7 #
8 # Does also work with an outdated bcp version
9 #
10 # Usage: extract.sh <path to new boost version>
11 #
12
13 HEADERS="\
14   boost/any.hpp \
15   boost/assert.hpp \
16   boost/crc.hpp \
17   boost/lexical_cast.hpp \
18   boost/signals2/signal.hpp \
19   "
20
21 if [ -z $1 ]
22 then
23     echo "Usage: extract.sh [--report] <path to new boost version>"
24     echo "Update our local boost copy"
25     echo "With --report, create a HTML report that contains in particular the dependencies"
26     exit 1
27 fi
28
29 if [ x$1 = x--report ]; then
30     bcp --boost=$2 --report $HEADERS report.html
31     exit 0;
32 fi
33
34
35 rm -rf needed
36 mkdir needed
37
38 bcp --boost=$1 $HEADERS needed/
39
40 # we do not use the provided MSVC project files
41 find needed -name '*.vcpro*' | xargs rm
42
43 # remove old boost headers
44 find boost -name \*.hpp | xargs rm
45
46 # copy new headers
47 cp -vR needed/boost .
48
49 rm -rf needed
50
51