You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

396 lines
12 KiB

#!/bin/sh
. package/info
usage () {
cat <<EOF
Usage: $0 [OPTION]... [TARGET]
Defaults for the options are specified in brackets.
Installation directories:
--prefix=PREFIX main installation prefix [/]
--exec-prefix=EPREFIX installation prefix for executable files [PREFIX]
Fine tuning of the installation directories:
--bindir=BINDIR user executables [EPREFIX/bin]
--libdir=LIBDIR static library files [PREFIX/lib/$package_macro_dir]
--sysconfdir=SYSDIR global configuration files [/etc]
--datarootdir=DATAROOTDIR read-only architecture-independent data root [PREFIX/share]
--mandir=DIR man documentation [$datarootdir/man]
--livedir=DIR 66 default live directory [/run/66]
--with-system-service=DIR 66 service intallation directory [DATAROOTDIR/$package_macro_dir/service]
--with-system-module=DIR 66 module intallation directory [DATAROOTDIR/$package_macro_dir/module]
--with-system-script=DIR 66 script installation directory of scripts [DATAROOTDIR/$package_macro_dir/script]
--with-sysadmin-service-conf=DIR 66 sysadmin service configuration file directory [SYSDIR/$package_macro_dir/conf]
--with-skeleton=DIR 66 skeleton files directory installation [SYSDIR/$package_macro_dir]
Fine tunning of boot configuration:
--HOSTNAME=VALUE hostname of the system [obarunS6]
--HARDWARECLOCK=VALUE set the hardware clock [UTC]
--TZ=VALUE set timezone [GMT]
--SETUPCONSOLE=BOOLEAN configure the console [!yes]
--TTY=VALUE number of tty to start. Maximum is 11. 0 for no tty at all [!2]
--LOCALE=BOOLEAN Setup locale from /etc/locale.conf or XDG_HOME/locale.conf
--KEYMAP=VALUE set the console keymap [!us]
--FONT=VALUE set the console font [!lat9w-16]
--FONT_MAP=VALUE set the console map []
--FONT_UNIMAP=VALUE set the console unimap []
--UDEV=BOOLEAN use udev [!yes]
--SYSCTL=BOOLEAN configure kernel runtime with sysctl [!yes]
--SYSUSER=BOOLEAN Run sysusers on boot
--FORCECHCK=BOOLEAN force a check of the filesystem [!no]
--LOCAL=BOOLEAN use rc.local scripts [!yes]
--CONTAINER=BOOLEAN boot inside a container [!no]
--TMPFILE=BOOLEAN use tmpfiles.d files [!yes]
--MODULE_KERNEL=BOOLEAN load modules kernel [!yes]
--MODULE_SYSTEM=BOOLEAN load modules from modules.d files [!yes]
--RANDOMSEED=BOOLEAN set random seed [!yes]
--FSTAB=BOOLEAN mount devices from fstab [!yes]
--SWAP=BOOLEAN mount swap [!no]
--LVM=BOOLEAN mount lvm devices [!no]
--DMRAID=BOOLEAN mount dmraid devices [!no]
--BTRFS=BOOLEAN mount btrfs devices [!no]
--ZFS=BOOLEAN mount zfs devices [!no]
--ZFS_IMPORT=VALUE use scan or zpoolcache method for zfs pools importation [!zpoolcache]
--CRYPTTAB=BOOLEAN use crypttab by default [!no]
--FIREWALL=VALUE use iptables|ip6tables|nftables|ebtables|arptables []
--CGROUPS=BOOLEAN mount cgroups [!yes]
--MNT_PROC=BOOLEAN mount /proc [!yes]
--MNT_SYS=BOOLEAN mount /sys [!yes]
--MNT_DEV=BOOLEAN mount /dev [!yes]
--MNT_RUN=BOOLEAN mount /run [!yes]
--MNT_TMP=BOOLEAN mount /tmp [!yes]
--MNT_PTS=BOOLEAN mount /dev/pts [!yes]
--MNT_SHM=BOOLEAN mount /dev/shm [!yes]
--MNT_NETFS=BOOLEAN mount no-network filesystems [!yes]
--POPULATE_SYS=BOOLEAN populate sys directory [!yes]
--POPULATE_DEV=BOOLEAN populate dev directory [!yes]
--POPULATE_RUN=BOOLEAN populate run directory [!yes]
--POPULATE_TMP=BOOLEAN populate tmp directory [!yes]
Use yes or no with lowercase character to set BOOLEAN values.
Empty value is a commented one and not used at all.
An exclamation mark '!' at the begin of the value unexport the variable
for the environment after the use. This is avoid to poluate the environment
with tempory variables. You need to single-quote the options as
follow:
./configure --KEYMAP='!us'
EOF
exit 0
}
# Helper functions
# If your system does not have printf, you can comment this, but it is
# generally not a good idea to use echo.
# See http://www.etalabs.net/sh_tricks.html
echo () {
IFS=" "
printf %s\\n "$*"
}
quote () {
tr '\n' ' ' <<EOF | grep '^[-[:alnum:]_=,./:]* $' >/dev/null 2>&1 && { echo "$1" ; return 0 ; }
$1
EOF
echo "$1" | sed -e "s/'/'\\\\''/g" -e "1s/^/'/" -e "\$s/\$/'/" -e "s#^'\([-[:alnum:]_,./:]*\)=\(.*\)\$#\1='\2#" -e "s|\*/|* /|g"
}
fail () {
echo "$*"
exit 1
}
fnmatch () {
eval "case \"\$2\" in $1) return 0 ;; *) return 1 ;; esac"
}
cmdexists () {
type "$1" >/dev/null 2>&1
}
stripdir () {
while eval "fnmatch '*/' \"\${$1}\"" ; do
eval "$1=\${$1%/}"
done
}
testval () {
if test -z ${1}; then
return 0 ;
else
return 1 ;
fi
}
# Actual script
prefix=
exec_prefix='$prefix'
bindir='$exec_prefix/bin'
libdir='$prefix/lib/$package_macro_dir'
sysconfdir='/etc'
datarootdir='$prefix/share'
mandir='$datarootdir/man'
livedir='/run/66'
service_directory='$datarootdir/$package_macro_dir/service'
module_directory='$datarootdir/$package_macro_dir/module'
script_directory='$datarootdir/$package_macro_dir/script'
skel_directory='$sysconfdir/$package_macro_dir'
adm_conf='$sysconfdir/$package_macro_dir/conf'
HOSTNAME='obarunS6'
HARDWARECLOCK='UTC'
TZ='GMT'
SETUPCONSOLE='!yes'
TTY='!2'
LOCALE='!yes'
KEYMAP='!us'
FONT='!lat9w-16'
FONT_MAP=
FONT_UNIMAP=
UDEV='!yes'
SYSCTL='!yes'
SYSUSER='!yes'
FORCECHCK='!no'
LOCAL='!yes'
CONTAINER='!no'
TMPFILE='!yes'
MODULE_KERNEL='!yes'
MODULE_SYSTEM='!yes'
RANDOMSEED='!yes'
FSTAB='!yes'
SWAP='!no'
LVM='!no'
DMRAID='!no'
BTRFS='!no'
ZFS='!no'
ZFS_IMPORT='!zpoolcache'
CRYPTTAB='!no'
FIREWALL=
CGROUPS='!yes'
MNT_PROC='!yes'
MNT_SYS='!yes'
MNT_DEV='!yes'
MNT_RUN='!yes'
MNT_TMP='!yes'
MNT_PTS='!yes'
MNT_SHM='!yes'
MNT_NETFS='!yes'
POPULATE_SYS='!yes'
POPULATE_DEV='!yes'
POPULATE_RUN='!yes'
POPULATE_TMP='!yes'
for arg ; do
case "$arg" in
--help) usage ;;
--prefix=*) prefix=${arg#*=} ;;
--exec-prefix=*) exec_prefix=${arg#*=} ;;
--bindir=*) bindir=${arg#*=} ;;
--libdir=*) libdir=${arg#*=} ;;
--sysconfdir=*) sysconfdir=${arg#*=} ;;
--datarootdir=*) datarootdir=${arg#*=} ;;
--mandir=*) mandir=${arg#*=} ;;
--livedir=*) livedir=${arg#*=} ;;
--with-system-service=*) service_directory=${arg#*=} ;;
--with-system-module=*) module_directory=${arg#*=} ;;
--with-system-script=*) script_directory=${arg#*=} ;;
--with-sysadmin-service-conf=*) adm_conf=${arg#*=} ;;
--with-skeleton=*) skel_directory=${arg#*=} ;;
--HOSTNAME=*) HOSTNAME=${arg#*=} ;;
--HARDWARECLOCK=*) HARDWARECLOCK=${arg#*=} ;;
--TZ=*) TZ=${arg#*=} ;;
--SETUPCONSOLE=*) SETUPCONSOLE=${arg#*=} ;;
--TTY=*) TTY=${arg#*=} ;;
--LOCALE=*) LOCALE=${arg#*=} ;;
--KEYMAP=*) KEYMAP=${arg#*=} ;;
--FONT=*) FONT=${arg#*=} ;;
--FONT_MAP=*) FONT_MAP=${arg#*=} ;;
--FONT_UNIMAP=*) FONT_UNIMAP=${arg#*=} ;;
--SYSCTL=*) SYSCTL=${arg#*=} ;;
--SYSUSER=*) SYSUSERS=${arg#*=} ;;
--FORCECHCK=*) FORCECHCK=${arg#*=} ;;
--LOCAL=*) LOCAL=${arg#*=} ;;
--CONTAINER=*) CONTAINER=${arg#*=} ;;
--TMPFILE=*) TMPFILE=${arg#*=} ;;
--MODULE_KERNEL=*) MODULE_KERNEL=${arg#*=} ;;
--MODULE_SYSTEM=*) MODULE_SYSTEM=${arg#*=} ;;
--RANDOMSEED=*) RANDOMSEED=${arg#*=} ;;
--FSTAB=*) FSTAB=${arg#*=} ;;
--SWAP=*) SWAP=${arg#*=} ;;
--LVM=*) LVM=${arg#*=} ;;
--DMRAID=*) DMRAID=${arg#*=} ;;
--BTRFS=*) BTRFS=${arg#*=} ;;
--ZFS=*) ZFS=${arg#*=} ;;
--ZFS_IMPORT=*) ZFS_IMPORT=${arg#*=} ;;
--CRYPTTAB=*) CRYPTTAB=${arg#*=} ;;
--FIREWALL=*) FIREWALL=${arg#*=} ;;
--CGROUPS=*) CGROUPS=${arg#*=} ;;
--MNT_PROC=*) MNT_PROC=${arg#*=} ;;
--MNT_SYS=*) MNT_SYS=${arg#*=} ;;
--MNT_DEV=*) MNT_DEV=${arg#*=} ;;
--MNT_RUN=*) MNT_RUN=${arg#*=} ;;
--MNT_TMP=*) MNT_TMP=${arg#*=} ;;
--MNT_PTS=*) MNT_PTS=${arg#*=} ;;
--MNT_SHM=*) MNT_SHM=${arg#*=} ;;
--MNT_NETFS=*) MNT_NETFS=${arg#*=} ;;
--POPULATE_SYS=*) POPULATE_SYS=${arg#*=} ;;
--POPULATE_DEV=*) POPULATE_DEV=${arg#*=} ;;
--POPULATE_RUN=*) POPULATE_RUN=${arg#*=} ;;
--POPULATE_TMP=*) POPULATE_TMP=${arg#*=} ;;
-* ) echo "$0: unknown option $arg" ;;
*=*) ;;
*) target=$arg ;;
esac
done
# Add /usr in the default case
if test -z "$prefix" ; then
if test "$libdir" = '$prefix/lib/$package_macro_dir' ; then
libdir=/usr/lib/$package_macro_dir
fi
if test "$datarootdir" = '$prefix/share'; then
datarootdir=/usr/share
fi
fi
if test -z "$sysconfdir" ; then
if test "$sysconfdir" = '$sysconfdir' ; then
sysconfdir = '/etc'
fi
if test "$adm_conf" = '$sysconfdir/$package_macro_dir/conf' ; then
adm_conf = '$sysconfdir/$package_macro_dir/conf'
fi
if test "$skel_directory" = '$sysconfdir/$package_macro_dir' ; then
skel_directory = '$sysconfdir/$package_macro_dir'
fi
fi
# Expand installation directories
stripdir prefix
for i in exec_prefix bindir libdir sysconfdir datarootdir mandir livedir \
service_directory module_directory script_directory skel_directory adm_conf ; do
eval tmp=\${$i}
eval $i=$tmp
stripdir $i
done
stripdir sysconfdir
for i in adm_conf skel_directory; do
eval tmp=\${$i}
eval $i=$tmp
stripdir $i
done
stripdir datarootdir
for i in service_directory module_directory script_directory mandir; do
eval tmp=\${$i}
eval $i=$tmp
stripdir $i
done
for i in HOSTNAME HARDWARECLOCK TZ SETUPCONSOLE TTY LOCALE \
KEYMAP FONT FONT_MAP FONT_UNIMAP UDEV SYSCTL FORCECHCK LOCAL CONTAINER \
TMPFILE MODULE_KERNEL MODULE_SYSTEM RANDOMSEED \
FSTAB SWAP LVM DMRAID BTRFS ZFS ZFS_IMPORT \
CRYPTTAB FIREWALL SYSUSERS \
CGROUPS MNT_PROC MNT_SYS MNT_DEV MNT_RUN MNT_TMP \
MNT_PTS MNT_SHM MNT_NETFS POPULATE_SYS POPULATE_DEV POPULATE_RUN POPULATE_TMP ; do
eval tmp=\${$i}
if testval $tmp; then
eval $i='${i}=\"\\#${i}=\"'
else
eval $i='$i=$i=$tmp'
fi
done
# Get usable temp filenames
i=0
set -C
while : ; do
i=$(($i+1))
tmpc="./tmp-configure-$$-$PPID-$i.c"
tmpe="./tmp-configure-$$-$PPID-$i.tmp"
2>|/dev/null > "$tmpc" && break
2>|/dev/null > "$tmpe" && break
test "$i" -gt 50 && fail "$0: cannot create temporary files"
done
set +C
trap 'rm -f "$tmpc" "$tmpe"' EXIT ABRT INT QUIT TERM HUP
echo "creating config.mak..."
cmdline=$(quote "$0")
for i ; do cmdline="$cmdline $(quote "$i")" ; done
exec 3>&1 1>config.mak
cat << EOF
# This file was generated by:
# $cmdline
# Any changes made here will be lost if configure is re-run.
package := $package
version := $version
prefix := $prefix
exec_prefix := $exec_prefix
bindir := $bindir
libdir := $libdir
sysconfdir := $sysconfdir
datarootdir := $datarootdir
mandir := $mandir
livedir := $livedir
service_directory := $service_directory
module_directory := $module_directory
script_directory := $script_directory
adm_conf := $adm_conf
skel_directory := $skel_directory
package_macro_dir := $package_macro_dir
$HOSTNAME
$HARDWARECLOCK
$TZ
$SETUPCONSOLE
$TTY
$LOCALE
$KEYMAP
$FONT
$FONT_MAP
$FONT_UNIMAP
$UDEV
$SYSCTL
$SYSUSERS
$FORCECHCK
$LOCAL
$CONTAINER
$TMPFILE
$MODULE_KERNEL
$MODULE_SYSTEM
$RANDOMSEED
$FSTAB
$SWAP
$LVM
$DMRAID
$BTRFS
$ZFS
$ZFS_IMPORT
$CRYPTTAB
$FIREWALL
$CGROUPS
$MNT_PROC
$MNT_SYS
$MNT_DEV
$MNT_RUN
$MNT_TMP
$MNT_PTS
$MNT_SHM
$MNT_NETFS
$POPULATE_SYS
$POPULATE_DEV
$POPULATE_RUN
$POPULATE_TMP
EOF
exec 1>&3 3>&-
echo " ... done."