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.

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