configure
author Akos Ladanyi <ladanyi@tmit.bme.hu>
Wed, 17 Feb 2010 17:42:19 +0000
changeset 35 f7a4e8024952
parent 34 eda742a0b1b4
permissions -rwxr-xr-x
Put all version numbers in config.sh for easier changing
alpar@17
     1
#!/bin/bash
alpar@17
     2
ladanyi@35
     3
source config.sh
ladanyi@35
     4
alpar@17
     5
quiet=0
alpar@17
     6
function quiet { [[ $quiet == 1 ]]; }
alpar@17
     7
alpar@17
     8
if [[ "$1" == "-q" ]]; then
alpar@17
     9
  quiet=1
alpar@17
    10
  shift
alpar@17
    11
fi
alpar@17
    12
alpar@17
    13
prev=
alpar@17
    14
for option
alpar@17
    15
do
alpar@17
    16
  if test -n "$prev"
alpar@17
    17
  then
alpar@17
    18
    eval "$prev=\$option"
alpar@17
    19
    prev=
alpar@17
    20
    continue
alpar@17
    21
  fi
alpar@17
    22
alpar@17
    23
  optarg=`expr "x$option" : 'x[^=]*=\(.*\)'`
alpar@17
    24
alpar@17
    25
  case $option in
alpar@17
    26
      --lemon-doc-prefix)
alpar@17
    27
	  prev=lemon_doc_prefix ;;
alpar@17
    28
      --lemon-doc-prefix=*)
alpar@17
    29
      lemon_doc_prefix=$optarg ;;
alpar@17
    30
      --help | -h)
alpar@17
    31
	  cat << EOF
alpar@17
    32
Usage: $0 [OPTION]
alpar@17
    33
alpar@17
    34
Options:
alpar@17
    35
  -h, --help                  display this help and exit
alpar@17
    36
      --lemon-doc-prefix=loc  The location of the lemon doc. By default it is
ladanyi@35
    37
                              http://lemon.cs.elte.hu/pub/doc/$LEMON_VERSION
alpar@17
    38
alpar@17
    39
Expamle:
alpar@17
    40
  $0 --lemon-doc-prefix=file://usr/local/share/doc/lemon/docs/
alpar@17
    41
EOF
alpar@17
    42
    exit 0
alpar@17
    43
    ;;
alpar@17
    44
alpar@17
    45
  *)
alpar@17
    46
    cat << EOF >&2
alpar@17
    47
$0: unrecognized option: $option
alpar@17
    48
Try \`$0 --help' for more information.
alpar@17
    49
EOF
alpar@17
    50
    exit 1
alpar@17
    51
    ;;
alpar@17
    52
alpar@17
    53
  esac
alpar@17
    54
done
alpar@17
    55
alpar@17
    56
alpar@17
    57
if test -z "$lemon_doc_prefix"
alpar@17
    58
then
ladanyi@35
    59
    lemon_doc_prefix="http://lemon.cs.elte.hu/pub/doc/$LEMON_VERSION"
alpar@17
    60
fi
alpar@17
    61
lemon_doc_prefix=$(echo $lemon_doc_prefix|sed 's/\//\\\\\\\//g')
alpar@17
    62
alpar@17
    63
lemon_cflags=$(pkg-config --cflags lemon|sed 's/\//\\\//g')
alpar@17
    64
lemon_libs=$(pkg-config --libs lemon|sed 's/\//\\\//g')
alpar@17
    65
alpar@17
    66
alpar@17
    67
sed -e "s/@lemon_cflags@/${lemon_cflags}/g" \
alpar@17
    68
    -e "s/@lemon_libs@/${lemon_libs}/g" \
ladanyi@35
    69
    -e "s/@make_lemon_doc_prefix@/${lemon_doc_prefix}/g" \
ladanyi@35
    70
    -e "s/@LIBSTDCXX_VERSION@/${LIBSTDCXX_VERSION}/g" \
alpar@17
    71
    < Makefile.in > Makefile