configure
author "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
Mon Nov 07 21:40:28 2011 +0100 (2011-11-07)
changeset 2763 3f1798d436da
parent 2754 0cc4d6352c3e
permissions -rwxr-xr-x
scripts: use wget, not curl

It seems wget is more popular than curl.

Signed-off-by: "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
     1 #!/bin/sh
     2 
     3 myname="${0##*/}"
     4 
     5 VERSION=$( cat .version )
     6 DATE=$( date +%Y%m%d )
     7 
     8 PREFIX_DEFAULT=/usr/local
     9 
    10 BINDIR_set=
    11 LIBDIR_set=
    12 DOCDIR_set=
    13 MANDIR_set=
    14 PROG_PFX=
    15 PROG_SFX=
    16 PROG_SED=
    17 LOCAL_set=
    18 FORCE=
    19 
    20 do_quit=
    21 
    22 # Simply print the error message, and exit. Obvious, he?
    23 do_error() {
    24     printf "${myname}: ${@}\n"
    25     exit 1
    26 }
    27 
    28 # Given an option string and the following argument,
    29 # echoes the value of the option.
    30 # If --var=val => echoes val and returns 0, meaning second arg was not consumed
    31 # If --var val => echoes val and returns non null, meaning second arg was used
    32 get_optval(){
    33     case "$1" in
    34         --*=?*)
    35             printf "${1#*=}"
    36             return 0
    37             ;;
    38         *)
    39             printf "${2}"
    40             return 1
    41             ;;
    42     esac
    43 }
    44 
    45 # The set_xxx functions will set the corresponding configuration variable
    46 # They return 0 if second arg was not consumed, and non-zero if it was consumed.
    47 set_prefix() {
    48     PREFIX="$( get_optval "$1" "$2" )"
    49 }
    50 set_bindir() {
    51     BINDIR_set=1
    52     BINDIR="$( get_optval "$1" "$2" )"
    53 }
    54 set_libdir() {
    55     LIBDIR_set=1
    56     LIBDIR="$( get_optval "$1" "$2" )"
    57 }
    58 set_docdir() {
    59     DOCDIR_set=1
    60     DOCDIR="$( get_optval "$1" "$2" )"
    61 }
    62 set_mandir() {
    63     MANDIR_set=1
    64     MANDIR="$( get_optval "$1" "$2" )"
    65 }
    66 set_program_prefix() {
    67     PROG_PFX="$( get_optval "$1" "$2" )"
    68 }
    69 set_program_suffix() {
    70     PROG_SFX="$( get_optval "$1" "$2" )"
    71 }
    72 set_program_transform_name() {
    73     PROG_SED="$( get_optval "$1" "$2" )"
    74 }
    75 set_tool() {
    76     local var_name="${1%%=*}"
    77     var_name="${var_name#--with-}"
    78     eval ${var_name}="\$( get_optval "$1" "$2" )"
    79 }
    80 
    81 # var_list is a list of variables, each one holding a path to a
    82 # tool, either detected by ./configure, or specified by the user.
    83 var_list=""
    84 kconfig_list=""
    85 
    86 # This function adds a variable name to the above list of variable names.
    87 # $1: the name of the variable to add to the list
    88 add_to_var_list() {
    89     local v
    90     for v in ${var_list}; do
    91         [ "${v}" = "${1}" ] && return 0
    92     done
    93     var_list="${var_list} ${1}"
    94 }
    95 add_to_kconfig_list() {
    96     local k
    97     for k in ${kconfig_list}; do
    98         [ "${k}" = "${1}" ] && return 0
    99     done
   100     kconfig_list="${kconfig_list} ${1}"
   101 }
   102 
   103 # A function to test for required tools/headers/libraries
   104 # Return 0 (true) if found, !0 (false) if not found
   105 #
   106 # $*: [prog|inc|lib]=<name[ name...]>
   107 #     the name(s) of tool(s) to test for
   108 #     mandatory
   109 #       eg: prog=bash   prog="curl wget"
   110 # $*: var=<var_name>
   111 #     the name of the variable to test and set
   112 #     optional
   113 #       eg: var=bash    if ${bash} is set and non-null, use that,
   114 #                       else check for bash and set bash=$(which bash)
   115 # $*: ver=<regexp>
   116 #     for each 'prog', test if $(prog --version) matches 'regexp'
   117 #     optional
   118 #       eg: ver='^GNU bash, version [34]\.'
   119 # $*: lib_exts=<extension[ extension...]>
   120 #     the list of allowed library extension
   121 #     mandatory
   122 #       eg: lib_exts="so dylib"     lib_exts="so dylib a"
   123 # $*: err=<error_message>
   124 #     the error message to print if tool is missing
   125 #     optional, defaults to: '${prog}: none found'
   126 #       eg: err="'bash' 3.x or above was not found"
   127 #     Note: err may be printed by caller, not us
   128 # $*: kconfig=<var_name>
   129 #     the name of a variable to pass down to kconfig if
   130 #     the prog/inc/lib was found
   131 #     optional, defaults to none
   132 #       eg: kconfig=has_libncurses
   133 # $*: skip=[y|n|]
   134 #     if set to 'y', skip the test, but still register the
   135 #     kconfig and var variables; if 'n' or empty, do the
   136 #     test.
   137 #     optional, default to 'n'
   138 #       eg: skip="${static_link_ko}"
   139 check_for() {
   140     local lib_exts
   141     local skip
   142     local val
   143     local item
   144     local where
   145     local status
   146     local ext
   147 
   148     # Note: prog/inc/lib and var/kconfig/ver/err are set here,
   149     # but declared by the caller (because it needs it)
   150     for item in "${@}"; do
   151         case "${item}" in
   152             prog=*|inc=*|lib=*|var=*|ver=*|err=*|kconfig=*|lib_exts=*|skip=*)
   153                 eval ${item%%=*}=\"${item#*=}\"
   154                 ;;
   155             *)  do_error "check_for: incorrect parameters: '${item}'";;
   156         esac
   157     done
   158 
   159     case "${prog}:${inc}:${lib}" in
   160         ?*:?*:|?*::?*|:?*:?*|?*:?*:?*)
   161             if [ -n "${var}" ]; then
   162                 do_error "check_for: the use of var is not compatible with passing several of [prog|inc|lib] at once"
   163             fi
   164             ;;
   165         ::) do_error "check_for: [prog|inc|lib] is mandatory";;
   166     esac
   167 
   168     if [ -n "${var}" ]; then
   169         add_to_var_list "${var}"
   170     fi
   171     if [ -n "${kconfig}" ]; then
   172         add_to_kconfig_list "${kconfig}"
   173     fi
   174 
   175     if [ "${skip}" = "y" ]; then
   176         return 0
   177     fi
   178 
   179     if [ -n "${prog}" ]; then
   180         for item in ${prog}; do
   181             printf "Checking for '${item}'... "
   182             if [ -n "${var}" ]; then
   183                 eval val="\${${var}}"
   184                 if [ -n "${val}" ]; then
   185                     status="${val} (cached)\n"
   186                     where="${val}"
   187                     break
   188                 fi
   189             fi
   190             where="$( which "${item}" 2>/dev/null )"
   191             if [ -z "${where}" ]; then
   192                 printf "no\n"
   193                 continue
   194             elif [ -n "${ver}" ]; then
   195                 str=$( LC_ALL=C "${where}" --version 2>&1   \
   196                        |grep -E "${ver}"                    \
   197                        |head -n 1
   198                      )
   199                 if [ -z "${str}" ]; then
   200                     printf "no\n"
   201                     unset where
   202                     continue
   203                 fi
   204             fi
   205             status="${where}"
   206             break
   207         done
   208         if [ -z "${status}" ]; then
   209             return 1
   210         fi
   211         printf "${status}\n"
   212         unset status
   213     fi
   214 
   215     if [ -n "${inc}" ]; then
   216         for item in ${inc}; do
   217             printf "Checking for '${item}'... "
   218             if printf "#include \"${item}\"" |gcc -x c -c - -o /dev/null >/dev/null 2>&1; then
   219                 where="${item}"
   220                 status=yes
   221                 break;
   222             fi
   223             printf "no\n"
   224         done
   225         if [ -z "${status}" ]; then
   226             return 1
   227         fi
   228         printf "${status}\n"
   229         unset status
   230     fi
   231 
   232     if [ -n "${lib}" ]; then
   233         if [ -z "${lib_exts}" ]; then
   234             do_error "check_for: no library extension specified for '${lib}'"
   235         fi
   236         for item in ${lib}; do
   237             for ext in ${lib_exts}; do
   238                 printf "Checking for '${item}.${ext}'... "
   239                 where="$( gcc -print-file-name="${item}.${ext}" )"
   240                 if [ "${where}" != "${item}.${ext}" ]; then
   241                     where="$( readlink "${where}" )"
   242                     status=yes
   243                     break 2;
   244                 fi
   245                 printf "no\n"
   246             done
   247         done
   248         if [ -z "${status}" ]; then
   249             return 1
   250         fi
   251         printf "${status}\n"
   252         unset status
   253     fi
   254 
   255     if [ -n "${var}" ]; then
   256         eval ${var}='"'"${where}"'"'
   257     fi
   258     if [ -n "${kconfig}" ]; then
   259         eval ${kconfig}=y
   260     fi
   261 }
   262 
   263 # This function checks for a tool, and aborts if not found
   264 # See check_for(), above, for how to call has_or_abort
   265 has_or_abort() {
   266     # We declare these 6 variables here, although they are
   267     # set in check_for(), called below
   268     local prog inc lib
   269     local var ver err kconfig
   270 
   271     if ! check_for "$@"; then
   272         printf " * A mandatory dependency is missing, or version mis-match:\n"
   273         printf " * - ${err:-${prog}${inc}${lib}: none found}\n"
   274         if [ -n "${var}" ]; then
   275             printf " * --> You can give the path to this tool using: --with-${var}=PATH\n"
   276         fi
   277         printf "\n"
   278         # Bail out if --force is not specified
   279         [ -z "${FORCE}" ] && do_error "Bailing out..."
   280         printf "<*                                          *>\n"
   281         printf "<*            FORCE in action:              *>\n"
   282         printf "<* Continuing despite missing pre-requisite *>\n"
   283         printf "<*          Prepare for breakage            *>\n"
   284         printf "<*                                          *>\n"
   285         printf "\n"
   286     fi
   287 }
   288 
   289 # This function checks for a tool, and warns if not found
   290 # See check_for(), above, for how to call has_or_abort
   291 # Note: if err is not set, then no error message is printed
   292 has_or_warn() {
   293     # We declare these 6 variables here, although they are
   294     # set in check_for(), called below
   295     local prog inc lib
   296     local var ver err kconfig
   297 
   298     if ! check_for "$@"; then
   299         printf " * An optional dependency is missing, some features will be disabled"
   300         printf "${err:+:\n * - ${err}}\n"
   301         if [ -n "${var}" ]; then
   302             printf " * --> You can give the path to this tool using: --with-${var}=PATH\n"
   303         fi
   304     fi
   305 }
   306 
   307 do_help() {
   308     cat <<__EOF__
   309 \`configure' configures crosstool-NG-${VERSION} to adapt to many kind of systems.
   310 
   311 USAGE: ./configure [OPTION]...
   312 
   313 Defaults for the options are specified in brackets.
   314 
   315 Configuration:
   316   -h, --help              display this help and exit
   317       --force             force configure to continue, even in case
   318                           some pre-requisites are missing
   319 
   320 Installation directories:
   321   --prefix=PREFIX         install files in PREFIX [${PREFIX_DEFAULT}]
   322   --local                 don't install, and use current directory
   323 
   324 By default, \`make install' will install all the files in
   325 \`${PREFIX_DEFAULT}/bin', \`${PREFIX_DEFAULT}/lib' etc.  You can specify
   326 an installation prefix other than \`${PREFIX_DEFAULT}' using \`--prefix',
   327 for instance \`--prefix=\${HOME}'.
   328 
   329 For better control, use the options below.
   330 Note: options marked as \`ignored' are recognised, but not acted upon, as
   331 they make no sense for crosstool-NG, or they are not implemented yet.
   332 
   333 Fine tuning of the installation directories:
   334   --bindir=DIR            user executables [PREFIX/bin]
   335   --libdir=DIR            object code libraries [PREFIX/lib]
   336   --docdir=DIR            info documentation [PREFIX/share/doc]
   337   --mandir=DIR            man documentation [PREFIX/share/man]
   338   --infodir=DIR           info documentation [DATAROOTDIR/info] (ignored)
   339   --datadir=DIR           read-only architecture-independent data [DATAROOTDIR]
   340                           (ignored)
   341   --sysconfdir=DIR        read-only single-machine data [PREFIX/etc] (ignored)
   342   --localstatedir=DIR     modifiable single-machine data [PREFIX/var] (ignored)
   343 
   344 Program names:
   345   --program-prefix=PREFIX            prepend PREFIX to installed program names
   346   --program-suffix=SUFFIX            append SUFFIX to installed program names
   347   --program-transform-name=PROGRAM   run sed PROGRAM on installed program names
   348 
   349 System types:
   350   --build=BUILD     configure for building on BUILD [guessed] (ignored)
   351   --host=HOST       cross-compile to build programs to run on HOST [BUILD]
   352                     (ignored)
   353 
   354 Optional Features:
   355   --enable-shared[=PKGS]  build shared libraries [default=yes] (ignored)
   356   --enable-static[=PKGS]  build static libraries [default=yes] (ignored)
   357 
   358 Optional Packages:
   359   --with-install=PATH     Specify the full PATH to GNU install
   360   --with-make=PATH        Specify the full PATH to GNU make >= 3.80
   361   --with-grep=PATH        Specify the full PATH to GNU grep
   362   --with-sed=PATH         Specify the full PATH to GNU sed
   363   --with-bash=PATH        Specify the full PATH to bash >= 3.0
   364 __EOF__
   365 }
   366 
   367 #---------------------------------------------------------------------
   368 # Set user's options
   369 
   370 while [ $# -ne 0 ]; do
   371     case "$1" in
   372         --local)    LOCAL_set="y"; shift;;
   373         --prefix*)  set_prefix "$1" "$2" && shift || shift 2;;
   374         --bindir*)  set_bindir "$1" "$2" && shift || shift 2;;
   375         --libdir*)  set_libdir "$1" "$2" && shift || shift 2;;
   376         --docdir*)  set_docdir "$1" "$2" && shift || shift 2;;
   377         --mandir*)  set_mandir "$1" "$2" && shift || shift 2;;
   378         --with-*)   set_tool   "$1" "$2" && shift || shift 2;;
   379         --program-prefix=*|--program-prefix)
   380                     set_program_prefix "$1" "$2" && shift || shift 2
   381                     ;;
   382         --program-suffix=*|--program-suffix)
   383                     set_program_suffix "$1" "$2" && shift || shift 2
   384                     ;;
   385         --program-transform-name=*|--program-transform-name)
   386                     set_program_transform_name "$1" "$2" && shift || shift 2
   387                     ;;
   388         --force)    FORCE=1; shift;;
   389         --help|-h)  do_help; exit 0;;
   390         # Skip, auto-stuff compatibility
   391         --build=*|--host=*|--infodir=*|--datadir=*|--sysconfdir=*|--localstatedir=*) shift;;
   392         --build|--host|--infodir|--datadir|--sysconfdir|--localstatedir)             shift 2;;
   393         --enable-shared|--disable-shared|--enable-static|--disable-static)           shift;;
   394         *)          printf "Unrecognised option: '${1}'\n"; do_help; exit 1;;
   395     esac
   396 done
   397 
   398 # Use defaults
   399 [ -z "${PREFIX}" ] && set_prefix "" "${PREFIX_DEFAULT}"
   400 
   401 # Special case when installing locally
   402 if [ "${LOCAL_set}" = "y" ]; then
   403     set_prefix "" "$( pwd )"
   404     set_bindir "" "$( pwd )"
   405     set_libdir "" "$( pwd )"
   406     set_docdir "" "$( pwd )/docs"
   407     set_mandir "" "$( pwd )/docs"
   408     set_program_prefix "" ""
   409     set_program_suffix "" ""
   410     set_program_transform_name "" ""
   411 fi
   412 
   413 #---------------------------------------------------------------------
   414 # Some sanity checks, now
   415 
   416 # We check for grep and sed manually, because they are used in check_for()
   417 printf "Checking for 'grep'... "
   418 if [ -n "${grep}" ]; then
   419     printf "${grep} (cached)\n"
   420 else
   421     grep="$( which grep 2>/dev/null )"
   422     if [ -z "${grep}" ]; then
   423         printf "not found\n"
   424     else
   425         printf "${grep}\n"
   426         printf "Checking whether '${grep}' supports -E... "
   427         if echo 'foo' |"${grep}" -E 'foo' >/dev/null 2>&1; then
   428             printf "yes\n"
   429         else
   430             printf "no\n"
   431             grep=
   432         fi
   433     fi
   434 fi
   435 if [ -z "${grep}" ]; then
   436     printf "Either you are missing entirely the needed tool,\n"
   437     printf "or the version you have is too old.\n"
   438     printf "You can give the path to this tool using: --with-grep=PATH\n"
   439     do_error "Bailing out..."
   440 fi
   441 add_to_var_list grep
   442 
   443 printf "Checking for 'sed'... "
   444 if [ -n "${sed}" ]; then
   445     printf "${sed} (cached)\n"
   446 else
   447     sed="$( which sed 2>/dev/null )"
   448     if [ -z "${sed}" ]; then
   449         printf "not found\n"
   450     else
   451         printf "${sed}\n"
   452         printf "Checking whether '${sed}' supports -i and -e... "
   453         touch .ct-ng.sed.test
   454         if "${sed}" -r -i -e 's/foo/bar/' .ct-ng.sed.test >/dev/null 2>&1; then
   455             printf "yes\n"
   456         else
   457             printf "no\n"
   458             sed=
   459         fi
   460         rm -f .ct-ng.sed.test
   461     fi
   462 fi
   463 if [ -z "${sed}" ]; then
   464     printf "Either you are missing entirely the needed tool,\n"
   465     printf "or the version you have is too old.\n"
   466     printf "You can give the path to this tool using: --with-sed=PATH\n"
   467     do_error "Bailing out..."
   468 fi
   469 add_to_var_list sed
   470 
   471 # The regular list of tools we can now easily check for
   472 has_or_abort prog=bash                              \
   473              var=bash                               \
   474              ver='^GNU bash, version (3\.[1-9]|4)'  \
   475              err="'bash' 3.1 or above was not found"
   476 has_or_abort prog=cut
   477 has_or_abort prog=install var=install
   478 has_or_abort prog=make                                  \
   479              var=make                                   \
   480              ver='^GNU Make (3.[89][[:digit:]]|[4-9])'  \
   481              err="GNU 'make' 3.80 or above was not found"
   482 has_or_abort prog=gcc
   483 has_or_abort prog="awk gawk" ver='^GNU Awk' err="GNU 'awk' was not found"
   484 has_or_abort prog=bison
   485 has_or_abort prog=flex
   486 has_or_abort prog=makeinfo
   487 has_or_abort prog=automake                                                      \
   488              ver='\(GNU automake\) (1\.[[:digit:]]{2,}|[2-9][[:digit:]]*\.)'    \
   489              err="'automake' 1.10 or above was not found"
   490 has_or_abort prog=libtool                                                                           \
   491              var=libtool                                                                            \
   492              ver='\(GNU libtool.*\) (2[[:digit:]]*\.|1\.6[[:digit:]]*\.|1\.5\.[2-9][[:digit:]]+)'   \
   493              err="'libtool' 1.5.26 or above was not found"
   494 has_or_abort prog=libtoolize                                                                        \
   495              var=libtoolize                                                                         \
   496              ver='\(GNU libtool.*\) (2[[:digit:]]*\.|1\.6[[:digit:]]*\.|1\.5\.[2-9][[:digit:]]+)'   \
   497              err="'libtoolize' 1.5.26 or above was not found"
   498 has_or_abort prog=stat
   499 has_or_abort prog=wget
   500 has_or_abort prog=patch
   501 has_or_abort prog=tar
   502 has_or_abort prog=gzip
   503 has_or_abort prog=bzip2
   504 has_or_warn  prog=xz                                        \
   505              kconfig=has_xzutils                            \
   506              err="xz-compressed tarballs will not be used"
   507 has_or_warn  prog=lzma                                      \
   508              kconfig=has_lzma                               \
   509              skip="${has_xzutils}"                          \
   510              err="lzma-compressed tarballs will not be used"
   511 has_or_abort prog=readlink
   512 has_or_abort prog=objcopy var=objcopy
   513 has_or_abort prog=objdump var=objdump
   514 has_or_abort prog=readelf var=readelf
   515 has_or_abort prog=patch var=patch
   516 has_or_warn  prog=cvs                                                   \
   517              kconfig=has_cvs                                            \
   518              err="it will not be possible to use newlib cvs snapshots"
   519 has_or_warn  prog=svn                               \
   520              kconfig=has_svn                        \
   521              err="subversion is required to download eglibc"
   522 
   523 # Library checks
   524 libs_exts="so dylib a"
   525 
   526 ncurses_hdrs="ncurses/ncurses.h ncurses/curses.h ncurses.h curses.h"
   527 ncurses_libs="libncursesw libncurses libcurses"
   528 has_or_abort lib="${ncurses_libs}"                                          \
   529              lib_exts="${libs_exts}"                                        \
   530              inc="${ncurses_hdrs}"                                          \
   531              err="The 'ncurses' library is needed fo the menuconfig frontend"
   532 
   533 #---------------------------------------------------------------------
   534 # Compute the version string
   535 
   536 # If this version is n hg clone, try to get the revision number
   537 # If we can't get the revision number, use date
   538 printf "\nComputing version string... "
   539 
   540 # Pass the version to the version helper script, if present, to compute
   541 # a local version string, if needed.
   542 if [ -f version.sh -a -x version.sh ]; then
   543     V="$( ./version.sh "${VERSION}" 2>/dev/null |head -n 1 )"
   544 fi
   545 
   546 # If the script returns an empty string, revert to using the version
   547 # we just computed, above.
   548 if [ -n "${V}" ]; then
   549     VERSION="${V}"
   550 else
   551     case "${VERSION}" in
   552         *+hg|hg)
   553             rev_id="$( hg log -r . --template '{branch}-{node|short}\n' \
   554                               2>/dev/null                               \
   555                        || true                                          \
   556                      )"
   557             VERSION="${VERSION}+${rev_id:-unknown-$( date +%Y%m%d.%H%M%S )}"
   558             ;;
   559     esac
   560 fi
   561 
   562 # Arrange to have no / in the directory name, no need to create an
   563 # arbitrarily deep directory structure
   564 VERSION="$( printf "${VERSION}" |"${sed}" -r -e 's:/+:_:g;' )"
   565 
   566 printf "${VERSION}\n"
   567 
   568 #---------------------------------------------------------------------
   569 # Compute and check install paths
   570 
   571 # Now we have the version string, we can build up the paths
   572 [ -z "${BINDIR_set}" ] && BINDIR="${PREFIX}/bin"
   573 [ -z "${LIBDIR_set}" ] && LIBDIR="${PREFIX}/lib"
   574 [ -z "${DOCDIR_set}" ] && DOCDIR="${PREFIX}/share/doc"
   575 [ -z "${MANDIR_set}" ] && MANDIR="${PREFIX}/share/man"
   576 
   577 # Install support files in our own sub-dir, so as not to mangle (system)
   578 # files and dirs, but only if not --local
   579 if [ -z "${LOCAL_set}" ]; then
   580     LIBDIR="${LIBDIR}/ct-ng-${VERSION}"
   581     DOCDIR="${DOCDIR}/ct-ng-${VERSION}"
   582 fi
   583 
   584 # Check that install PATHs are absolute
   585 for p in BIN LIB DOC MAN; do
   586     var="${p}DIR"
   587     eval v='"${'"${var}"'}"'
   588     case "${v}" in
   589         /*) ;;
   590         *)  do_error "'${var}' is not an absolute path: '${v}'";;
   591     esac
   592 done
   593 case "${PROG_PFX}" in
   594     */*)    do_error "program prefix '${PROG_PFX}' contains a '/'";;
   595 esac
   596 case "${PROG_SFX}" in
   597     */*)    do_error "program suffix '${PROG_SFX}' contains a '/'";;
   598 esac
   599 
   600 #---------------------------------------------------------------------
   601 # That's all, folks!
   602 
   603 printf "Building up Makefile... "
   604 var_sed="$( for var_name in ${var_list}; do
   605                 eval echo 's,@@${var_name}@@,${'"${var_name}"'},g'
   606             done
   607           )"
   608 kconfig_sed="s/@@KCONFIG@@/$( for k_name in ${kconfig_list}; do
   609                                   eval printf \"${k_name}=\${${k_name}} \"
   610                               done
   611                             )/"
   612 "${sed}" -r -e "s,@@BINDIR@@,${BINDIR},g"       \
   613             -e "s,@@LIBDIR@@,${LIBDIR},g"       \
   614             -e "s,@@DOCDIR@@,${DOCDIR},g"       \
   615             -e "s,@@MANDIR@@,${MANDIR},g"       \
   616             -e "s,@@PROG_PFX@@,${PROG_PFX},g"   \
   617             -e "s,@@PROG_SFX@@,${PROG_SFX},g"   \
   618             -e "s,@@PROG_SED@@,${PROG_SED},g"   \
   619             -e "s,@@VERSION@@,${VERSION},g"     \
   620             -e "s,@@DATE@@,${DATE},g"           \
   621             -e "s,@@LOCAL@@,${LOCAL_set},g"     \
   622             -e "${var_sed}"                     \
   623             -e "${kconfig_sed}"                 \
   624          Makefile.in                            \
   625          >Makefile
   626 echo "done"
   627 
   628 cat <<__EOF__
   629 
   630 crosstool-NG configured as follows:
   631   PREFIX='${PREFIX}'
   632   BINDIR='${BINDIR}'
   633   LIBDIR='${LIBDIR}'
   634   DOCDIR='${DOCDIR}'
   635   MANDIR='${MANDIR}'
   636   PROG_PFX='${PROG_PFX}'
   637   PROG_SFX='${PROG_SFX}'
   638   PROG_SED='${PROG_SED}'
   639 
   640 Now run:
   641   make
   642 __EOF__
   643 if [ "${LOCAL_set}" != "y" ]; then
   644     printf "  make install\n"
   645 fi