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