# --- T2-COPYRIGHT-NOTE-BEGIN --- # T2 SDE: scripts/config.in # Copyright (C) 2004 - 2024 The T2 SDE Project # Copyright (C) 1998 - 2003 ROCK Linux Project # # This Copyright note is generated by scripts/Create-CopyPatch, # more information can be found in the files COPYING and README. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License version 2. # --- T2-COPYRIGHT-NOTE-END --- # # Main config script # # Execution of sub-scripts: # # - architecture/*/preconfig.in # - kernel/*/preconfig.in # # - misc/*/preconfig.in # - target/*/preconfig.in # - package/*/*/preconfig.in # # * Selecting Target # * target/$SDECFG_TARGET/config.in # - target/$SDECFG_TARGET/inconfig.in # # * Selecting Architecture # * architecture/$SDECFG_ARCH/config.in # # * Selecting Kernel # * kernel/$SDECFG_KERNEL/config.in # # - target/$SDECFG_TARGET/pkgsel{,.sed,.awk,.in} # # * {package/*,misc}/*/config-n.in (n<500) # # * {package/*,misc}/*/config{,-n}.in (n>=500) # * Various common build options # # - package/*/*/postconfig.in # - misc/*/postconfig.in # - architecture/$SDECFG_ARCH/postconfig.in # - kernel/$SDECFG_KERNEL/postconfig.in # - target/$SDECFG_TARGET/postconfig.in # # Only procedures marked with '*' might interact with the user. # # Naming-scheme for extening config variables: # # Core: SDECFG_* # Archs: SDECFG_ARCH__* # Kernels: SDECFG_KERNEL__* # Targets: SDECFG_TRG__* # Packages: SDECFG_PKG__* # # Config-Internal Variables: # # Core: CFGTEMP_* # Archs: CFGTEMP_ARCH__* # Kernels: CFGTEMP_Kernel__* # Targets: CFGTEMP_TRG__* # Packages: CFGTEMP_PKG__* # # Config Presets: SDECFGSET_* # CFGTEMP_ARCHLIST="" CFGTEMP_KERNELLIST="" CFGTEMP_TARGETLIST="" CFGTEMP_IMAGELIST="" . $cfgtmpdir/misc-preconfig.in . $cfgtmpdir/target-preconfig.in . $cfgtmpdir/package-preconfig.in comment_id '- Target Distribution' COMMENT_TARGET block_begin 7 choice SDECFG_TARGET generic $CFGTEMP_TARGETLIST SDECFG_ID="$SDECFG_ID-$SDECFG_TARGET" # detect the target chain targetchain="$SDECFG_TARGET" x="$SDECFG_TARGET" while [ -f "target/$x/extends" ]; do x="$(< target/$x/extends)" targetchain="$targetchain $x" done # config.in it foreward order for target in $targetchain; do if [ -f target/$target/config.in ] then . target/$target/config.in; fi done for target in $(get_reverted $targetchain); do if [ -f target/$target/inconfig.in ] then . target/$target/inconfig.in; fi done if [ "$CFGTEMP_IMAGELIST" ]; then choice SDECFG_IMAGE install $CFGTEMP_IMAGELIST if [ -f target/share/$SDECFG_IMAGE/config.in ] then . target/share/$SDECFG_IMAGE/config.in; fi fi block_end . $cfgtmpdir/architecture-preconfig.in . $cfgtmpdir/kernel-preconfig.in comment ' ' comment_id '- Architecture, CPU and Optimization' COMMENT_ARCHCPUOPT block_begin 7 choice SDECFG_ARCH "$SDECFG_ARCH" $CFGTEMP_ARCHLIST SDECFG_ID="$SDECFG_ID-$SDECFG_ARCH" if [ -f architecture/$SDECFG_ARCH/config.in ] then . architecture/$SDECFG_ARCH/config.in; fi bool 'Enable software floating point' SDECFG_SOFTFLOAT 0 bool 'Enable Link Time Optimisations (LTO)' SDECFG_LTO 0 bool 'This is a cross-build between architectures' SDECFG_CROSSBUILD 0 if [ "$SDECFG_CROSSBUILD" = 1 ]; then # enable cross toolchain ? for stage 0 and 1 # enable all packages flagged CROSS for stage 2, # and wipe all other stage marks pkgfilter sed 's,^\(. \)?,\10, ; s,^\(. .\)?,\11, ; s,^\(. ..\)?,\12, ; / CROSS /s/^\(. .-\)./\12/ ; s,^\(. ...\)[^ ]*,\1-------, ; s,^X ----------,O ----------,' SDECFG_ID="$SDECFG_ID-cross" SDECFGSET_USE_CROSSCC=1 fi comment ' ' choice SDECFG_OPT smartly \ none 'Disable optimization (debugging fastest build)' \ debug 'Optimize debugging experience' \ lazy 'Lazy optimization (debugging and fast building)' \ size 'Optimise for size' \ speed 'Optimise for speed' \ fast 'Optimise for more speed' \ faster 'Optimise for even more speed' \ smartly 'Smartly optimization using a profile DB (Ox/O2)' \ smart 'Smart optimization using a profile DB (Ox/O2, C++ more)' \ smarter 'Smarter optimization using a profile DB (Ox/O3)' \ smartest 'Smartest optimization using a profile DB (Ox/Ofast)' choice SDECFG_DEBUG 0 \ 0 'Create binaries without debug symbols' \ 1 'Create binaries with built-in debug symbols' \ 2 'Create binaries with separate debug symbols' [ "$SDECFG_DEBUG" == 2 ] && text 'Path for storing debugging files' SDECFG_DEBUG_PATH "debug" bool 'Enable Position Independent Code (PIE)' SDECFG_PIE 1 bool 'Enable Stack Smashing Protector (SSP)' SDECFG_SSP 1 bool 'Initialize automatic variables (with zero)' SDECFG_AUTO_VAR_INIT 0 block_end comment ' ' comment_id '- Kernel, Operating System' COMMENT_KERNELOS block_begin 7 choice SDECFG_KERNEL "$SDECFG_KERNEL" $CFGTEMP_KERNELLIST SDECFG_ID="$SDECFG_ID-$SDECFG_KERNEL" if [ -f kernel/$SDECFG_KERNEL/config.in ] then . kernel/$SDECFG_KERNEL/config.in; fi block_end block_begin 7 # pkgsel in backward order for target in $(get_reverted $targetchain); do [ -f target/$target/pkgsel ] && pkgsel_parse target/$target/pkgsel [ -f target/$target/pkgsel.awk ] && pkgfilter gawk -f target/$target/pkgsel.awk [ -f target/$target/pkgsel.sed ] && pkgfilter sed -f target/$target/pkgsel.sed [ -f target/$target/pkgsel.in ] && . target/$target/pkgsel.in [ "$SDECFG_LICENSE_ISSUE" = 0 ] && pkgchecklicense done block_end if test -f config/$config/license-issue.ask; then comment ' ' comment_id '- Licensing issues' COMMENT_LICENSE block_begin 7 if [ "$SDECFG_LICENSE_ISSUE" != 1 ]; then comment ' This distribution may contain software that is not publicly' comment ' distributable. Please check the following to testify that you' comment ' are aware of this fact.' comment ' ' comment ' The following packages may contain such restrictive licenses:' for i in $(< config/$config/license-issue.ask); do comment " $i" done comment ' ' fi bool 'I have read and understood the licensing issues.' SDECFG_LICENSE_ISSUE 0 block_end fi comment ' ' comment_id '- Build System Configuration' COMMENT_BUILD_SYS_CONF block_begin 3 choice SDECFG_CONTINUE_ON_ERROR_AFTER 4 \ 0 'Continue on package error after stage 0 (toolchain)' \ 1 'Continue on package error after stage 1 (cross)' \ 2 'Continue on package error after stage 2' \ 3 'Continue on package error after stage 3' \ 4 'Continue on package error after stage 4' \ 5 'Continue on package error after stage 5' \ 6 'Continue on package error after stage 6' \ 7 'Continue on package error after stage 7' \ 8 'Continue on package error after stage 8' \ 9 'Always abort on package error' bool 'Retry building broken packages' SDECFG_RETRY_BROKEN 0 bool 'Do not try building packages if deps failed' \ SDECFG_NOBROKENDEPS 0 choice SDECFG_KEEP_SRC 2 \ 0 'Never keep src dirs' \ 1 'Always keep src dirs' \ 2 'Keep src dirs on build errors' \ 3 'Keep src dirs for packages from a list' \ 4 'Keep src dirs for packages from a list and on error' case "$SDECFG_KEEP_SRC" in 3|4) text 'Packages to keep the src dirs for' SDECFG_KEEP_SRC_LIST '' ;; esac bool 'Create debug information (xtrace) for builds' SDECFG_XTRACE 0 bool 'Use TmpFS for building packages' SDECFG_SRC_TMPFS 0 if [ "$SDECFG_SRC_TMPFS" = 1 ]; then block_begin comment 'WARNING: This may deadlock your system, if you overcommit memory!' text 'TmpFS mount options' SDECFG_SRC_TMPFS_OPT 'size=66%' text 'Max compressed package source size in MB for using TmpFS' \ SDECFG_SRC_TMPFS_MAX_SIZE 32 bool 'Do not unmount build-dir TmpFS on pkg build error' \ SDECFG_SRC_TMPFS_KEEP_ON_ERROR 1 block_end fi block_end # Apply custom package selection if [ "$SDECFG_PKGSEL" = 1 -a -f config/$config/pkgsel ]; then # Active error checking: explicitly show an annoying popup filter=`printf "^[-xXoO=][ \t]\+[a-zA-Z0-9_/*+.-]"` if grep -lvq "$filter" config/$config/pkgsel 2> /dev/null; then if [ -n "$oldconfig" ]; then echo "Invalid line(s) in package rule set will be removed" grep -nv "$filter" config/$config/pkgsel grep "$filter" config/$config/pkgsel \ > $cfgtmpdir/pkgsel.new mv $cfgtmpdir/pkgsel.new config/$config/pkgsel elif src/confdialog.bin --title "Build Config" --yesno \ "Invalid line(s) in package rule set. Remove?" 5 50 then grep "$filter" config/$config/pkgsel \ > $cfgtmpdir/pkgsel.new mv $cfgtmpdir/pkgsel.new config/$config/pkgsel fi fi unset filter pkgsel_parse config/$config/pkgsel fi comment ' ' SDECFG_PARALLEL_MAX="`echo $SDECFG_PARALLEL_MAX | grep -o -e '[0-9]*' -e 'auto'`" text 'Maximum number of jobs to be executed in parallel' \ SDECFG_PARALLEL_MAX auto comment ' ' block_begin 3 # this is warranted to exist . $cfgtmpdir/noexpert-config.in block_end comment ' ' block_begin 3 bool 'Show expert and experimental options' SDECFG_EXPERT 0 block_end expert_begin comment ' ' comment '- Binary package format' block_begin 3 choice SDECFG_PKGFILE_TYPE tar.zst \ tar.br 'Create tar.br binary packages' \ tar.bz2 'Create tar.bz2 binary packages' \ tar.gz 'Create tar.gz binary packages' \ tar.lzo 'Create tar.lzo binary packages' \ tar.lzma 'Create tar.lzma binary packages' \ tar.xz 'Create tar.xz binary packages' \ tar.zst 'Create tar.zst binary packages' \ gem 'Create gem binary packages' \ none 'Create no binary packages' bool 'Append version number to package files' SDECFG_PKGFILE_VER 1 block_end comment ' ' comment '- Additional Package Selection' block_begin 3 bool 'Custom package selection' SDECFG_PKGSEL 0 if [ "$SDECFG_PKGSEL" = 1 ]; then menu_begin MENU_PKGSEL_RULES 'Edit package selection rules' editfile SDECFG_PKGSEL_FILE config/$config/pkgsel \ 'Package selection rules' if [ "$CFGTEMP_PKGSEL_ERROR" = 1 ]; then comment '---- Syntax error(s) in rule set!' fi [ "$SDECFG_LICENSE_ISSUE" = 0 ] && pkgchecklicense menu_end else rm -f config/$config/pkgsel $cfgtmpdir/pkgsel.awk fi startprog SDECFG_SHOW_PKGLIST 'Show the current package list' \ "src/confdialog.bin --title 'T2 Config - Package List' \ --backtitle 'T2 $sdever Configuration' \ --textbox $cfgtmpdir/packages.txt \ $(($lines - 4)) $(($columns - 5))" block_end comment ' ' # this is warranted to exist . $cfgtmpdir/expert-config.in comment ' ' comment '- Additional GNU Configure Options' block_begin 5 editfile SDECFG_CONFOPT_FILE config/$config/confopt \ 'GNU Configure Options' if [ -f config/$config/confopt ]; then const SDECFG_CONFIGURE_OPTS "`tr '\n' ' ' \ < config/$config/confopt`" else const SDECFG_CONFIGURE_OPTS "" fi for option in $SDECFG_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' SDECFG_C_FLAGS "" comment ' ' comment_id '- Flist detection technique' COMMENT_FLIST block_begin 5 choice SDECFG_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' block_end comment ' ' comment '- Various Options' block_begin 5 bool 'Bootstrap a new, clean and up-to-date toolchain' SDECFG_USE_CROSSCC 1 bool 'Make rebuild stage (stage 9)' SDECFG_DO_REBUILD_STAGE 0 if [ $SDECFG_CROSSBUILD != 1 ]; then bool 'Run a check/test for packages with support' SDECFG_DO_CHECK 0 fi if [ $SDECFG_USE_CROSSCC != 1 ]; then pkgfilter sed 's,^\([XO] \)0,\1-,' fi if [ $SDECFG_DO_REBUILD_STAGE != 1 ]; then pkgfilter sed 's,^\([XO] [0-8?-]*\)9 ,\1- ,' fi bool 'Create statically linked binaries' SDECFG_STATIC 0 bool 'Move static libraries from /lib* to /usr/lib*' SDECFG_STATIC_IN_USR 0 bool 'Enable ld --as-needed' SDECFG_LD_AS_NEEDED 0 bool 'Disable exceptions and rtti in C++' SDECFG_LIMITCXX 0 bool 'Enable c-compiler multilib support' SDECFG_MULTILIB 0 bool 'Disable National Language Support' SDECFG_DISABLE_NLS 0 bool 'Automatic documentation creation' SDECFG_CREATE_DOCS 0 bool 'Create cache files after packages have been built' \ SDECFG_CREATE_CACHE 1 bool 'Run Paranoia Checks in Build-Target and Build-Pkg' \ SDECFG_PARANOIA_CHECK 1 bool 'Abbreviate Config ID with checksum' SDECFG_IDCKSUM 0 block_end expert_end . $cfgtmpdir/package-postconfig.in . $cfgtmpdir/misc-postconfig.in . $cfgtmpdir/architecture-postconfig.in . $cfgtmpdir/target-postconfig.in # discard unselected, and set conditional stage 0 ? accordingly pkgfilter sed '/^[XO] --* / d; s/^X ?1/X 01/; s/^X ?-/X --/' [ $SDECFG_EXPERT = 1 ] || SDECFG_ID="`echo $SDECFG_ID | sed 's,-noexpert.*,,'`" [ "$SDECFG_IDCKSUM" = 1 ] && SDECFG_ID="`echo $SDECFG_ID | cksum | cut -f1 -d' '`" const SDECFG_SHORTID "$SDECFG_ID" SDECFG_ID="$config-$SDECFG_ID"