2025-02-17 18:33:31 +01:00
|
|
|
#! /bin/sh
|
2025-02-17 20:27:34 +01:00
|
|
|
# configure script for Clzip - LZMA lossless data compressor
|
2025-02-17 20:53:44 +01:00
|
|
|
# Copyright (C) 2010-2024 Antonio Diaz Diaz.
|
2025-02-17 18:33:31 +01:00
|
|
|
#
|
|
|
|
# This configure script is free software: you have unlimited permission
|
2025-02-17 20:49:14 +01:00
|
|
|
# to copy, distribute, and modify it.
|
2025-02-17 18:33:31 +01:00
|
|
|
|
|
|
|
pkgname=clzip
|
2025-02-17 20:54:18 +01:00
|
|
|
pkgversion=1.15-rc1
|
2025-02-17 18:33:31 +01:00
|
|
|
progname=clzip
|
2025-02-17 20:32:06 +01:00
|
|
|
srctrigger=doc/${pkgname}.texi
|
2025-02-17 18:33:31 +01:00
|
|
|
|
|
|
|
# clear some things potentially inherited from environment.
|
|
|
|
LC_ALL=C
|
|
|
|
export LC_ALL
|
|
|
|
srcdir=
|
|
|
|
prefix=/usr/local
|
|
|
|
exec_prefix='$(prefix)'
|
|
|
|
bindir='$(exec_prefix)/bin'
|
2025-02-17 20:05:47 +01:00
|
|
|
datarootdir='$(prefix)/share'
|
|
|
|
infodir='$(datarootdir)/info'
|
|
|
|
mandir='$(datarootdir)/man'
|
2025-02-17 20:12:24 +01:00
|
|
|
CC=gcc
|
2025-02-17 18:33:31 +01:00
|
|
|
CPPFLAGS=
|
2025-02-17 19:14:54 +01:00
|
|
|
CFLAGS='-Wall -W -O2'
|
2025-02-17 18:33:31 +01:00
|
|
|
LDFLAGS=
|
2025-02-17 20:53:19 +01:00
|
|
|
MAKEINFO=makeinfo
|
2025-02-17 18:33:31 +01:00
|
|
|
|
2025-02-17 20:12:24 +01:00
|
|
|
# checking whether we are using GNU C.
|
2025-02-17 20:49:14 +01:00
|
|
|
/bin/sh -c "${CC} --version" > /dev/null 2>&1 || { CC=cc ; CFLAGS=-O2 ; }
|
2025-02-17 20:12:24 +01:00
|
|
|
|
2025-02-17 18:33:31 +01:00
|
|
|
# Loop over all args
|
2025-02-17 20:24:33 +01:00
|
|
|
args=
|
|
|
|
no_create=
|
|
|
|
while [ $# != 0 ] ; do
|
2025-02-17 18:33:31 +01:00
|
|
|
|
|
|
|
# Get the first arg, and shuffle
|
2025-02-17 20:24:33 +01:00
|
|
|
option=$1 ; arg2=no
|
2025-02-17 18:33:31 +01:00
|
|
|
shift
|
|
|
|
|
|
|
|
# Add the argument quoted to args
|
2025-02-17 20:49:14 +01:00
|
|
|
if [ -z "${args}" ] ; then args="\"${option}\""
|
|
|
|
else args="${args} \"${option}\"" ; fi
|
2025-02-17 18:33:31 +01:00
|
|
|
|
|
|
|
# Split out the argument for options that take them
|
|
|
|
case ${option} in
|
2025-02-17 20:49:14 +01:00
|
|
|
*=*) optarg=`echo "${option}" | sed -e 's,^[^=]*=,,;s,/$,,'` ;;
|
2025-02-17 18:33:31 +01:00
|
|
|
esac
|
|
|
|
|
|
|
|
# Process the options
|
|
|
|
case ${option} in
|
2025-02-17 20:05:47 +01:00
|
|
|
--help | -h)
|
2025-02-17 20:44:01 +01:00
|
|
|
echo "Usage: $0 [OPTION]... [VAR=VALUE]..."
|
|
|
|
echo
|
|
|
|
echo "To assign makefile variables (e.g., CC, CFLAGS...), specify them as"
|
|
|
|
echo "arguments to configure in the form VAR=VALUE."
|
2025-02-17 18:33:31 +01:00
|
|
|
echo
|
2025-02-17 20:44:01 +01:00
|
|
|
echo "Options and variables: [defaults in brackets]"
|
2025-02-17 18:33:31 +01:00
|
|
|
echo " -h, --help display this help and exit"
|
|
|
|
echo " -V, --version output version information and exit"
|
2025-02-17 20:53:19 +01:00
|
|
|
echo " --srcdir=DIR find the source code in DIR [. or ..]"
|
2025-02-17 18:33:31 +01:00
|
|
|
echo " --prefix=DIR install into DIR [${prefix}]"
|
|
|
|
echo " --exec-prefix=DIR base directory for arch-dependent files [${exec_prefix}]"
|
|
|
|
echo " --bindir=DIR user executables directory [${bindir}]"
|
2025-02-17 20:05:47 +01:00
|
|
|
echo " --datarootdir=DIR base directory for doc and data [${datarootdir}]"
|
2025-02-17 18:33:31 +01:00
|
|
|
echo " --infodir=DIR info files directory [${infodir}]"
|
|
|
|
echo " --mandir=DIR man pages directory [${mandir}]"
|
2025-02-17 20:34:11 +01:00
|
|
|
echo " CC=COMPILER C compiler to use [${CC}]"
|
2025-02-17 20:53:19 +01:00
|
|
|
echo " CPPFLAGS=OPTIONS command-line options for the preprocessor [${CPPFLAGS}]"
|
|
|
|
echo " CFLAGS=OPTIONS command-line options for the C compiler [${CFLAGS}]"
|
2025-02-17 20:46:36 +01:00
|
|
|
echo " CFLAGS+=OPTIONS append options to the current value of CFLAGS"
|
2025-02-17 20:53:19 +01:00
|
|
|
echo " LDFLAGS=OPTIONS command-line options for the linker [${LDFLAGS}]"
|
|
|
|
echo " MAKEINFO=NAME makeinfo program to use [${MAKEINFO}]"
|
2025-02-17 18:33:31 +01:00
|
|
|
echo
|
|
|
|
exit 0 ;;
|
2025-02-17 20:05:47 +01:00
|
|
|
--version | -V)
|
2025-02-17 18:33:31 +01:00
|
|
|
echo "Configure script for ${pkgname} version ${pkgversion}"
|
|
|
|
exit 0 ;;
|
2025-02-17 20:24:33 +01:00
|
|
|
--srcdir) srcdir=$1 ; arg2=yes ;;
|
|
|
|
--prefix) prefix=$1 ; arg2=yes ;;
|
|
|
|
--exec-prefix) exec_prefix=$1 ; arg2=yes ;;
|
|
|
|
--bindir) bindir=$1 ; arg2=yes ;;
|
|
|
|
--datarootdir) datarootdir=$1 ; arg2=yes ;;
|
|
|
|
--infodir) infodir=$1 ; arg2=yes ;;
|
|
|
|
--mandir) mandir=$1 ; arg2=yes ;;
|
|
|
|
|
2025-02-17 20:05:47 +01:00
|
|
|
--srcdir=*) srcdir=${optarg} ;;
|
|
|
|
--prefix=*) prefix=${optarg} ;;
|
|
|
|
--exec-prefix=*) exec_prefix=${optarg} ;;
|
|
|
|
--bindir=*) bindir=${optarg} ;;
|
|
|
|
--datarootdir=*) datarootdir=${optarg} ;;
|
|
|
|
--infodir=*) infodir=${optarg} ;;
|
|
|
|
--mandir=*) mandir=${optarg} ;;
|
|
|
|
--no-create) no_create=yes ;;
|
|
|
|
|
2025-02-17 20:46:36 +01:00
|
|
|
CC=*) CC=${optarg} ;;
|
|
|
|
CPPFLAGS=*) CPPFLAGS=${optarg} ;;
|
|
|
|
CFLAGS=*) CFLAGS=${optarg} ;;
|
|
|
|
CFLAGS+=*) CFLAGS="${CFLAGS} ${optarg}" ;;
|
|
|
|
LDFLAGS=*) LDFLAGS=${optarg} ;;
|
2025-02-17 20:53:19 +01:00
|
|
|
MAKEINFO=*) MAKEINFO=${optarg} ;;
|
2025-02-17 18:33:31 +01:00
|
|
|
|
2025-02-17 20:27:34 +01:00
|
|
|
--*)
|
|
|
|
echo "configure: WARNING: unrecognized option: '${option}'" 1>&2 ;;
|
|
|
|
*=* | *-*-*) ;;
|
2025-02-17 18:33:31 +01:00
|
|
|
*)
|
2025-02-17 20:27:34 +01:00
|
|
|
echo "configure: unrecognized option: '${option}'" 1>&2
|
|
|
|
echo "Try 'configure --help' for more information." 1>&2
|
2025-02-17 18:33:31 +01:00
|
|
|
exit 1 ;;
|
|
|
|
esac
|
2025-02-17 20:24:33 +01:00
|
|
|
|
2025-02-17 20:54:18 +01:00
|
|
|
# Check whether the option took a separate argument
|
2025-02-17 20:24:33 +01:00
|
|
|
if [ "${arg2}" = yes ] ; then
|
|
|
|
if [ $# != 0 ] ; then args="${args} \"$1\"" ; shift
|
2025-02-17 20:27:34 +01:00
|
|
|
else echo "configure: Missing argument to '${option}'" 1>&2
|
2025-02-17 20:24:33 +01:00
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
fi
|
2025-02-17 18:33:31 +01:00
|
|
|
done
|
|
|
|
|
2025-02-17 20:53:19 +01:00
|
|
|
# Find the source code, if location was not specified.
|
2025-02-17 18:33:31 +01:00
|
|
|
srcdirtext=
|
|
|
|
if [ -z "${srcdir}" ] ; then
|
|
|
|
srcdirtext="or . or .." ; srcdir=.
|
2025-02-17 20:12:24 +01:00
|
|
|
if [ ! -r "${srcdir}/${srctrigger}" ] ; then srcdir=.. ; fi
|
|
|
|
if [ ! -r "${srcdir}/${srctrigger}" ] ; then
|
2025-02-17 18:33:31 +01:00
|
|
|
## the sed command below emulates the dirname command
|
2025-02-17 20:49:14 +01:00
|
|
|
srcdir=`echo "$0" | sed -e 's,[^/]*$,,;s,/$,,;s,^$,.,'`
|
2025-02-17 18:33:31 +01:00
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
2025-02-17 20:12:24 +01:00
|
|
|
if [ ! -r "${srcdir}/${srctrigger}" ] ; then
|
2025-02-17 20:53:19 +01:00
|
|
|
echo "configure: Can't find source code in ${srcdir} ${srcdirtext}" 1>&2
|
2025-02-17 20:27:34 +01:00
|
|
|
echo "configure: (At least ${srctrigger} is missing)." 1>&2
|
2025-02-17 18:33:31 +01:00
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
|
|
|
# Set srcdir to . if that's what it is.
|
2025-02-17 20:12:24 +01:00
|
|
|
if [ "`pwd`" = "`cd "${srcdir}" ; pwd`" ] ; then srcdir=. ; fi
|
2025-02-17 18:33:31 +01:00
|
|
|
|
|
|
|
echo
|
|
|
|
if [ -z "${no_create}" ] ; then
|
|
|
|
echo "creating config.status"
|
|
|
|
rm -f config.status
|
|
|
|
cat > config.status << EOF
|
|
|
|
#! /bin/sh
|
2025-02-17 20:42:17 +01:00
|
|
|
# This file was generated automatically by configure. Don't edit.
|
2025-02-17 18:33:31 +01:00
|
|
|
# Run this file to recreate the current configuration.
|
|
|
|
#
|
|
|
|
# This script is free software: you have unlimited permission
|
2025-02-17 20:49:14 +01:00
|
|
|
# to copy, distribute, and modify it.
|
2025-02-17 18:33:31 +01:00
|
|
|
|
2025-02-17 20:53:19 +01:00
|
|
|
exec /bin/sh "$0" ${args} --no-create
|
2025-02-17 18:33:31 +01:00
|
|
|
EOF
|
|
|
|
chmod +x config.status
|
|
|
|
fi
|
|
|
|
|
|
|
|
echo "creating Makefile"
|
|
|
|
echo "VPATH = ${srcdir}"
|
|
|
|
echo "prefix = ${prefix}"
|
|
|
|
echo "exec_prefix = ${exec_prefix}"
|
|
|
|
echo "bindir = ${bindir}"
|
2025-02-17 20:05:47 +01:00
|
|
|
echo "datarootdir = ${datarootdir}"
|
2025-02-17 18:33:31 +01:00
|
|
|
echo "infodir = ${infodir}"
|
|
|
|
echo "mandir = ${mandir}"
|
|
|
|
echo "CC = ${CC}"
|
|
|
|
echo "CPPFLAGS = ${CPPFLAGS}"
|
|
|
|
echo "CFLAGS = ${CFLAGS}"
|
|
|
|
echo "LDFLAGS = ${LDFLAGS}"
|
2025-02-17 20:53:19 +01:00
|
|
|
echo "MAKEINFO = ${MAKEINFO}"
|
2025-02-17 18:33:31 +01:00
|
|
|
rm -f Makefile
|
|
|
|
cat > Makefile << EOF
|
2025-02-17 20:27:34 +01:00
|
|
|
# Makefile for Clzip - LZMA lossless data compressor
|
2025-02-17 20:53:44 +01:00
|
|
|
# Copyright (C) 2010-2024 Antonio Diaz Diaz.
|
2025-02-17 20:42:17 +01:00
|
|
|
# This file was generated automatically by configure. Don't edit.
|
2025-02-17 18:33:31 +01:00
|
|
|
#
|
|
|
|
# This Makefile is free software: you have unlimited permission
|
2025-02-17 20:49:14 +01:00
|
|
|
# to copy, distribute, and modify it.
|
2025-02-17 18:33:31 +01:00
|
|
|
|
|
|
|
pkgname = ${pkgname}
|
|
|
|
pkgversion = ${pkgversion}
|
|
|
|
progname = ${progname}
|
|
|
|
VPATH = ${srcdir}
|
|
|
|
prefix = ${prefix}
|
|
|
|
exec_prefix = ${exec_prefix}
|
|
|
|
bindir = ${bindir}
|
2025-02-17 20:05:47 +01:00
|
|
|
datarootdir = ${datarootdir}
|
2025-02-17 18:33:31 +01:00
|
|
|
infodir = ${infodir}
|
|
|
|
mandir = ${mandir}
|
|
|
|
CC = ${CC}
|
|
|
|
CPPFLAGS = ${CPPFLAGS}
|
|
|
|
CFLAGS = ${CFLAGS}
|
|
|
|
LDFLAGS = ${LDFLAGS}
|
2025-02-17 20:53:19 +01:00
|
|
|
MAKEINFO = ${MAKEINFO}
|
2025-02-17 18:33:31 +01:00
|
|
|
EOF
|
2025-02-17 20:12:24 +01:00
|
|
|
cat "${srcdir}/Makefile.in" >> Makefile
|
2025-02-17 18:33:31 +01:00
|
|
|
|
|
|
|
echo "OK. Now you can run make."
|