Build of Boost Cleanup (#707)
* Updated to check the boost SHA256 when downloading * Fixed invalid shell option * Allow the user to request a minimal build of Boost * Ensure boost build script exits on error * Removed apparently unused "mkdir"
This commit is contained in:
		
					parent
					
						
							
								6d6ad17c33
							
						
					
				
			
			
				commit
				
					
						6051604c10
					
				
			
		
					 1 changed files with 25 additions and 6 deletions
				
			
		| 
						 | 
					@ -1,18 +1,37 @@
 | 
				
			||||||
#!/usr/bin/env bash
 | 
					#!/usr/bin/env bash
 | 
				
			||||||
 | 
					
 | 
				
			||||||
set -o unset
 | 
					set -o nounset
 | 
				
			||||||
 | 
					set -o errexit
 | 
				
			||||||
set -o xtrace
 | 
					set -o xtrace
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					bootstrapArgs=()
 | 
				
			||||||
 | 
					while getopts 'm' OPT; do
 | 
				
			||||||
 | 
						case "${OPT}" in
 | 
				
			||||||
 | 
							m)
 | 
				
			||||||
 | 
								bootstrapArgs+=('--with-libraries=atomic,chrono,thread,log,date_time,filesystem,program_options,regex')
 | 
				
			||||||
 | 
								;;
 | 
				
			||||||
 | 
						esac
 | 
				
			||||||
 | 
					done
 | 
				
			||||||
 | 
					
 | 
				
			||||||
BOOST_BASENAME=boost_1_66_0
 | 
					BOOST_BASENAME=boost_1_66_0
 | 
				
			||||||
BOOST_ROOT=${BOOST_ROOT-/usr/local/boost}
 | 
					BOOST_ROOT=${BOOST_ROOT-/usr/local/boost}
 | 
				
			||||||
BOOST_URL=https://downloads.sourceforge.net/project/boost/boost/1.66.0/${BOOST_BASENAME}.tar.bz2
 | 
					BOOST_URL=https://downloads.sourceforge.net/project/boost/boost/1.66.0/${BOOST_BASENAME}.tar.bz2
 | 
				
			||||||
 | 
					BOOST_ARCHIVE="${BOOST_BASENAME}.tar.bz2"
 | 
				
			||||||
 | 
					BOOST_ARCHIVE_SHA256='5721818253e6a0989583192f96782c4a98eb6204965316df9f5ad75819225ca9'
 | 
				
			||||||
 | 
					
 | 
				
			||||||
wget --quiet -O ${BOOST_BASENAME}.tar.gz "${BOOST_URL}"
 | 
					wget --quiet -O "${BOOST_ARCHIVE}.new" "${BOOST_URL}"
 | 
				
			||||||
tar xf ${BOOST_BASENAME}.tar.gz
 | 
					checkHash="$(openssl dgst -sha256 "${BOOST_ARCHIVE}.new" | sed 's@^.*= *@@')"
 | 
				
			||||||
 | 
					if [ "${checkHash}" != "${BOOST_ARCHIVE_SHA256}" ]; then
 | 
				
			||||||
 | 
						echo "Checksum mismatch.  Expected ${BOOST_ARCHIVE_SHA256}, got ${checkHash}" >&2
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						exit 1
 | 
				
			||||||
 | 
					fi
 | 
				
			||||||
 | 
					mv "${BOOST_ARCHIVE}.new" "${BOOST_ARCHIVE}"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					tar xf "${BOOST_ARCHIVE}"
 | 
				
			||||||
cd ${BOOST_BASENAME}
 | 
					cd ${BOOST_BASENAME}
 | 
				
			||||||
./bootstrap.sh
 | 
					./bootstrap.sh "${bootstrapArgs[@]}"
 | 
				
			||||||
./b2 -d0 --prefix=${BOOST_ROOT} link=static install
 | 
					./b2 -d0 --prefix=${BOOST_ROOT} link=static install
 | 
				
			||||||
cd ..
 | 
					cd ..
 | 
				
			||||||
rm -rf ${BOOST_BASENAME}
 | 
					rm -rf ${BOOST_BASENAME}
 | 
				
			||||||
rm -f ${BOOST_BASENAME}.tar.gz
 | 
					rm -f "${BOOST_ARCHIVE}"
 | 
				
			||||||
mkdir -p app
 | 
					 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue