X-Git-Url: https://git.m6w6.name/?a=blobdiff_plain;f=bootstrap.sh;h=9c8731888fecbe3b402abb75162d361822fe9f1f;hb=3946da421f695bdc5eda65f70ab8f7a4e1786586;hp=74637a89b2a6acb6da967804de3e89ad42618d47;hpb=f560168588b129d4bf22e5aacf4617210e0a6104;p=awesomized%2Flibmemcached diff --git a/bootstrap.sh b/bootstrap.sh index 74637a89..9c873188 100755 --- a/bootstrap.sh +++ b/bootstrap.sh @@ -281,7 +281,32 @@ run() { $@ $ARGS } +parse_command_line_options() { + + if ! options=$(getopt -o c --long configure -n 'bootstrap' -- "$@"); then + exit 1 + fi + + eval set -- "$options" + + while [ $# -gt 0 ]; do + case $1 in + -c | --configure ) + CONFIGURE_OPTION="yes" ; shift;; + -- ) + shift; break;; + -* ) + echo "$0: error - unrecognized option $1" 1>&2; exit 1;; + *) + break;; + esac + done +} + + + bootstrap() { + parse_command_line_options $@ determine_target_platform if [ -d .git ]; then @@ -345,6 +370,10 @@ bootstrap() { run $AUTORECONF $AUTORECONF_FLAGS || die "Cannot execute $AUTORECONF $AUTORECONF_FLAGS" configure_target_platform + + if [ "$CONFIGURE_OPTION" == "yes" ]; then + exit + fi # Backwards compatibility if [ -n "$VALGRIND" ]; then @@ -382,8 +411,9 @@ bootstrap() { export -n VCS_CHECKOUT export -n PLATFORM export -n TARGET_PLATFORM +CONFIGURE_OPTION=no VCS_CHECKOUT= PLATFORM=unknown TARGET_PLATFORM=unknown -bootstrap +bootstrap $@