4 # Edit these settings to reflect your system
8 export CXX
="ccache g++"
10 # Make sure any errors stop the test
14 echo "Main Barry build test script."
17 echo " ./buildtest.sh /path/to/libopensync-0.22.tar.bz2"
19 echo "Or, write a ~/.barrytest file that contains the directory"
20 echo "you used as a --prefix when building your own libopensync."
21 echo "Note that this directory must be writable by the user that"
22 echo "runs the test, as the plugin will be installed during the"
27 if [ "$1" = "-h" ] ; then
33 # Jump to directory that script is located, if necessary
36 if [ "$(dirname $0)" != "." ] ; then
37 cd "$(pwd)/$(dirname $0)"
38 echo "You ran the script outside the directory it is in."
39 echo "Changing directory to: $(pwd)"
40 echo "If this is not desired, abort now..."
44 if [ -d "build" ] ; then
45 echo "'build' directory already exists, exiting..."
55 # First, build opensync in a local directory
58 if [ -z "$OSYNCSOURCE" -a -f ~
/.barrytest
] ; then
59 read OSYNCROOTDIR
< ~
/.barrytest
60 elif [ -n "$OSYNCSOURCE" ] ; then
61 echo "Extracting opensync sources and building..."
62 (cd build
&& tar xjf
"$OSYNCSOURCE" && \
63 cd libopensync-0.22
&& \
64 .
/configure
-prefix="$BASEPATH/build/osyncrootdir" && \
65 make $MAKEOPTS install)
66 OSYNCROOTDIR
="$BASEPATH/build/osyncrootdir"
71 echo "Using opensync rootdir: $OSYNCROOTDIR"
76 # Move .. barry into its own buildable directory
80 (tar -C ..
--exclude=CVS
--exclude=.git
--exclude=test
/build
-cf - . | \
81 tar -C build
/barry
-xf -)
82 diff -ruN --exclude=CVS
--exclude=.git
--exclude=test .. build
/barry
87 # Prepare for Barry building
90 export PKG_CONFIG_PATH
="$BASEPATH/build/rootdir/lib/pkgconfig:$OSYNCROOTDIR/lib/pkgconfig"
94 # Create configure script
100 # Build and test as individual packages
102 echo "Individual package build test..."
104 rm -rf "$BASEPATH/build/rootdir"
106 export CXXFLAGS
="-Wall -Werror -pedantic -O0 -g"
107 .
/configure
--prefix="$BASEPATH/build/rootdir"
110 .
/configure
--prefix="$BASEPATH/build/rootdir" --with-boost
116 export CXXFLAGS
="-Wall -Werror -pedantic -O0 -g"
117 .
/configure
--prefix="$BASEPATH/build/rootdir"
118 make $MAKEOPTS install
123 export CXXFLAGS
="-Wall -Werror -O0 -g"
124 .
/configure
--prefix="$BASEPATH/build/rootdir"
125 make $MAKEOPTS install
132 # Build and test as one package
135 echo "Single build test..."
137 rm -rf "$BASEPATH/build/rootdir"
139 export CXXFLAGS
="-Wall -Werror -O0 -g"
140 .
/configure
--prefix="$BASEPATH/build/rootdir" --with-boost \
141 --enable-gui --enable-opensync-plugin
142 make $MAKEOPTS install
144 .
/configure
--prefix="$BASEPATH/build/rootdir" \
145 --enable-gui --enable-opensync-plugin
151 # Test that cleanall cleans up all traces
153 .
/buildgen.sh cleanall
155 diff -ruN --exclude=CVS
--exclude=.git
--exclude=test .. build
/barry
161 # Test 'make dist' (the dist family of targets leaves build evidence
162 # behind, so do this after the cleanall check)
164 echo "Testing 'make dist'..."
166 rm -rf "$BASEPATH/build/rootdir"
169 .
/configure
--enable-gui --enable-opensync-plugin
180 rm -rf "$BASEPATH/build"
181 echo "All tests passed."