Changeset c21bdd6 for configure


Ignore:
Timestamp:
02/07/12 15:47:14 (12 years ago)
Author:
Maciej Prill <mprill@…>
Branches:
master
Children:
2ff1f65
Parents:
5f4d9c3
git-author:
Maciej Prill <mprill@…> (02/07/12 15:47:14)
git-committer:
Maciej Prill <mprill@…> (02/07/12 15:47:14)
Message:

Removed old files.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • configure

    ra6e708f rc21bdd6  
    11#!/bin/sh 
    22 
    3 . ./auto/defaults 
    4 . ./auto/options 
    5  
    6 if [ -f ./src/config.h ]; then 
    7   echo ERROR: config.h exists 
    8   exit 
    9 fi 
    10  
    11 if [ -f ./Makefile ]; then 
    12   echo ERROR: Makefile exists 
    13   exit 
    14 fi 
    15  
    16 if [ ! -d ./src ]; then 
    17   mkdir ./src 
    18 fi 
    19  
    20 . ./auto/output/config_h 
    21 . ./auto/output/Makefile 
    22  
    23 . ./auto/summary 
     3# utt configure file 
     4# creates config.mak which is used by other makefiles 
     5 
     6# variables for dynamically selecting whether to compile utf8 versions 
     7CUR_DIR=$(pwd) 
     8SRC_DIR="${CUR_DIR}/src" 
     9 
     10# list of components to compile 
     11CMPLIST="compiledic cor dgp fla gph grp gue kon kor kot lem mar rm12 rs12 sen-nl ser tags tok.c tok.l tok.pl unfla" 
     12COMP= 
     13 
     14 
     15# sets all variables to a defined value 
     16set_all(){ 
     17        value=$1 
     18        shift 
     19        for var in $*; do 
     20                eval $var=$value 
     21        done 
     22} 
     23 
     24# enables a feature 
     25enable(){ 
     26        set_all yes $* 
     27} 
     28 
     29# disables a feature 
     30disable(){ 
     31        set_all no $* 
     32} 
     33 
     34# checks whether a feature is enabled 
     35enabled(){ 
     36        eval test "x\$$1" = "xyes" 
     37} 
     38 
     39# checks whether a feature is disabled 
     40disabled(){ 
     41        eval test "x\$$1" = "xno" 
     42} 
     43 
     44show_help(){ 
     45        echo "Usage configure [options]" 
     46        echo "Options: [defaults in brackets after descriptions]" 
     47        echo "All \"enable\" options have \"disable\" counterparts" 
     48        echo 
     49        echo "   --help                    print this message" 
     50        echo "   --prefix=PREFIX           install in PREFIX [$PREFIX]" 
     51        echo "   --bindir=BINDIR           install binaries in BINDIR [$bindir]" 
     52        echo "   --confdir=CONFDIR         install configuration in CONFDIR [$confdir]" 
     53        echo "   --sharedir=SHAREDIR       install shared in SHAREDIR [$sharedir]" 
     54        echo "   --docdir=DOCDIR           install doc in DOCDIR [$docdir]" 
     55        echo "   --langdir=LANGDIR         install lang in LANGDIR [$langdir]" 
     56        echo "   --libdir=LIBDIR           install libraries in LIBDIR [$libdir]" 
     57        echo 
     58  echo "   --enable-static           build static versions [no]" 
     59        echo "   --enable-doc              build documentation [yes]" 
     60        echo "   --enable-utf8             build UTF-8 versions of applications [no]" 
     61  echo 
     62  echo "   --cc=CC                   use C compiler CC [$cc_default]" 
     63        echo "   --cxx=CXX                 use C++ compiler CXX [$cxx_default]" 
     64        echo "   --gengetopt=GGO           use gengetopt GGO [$gengetopt_default]" 
     65        echo "   --flex=FLEX               use flex FLEX [$flex_default]" 
     66  echo "   --makeinfo=MAKEINFO       use makeinfo MAKEINFO [$makeinfo_default]" 
     67        echo "   --texi2dvi=TEXI2DVI       use texi2dvi TEXI2DVI [$texi2dvi_default]" 
     68        echo "   --texi2pdf=TEXI2PDF       use texi2pdf TEXI2PDF [$texi2pdf_default]" 
     69        echo "   --dvips=DVIPS             use dvips DVIPS [$dvips_default]" 
     70        exit 1 
     71} 
     72 
     73die_unknown(){ 
     74        echo "Unknown option \"$1\"." 
     75        echo "See $0 --help for availible options." 
     76        exit 1 
     77} 
     78 
     79# 
     80# default values 
     81PREFIX="/usr/local" 
     82 
     83bindir="${PREFIX}/bin" 
     84confdir="/etc/utt" 
     85sharedir="${PREFIX}/share" 
     86docdir="${PREFIX}/share/doc/utt" 
     87langdir="${PREFIX}/share/utt" 
     88libdir="${PREFIX}/lib/utt" 
     89 
     90cc_default="gcc" 
     91cxx_default="g++" 
     92gengetopt_default="gengetopt" 
     93flex_default="flex" 
     94makeinfo_default="makeinfo" 
     95texi2dvi_default="texi2dvi" 
     96texi2pdf_default="texi2pdf" 
     97dvips_default="dvips" 
     98 
     99# default switch values 
     100DEFAULT=" 
     101" 
     102 
     103DEFAULT_NO="static 
     104utf8 
     105" 
     106 
     107DEFAULT_YES="doc 
     108" 
     109 
     110CMDLINE_SELECT="$DEFAULT 
     111  $DEFAULT_NO 
     112  $DEFAULT_YES 
     113" 
     114 
     115enable $DEFAULT_YES 
     116disable $DEFAULT_NO 
     117 
     118for opt do 
     119        optval="${opt#*=}" 
     120        case "$opt" in 
     121        --help) 
     122                show_help 
     123        ;; 
     124        --prefix=*) 
     125                PREFIX="$optval" 
     126    bindir="$optval/bin" 
     127    sharedir="$optval/share" 
     128    docdir="$optval/share/doc/utt" 
     129    langdir="$optval/share/utt" 
     130    libdir="$optval/lib/utt" 
     131        ;; 
     132        --bindir=*) 
     133                bindir="$optval" 
     134        ;; 
     135        --confdir=*) 
     136                confdir="$optval" 
     137        ;; 
     138        --sharedir=*) 
     139                sharedir="$optval" 
     140        ;; 
     141        --docdir=*) 
     142                docdir="$optval" 
     143        ;; 
     144        --langdir=*) 
     145                langdir="$optval" 
     146        ;; 
     147        --libdir=*) 
     148                libdir="$optval" 
     149        ;; 
     150        --cc=*) 
     151                cc="$optval" 
     152        ;; 
     153        --cxx=*) 
     154                cxx="$optval" 
     155        ;; 
     156        --gengetopt=*) 
     157                gengetopt="$optval" 
     158        ;; 
     159  --flex=*) 
     160    flex="$optval" 
     161  ;; 
     162        --makeinfo=*) 
     163                makeinfo="$optval" 
     164        ;; 
     165        --texi2dvi=*) 
     166                texi2dvi="$optval" 
     167        ;; 
     168        --texi2pdf=*) 
     169                texi2pdf="$optval" 
     170        ;; 
     171        --dvips=*) 
     172                dvips="$optval" 
     173        ;; 
     174        --enable-?*|--disable-?*) 
     175                eval `echo "$opt" | sed 's/--/action=/;s/-/ option=/;s/-/_/g'` 
     176    echo "$CMDLINE_SELECT" | grep -q "^ *$option\$" || die_unknown $opt 
     177                $action $option 
     178        ;; 
     179        *) 
     180                die_unknown $opt 
     181        ;; 
     182        esac 
     183done 
     184 
     185if ! test -z $cc; then 
     186        cc_default="${cc}" 
     187fi 
     188cc="${cc_default}" 
     189 
     190if ! test -z $cxx; then 
     191        cxx_default="${cxx}" 
     192fi 
     193 
     194cxx="${cxx_default}" 
     195 
     196if ! test -z $gengetopt; then 
     197        gengetopt_default="${gengetopt}" 
     198fi 
     199 
     200gengetopt="${gengetopt_default}" 
     201 
     202if ! test -z $flex; then 
     203  flex_default="$flex" 
     204fi 
     205 
     206flex="${flex_default}" 
     207 
     208enabled doc && { 
     209        if ! test -z $makeinfo; then 
     210                makeinfo_default="${makeinfo}" 
     211        fi 
     212        if ! test -z $texi2dvi; then 
     213                texi2dvi_default="${texi2dvi}" 
     214        fi 
     215        if ! test -z $texi2pdf; then 
     216                texi2pdf_default="${texi2pdf}" 
     217        fi 
     218        if ! test -z $dvips; then 
     219                dvips_default="${dvips}" 
     220        fi 
     221         
     222        makeinfo="${makeinfo_default}" 
     223        texi2dvi="${texi2dvi_default}" 
     224        texi2pdf="${texi2pdf_default}" 
     225        dvips="${dvips_default}" 
     226} 
     227 
     228# generating config.mak 
     229 
     230echo "# Automatically generated by configure" > config.mak 
     231echo "PREFIX=$PREFIX" >> config.mak 
     232echo "BIN_DIR=$bindir" >> config.mak 
     233echo "CONF_DIR=$confdir" >> config.mak 
     234echo "SHARE_DIR=$sharedir" >> config.mak 
     235echo "DOC_DIR=$docdir" >> config.mak 
     236echo "LANG_DIR=$langdir" >> config.mak 
     237echo "LIB_DIR=$libdir" >> config.mak 
     238echo "CC=$cc" >> config.mak 
     239echo "CXX=$cxx" >> config.mak 
     240echo "GENGETOPT=$gengetopt" >> config.mak 
     241echo "FLEX=$flex" >> config.mak 
     242enabled doc && { 
     243        echo "MAKEINFO=$makeinfo" >> config.mak 
     244        echo "TEXI2DVI=$texi2dvi" >> config.mak 
     245        echo "TEXI2PDF=$texi2pdf" >> config.mak 
     246        echo "DVIPS=$dvips" >> config.mak 
     247} 
     248echo "BUILD_UTF8=$utf8" >> config.mak 
     249echo "BUILD_STATIC=$static" >> config.mak 
     250echo "BUILD_DOC=$doc" >> config.mak 
     251 
     252enabled utf8 && { 
     253  for cmp in $CMPLIST; do 
     254    if [ -d "${SRC_DIR}/${cmp}_utf8" ]; then 
     255      COMPONENTS="${COMPONENTS} ${cmp}_utf8" 
     256    else 
     257      COMPONENTS="${COMPONENTS} ${cmp}" 
     258    fi 
     259  done 
     260} 
     261 
     262disabled utf8 && { 
     263  for cmp in $CMPLIST; do 
     264    COMPONENTS="${COMPONENTS} ${cmp}" 
     265  done 
     266} 
     267COMPONENTS=$(echo $COMPONENTS | cut -c1-) 
     268echo "COMPONENTS=$COMPONENTS" >> config.mak 
     269 
     270# echoing the configuration to console 
     271echo "prefix:     $PREFIX" 
     272echo "bindir:     $bindir" 
     273echo "confdir:    $confdir" 
     274echo "sharedir:   $sharedir" 
     275echo "docdir:     $docdir" 
     276echo "langdir:    $langdir" 
     277echo "libdir:     $libdir" 
     278enabled doc && { 
     279echo "makeinfo:   $makeinfo" 
     280echo "texi2dvi:   $texi2dvi" 
     281echo "texi2pdf:   $texi2pdf" 
     282echo "dvips:      $dvips" 
     283} 
     284echo "cc:         $cc" 
     285echo "cxx:        $cxx" 
     286echo "gengetopt:  $gengetopt" 
     287echo "flex:       $flex" 
     288echo "utf8:       $utf8" 
     289echo "static:     $static" 
     290echo "doc:        $doc" 
Note: See TracChangeset for help on using the changeset viewer.