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 ~/.barrytest2 file that contains shell commands"
20 echo "setting OSYNCROOTDIR to the directory you used as a --prefix"
21 echo "when building your own libopensync."
23 echo "Note that this directory must be writable by the user that"
24 echo "runs the test, as the plugin will be installed during the"
27 echo "You can also set OSYNCROOTDIR_0_40 to the 0.4x opensync directory."
31 if [ "$1" = "-h" ] ; then
37 # Jump to directory that script is located, if necessary
40 if [ "$(dirname $0)" != "." ] ; then
41 cd "$(pwd)/$(dirname $0)"
42 echo "You ran the script outside the directory it is in."
43 echo "Changing directory to: $(pwd)"
44 echo "If this is not desired, abort now..."
48 if [ -d "build" ] ; then
49 echo "'build' directory already exists, exiting..."
59 # Do we have a ~/.barrytest2 config?
61 if [ -f ~
/.barrytest2
] ; then
67 # First, build opensync in a local directory
70 if [ -n "$OSYNCROOTDIR" ] ; then
71 echo "Using opensync rootdir: $OSYNCROOTDIR"
72 elif [ -z "$OSYNCROOTDIR" -a -n "$OSYNCSOURCE" ] ; then
73 echo "Extracting opensync sources and building..."
74 (cd build
&& tar xjf
"$OSYNCSOURCE" && \
75 cd libopensync-0.22
&& \
76 .
/configure
-prefix="$BASEPATH/build/osyncrootdir" && \
77 make $MAKEOPTS install)
78 OSYNCROOTDIR
="$BASEPATH/build/osyncrootdir"
84 if [ -n "$OSYNCROOTDIR_0_40" ] ; then
85 echo "Using opensync-0.4x rootdir: $OSYNCROOTDIR_0_40"
91 # Move .. barry into its own buildable directory
95 (tar -C ..
--exclude=CVS
--exclude=.git
--exclude=test
/build
-cf - . | \
96 tar -C build
/barry
-xf -)
97 diff -ruN --exclude=CVS
--exclude=.git
--exclude=test --exclude=build .. build
/barry
102 # Prepare for Barry building
105 export PKG_CONFIG_PATH
="$BASEPATH/build/rootdir/lib/pkgconfig:$OSYNCROOTDIR/lib/pkgconfig:$OSYNCROOTDIR_0_40/lib/pkgconfig"
109 # Create configure script
115 # Build and test as individual packages
117 echo "Individual package build test..."
119 rm -rf "$BASEPATH/build/rootdir"
121 export CXXFLAGS
="-Wall -Werror -O0 -g"
122 .
/configure
--prefix="$BASEPATH/build/rootdir" --disable-boost
125 .
/configure
--prefix="$BASEPATH/build/rootdir" --enable-boost --with-zlib
131 export CXXFLAGS
="-Wall -Werror -ansi -pedantic -O0 -g"
132 .
/configure
--prefix="$BASEPATH/build/rootdir"
139 export CXXFLAGS
="-Wall -Werror -O0 -g"
140 .
/configure
--prefix="$BASEPATH/build/rootdir"
146 cd opensync-plugin-0.4x
147 export CXXFLAGS
="-Wall -Werror -O0 -g"
148 .
/configure
--prefix="$BASEPATH/build/rootdir"
157 # Build and test as one package
160 echo "Single build test..."
162 rm -rf "$BASEPATH/build/rootdir"
164 export CXXFLAGS
="-Wall -Werror -O0 -g"
165 .
/configure
--prefix="$BASEPATH/build/rootdir" --enable-boost \
166 --enable-gui --enable-opensync-plugin --enable-opensync-plugin-4x
167 make $MAKEOPTS install
169 .
/configure
--prefix="$BASEPATH/build/rootdir" \
170 --enable-gui --enable-opensync-plugin --enable-opensync-plugin-4x
176 # Test that cleanall cleans up all traces
178 .
/buildgen.sh cleanall
180 diff -ruN --exclude=CVS
--exclude=.git
--exclude=test --exclude=build .. build
/barry
186 # Test 'make dist' (the dist family of targets leaves build evidence
187 # behind, so do this after the cleanall check)
189 echo "Testing 'make dist'..."
191 rm -rf "$BASEPATH/build/rootdir"
194 .
/configure
--enable-gui --enable-opensync-plugin --enable-opensync-plugin-4x
205 rm -rf "$BASEPATH/build"
206 echo "All tests passed."