mirror of the now-defunct rocklinux.org
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.
 
 
 
 
 
 

415 lines
14 KiB

#
# --- ROCK-COPYRIGHT-NOTE-BEGIN ---
#
# This copyright note is auto-generated by ./scripts/Create-CopyPatch.
# Please add additional copyright information _after_ the line containing
# the ROCK-COPYRIGHT-NOTE-END tag. Otherwise it might get removed by
# the ./scripts/Create-CopyPatch script. Do not edit this copyright text!
#
# ROCK Linux: rock-src/scripts/config.in
# ROCK Linux is Copyright (C) 1998 - 2005 Clifford Wolf
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version. A copy of the GNU General Public
# License can be found at Documentation/COPYING.
#
# Many people helped and are helping developing ROCK Linux. Please
# have a look at http://www.rocklinux.org/ and the Documentation/TEAM
# file for details.
#
# --- ROCK-COPYRIGHT-NOTE-END ---
#
# Main config script
#
# Execution of sub-scripts:
#
# - architecture/*/preconfig.in
#
# * Selecting Architecture
# * architecture/$ROCKCFG_ARCH/config.in
#
# - misc/*/preconfig.in
# - target/*/preconfig.in
# - package/*/*/preconfig.in
#
# * Selecting Target
# * target/$ROCKCFG_TARGET/config.in
#
# * misc/*/noexpertconfig.in
#
# * {package/*,misc}/*/config-*.in
# * {package/*,misc}/*/config.in
# * Various common build options
#
# - package/*/*/postconfig.in
# - misc/*/postconfig.in
# - architecture/$ROCKCFG_ARCH/postconfig.in
# - target/$ROCKCFG_TARGET/postconfig.in
#
# Only procedures marked with '*' might interact with the user.
#
# Naming-scheme for extening config variables:
#
# Core: ROCKCFG_*
# Archs: ROCKCFG_ARCH_<Arch-Name>_*
# Targets: ROCKCFG_TRG_<Target-Name>_*
# Packages: ROCKCFG_PKG_<Pkg-Name>_*
#
# Config-Internal Variables:
#
# Core: CFGTEMP_*
# Archs: CFGTEMP_ARCH_<Arch-Name>_*
# Targets: CFGTEMP_TRG_<Target-Name>_*
# Packages: CFGTEMP_PKG_<Pkg-Name>_*
#
# Config Presets: ROCKCFGSET_*
#
CFGTEMP_ARCHLIST=""
CFGTEMP_TARGETLIST=""
%include architecture/*/preconfig.in
comment_id '- Architecture, CPU and Optimization' COMMENT_ARCHCPUOPT
block_begin 7
choice ROCKCFG_ARCH $ROCKCFG_ARCH $CFGTEMP_ARCHLIST
ROCKCFG_ID="$ROCKCFG_ID-$ROCKCFG_ARCH"
if [ -f architecture/$ROCKCFG_ARCH/config.in ]
then . architecture/$ROCKCFG_ARCH/config.in ; fi
bool 'This is a cross-build between architectures' ROCKCFG_CROSSBUILD 0
if [ "$ROCKCFG_CROSSBUILD" = 1 ] ; then
block_begin
bool 'Test-build the packages which are not known to cross build' ROCKCFG_CROSS_TESTALL 0
if [ $ROCKCFG_CROSS_TESTALL = 1 ]; then
comment '-- WARNING: Test-building packages which are not known to cross build'
comment '-- might cause damage on your build system if it is not read-only. So'
comment '-- only run this if your /{bin,lib,usr,..} is somehow write-protected.'
pkgfilter sed -e 's,^\(. ..\)[^ ]*,\1--------,; s,^\(. .\)[1X?],\11,; s,^\(. \)X,\1-,;'
else
pkgfilter sed -e 's,^\(. ..\)[^ ]*,\1--------,; s,^\(. .\)[1X],\11,; s,^\(. .\)?,\1-,; s,^\(. \)X,\1-,;'
fi
ROCKCFG_ID="$ROCKCFG_ID-cross" ; ROCKCFGSET_USE_CROSSCC=1
const ROCKCFG_PSEUDONATIVE 0
block_end
else
bool 'This is a pseudo-native cross-build' ROCKCFG_PSEUDONATIVE 0
if [ "$ROCKCFG_PSEUDONATIVE" = 1 ] ; then
comment '-- WARNING: Doing pseudo native builds is a tricky thing.'
comment '-- Better write the documentation first... ;-)'
text 'IP of native host for command forwarding' ROCKCFG_PSEUDONATIVE_NATIVEHOST ''
text 'NFSROOT to be mounted on native host' ROCKCFG_PSEUDONATIVE_NFSROOT "$HOSTNAME:$PWD"
pkgfilter sed -e 's,^\(. .\)[?X],\1-,; s,^\(. \)X,\10,;'
ROCKCFG_ID="$ROCKCFG_ID-pseudonative" ; ROCKCFGSET_USE_CROSSCC=1
else
pkgfilter sed -e 's,^\(. .\)[?X],\1-,; s,^\(. \)X,\1-,;'
fi
fi
block_end
%include misc/*/preconfig.in
%include target/*/preconfig.in
%include package/*/*/preconfig.in
comment ' '
comment_id '- Target Distribution' COMMENT_TARGET
block_begin 7
choice ROCKCFG_TARGET generic $CFGTEMP_TARGETLIST
ROCKCFG_ID="$ROCKCFG_ID-$ROCKCFG_TARGET"
if [ -f target/$ROCKCFG_TARGET/config.in ]
then . target/$ROCKCFG_TARGET/config.in ; fi
block_end
echo "## BUILDENV_SETTINGS_BEGIN" >> config/$config.$swpid/config
comment ' '
comment_id '- Build System Configuration' COMMENT_BUILD_SYS_CONF
block_begin 3
bool 'Make a parallel (cluster) build' ROCKCFG_PARALLEL 0
if [ "$ROCKCFG_PARALLEL" = 1 ] ; then
block_begin 10
ROCKCFG_PARALLEL_MAX="`echo $ROCKCFG_PARALLEL_MAX |
sed 's,[^0-9],,g'`"
text 'Maximum size of job queue' ROCKCFG_PARALLEL_MAX 10
text 'Command for adding jobs' ROCKCFG_PARALLEL_ADDJOB ''
block_end
else
bool 'Abort when a package-build fails' \
ROCKCFG_ABORT_ON_ERROR 0
fi
bool 'Retry building broken packages' ROCKCFG_RETRY_BROKEN 0
bool 'Disable packages which are marked as broken' \
ROCKCFG_DISABLE_BROKEN 0
bool 'Do not try building packages if deps failed' \
ROCKCFG_NOBROKENDEPS 0
bool 'Always clean up src dirs (even on pkg fail)' \
ROCKCFG_ALWAYS_CLEAN 0
bool 'Create debug information (xtrace) for builds' ROCKCFG_XTRACE 0
bool 'Use tmpfs for building packages' ROCKCFG_SRC_TMPFS 0
if [ "$ROCKCFG_SRC_TMPFS" = 1 ] ; then
block_begin
comment '! WARNING: This feature can hang your system, if'
comment '! you do not have enough virtual memory!'
text 'tmpfs mount options' ROCKCFG_SRC_TMPFS_OPT \
'size=1024M,nr_inodes=100k'
bool 'Write tmpfs log to var/adm/rock-debug/tmpfslog.txt' \
ROCKCFG_SRC_TMPFS_LOG 0
block_end
fi
bool 'Send emails on special events' ROCKCFG_SENDMAIL 0
if [ "$ROCKCFG_SENDMAIL" = 1 ] ; then
block_begin
text 'Sendmail program' ROCKCFG_SENDMAIL_BIN 'sendmail'
text 'Recipient address' ROCKCFG_SENDMAIL_TO 'root'
block_end
fi
block_end
%include misc/*/noexpertconfig.in
echo "## BUILDENV_SETTINGS_END" >> config/$config.$swpid/config
comment ' '
block_begin 3
bool 'Show expert-only and experimental options' ROCKCFG_EXPERT 0
block_end
if [ $ROCKCFG_EXPERT = 1 ] ; then ROCKCFG_ID="$ROCKCFG_ID-expert"
else ROCKCFG_ID="$ROCKCFG_ID-noexpert" ; fi
expert_begin
comment ' '
comment '- Binary package format'
block_begin 3
bool 'Create *.tar.bz2 binary packages' ROCKCFG_CREATE_TARBZ2 0
bool 'Create *.gem binary packages' ROCKCFG_CREATE_GEM 1
bool 'Append version number to package files' ROCKCFG_PKGFILE_VER 1
block_end
comment ' '
comment '- Package splitting'
block_begin 3
bool 'Create extra *:doc packages' ROCKCFG_SPLIT_DOC 1
bool 'Create extra *:dev packages' ROCKCFG_SPLIT_DEV 1
block_end
comment ' '
comment '- Additional Package Selection'
block_begin 3
choice ROCKCFG_PKGSEL_TPL none none 'No package preselection template' \
$( cd misc/pkgsel; grep -H "^# TITLE: " *.in | tr ' ' '_' | sed 's,\.in:#_TITLE:_, ,' )
if [ -f misc/pkgsel/${ROCKCFG_PKGSEL_TPL}.in ]; then
. misc/pkgsel/${ROCKCFG_PKGSEL_TPL}.in
fi
bool 'Custom package selection' ROCKCFG_PKGSEL 0
if [ "$ROCKCFG_PKGSEL" = 1 ] ; then
menu_begin MENU_PKGSEL_RULES 'Edit package selection rules'
# Active error checking: explicitly show an annoying popup
filter=`printf "^[-xXoO][ \t]\+[a-zA-Z0-9_/*+.-]"`
if grep -lvq "$filter" config/$config.$swpid/pkgsel 2> /dev/null && \
./src/rockdialog.bin --title "Build Config" --yesno \
"Invalid line(s) in package rule set. Remove?" 5 50
then
grep "$filter" < config/$config.$swpid/pkgsel \
> config/$config.$swpid/pkgsel.new
mv config/$config.$swpid/pkgsel.new config/$config.$swpid/pkgsel
fi
unset filter
editfile ROCKCFG_PKGSEL_FILE config/$config.$swpid/pkgsel \
'Package selection rules'
# Create an awk program from the list of package selection rules stored in
# config/$config.$swpid/pkgsel which is applied to the list of packages stored in
# config/$config.$swpid/packages.
# Syntax for package selection rules is:
# <action> <patternlist>
# <action> is a single character: x or X enables the packages matching
# <patternlist>, o or O disables them, - omits them in the packages list.
# Any other character exits the awk program, resulting in an empty list.
# <patternlist> consists of one or more white-space separated <pattern>s.
# <pattern> consists of letters, numbers, and characters _ * + . = -
# <action> is performed on every line in the list matching all <pattern>s of a rule.
# If the first <pattern> of a rule is a !, <action> is performed on every line
# _not_ matching _any_ <pattern> of a rule.
# A <pattern> of the form <base-pkg>=<derived-pkg> denotes a pkgforked package;
# such a <pattern> will duplicate the line of the <base-pkg> and substitute its
# package name with the name of the pkgforked package, that is, the <pattern>.
echo "# created from 'pkgsel'" > config/$config.$swpid/pkgsel.awk
while read action patternlist ; do
case "$action" in
[xX])
action='$1="X"' ;;
[oO])
action='$1="O"' ;;
-)
action='next' ;;
*)
echo '{ exit; }'
continue ;;
esac
address="" ; first="(" ; others="&&"
while read pattern ; do
if [ -z "$address" ] && \
[ "$pattern" = "!" ] ; then
address="! " ; others="||"
else
pattern="$( echo "$pattern" | sed \
-e 's,[^a-zA-Z0-9_/\*+\.=-],,g' \
-e 's,[/\.\+],\\&,g' \
-e 's,\*,[^ ]*,g' )"
[ "$pattern" ] || continue
address="$address$first /[ =]$pattern[ =]/"
first=" $others"
fi
done < <( echo "$patternlist" | tr '\t ' '\n\n' )
echo "$address ) { $action; }"
done < config/$config.$swpid/pkgsel >> config/$config.$swpid/pkgsel.awk
echo '{ print; }' >> config/$config.$swpid/pkgsel.awk
pkgout
gawk -f config/$config.$swpid/pkgsel.awk < config/$config.$swpid/packages \
> config/$config.$swpid/packages.new 2> /dev/null
if [ -s config/$config.$swpid/packages.new ] ; then
mv config/$config.$swpid/packages.new config/$config.$swpid/packages
else
rm -f config/$config.$swpid/packages.new
comment '---- Syntax error(s) in rule set!'
fi
pkgin
menu_end
else
rm -f config/$config.$swpid/pkgsel
rm -f config/$config.$swpid/pkgsel.awk
fi
startprog ROCKCFG_SHOW_PKGLIST 'Show the current package list' \
"./src/rockdialog.bin --title 'ROCK Linux Config - Package List' \
--backtitle 'ROCK Linux $rockver Configuration' \
--textbox config/$config.$swpid/packages.txt \
$(( $lines - 4 )) $(( $columns - 5 ))"
block_end
comment ' '
%include $( ls {package/*,misc}/*/config{,-*}.in 2>/dev/null | sed 's,\(.*/\)\([^/]*/\)\([^/]*\),\3\2 \1\2\3,' | sort | cut -f2 -d' ' )
comment ' '
comment '- Additional GNU Configure Options'
block_begin 5
editfile ROCKCFG_CONFOPT_FILE config/$config.$swpid/confopt \
'GNU Configure Options'
if [ -f config/$config.$swpid/confopt ] ; then
const ROCKCFG_CONFIGURE_OPTS "`tr '\n' ' ' \
< config/$config.$swpid/confopt`"
else
const ROCKCFG_CONFIGURE_OPTS ""
fi
for option in $ROCKCFG_CONFIGURE_OPTS ; do
if [ "${option#--with-}" = "$option" -a \
"${option#--without-}" = "$option" ]
then
comment '---- Warning! The custom options may
break packages!'
break
fi
done
block_end
comment ' '
text 'Additional compiler flags' ROCKCFG_C_FLAGS ""
comment ' '
comment_id '- Flist detection technique' COMMENT_FLIST
block_begin 5
choice ROCKCFG_FLIST flwrapper \
flwrapper 'Use the flist wrapper library for flist creation' \
strace 'Use strace to get the file list' \
find 'Use find on timestamp-file for flist creation'
if [ "$ROCKCFG_FLIST" = strace ]; then
pkgenable strace
fi
block_end
comment ' '
comment '- Various Options'
block_begin 5
bool 'Build and use a (pseudo-)cross compiler' ROCKCFG_USE_CROSSCC 1
bool 'Make rebuild stage (stage 9)' ROCKCFG_DO_REBUILD_STAGE 1
if [ $ROCKCFG_CROSSBUILD != 1 ]; then
bool 'Run a check/test for packages with support' ROCKCFG_DO_CHECK 0
fi
if [ $ROCKCFG_USE_CROSSCC != 1 ]; then
pkgfilter sed 's,^\([XO] \)0,\1-,'
fi
if [ $ROCKCFG_DO_REBUILD_STAGE != 1 ]; then
pkgfilter sed 's,^\([XO] [^ ]*\)9 ,\1- ,'
fi
choice ROCKCFG_OPT size \
smart 'Smart optimisation using a profile database' \
bizarre 'Inverse smart optimisation (this is bizarre)' \
speed 'Hard optimise for speed (often pretty slow)' \
size 'Hard optimise for size (recommended)' \
lazy 'Lazy optimisiation (for debugging binaries)' \
test 'Only optimize toolchain (for fast builds)'
bool 'Create binaries with debug symbols' ROCKCFG_DEBUG 0
bool 'Create statically linked binaries' ROCKCFG_STATIC 0
bool 'Disable exceptions and rtti in C++' ROCKCFG_LIMITCXX 0
bool 'Enable C compiler multilib support' ROCKCFG_MULTILIB 0
bool 'Disable National Language Support' ROCKCFG_DISABLE_NLS 0
if [ "$ROCKCFG_DISABLE_NLS" = 1 ] ; then
pkgremove gettext
fi
bool 'Automatic documentation creation' ROCKCFG_CREATE_DOCS 1
bool 'Create cache files after packages have been built' \
ROCKCFG_CREATE_CACHE 1
bool 'Run Paranoia Checks in Build-Target and Build-Pkg' \
ROCKCFG_PARANOIA_CHECK 1
bool 'Abbreviate ROCK Config ID with checksum' ROCKCFG_IDCKSUM 0
block_end
expert_end
%include package/*/*/postconfig.in
%include misc/*/postconfig.in
if [ -f architecture/$ROCKCFG_ARCH/postconfig.in ]
then . architecture/$ROCKCFG_ARCH/postconfig.in; fi
if [ -f target/$ROCKCFG_TARGET/postconfig.in ]
then . target/$ROCKCFG_TARGET/postconfig.in; fi
if [ "$ROCKCFG_CROSSBUILD" = 1 ] ; then
pkgfilter sed -e 's,^\(. ..\)[^ ]*,\1--------,;'
fi
pkgfilter sed '/^[XO] --* / d;'
[ $ROCKCFG_EXPERT = 1 ] ||
ROCKCFG_ID="`echo $ROCKCFG_ID | sed 's,-noexpert.*,,'`"
[ "$ROCKCFG_IDCKSUM" = 1 ] &&
ROCKCFG_ID="`echo $ROCKCFG_ID | cksum | cut -f1 -d' '`"
const ROCKCFG_SHORTID "$ROCKCFG_ID"
ROCKCFG_ID="$config-$ROCKCFG_ID"