configure
changeset 17 0b3b26cd1cea
child 34 eda742a0b1b4
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/configure	Wed Nov 05 17:10:54 2008 +0000
     1.3 @@ -0,0 +1,68 @@
     1.4 +#!/bin/bash
     1.5 +
     1.6 +quiet=0
     1.7 +function quiet { [[ $quiet == 1 ]]; }
     1.8 +
     1.9 +if [[ "$1" == "-q" ]]; then
    1.10 +  quiet=1
    1.11 +  shift
    1.12 +fi
    1.13 +
    1.14 +prev=
    1.15 +for option
    1.16 +do
    1.17 +  if test -n "$prev"
    1.18 +  then
    1.19 +    eval "$prev=\$option"
    1.20 +    prev=
    1.21 +    continue
    1.22 +  fi
    1.23 +
    1.24 +  optarg=`expr "x$option" : 'x[^=]*=\(.*\)'`
    1.25 +
    1.26 +  case $option in
    1.27 +      --lemon-doc-prefix)
    1.28 +	  prev=lemon_doc_prefix ;;
    1.29 +      --lemon-doc-prefix=*)
    1.30 +      lemon_doc_prefix=$optarg ;;
    1.31 +      --help | -h)
    1.32 +	  cat << EOF
    1.33 +Usage: $0 [OPTION]
    1.34 +
    1.35 +Options:
    1.36 +  -h, --help                  display this help and exit
    1.37 +      --lemon-doc-prefix=loc  The location of the lemon doc. By default it is
    1.38 +                              http://lemon.cs.elte.hu/pub/doc/1.0
    1.39 +
    1.40 +Expamle:
    1.41 +  $0 --lemon-doc-prefix=file://usr/local/share/doc/lemon/docs/
    1.42 +EOF
    1.43 +    exit 0
    1.44 +    ;;
    1.45 +
    1.46 +  *)
    1.47 +    cat << EOF >&2
    1.48 +$0: unrecognized option: $option
    1.49 +Try \`$0 --help' for more information.
    1.50 +EOF
    1.51 +    exit 1
    1.52 +    ;;
    1.53 +
    1.54 +  esac
    1.55 +done
    1.56 +
    1.57 +
    1.58 +if test -z "$lemon_doc_prefix"
    1.59 +then
    1.60 +    lemon_doc_prefix='http://lemon.cs.elte.hu/pub/doc/1.0'
    1.61 +fi
    1.62 +lemon_doc_prefix=$(echo $lemon_doc_prefix|sed 's/\//\\\\\\\//g')
    1.63 +
    1.64 +lemon_cflags=$(pkg-config --cflags lemon|sed 's/\//\\\//g')
    1.65 +lemon_libs=$(pkg-config --libs lemon|sed 's/\//\\\//g')
    1.66 +
    1.67 +
    1.68 +sed -e "s/@lemon_cflags@/${lemon_cflags}/g" \
    1.69 +    -e "s/@lemon_libs@/${lemon_libs}/g" \
    1.70 +   -e "s/@make_lemon_doc_prefix@/${lemon_doc_prefix}/g" \
    1.71 +    < Makefile.in > Makefile