#!/bin/bash # # --- 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 - 2006 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 https://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 # # * misc/*/config-*.in # * misc/*/config.in # * package/*/config-*.in # * package/*/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__* # Targets: ROCKCFG_TRG__* # Packages: ROCKCFG_PKG__* # # Config-Internal Variables: # # Core: CFGTEMP_* # Archs: CFGTEMP_ARCH__* # Targets: CFGTEMP_TRG__* # Packages: CFGTEMP_PKG__* # # Config Presets: ROCKCFGSET_* # unset ${!CFGTEMP_*} bprof rockconfig_preconfig start if [ ! -e "$swpdir/preconfig.in.tmp" ] ; then grep -h -v "^#" architecture/*/preconfig.in \ misc/*/preconfig.in \ target/*/preconfig.in \ package/*/*/preconfig.in \ 2> /dev/null > "$swpdir/preconfig.in.tmp" fi include "$swpdir/preconfig.in.tmp" bprof rockconfig_preconfig stop bprof rockconfig_arch start comment_id '- Architecture, CPU and Optimization' COMMENT_ARCHCPUOPT block_begin 7 choice ROCKCFG_ARCH $arch $CFGTEMP_ARCHLIST ROCKCFG_ID="$rockver-$ROCKCFG_ARCH" if [ -f architecture/$ROCKCFG_ARCH/config.in ] then . architecture/$ROCKCFG_ARCH/config.in ; fi expert_begin 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 optimisation (for debugging binaries)' \ test 'Only optimize toolchain (for fast builds)' expert_end 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.' fi 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" fi fi block_end bprof rockconfig_arch stop bprof rockconfig_target start comment ' ' comment_id '- Target Distribution' COMMENT_TARGET block_begin 7 choice ROCKCFG_TARGET crystal $CFGTEMP_TARGETLIST include target/$ROCKCFG_TARGET/config.in text 'Linguas (translations)' ROCKCFG_LINGUAS 'de es fr it ru' bool 'Show expert-only and experimental options' ROCKCFG_EXPERT 0 bool 'Abbreviate ROCK Config ID with checksum' ROCKCFG_IDCKSUM 0 block_end bprof rockconfig_target stop bprof rockconfig_buildsys start comment ' ' comment_id '- Build System Configuration' COMMENT_BUILD_SYS_CONF block_begin 3 bool 'Run Paranoia Checks in Build-Target and Build-Pkg' \ ROCKCFG_PARANOIA_CHECK 1 bool 'Make rebuild stage (stage 9)' ROCKCFG_DO_REBUILD_STAGE 1 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 expert_begin bool 'Automatic documentation creation' ROCKCFG_CREATE_DOCS 1 bool 'Create cache files after packages have been built' \ ROCKCFG_CREATE_CACHE 1 if [ $ROCKCFG_CROSSBUILD != 1 ]; then bool 'Run a check/test for packages with support' ROCKCFG_DO_CHECK 0 fi comment ' ' comment_id '- Flist detection technique' COMMENT_FLIST 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 expert_end block_end bprof rockconfig_buildsys stop bprof rockconfig_noexpert start include "misc/*/noexpertconfig.in" bprof rockconfig_noexpert stop bprof rockconfig_expert start expert_begin comment ' ' comment '- Binary package format' block_begin 3 bool 'Create Checksums for installed files' ROCKCFG_CREATE_CKSUM 1 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 '- Compiler Options' block_begin 3 bool 'Create binaries with debug symbols' ROCKCFG_DEBUG 0 bool 'Create statically linked binaries' ROCKCFG_STATIC 0 bool 'Enable C compiler multilib support' ROCKCFG_MULTILIB 0 bool 'Disable exceptions and rtti in C++' ROCKCFG_LIMITCXX 0 bool 'Use automatically precompiled C++ headers (EXPERIMENTAL)' ROCKCFG_AUTOPCH 0 bool 'Disable National Language Support' ROCKCFG_DISABLE_NLS 0 if [ "$ROCKCFG_DISABLE_NLS" = 1 ] ; then pkgremove gettext fi text 'Additional compiler flags' ROCKCFG_C_FLAGS "" block_end comment ' ' comment '- Additional GNU Configure Options' block_begin 3 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 if [ ! -e "$swpdir/config.in.tmp" ] ; then ls package/*/*/config{,-*}.in ./misc/*/config{,-*}.in | \ LC_ALL=C sort -k4,4 -t"/" | \ xargs grep -h -v "^#" 2> /dev/null > "$swpdir/config.in.tmp" fi include "$swpdir/config.in.tmp" expert_end bprof rockconfig_expert stop bprof rockconfig_postconfig start [ "$ROCKCFG_CROSSBUILD" = 1 ] && ROCKCFG_ID="$ROCKCFG_ID-cross" [ "$ROCKCFG_PSEUDONATIVE" = 1 ] && ROCKCFG_ID="$ROCKCFG_ID-pseudonative" ROCKCFG_ID="$ROCKCFG_ID-$ROCKCFG_TARGET" [ $ROCKCFG_EXPERT == 1 ] && ROCKCFG_ID="$ROCKCFG_ID-expert" [ "$ROCKCFG_IDCKSUM" = 1 ] && \ ROCKCFG_ID="`echo $ROCKCFG_ID | cksum | cut -f1 -d' '`" const ROCKCFG_SHORTID "$ROCKCFG_ID" ROCKCFG_ID="$config-$ROCKCFG_ID" const ROCKCFG_ID "$ROCKCFG_ID" if [ ! -e "$swpdir/postconfig.in.tmp" ] ; then { ls misc/*/postconfig{,-*}.in 2>/dev/null \ | LC_ALL=C sort -k3,3 -t"/" ls package/*/*/postconfig.in } | xargs grep -h -v "^#" 2> /dev/null > "$swpdir/postconfig.in.tmp" fi include "$swpdir/postconfig.in.tmp" include architecture/$ROCKCFG_ARCH/postconfig.in include target/$ROCKCFG_TARGET/postconfig.in filterscript="" if [ "$ROCKCFG_CROSSBUILD" = 1 ] ; then var_append filterscript ' ' 's,^\(. ...\)[^ ]*,\1-------, ;' var_append filterscript ' ' 's,^\(. .\)?,\1-, ;' if [ $ROCKCFG_CROSS_TESTALL = 1 ]; then var_append filterscript ' ' 's,^\(. ..\)?,\12, ;' else var_append filterscript ' ' 's,^\(. ..\)?,\1-, ;' fi var_append filterscript ' ' 's,^\(. .\)X,\11, ; s,^\(. \)X,\1-, ; s,^\(. ..\)X,\12, ;' else var_append filterscript ' ' 's,^\(. .\)[?X],\1-, ; s,^\(. ..\)[?X],\1-, ;' if [ "$ROCKCFG_PSEUDONATIVE" = 1 ] ; then var_append filterscript ' ' 's,^\(. \)X,\10, ;' else var_append filterscript ' ' 's,^\(. \)X,\1-, ;' fi fi if [ "$ROCKCFG_MULTILIB" = 1 ] ; then var_append filterscript ' ' '/ MULTILIB / { h ; s,\(\( [^ ]*\)\{3\}\) \([^ ]*\),\1 \3=\3-32bit, ; G } ;' fi if [ $ROCKCFG_DO_REBUILD_STAGE != 1 ]; then var_append filterscript ' ' 's,^\([XO] [^ ]*\)9 ,\1- , ;' fi var_append filterscript ' ' '/^[XO] --* / d ;' pkgfilter sed -e "$filterscript" bprof rockconfig_postconfig stop