X-Git-Url: https://git.m6w6.name/?a=blobdiff_plain;f=bootstrap.sh;h=1d114b28e53794c16ecfcfc8d8d9f3bc248ad9e4;hb=refs%2Ftags%2F1.0.13;hp=13d10b39f10c86d22daa42fb45ce1e7b72c50686;hpb=1f3d43109ef752862093f8e4340fcfec1832b3be;p=awesomized%2Flibmemcached diff --git a/bootstrap.sh b/bootstrap.sh index 13d10b39..1d114b28 100755 --- a/bootstrap.sh +++ b/bootstrap.sh @@ -604,7 +604,7 @@ make_gdb () # $1 target to compile # $2 to die, or not to die, based on contents -make_target () +function make_target () { if [[ -z "$1" ]]; then die "Programmer error, no target provided for make" @@ -687,76 +687,56 @@ run_autoreconf () eval 'bash -n configure' || die "autoreconf generated a malformed configure" } -run () +function run () { if $VERBOSE; then echo "\`$@' $ARGS" fi - ($@ $ARGS) + $@ $ARGS } parse_command_line_options () { - local options= + local SHORTOPTS=':apcmt:dv' - local SHORTOPTS='p,c,a,v' - local LONGOPTS='target:,debug,clean,print-env,configure,autoreconf' - - if ! options=$(getopt --shell bash --longoptions $LONGOPTS --options $SHORTOPTS -n 'bootstrap' -- "$@"); then - die 'Bad option given' - fi - - eval set -- "$options" - - while [[ $# -gt 0 ]]; do - case $1 in - -a | --autoreconf ) + while getopts "$SHORTOPTS" opt; do + case $opt in + a) #--autoreconf AUTORECONF_OPTION=true MAKE_TARGET='autoreconf' - shift ;; - -p | --print-env ) + p) #--print-env PRINT_SETUP_OPTION=true - shift ;; - -c | --configure ) + c) # --configure CONFIGURE_OPTION=true MAKE_TARGET='configure' - shift ;; - --clean ) + m) # maintainer-clean CLEAN_OPTION=true MAKE_TARGET='clean_op' - shift ;; - --target ) + t) # target TARGET_OPTION=true - shift - TARGET_OPTION_ARG="$1" - MAKE_TARGET="$1" - shift + TARGET_OPTION_ARG="$OPTARG" + MAKE_TARGET="$OPTARG" ;; - --debug ) + d) # debug DEBUG_OPTION=true enable_debug - shift ;; - -v | --verbose ) + v) # verbose VERBOSE_OPTION=true VERBOSE=true - shift ;; - -- ) - shift - break - ;; - -* ) - echo "$0: error - unrecognized option $1" 1>&2 + :) + echo "Option -$OPTARG requires an argument." >&2 exit 1 ;; *) - break + echo "$0: error - unrecognized option $1" 1>&2 + exit 1 ;; esac done