"Fossies" - the Fresh Open Source Software Archive

Member "lzip-1.22/configure" (1 Jan 2021, 7401 Bytes) of package /linux/misc/lzip-1.22.tar.lz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) Bash source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file. See also the latest Fossies "Diffs" side-by-side code changes reports for "configure": 1.22-rc3_vs_1.22 or 1.21_vs_1.22.

    1 #! /bin/sh
    2 # configure script for Lzip - LZMA lossless data compressor
    3 # Copyright (C) 2008-2021 Antonio Diaz Diaz.
    4 #
    5 # This configure script is free software: you have unlimited permission
    6 # to copy, distribute, and modify it.
    7 
    8 pkgname=lzip
    9 pkgversion=1.22
   10 progname=lzip
   11 srctrigger=doc/${pkgname}.texi
   12 
   13 # clear some things potentially inherited from environment.
   14 LC_ALL=C
   15 export LC_ALL
   16 srcdir=
   17 prefix=/usr/local
   18 exec_prefix='$(prefix)'
   19 bindir='$(exec_prefix)/bin'
   20 datarootdir='$(prefix)/share'
   21 infodir='$(datarootdir)/info'
   22 mandir='$(datarootdir)/man'
   23 build=no
   24 check=no
   25 installdir=
   26 CXX=g++
   27 CPPFLAGS=
   28 CXXFLAGS='-Wall -W -O2'
   29 LDFLAGS=
   30 
   31 # checking whether we are using GNU C++.
   32 /bin/sh -c "${CXX} --version" > /dev/null 2>&1 || { CXX=c++ ; CXXFLAGS=-O2 ; }
   33 
   34 # Loop over all args
   35 args=
   36 no_create=
   37 while [ $# != 0 ] ; do
   38 
   39     # Get the first arg, and shuffle
   40     option=$1 ; arg2=no
   41     shift
   42 
   43     # Add the argument quoted to args
   44     if [ -z "${args}" ] ; then args="\"${option}\""
   45     else args="${args} \"${option}\"" ; fi
   46 
   47     # Split out the argument for options that take them
   48     case ${option} in
   49     *=*) optarg=`echo "${option}" | sed -e 's,^[^=]*=,,;s,/$,,'` ;;
   50     esac
   51 
   52     # Process the options
   53     case ${option} in
   54     --help | -h)
   55         echo "Usage: $0 [OPTION]... [VAR=VALUE]..."
   56         echo
   57         echo "To assign makefile variables (e.g., CXX, CXXFLAGS...), specify them as"
   58         echo "arguments to configure in the form VAR=VALUE."
   59         echo
   60         echo "Options and variables: [defaults in brackets]"
   61         echo "  -h, --help            display this help and exit"
   62         echo "  -V, --version         output version information and exit"
   63         echo "  --srcdir=DIR          find the sources in DIR [. or ..]"
   64         echo "  --prefix=DIR          install into DIR [${prefix}]"
   65         echo "  --exec-prefix=DIR     base directory for arch-dependent files [${exec_prefix}]"
   66         echo "  --bindir=DIR          user executables directory [${bindir}]"
   67         echo "  --datarootdir=DIR     base directory for doc and data [${datarootdir}]"
   68         echo "  --infodir=DIR         info files directory [${infodir}]"
   69         echo "  --mandir=DIR          man pages directory [${mandir}]"
   70         echo "  --build               build in one step without using 'make'"
   71         echo "  --check               check without using 'make', implies --build"
   72         echo "  --installdir=BINDIR   install without using 'make', implies --build"
   73         echo "  CXX=COMPILER          C++ compiler to use [${CXX}]"
   74         echo "  CPPFLAGS=OPTIONS      command line options for the preprocessor [${CPPFLAGS}]"
   75         echo "  CXXFLAGS=OPTIONS      command line options for the C++ compiler [${CXXFLAGS}]"
   76         echo "  CXXFLAGS+=OPTIONS     append options to the current value of CXXFLAGS"
   77         echo "  LDFLAGS=OPTIONS       command line options for the linker [${LDFLAGS}]"
   78         echo
   79         exit 0 ;;
   80     --version | -V)
   81         echo "Configure script for ${pkgname} version ${pkgversion}"
   82         exit 0 ;;
   83     --srcdir)            srcdir=$1 ; arg2=yes ;;
   84     --prefix)            prefix=$1 ; arg2=yes ;;
   85     --exec-prefix)  exec_prefix=$1 ; arg2=yes ;;
   86     --bindir)            bindir=$1 ; arg2=yes ;;
   87     --datarootdir)  datarootdir=$1 ; arg2=yes ;;
   88     --infodir)          infodir=$1 ; arg2=yes ;;
   89     --mandir)            mandir=$1 ; arg2=yes ;;
   90     --installdir)    installdir=$1 ; arg2=yes ;;
   91 
   92     --srcdir=*)            srcdir=${optarg} ;;
   93     --prefix=*)            prefix=${optarg} ;;
   94     --exec-prefix=*)  exec_prefix=${optarg} ;;
   95     --bindir=*)            bindir=${optarg} ;;
   96     --datarootdir=*)  datarootdir=${optarg} ;;
   97     --infodir=*)          infodir=${optarg} ;;
   98     --mandir=*)            mandir=${optarg} ;;
   99     --build)                      build=yes ;;
  100     --check)          check=yes ; build=yes ;;
  101     --installdir=*)    installdir=${optarg} ; build=yes ;;
  102     --no-create)              no_create=yes ;;
  103 
  104     CXX=*)            CXX=${optarg} ;;
  105     CPPFLAGS=*)  CPPFLAGS=${optarg} ;;
  106     CXXFLAGS=*)  CXXFLAGS=${optarg} ;;
  107     CXXFLAGS+=*) CXXFLAGS="${CXXFLAGS} ${optarg}" ;;
  108     LDFLAGS=*)    LDFLAGS=${optarg} ;;
  109 
  110     --*)
  111         echo "configure: WARNING: unrecognized option: '${option}'" 1>&2 ;;
  112     *=* | *-*-*) ;;
  113     *)
  114         echo "configure: unrecognized option: '${option}'" 1>&2
  115         echo "Try 'configure --help' for more information." 1>&2
  116         exit 1 ;;
  117     esac
  118 
  119     # Check if the option took a separate argument
  120     if [ "${arg2}" = yes ] ; then
  121         if [ $# != 0 ] ; then args="${args} \"$1\"" ; shift
  122         else echo "configure: Missing argument to '${option}'" 1>&2
  123             exit 1
  124         fi
  125     fi
  126 done
  127 
  128 # Find the source files, if location was not specified.
  129 srcdirtext=
  130 if [ -z "${srcdir}" ] ; then
  131     srcdirtext="or . or .." ; srcdir=.
  132     if [ ! -r "${srcdir}/${srctrigger}" ] ; then srcdir=.. ; fi
  133     if [ ! -r "${srcdir}/${srctrigger}" ] ; then
  134         ## the sed command below emulates the dirname command
  135         srcdir=`echo "$0" | sed -e 's,[^/]*$,,;s,/$,,;s,^$,.,'`
  136     fi
  137 fi
  138 
  139 if [ ! -r "${srcdir}/${srctrigger}" ] ; then
  140     echo "configure: Can't find sources in ${srcdir} ${srcdirtext}" 1>&2
  141     echo "configure: (At least ${srctrigger} is missing)." 1>&2
  142     exit 1
  143 fi
  144 
  145 # Set srcdir to . if that's what it is.
  146 if [ "`pwd`" = "`cd "${srcdir}" ; pwd`" ] ; then srcdir=. ; fi
  147 
  148 if [ "${build}" = yes ] ; then
  149   objs=$(sed -e :a -e '/\\$/N; s/\\\n//; ta' "${srcdir}/Makefile.in" | \
  150          sed -n -e 's/^ *objs *= *//p' | sed -e 's/ \{2,\}/ /g')
  151   for ofile in ${objs} ; do
  152     file="${ofile%.o}.cc" ; pver=
  153     [ "${ofile}" = main.o ] && pver=" -DPROGVERSION=\"${pkgversion}\""
  154     compile_command="${CXX} ${CPPFLAGS} ${CXXFLAGS}${pver} -c -o ${ofile}"
  155     echo "${compile_command} ${srcdir}/${file}"
  156     ${compile_command} "${srcdir}/${file}" || exit 1
  157   done
  158   link_command="${CXX} ${LDFLAGS} ${CXXFLAGS} -o ${progname} ${objs}"
  159   echo "${link_command}" ; ${link_command} || exit 1
  160   if [ "${check}" = yes ] ; then
  161     "${srcdir}/testsuite/check.sh" "${srcdir}/testsuite" ${pkgversion} || exit 1
  162   fi
  163   if [ -n "${installdir}" ] ; then
  164     echo "installing ${progname} in ${installdir}"
  165     [ -d "${installdir}" ] || mkdir -p "${installdir}" || exit 1
  166     cp -fp ${progname} "${installdir}/${progname}" || exit 1
  167   fi
  168   exit 0
  169 fi
  170 
  171 echo
  172 if [ -z "${no_create}" ] ; then
  173     echo "creating config.status"
  174     rm -f config.status
  175     cat > config.status << EOF
  176 #! /bin/sh
  177 # This file was generated automatically by configure. Don't edit.
  178 # Run this file to recreate the current configuration.
  179 #
  180 # This script is free software: you have unlimited permission
  181 # to copy, distribute, and modify it.
  182 
  183 exec /bin/sh $0 ${args} --no-create
  184 EOF
  185     chmod +x config.status
  186 fi
  187 
  188 echo "creating Makefile"
  189 echo "VPATH = ${srcdir}"
  190 echo "prefix = ${prefix}"
  191 echo "exec_prefix = ${exec_prefix}"
  192 echo "bindir = ${bindir}"
  193 echo "datarootdir = ${datarootdir}"
  194 echo "infodir = ${infodir}"
  195 echo "mandir = ${mandir}"
  196 echo "CXX = ${CXX}"
  197 echo "CPPFLAGS = ${CPPFLAGS}"
  198 echo "CXXFLAGS = ${CXXFLAGS}"
  199 echo "LDFLAGS = ${LDFLAGS}"
  200 rm -f Makefile
  201 cat > Makefile << EOF
  202 # Makefile for Lzip - LZMA lossless data compressor
  203 # Copyright (C) 2008-2021 Antonio Diaz Diaz.
  204 # This file was generated automatically by configure. Don't edit.
  205 #
  206 # This Makefile is free software: you have unlimited permission
  207 # to copy, distribute, and modify it.
  208 
  209 pkgname = ${pkgname}
  210 pkgversion = ${pkgversion}
  211 progname = ${progname}
  212 VPATH = ${srcdir}
  213 prefix = ${prefix}
  214 exec_prefix = ${exec_prefix}
  215 bindir = ${bindir}
  216 datarootdir = ${datarootdir}
  217 infodir = ${infodir}
  218 mandir = ${mandir}
  219 CXX = ${CXX}
  220 CPPFLAGS = ${CPPFLAGS}
  221 CXXFLAGS = ${CXXFLAGS}
  222 LDFLAGS = ${LDFLAGS}
  223 EOF
  224 cat "${srcdir}/Makefile.in" >> Makefile
  225 
  226 echo "OK. Now you can run make."