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.

379 lines
12 KiB

  1. #
  2. # --- ROCK-COPYRIGHT-NOTE-BEGIN ---
  3. #
  4. # This copyright note is auto-generated by ./scripts/Create-CopyPatch.
  5. # Please add additional copyright information _after_ the line containing
  6. # the ROCK-COPYRIGHT-NOTE-END tag. Otherwise it might get removed by
  7. # the ./scripts/Create-CopyPatch script. Do not edit this copyright text!
  8. #
  9. # ROCK Linux: rock-src/scripts/config.in
  10. # ROCK Linux is Copyright (C) 1998 - 2003 Clifford Wolf
  11. #
  12. # This program is free software; you can redistribute it and/or modify
  13. # it under the terms of the GNU General Public License as published by
  14. # the Free Software Foundation; either version 2 of the License, or
  15. # (at your option) any later version. A copy of the GNU General Public
  16. # License can be found at Documentation/COPYING.
  17. #
  18. # Many people helped and are helping developing ROCK Linux. Please
  19. # have a look at http://www.rocklinux.org/ and the Documentation/TEAM
  20. # file for details.
  21. #
  22. # --- ROCK-COPYRIGHT-NOTE-END ---
  23. #
  24. # Main config script
  25. #
  26. # Execution of sub-scripts:
  27. #
  28. # - architecture/*/preconfig.in
  29. #
  30. # * Selecting Architecture
  31. # * architecture/$ROCKCFG_ARCH/config.in
  32. #
  33. # - misc/*/preconfig.in
  34. # - target/*/preconfig.in
  35. # - package/*/*/preconfig.in
  36. #
  37. # * Selecting Target
  38. # * target/$ROCKCFG_TARGET/config.in
  39. #
  40. # * misc/*/noexpertconfig.in
  41. #
  42. # * {package/*,misc}/*/config-*.in
  43. # * {package/*,misc}/*/config.in
  44. # * Various common build options
  45. #
  46. # - package/*/*/postconfig.in
  47. # - misc/*/postconfig.in
  48. # - architecture/$ROCKCFG_ARCH/postconfig.in
  49. # - target/$ROCKCFG_TARGET/postconfig.in
  50. #
  51. # Only procedures marked with '*' might interact with the user.
  52. #
  53. # Naming-scheme for extening config variables:
  54. #
  55. # Core: ROCKCFG_*
  56. # Archs: ROCKCFG_ARCH_<Arch-Name>_*
  57. # Targets: ROCKCFG_TRG_<Target-Name>_*
  58. # Packages: ROCKCFG_PKG_<Pkg-Name>_*
  59. #
  60. # Config-Internal Variables:
  61. #
  62. # Core: CFGTEMP_*
  63. # Archs: CFGTEMP_ARCH_<Arch-Name>_*
  64. # Targets: CFGTEMP_TRG_<Target-Name>_*
  65. # Packages: CFGTEMP_PKG_<Pkg-Name>_*
  66. #
  67. # Config Presets: ROCKCFGSET_*
  68. #
  69. CFGTEMP_ARCHLIST=""
  70. CFGTEMP_TARGETLIST=""
  71. %include architecture/*/preconfig.in
  72. comment_id '- Architecture, CPU and Optimization' COMMENT_ARCHCPUOPT
  73. block_begin 7
  74. choice ROCKCFG_ARCH $ROCKCFG_ARCH $CFGTEMP_ARCHLIST
  75. ROCKCFG_ID="$ROCKCFG_ID-$ROCKCFG_ARCH"
  76. if [ -f architecture/$ROCKCFG_ARCH/config.in ]
  77. then . architecture/$ROCKCFG_ARCH/config.in ; fi
  78. bool 'This is a cross-build between architectures' ROCKCFG_CROSSBUILD 0
  79. if [ "$ROCKCFG_CROSSBUILD" = 1 ] ; then
  80. block_begin
  81. bool 'Test-build the packages which are not known to cross build' ROCKCFG_CROSS_TESTALL 0
  82. if [ $ROCKCFG_CROSS_TESTALL = 1 ]; then
  83. comment '-- WARNING: Test-building packages which are not known to cross build'
  84. comment '-- might cause damage on your build system if it is not read-only. So'
  85. comment '-- only run this if your /{bin,lib,usr,..} is somehow write-protected.'
  86. pkgfilter sed -e 's,^\(. .\)[1X?][^ ]*,\11--------,; s,\(. .\)[-][^ ]*,\1---------,;'
  87. else
  88. pkgfilter sed -e 's,^\(. .\)[1X][^ ]*,\11--------,; s,\(. .\)[?-][^ ]*,\1---------,;'
  89. fi
  90. ROCKCFG_ID="$ROCKCFG_ID-cross" ; ROCKCFGSET_USE_CROSSCC=1
  91. block_end
  92. else
  93. pkgfilter sed -e 's,\(. .\)[?X],\1-,;'
  94. fi
  95. block_end
  96. %include misc/*/preconfig.in
  97. %include target/*/preconfig.in
  98. %include package/*/*/preconfig.in
  99. comment ' '
  100. comment_id '- Target Distribution' COMMENT_TARGET
  101. block_begin 7
  102. choice ROCKCFG_TARGET generic $CFGTEMP_TARGETLIST
  103. ROCKCFG_ID="$ROCKCFG_ID-$ROCKCFG_TARGET"
  104. if [ -f target/$ROCKCFG_TARGET/config.in ]
  105. then . target/$ROCKCFG_TARGET/config.in ; fi
  106. block_end
  107. comment ' '
  108. comment_id '- Build System Configuration' COMMENT_BUILD_SYS_CONF
  109. block_begin 3
  110. bool 'Make a parallel (cluster) build' ROCKCFG_PARALLEL 0
  111. if [ "$ROCKCFG_PARALLEL" = 1 ] ; then
  112. block_begin 10
  113. ROCKCFG_PARALLEL_MAX="`echo $ROCKCFG_PARALLEL_MAX |
  114. sed 's,[^0-9],,g'`"
  115. text 'Maximum size of job queue' ROCKCFG_PARALLEL_MAX 10
  116. text 'Command for adding jobs' ROCKCFG_PARALLEL_ADDJOB ''
  117. block_end
  118. else
  119. bool 'Abort when a package-build fails' \
  120. ROCKCFG_ABORT_ON_ERROR 0
  121. fi
  122. bool 'Retry building broken packages' ROCKCFG_RETRY_BROKEN 0
  123. bool 'Disable packages which are marked as broken' \
  124. ROCKCFG_DISABLE_BROKEN 0
  125. bool 'Do not try building packages if deps failed' \
  126. ROCKCFG_NOBROKENDEPS 0
  127. bool 'Always clean up src dirs (even on pkg fail)' \
  128. ROCKCFG_ALWAYS_CLEAN 0
  129. bool 'Create debug information (xtrace) for builds' ROCKCFG_XTRACE 0
  130. bool 'Use tmpfs for building packages' ROCKCFG_SRC_TMPFS 0
  131. if [ "$ROCKCFG_SRC_TMPFS" = 1 ] ; then
  132. block_begin
  133. comment '! WARNING: This feature can hang your system, if'
  134. comment '! you do not have enough virtual memory!'
  135. text 'tmpfs mount options' ROCKCFG_SRC_TMPFS_OPT \
  136. 'size=800M,nr_inodes=100k'
  137. bool 'Write tmpfs log to var/adm/rock-debug/tmpfslog.txt' \
  138. ROCKCFG_SRC_TMPFS_LOG 0
  139. block_end
  140. fi
  141. bool 'Send emails on special events' ROCKCFG_SENDMAIL 0
  142. if [ "$ROCKCFG_SENDMAIL" = 1 ] ; then
  143. block_begin
  144. text 'Sendmail program' ROCKCFG_SENDMAIL_BIN 'sendmail'
  145. text 'Recipient address' ROCKCFG_SENDMAIL_TO 'root'
  146. block_end
  147. fi
  148. block_end
  149. %include misc/*/noexpertconfig.in
  150. comment ' '
  151. block_begin 3
  152. bool 'Show expert-only and experimental options' ROCKCFG_EXPERT 0
  153. block_end
  154. if [ $ROCKCFG_EXPERT = 1 ] ; then ROCKCFG_ID="$ROCKCFG_ID-expert"
  155. else ROCKCFG_ID="$ROCKCFG_ID-noexpert" ; fi
  156. expert_begin
  157. comment ' '
  158. comment '- Binary package format'
  159. block_begin 3
  160. bool 'Create *.tar.bz2 binary packages' ROCKCFG_CREATE_TARBZ2 0
  161. bool 'Create *.gem binary packages' ROCKCFG_CREATE_GEM 1
  162. bool 'Append version number to package files' ROCKCFG_PKGFILE_VER 1
  163. block_end
  164. comment ' '
  165. comment '- Additional Package Selection'
  166. block_begin 3
  167. choice ROCKCFG_PKGSEL_TPL none none 'No package preselection template' \
  168. $( cd misc/pkgsel; grep -H "^# TITLE: " *.in | tr ' ' '_' | sed 's,\.in:#_TITLE:_, ,' )
  169. if [ -f misc/pkgsel/${ROCKCFG_PKGSEL_TPL}.in ]; then
  170. . misc/pkgsel/${ROCKCFG_PKGSEL_TPL}.in
  171. fi
  172. bool 'Custom package selection' ROCKCFG_PKGSEL 0
  173. if [ "$ROCKCFG_PKGSEL" = 1 ] ; then
  174. menu_begin MENU_PKGSEL_RULES 'Edit package selection rules'
  175. # Active error checking: explicitly show an annoying popup
  176. filter=`printf "^[-xXoO][ \t]\+[a-zA-Z0-9_/*+.-]"`
  177. if grep -lvq "$filter" config/$config/pkgsel 2> /dev/null && \
  178. ./src/rockdialog.bin --title "Build Config" --yesno \
  179. "Invalid line(s) in package rule set. Remove?" 5 50
  180. then
  181. grep "$filter" < config/$config/pkgsel \
  182. > config/$config/pkgsel.new
  183. mv config/$config/pkgsel.new config/$config/pkgsel
  184. fi
  185. unset filter
  186. editfile ROCKCFG_PKGSEL_FILE config/$config/pkgsel \
  187. 'Package selection rules'
  188. # Create an awk program from the list of package selection rules stored in
  189. # config/$config/pkgsel which is applied to the list of packages stored in
  190. # config/$config/packages.
  191. # Syntax for package selection rules is:
  192. # <action> <patternlist>
  193. # <action> is a single character: x or X enables the packages matching
  194. # <patternlist>, o or O disables them, - omits them in the packages list.
  195. # Any other character exits the awk program, resulting in an empty list.
  196. # <patternlist> consists of one or more white-space separated <pattern>s.
  197. # <pattern> consists of letters, numbers, and characters _ * + . = -
  198. # <action> is performed on every line in the list matching all <pattern>s of a rule.
  199. # If the first <pattern> of a rule is a !, <action> is performed on every line
  200. # _not_ matching _any_ <pattern> of a rule.
  201. # A <pattern> of the form <base-pkg>=<derived-pkg> denotes a pkgforked package;
  202. # such a <pattern> will duplicate the line of the <base-pkg> and substitute its
  203. # package name with the name of the pkgforked package, that is, the <pattern>.
  204. echo "# created from 'pkgsel'" > config/$config/pkgsel.awk
  205. while read action patternlist ; do
  206. case "$action" in
  207. [xX])
  208. action='$1="X"' ;;
  209. [oO])
  210. action='$1="O"' ;;
  211. -)
  212. action='next' ;;
  213. *)
  214. echo '{ exit; }'
  215. continue ;;
  216. esac
  217. address="" ; first="(" ; others="&&"
  218. while read pattern ; do
  219. if [ -z "$address" ] && \
  220. [ "$pattern" = "!" ] ; then
  221. address="! " ; others="||"
  222. else
  223. pattern="$( echo "$pattern" | sed \
  224. -e 's,[^a-zA-Z0-9_/\*+\.=-],,g' \
  225. -e 's,[/\.\+],\\&,g' \
  226. -e 's,\*,[^ ]*,g' )"
  227. [ "$pattern" ] || continue
  228. address="$address$first /[ =]$pattern[ =]/"
  229. first=" $others"
  230. fi
  231. done < <( echo "$patternlist" | tr '\t ' '\n\n' )
  232. echo "$address ) { $action; }"
  233. done < config/$config/pkgsel >> config/$config/pkgsel.awk
  234. echo '{ print; }' >> config/$config/pkgsel.awk
  235. pkgout
  236. gawk -f config/$config/pkgsel.awk < config/$config/packages \
  237. > config/$config/packages.new 2> /dev/null
  238. if [ -s config/$config/packages.new ] ; then
  239. mv config/$config/packages.new config/$config/packages
  240. else
  241. rm -f config/$config/packages.new
  242. comment '---- Syntax error(s) in rule set!'
  243. fi
  244. pkgin
  245. menu_end
  246. else
  247. rm -f config/$config/pkgsel
  248. rm -f config/$config/pkgsel.awk
  249. fi
  250. startprog ROCKCFG_SHOW_PKGLIST 'Show the current package list' \
  251. "./src/rockdialog.bin --title 'ROCK Linux Config - Package List' \
  252. --backtitle 'ROCK Linux $rockver Configuration' \
  253. --textbox config/$config/packages.txt \
  254. $(( $lines - 4 )) $(( $columns - 5 ))"
  255. block_end
  256. comment ' '
  257. %include $( ls {package/*,misc}/*/config{,-*}.in 2>/dev/null | sed 's,\(.*/\)\([^/]*\),\2 \1\2,' | sort | cut -f2 -d' ' )
  258. comment ' '
  259. comment '- Additional GNU Configure Options'
  260. block_begin 5
  261. editfile ROCKCFG_CONFOPT_FILE config/$config/confopt \
  262. 'GNU Configure Options'
  263. if [ -f config/$config/confopt ] ; then
  264. const ROCKCFG_CONFIGURE_OPTS "`tr '\n' ' ' \
  265. < config/$config/confopt`"
  266. else
  267. const ROCKCFG_CONFIGURE_OPTS ""
  268. fi
  269. for option in $ROCKCFG_CONFIGURE_OPTS ; do
  270. if [ "${option#--with-}" = "$option" -a \
  271. "${option#--without-}" = "$option" ]
  272. then
  273. comment '---- Warning! The custom options may
  274. break packages!'
  275. break
  276. fi
  277. done
  278. block_end
  279. comment ' '
  280. text 'Additional compiler flags' ROCKCFG_C_FLAGS ""
  281. comment ' '
  282. comment_id '- Flist detection technique' COMMENT_FLIST
  283. block_begin 5
  284. choice ROCKCFG_FLIST flwrapper \
  285. flwrapper 'Use the flist wrapper library for flist creation' \
  286. strace 'Use strace to get the file list' \
  287. find 'Use find on timestamp-file for flist creation'
  288. block_end
  289. comment ' '
  290. comment '- Various Options'
  291. block_begin 5
  292. bool 'Build and use a (pseudo-)cross compiler' ROCKCFG_USE_CROSSCC 1
  293. bool 'Make rebuild stage (stage 9)' ROCKCFG_DO_REBUILD_STAGE 1
  294. if [ $ROCKCFG_CROSSBUILD != 1 ]; then
  295. bool 'Run a check/test for packages with support' ROCKCFG_DO_CHECK 0
  296. fi
  297. if [ $ROCKCFG_USE_CROSSCC != 1 ]; then
  298. pkgfilter sed 's,^\([XO] \)0,\1-,'
  299. fi
  300. if [ $ROCKCFG_DO_REBUILD_STAGE != 1 ]; then
  301. pkgfilter sed 's,^\([XO] [^ ]*\)9 ,\1- ,'
  302. fi
  303. choice ROCKCFG_OPT size \
  304. smart 'Smart optimisation using a profile database' \
  305. bizarre 'Inverse smart optimisation (this is bizarre)' \
  306. speed 'Hard optimise for speed (often pretty slow)' \
  307. size 'Hard optimise for size (recommended)' \
  308. lazy 'Lazy optimisiation (for debugging binaries)'
  309. bool 'Create binaries with debug symbols' ROCKCFG_DEBUG 0
  310. bool 'Create statically linked binaries' ROCKCFG_STATIC 0
  311. bool 'Disable exceptions and rtti in C++' ROCKCFG_LIMITCXX 0
  312. bool 'Enable C compiler multilib support' ROCKCFG_MULTILIB 0
  313. bool 'Disable National Language Support' ROCKCFG_DISABLE_NLS 0
  314. if [ "$ROCKCFG_DISABLE_NLS" = 1 ] ; then
  315. pkgremove gettext
  316. fi
  317. bool 'Automatic documentation creation' ROCKCFG_CREATE_DOCS 1
  318. bool 'Create cache files after packages have been built' \
  319. ROCKCFG_CREATE_CACHE 1
  320. bool 'Run Paranoia Checks in Build-Target and Build-Pkg' \
  321. ROCKCFG_PARANOIA_CHECK 1
  322. bool 'Abbreviate ROCK Config ID with checksum' ROCKCFG_IDCKSUM 0
  323. block_end
  324. expert_end
  325. %include package/*/*/postconfig.in
  326. %include misc/*/postconfig.in
  327. %include architecture/*/postconfig.in
  328. %include target/*/postconfig.in
  329. pkgfilter sed '/^[XO] --* / d;'
  330. [ $ROCKCFG_EXPERT = 1 ] ||
  331. ROCKCFG_ID="`echo $ROCKCFG_ID | sed 's,-noexpert.*,,'`"
  332. [ "$ROCKCFG_IDCKSUM" = 1 ] &&
  333. ROCKCFG_ID="`echo $ROCKCFG_ID | cksum | cut -f1 -d' '`"
  334. const ROCKCFG_SHORTID "$ROCKCFG_ID"
  335. ROCKCFG_ID="$config-$ROCKCFG_ID"