Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add "prefix" option to autogen.sh #115

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 11 additions & 7 deletions autogen.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,15 @@

MONGOC_VERSION=1.9.5
JSONC_VERSION=0.13.1-20180305
PREFIX="/usr/local"

if [ "$#" -ne 1 ]; then
echo "Usage: autogen.sh --[with-legacy | with-master]"
if [ "$#" -ne 1 -a "$#" -ne 2 ]; then
echo "Usage: autogen.sh --[with-legacy | with-master] [prefix]"
exit
fi
if [ "$#" -eq 2 ]; then
PREFIX=$2
fi

###
# Pull the latest version of Monggo C Driver's master branch
Expand Down Expand Up @@ -70,7 +74,7 @@ function install_json_lib
{
cd json-c
sh ./autogen.sh
./configure CFLAGS='-fPIC'
./configure CFLAGS='-fPIC' --prefix=$1
make install
cd ..
}
Expand All @@ -81,7 +85,7 @@ function install_json_lib
function install_mongoc_driver
{
cd mongo-c-driver
./configure --with-libbson=auto --enable-ssl
./configure --with-libbson=auto --enable-ssl --prefix=$1
make install
cd ..
}
Expand Down Expand Up @@ -117,12 +121,12 @@ if [ "--with-legacy" = $1 ]; then
elif [ "--with-master" == $1 ]; then
checkout_mongo_driver
checkout_json_lib
install_mongoc_driver
install_json_lib
install_mongoc_driver $PREFIX
install_json_lib $PREFIX
create_config
export PKG_CONFIG_PATH=mongo-c-driver/src/:mongo-c-driver/src/libbson/src
cp Makefile.meta Makefile
echo "Done"
else
echo "Usage: autogen.sh --[with-legacy | with-master]"
echo "Usage: autogen.sh --[with-legacy | with-master] [prefix]"
fi