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.

392 lines
11 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. # This function appends or inserts values to a variable:
  70. #
  71. # var_append PATH ":" "$HOME/bin"
  72. # var_insert PATH ":" "$HOME/bin"
  73. #
  74. var_append() {
  75. eval "[ \"\$$1\" ] && $1=\"\${$1}$2\""
  76. eval "$1=\"\${$1}$3\""
  77. }
  78. var_insert() {
  79. eval "[ \"\$$1\" ] && $1=\"$2\$$1\""
  80. eval "$1=\"$3\$$1\""
  81. }
  82. # Functions for working with config/$config/packages
  83. #
  84. # pkgenable package-list
  85. # pkgdisable package-list
  86. # pkgremove package-list
  87. # pkgcheck pattern [XO]
  88. # pkgfilter cmd arg1 ...
  89. #
  90. pkgfilter() {
  91. "$@" < config/$config/packages > config/$config/packages.new
  92. mv config/$config/packages.new config/$config/packages
  93. }
  94. pkgenable() {
  95. local pattern patterns
  96. for pattern; do
  97. patterns="$patterns -e '/ $pattern / s/^./X/'"
  98. done
  99. if [ "$patterns" ]; then
  100. eval "pkgfilter sed $patterns"
  101. fi
  102. }
  103. pkgdisable() {
  104. local pattern patterns
  105. for pattern; do
  106. patterns="$patterns -e '/ $pattern / s/^./O/'"
  107. done
  108. if [ "$patterns" ]; then
  109. eval "pkgfilter sed $patterns"
  110. fi
  111. }
  112. pkgremove() {
  113. local pattern patterns
  114. if [ "$1" ]; then
  115. patterns=" $1 "; shift
  116. for pattern; do
  117. patterns="$patterns| $pattern "
  118. done
  119. pkgfilter egrep -v "$patterns"
  120. fi
  121. }
  122. pkgcheck() {
  123. egrep -q "^$2.* ($1) " config/$config/packages
  124. }
  125. CFGTEMP_ARCHLIST=""
  126. CFGTEMP_TARGETLIST=""
  127. %include architecture/*/preconfig.in
  128. comment_id '- Architecture, CPU and Optimization' COMMENT_ARCHCPUOPT
  129. block_begin 7
  130. choice ROCKCFG_ARCH $ROCKCFG_ARCH $CFGTEMP_ARCHLIST
  131. ROCKCFG_ID="$ROCKCFG_ID-$ROCKCFG_ARCH"
  132. if [ -f architecture/$ROCKCFG_ARCH/config.in ]
  133. then . architecture/$ROCKCFG_ARCH/config.in ; fi
  134. bool 'This is a cross-build between architectures' ROCKCFG_CROSSBUILD 0
  135. if [ "$ROCKCFG_CROSSBUILD" = 1 ] ; then
  136. sed 's,^\(. ..\)[^ ]*,\1--------,' < config/$config/packages |
  137. grep -vx '. --* .*' > config/$config/packages.new
  138. mv config/$config/packages.new config/$config/packages
  139. ROCKCFG_ID="$ROCKCFG_ID-cross" ; ROCKCFGSET_USE_CROSSCC=1
  140. fi
  141. block_end
  142. %include misc/*/preconfig.in
  143. %include target/*/preconfig.in
  144. %include package/*/*/preconfig.in
  145. comment ' '
  146. comment_id '- Target Distribution' COMMENT_TARGET
  147. block_begin 7
  148. choice ROCKCFG_TARGET generic $CFGTEMP_TARGETLIST
  149. ROCKCFG_ID="$ROCKCFG_ID-$ROCKCFG_TARGET"
  150. if [ -f target/$ROCKCFG_TARGET/config.in ]
  151. then . target/$ROCKCFG_TARGET/config.in ; fi
  152. block_end
  153. comment ' '
  154. comment_id '- Build System Configuration' COMMENT_BUILD_SYS_CONF
  155. block_begin 3
  156. bool 'Make a parallel (cluster) build' ROCKCFG_PARALLEL 0
  157. if [ "$ROCKCFG_PARALLEL" = 1 ] ; then
  158. block_begin 10
  159. ROCKCFG_PARALLEL_MAX="`echo $ROCKCFG_PARALLEL_MAX |
  160. sed 's,[^0-9],,g'`"
  161. text 'Maximum size of job queue' ROCKCFG_PARALLEL_MAX 10
  162. text 'Command for adding jobs' ROCKCFG_PARALLEL_ADDJOB ''
  163. block_end
  164. else
  165. bool 'Abort when a package-build fails' \
  166. ROCKCFG_ABORT_ON_ERROR 0
  167. fi
  168. bool 'Retry building broken packages' ROCKCFG_RETRY_BROKEN 0
  169. bool 'Disable packages which are marked as broken' \
  170. ROCKCFG_DISABLE_BROKEN 0
  171. bool 'Do not try building packages if deps failed' \
  172. ROCKCFG_NOBROKENDEPS 0
  173. bool 'Always clean up src dirs (even on pkg fail)' \
  174. ROCKCFG_ALWAYS_CLEAN 0
  175. bool 'Create debug information (xtrace) for builds' ROCKCFG_XTRACE 0
  176. bool 'Use TMPFS for building packages' ROCKCFG_SRC_TMPFS 0
  177. if [ "$ROCKCFG_SRC_TMPFS" = 1 ] ; then
  178. block_begin
  179. comment '! WARNING: This feature can hang your system, if'
  180. comment '! you do not have enough virtual memory!'
  181. text 'TMPFS mount options' ROCKCFG_SRC_TMPFS_OPT \
  182. 'size=800M,nr_inodes=100k'
  183. bool 'Write tmpfs log to var/adm/rock-debug/tmpfslog.txt' \
  184. ROCKCFG_SRC_TMPFS_LOG 0
  185. block_end
  186. fi
  187. block_end
  188. %include misc/*/noexpertconfig.in
  189. comment ' '
  190. block_begin 3
  191. bool 'Show expert-only and experimental options' ROCKCFG_EXPERT 0
  192. block_end
  193. if [ $ROCKCFG_EXPERT = 1 ] ; then ROCKCFG_ID="$ROCKCFG_ID-expert"
  194. else ROCKCFG_ID="$ROCKCFG_ID-noexpert" ; fi
  195. expert_begin
  196. comment ' '
  197. comment '- Binary package format'
  198. block_begin 3
  199. bool 'Create *.tar.bz2 binary packages' ROCKCFG_CREATE_TARBZ2 0
  200. bool 'Create *.gem binary packages' ROCKCFG_CREATE_GEM 1
  201. bool 'Append version number to package files' ROCKCFG_PKGFILE_VER 1
  202. block_end
  203. comment ' '
  204. comment '- Additional Package Selection'
  205. block_begin 3
  206. choice ROCKCFG_PKGSEL_TPL none none 'No package preselection template' \
  207. $( cd misc/pkgsel; grep -H "^# TITLE: " *.in | tr ' ' '_' | sed 's,\.in:#_TITLE:_, ,' )
  208. if [ -f misc/pkgsel/${ROCKCFG_PKGSEL_TPL}.in ]; then
  209. . misc/pkgsel/${ROCKCFG_PKGSEL_TPL}.in
  210. fi
  211. bool 'Custom package selection' ROCKCFG_PKGSEL 0
  212. if [ "$ROCKCFG_PKGSEL" = 1 ] ; then
  213. menu_begin MENU_PKGSEL_RULES 'Edit package selection rules'
  214. # Active error checking: explicitly show an annoying popup
  215. filter=`printf "^[-xXoO][ \t]\+[a-zA-Z0-9_/*+.-]"`
  216. if grep -lvq "$filter" config/$config/pkgsel 2> /dev/null && \
  217. ./src/rockdialog.bin --title "Build Config" --yesno \
  218. "Invalid line(s) in package rule set. Remove?" 5 50
  219. then
  220. grep "$filter" < config/$config/pkgsel \
  221. > config/$config/pkgsel.new
  222. mv config/$config/pkgsel.new config/$config/pkgsel
  223. fi
  224. unset filter
  225. editfile ROCKCFG_PKGSEL_FILE config/$config/pkgsel \
  226. 'Package selection rules'
  227. echo "# created from 'pkgsel'" > config/$config/pkgsel.awk
  228. while read action patternlist ; do
  229. case "$action" in
  230. [xX])
  231. action='$1="X"' ;;
  232. [oO])
  233. action='$1="O"' ;;
  234. -)
  235. action='next' ;;
  236. *)
  237. echo '{ exit; }'
  238. continue ;;
  239. esac
  240. address="" ; first="(" ; others="&&"
  241. while read pattern ; do
  242. if [ -z "$address" ] && \
  243. [ "$pattern" = "!" ] ; then
  244. address="! " ; others="||"
  245. else
  246. pattern="$( echo "$pattern" | sed \
  247. -e 's,[^a-zA-Z0-9_/\*+\.-],,g' \
  248. -e 's,[/\.\+],\\&,g' \
  249. -e 's,\*,[^ ]*,g' )"
  250. [ "$pattern" ] || continue
  251. address="$address$first"
  252. address="$address / $pattern /"
  253. first=" $others"
  254. fi
  255. done < <( echo "$patternlist" | tr '\t ' '\n\n' )
  256. echo "$address ) { $action; }"
  257. done < config/$config/pkgsel >> config/$config/pkgsel.awk
  258. echo '{ print; }' >> config/$config/pkgsel.awk
  259. gawk -f config/$config/pkgsel.awk < config/$config/packages \
  260. > config/$config/packages.new 2> /dev/null
  261. if [ -s config/$config/packages.new ] ; then
  262. mv config/$config/packages.new config/$config/packages
  263. else
  264. rm -f config/$config/packages.new
  265. comment '---- Syntax error(s) in rule set!'
  266. fi
  267. menu_end
  268. else
  269. rm -f config/$config/pkgsel
  270. rm -f config/$config/pkgsel.awk
  271. fi
  272. startprog ROCKCFG_SHOW_PKGLIST 'Show the current package list' \
  273. "./src/rockdialog.bin --title 'ROCK Linux Config - Package List' \
  274. --backtitle 'ROCK Linux $rockver Configuration' \
  275. --textbox config/$config/packages.txt \
  276. $(( $lines - 4 )) $(( $columns - 5 ))"
  277. block_end
  278. comment ' '
  279. %include $( ls {package/*,misc}/*/config{,-*}.in 2>/dev/null | sed 's,\(.*/\)\([^/]*\),\2 \1\2,' | sort | cut -f2 -d' ' )
  280. comment ' '
  281. comment '- Additional GNU Configure Options'
  282. block_begin 5
  283. editfile ROCKCFG_CONFOPT_FILE config/$config/confopt \
  284. 'GNU Configure Options'
  285. if [ -f config/$config/confopt ] ; then
  286. const ROCKCFG_CONFIGURE_OPTS "`tr '\n' ' ' \
  287. < config/$config/confopt`"
  288. else
  289. const ROCKCFG_CONFIGURE_OPTS ""
  290. fi
  291. for option in $ROCKCFG_CONFIGURE_OPTS ; do
  292. if [ "${option#--with-}" = "$option" -a \
  293. "${option#--without-}" = "$option" ]
  294. then
  295. comment '---- Warning! The custom options may
  296. break packages!'
  297. break
  298. fi
  299. done
  300. block_end
  301. comment ' '
  302. comment_id '- Flist detection technique' COMMENT_FLIST
  303. block_begin 5
  304. choice ROCKCFG_FLIST flwrapper \
  305. flwrapper 'Use the flist wrapper library for flist creation' \
  306. strace 'Use strace to get the file list' \
  307. find 'Use find on timestamp-file for flist creation'
  308. block_end
  309. comment ' '
  310. comment '- Various Options'
  311. block_begin 5
  312. bool 'Build and use a (pseudo-)cross compiler' ROCKCFG_USE_CROSSCC 1
  313. bool 'Make rebuild stage (stage 9)' ROCKCFG_DO_REBUILD_STAGE 1
  314. if [ $ROCKCFG_CROSSBUILD != 1 ]; then
  315. bool 'Run a check/test for packages with support' ROCKCFG_DO_CHECK 0
  316. fi
  317. if [ $ROCKCFG_USE_CROSSCC != 1 ]; then
  318. pkgfilter sed 's,^\([XO] \)0,\1-,'
  319. fi
  320. if [ $ROCKCFG_DO_REBUILD_STAGE != 1 ]; then
  321. pkgfilter sed 's,^\([XO] [0-8-]*\)9 ,\1- ,'
  322. fi
  323. bool 'Optimise all binaries and libraries' ROCKCFG_OPT 1
  324. if [ $ROCKCFG_OPT = 1 ] ; then
  325. bool 'Optimise for size and not for speed' ROCKCFG_OPTSIZE 0
  326. fi
  327. bool 'Disable exceptions and rtti in C++' ROCKCFG_LIMITCXX 0
  328. bool 'Enable c-compiler multilib support' ROCKCFG_MULTILIB 0
  329. bool 'Disable National Language Support' ROCKCFG_DISABLE_NLS 0
  330. if [ "$ROCKCFG_DISABLE_NLS" = 1 ] ; then
  331. pkgremove ' gettext '
  332. fi
  333. bool 'Automatic documentation creation' ROCKCFG_CREATE_DOCS 1
  334. bool 'Create cache files after packages have been built' \
  335. ROCKCFG_CREATE_CACHE 1
  336. bool 'Run Paranoia Checks in Build-Target and Build-Pkg' \
  337. ROCKCFG_PARANOIA_CHECK 1
  338. bool 'Abbreviate ROCK Config ID with checksum' ROCKCFG_IDCKSUM 0
  339. block_end
  340. expert_end
  341. %include package/*/*/postconfig.in
  342. %include misc/*/postconfig.in
  343. %include architecture/*/postconfig.in
  344. %include target/*/postconfig.in
  345. pkgfilter sed '/^[XO] --* / d;'
  346. [ $ROCKCFG_EXPERT = 1 ] ||
  347. ROCKCFG_ID="`echo $ROCKCFG_ID | sed 's,-noexpert.*,,'`"
  348. [ "$ROCKCFG_IDCKSUM" = 1 ] &&
  349. ROCKCFG_ID="`echo $ROCKCFG_ID | cksum | cut -f1 -d' '`"
  350. const ROCKCFG_SHORTID "$ROCKCFG_ID"
  351. ROCKCFG_ID="$config-$ROCKCFG_ID"