"Fossies" - the Fresh Open Source Software Archive

Member "zutils-1.10/configure" (5 Jan 2021, 6566 Bytes) of package /linux/privat/zutils-1.10.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.10-rc1_vs_1.10 or 1.9_vs_1.10.

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