File indexing completed on 2024-04-28 04:48:05

0001 #!/bin/bash
0002 
0003 # Assume you have mysql sources at ~/dev/mysql
0004 # Create dir ~/dev/mysql/patches and copy patches over there
0005 # Then run this script from ~/dev/mysql dir like this: ./build-mysqle.sh --prefix=${HOME}/usr
0006 # This script respects CFLAGS, CXXFLAGS and MAKEOPTS variables
0007 
0008 echo ">>> Hi there!"
0009 
0010 if [ -e .configured ]
0011 then
0012     echo ">>> Looks like sources are already configured. Remove .configured if that's untrue"
0013 else
0014     MYOPTS="--without-server --with-embedded-server --without-docs --without-man --without-bench --without-ssl --without-extra-tools --with-pic --without-libwrap --with-mysqld-ldflags=-all-static --with-client-ldflags=-all-static --disable-shared"
0015     EXTRAOPTS="$@"
0016     CFLAGS="-fPIC -ggdb ${CFLAGS}"
0017     CXXFLAGS="-fPIC -ggdb ${CXXFLAGS}"
0018     echo ">>> Ready to run configure like this:"
0019     echo "CFLAGS=\"${CFLAGS}\" CXXFLAGS=\"${CXXFLAGS}\" ./configure ${MYOPTS} ${EXTRAOPTS}"
0020     echo -n ">>> Configuring in "
0021     countdown=6
0022     while [ $countdown -gt 0 ]
0023     do
0024         echo -n $((countdown--)) ""
0025         sleep 1
0026     done
0027     
0028     CFLAGS="${CFLAGS}" CXXFLAGS="${CXXFLAGS}" ./configure ${MYOPTS} ${EXTRAOPTS} || {
0029         echo "!!! configure failed, aborting"
0030         exit 2
0031     }
0032 
0033     touch .configured
0034 fi
0035 
0036 echo ">>> Running make"
0037 
0038 make ${MAKEOPTS} || {
0039     echo "!!! make failed, aborting"
0040     exit 3
0041 }
0042 
0043 echo ">>> Running make install"
0044 
0045 make install || {
0046     echo "!!! make install failed"
0047     exit 4
0048 }
0049 
0050 echo ">>> Done."
0051