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.

372 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. pkgfilter sed -e 's,^\(. ..\)[^ ]*,\1--------,'
  81. ROCKCFG_ID="$ROCKCFG_ID-cross" ; ROCKCFGSET_USE_CROSSCC=1
  82. fi
  83. block_end
  84. %include misc/*/preconfig.in
  85. %include target/*/preconfig.in
  86. %include package/*/*/preconfig.in
  87. comment ' '
  88. comment_id '- Target Distribution' COMMENT_TARGET
  89. block_begin 7
  90. choice ROCKCFG_TARGET generic $CFGTEMP_TARGETLIST
  91. ROCKCFG_ID="$ROCKCFG_ID-$ROCKCFG_TARGET"
  92. if [ -f target/$ROCKCFG_TARGET/config.in ]
  93. then . target/$ROCKCFG_TARGET/config.in ; fi
  94. block_end
  95. comment ' '
  96. comment_id '- Build System Configuration' COMMENT_BUILD_SYS_CONF
  97. block_begin 3
  98. bool 'Make a parallel (cluster) build' ROCKCFG_PARALLEL 0
  99. if [ "$ROCKCFG_PARALLEL" = 1 ] ; then
  100. block_begin 10
  101. ROCKCFG_PARALLEL_MAX="`echo $ROCKCFG_PARALLEL_MAX |
  102. sed 's,[^0-9],,g'`"
  103. text 'Maximum size of job queue' ROCKCFG_PARALLEL_MAX 10
  104. text 'Command for adding jobs' ROCKCFG_PARALLEL_ADDJOB ''
  105. block_end
  106. else
  107. bool 'Abort when a package-build fails' \
  108. ROCKCFG_ABORT_ON_ERROR 0
  109. fi
  110. bool 'Retry building broken packages' ROCKCFG_RETRY_BROKEN 0
  111. bool 'Disable packages which are marked as broken' \
  112. ROCKCFG_DISABLE_BROKEN 0
  113. bool 'Do not try building packages if deps failed' \
  114. ROCKCFG_NOBROKENDEPS 0
  115. bool 'Always clean up src dirs (even on pkg fail)' \
  116. ROCKCFG_ALWAYS_CLEAN 0
  117. bool 'Create debug information (xtrace) for builds' ROCKCFG_XTRACE 0
  118. bool 'Use TMPFS for building packages' ROCKCFG_SRC_TMPFS 0
  119. if [ "$ROCKCFG_SRC_TMPFS" = 1 ] ; then
  120. block_begin
  121. comment '! WARNING: This feature can hang your system, if'
  122. comment '! you do not have enough virtual memory!'
  123. text 'TMPFS mount options' ROCKCFG_SRC_TMPFS_OPT \
  124. 'size=800M,nr_inodes=100k'
  125. bool 'Write tmpfs log to var/adm/rock-debug/tmpfslog.txt' \
  126. ROCKCFG_SRC_TMPFS_LOG 0
  127. block_end
  128. fi
  129. bool 'Send emails on special events' ROCKCFG_SENDMAIL 0
  130. if [ "$ROCKCFG_SENDMAIL" = 1 ] ; then
  131. block_begin
  132. text 'Sendmail program' ROCKCFG_SENDMAIL_BIN 'sendmail'
  133. text 'Recipient address' ROCKCFG_SENDMAIL_TO 'root'
  134. block_end
  135. fi
  136. block_end
  137. %include misc/*/noexpertconfig.in
  138. comment ' '
  139. block_begin 3
  140. bool 'Show expert-only and experimental options' ROCKCFG_EXPERT 0
  141. block_end
  142. if [ $ROCKCFG_EXPERT = 1 ] ; then ROCKCFG_ID="$ROCKCFG_ID-expert"
  143. else ROCKCFG_ID="$ROCKCFG_ID-noexpert" ; fi
  144. expert_begin
  145. comment ' '
  146. comment '- Binary package format'
  147. block_begin 3
  148. bool 'Create *.tar.bz2 binary packages' ROCKCFG_CREATE_TARBZ2 0
  149. bool 'Create *.gem binary packages' ROCKCFG_CREATE_GEM 1
  150. bool 'Append version number to package files' ROCKCFG_PKGFILE_VER 1
  151. block_end
  152. comment ' '
  153. comment '- Additional Package Selection'
  154. block_begin 3
  155. choice ROCKCFG_PKGSEL_TPL none none 'No package preselection template' \
  156. $( cd misc/pkgsel; grep -H "^# TITLE: " *.in | tr ' ' '_' | sed 's,\.in:#_TITLE:_, ,' )
  157. if [ -f misc/pkgsel/${ROCKCFG_PKGSEL_TPL}.in ]; then
  158. . misc/pkgsel/${ROCKCFG_PKGSEL_TPL}.in
  159. fi
  160. bool 'Custom package selection' ROCKCFG_PKGSEL 0
  161. if [ "$ROCKCFG_PKGSEL" = 1 ] ; then
  162. menu_begin MENU_PKGSEL_RULES 'Edit package selection rules'
  163. # Active error checking: explicitly show an annoying popup
  164. filter=`printf "^[-xXoO][ \t]\+[a-zA-Z0-9_/*+.-]"`
  165. if grep -lvq "$filter" config/$config/pkgsel 2> /dev/null && \
  166. ./src/rockdialog.bin --title "Build Config" --yesno \
  167. "Invalid line(s) in package rule set. Remove?" 5 50
  168. then
  169. grep "$filter" < config/$config/pkgsel \
  170. > config/$config/pkgsel.new
  171. mv config/$config/pkgsel.new config/$config/pkgsel
  172. fi
  173. unset filter
  174. editfile ROCKCFG_PKGSEL_FILE config/$config/pkgsel \
  175. 'Package selection rules'
  176. # Create an awk program from the list of package selection rules stored in
  177. # config/$config/pkgsel which is applied to the list of packages stored in
  178. # config/$config/packages.
  179. # Syntax for package selection rules is:
  180. # <action> <patternlist>
  181. # <action> is a single character: x or X enables the packages matching
  182. # <patternlist>, o or O disables them, - omits them in the packages list.
  183. # Any other character exits the awk program, resulting in an empty list.
  184. # <patternlist> consists of one or more white-space separated <pattern>s.
  185. # <pattern> consists of letters, numbers, and characters _ * + . = -
  186. # <action> is performed on every line in the list matching all <pattern>s of a rule.
  187. # If the first <pattern> of a rule is a !, <action> is performed on every line
  188. # _not_ matching _any_ <pattern> of a rule.
  189. # A <pattern> of the form <base-pkg>=<derived-pkg> denotes a pkgforked package;
  190. # such a <pattern> will duplicate the line of the <base-pkg> and substitute its
  191. # package name with the name of the pkgforked package, that is, the <pattern>.
  192. echo "# created from 'pkgsel'" > config/$config/pkgsel.awk
  193. while read action patternlist ; do
  194. case "$action" in
  195. [xX])
  196. action='$1="X"' ;;
  197. [oO])
  198. action='$1="O"' ;;
  199. -)
  200. action='next' ;;
  201. *)
  202. echo '{ exit; }'
  203. continue ;;
  204. esac
  205. address="" ; first="(" ; others="&&"
  206. while read pattern ; do
  207. if [ -z "$address" ] && \
  208. [ "$pattern" = "!" ] ; then
  209. address="! " ; others="||"
  210. else
  211. pattern="$( echo "$pattern" | sed \
  212. -e 's,[^a-zA-Z0-9_/\*+\.=-],,g' \
  213. -e 's,[/\.\+],\\&,g' \
  214. -e 's,\*,[^ ]*,g' )"
  215. [ "$pattern" ] || continue
  216. # check if pattern describes a pkgforked package
  217. if [ "$pattern" != "${pattern%=*}" ] ; then
  218. action="print; $action; \$5=\"$pattern\""
  219. pattern=${pattern%=*}
  220. fi
  221. address="$address$first / $pattern /"
  222. first=" $others"
  223. fi
  224. done < <( echo "$patternlist" | tr '\t ' '\n\n' )
  225. echo "$address ) { $action; }"
  226. done < config/$config/pkgsel >> config/$config/pkgsel.awk
  227. echo '{ print; }' >> config/$config/pkgsel.awk
  228. pkgout
  229. gawk -f config/$config/pkgsel.awk < config/$config/packages \
  230. > config/$config/packages.new 2> /dev/null
  231. if [ -s config/$config/packages.new ] ; then
  232. mv config/$config/packages.new config/$config/packages
  233. else
  234. rm -f config/$config/packages.new
  235. comment '---- Syntax error(s) in rule set!'
  236. fi
  237. pkgin
  238. menu_end
  239. else
  240. rm -f config/$config/pkgsel
  241. rm -f config/$config/pkgsel.awk
  242. fi
  243. startprog ROCKCFG_SHOW_PKGLIST 'Show the current package list' \
  244. "./src/rockdialog.bin --title 'ROCK Linux Config - Package List' \
  245. --backtitle 'ROCK Linux $rockver Configuration' \
  246. --textbox config/$config/packages.txt \
  247. $(( $lines - 4 )) $(( $columns - 5 ))"
  248. block_end
  249. comment ' '
  250. %include $( ls {package/*,misc}/*/config{,-*}.in 2>/dev/null | sed 's,\(.*/\)\([^/]*\),\2 \1\2,' | sort | cut -f2 -d' ' )
  251. comment ' '
  252. comment '- Additional GNU Configure Options'
  253. block_begin 5
  254. editfile ROCKCFG_CONFOPT_FILE config/$config/confopt \
  255. 'GNU Configure Options'
  256. if [ -f config/$config/confopt ] ; then
  257. const ROCKCFG_CONFIGURE_OPTS "`tr '\n' ' ' \
  258. < config/$config/confopt`"
  259. else
  260. const ROCKCFG_CONFIGURE_OPTS ""
  261. fi
  262. for option in $ROCKCFG_CONFIGURE_OPTS ; do
  263. if [ "${option#--with-}" = "$option" -a \
  264. "${option#--without-}" = "$option" ]
  265. then
  266. comment '---- Warning! The custom options may
  267. break packages!'
  268. break
  269. fi
  270. done
  271. block_end
  272. comment ' '
  273. text 'Additional compiler flags' ROCKCFG_C_FLAGS ""
  274. comment ' '
  275. comment_id '- Flist detection technique' COMMENT_FLIST
  276. block_begin 5
  277. choice ROCKCFG_FLIST flwrapper \
  278. flwrapper 'Use the flist wrapper library for flist creation' \
  279. strace 'Use strace to get the file list' \
  280. find 'Use find on timestamp-file for flist creation'
  281. block_end
  282. comment ' '
  283. comment '- Various Options'
  284. block_begin 5
  285. bool 'Build and use a (pseudo-)cross compiler' ROCKCFG_USE_CROSSCC 1
  286. bool 'Make rebuild stage (stage 9)' ROCKCFG_DO_REBUILD_STAGE 1
  287. if [ $ROCKCFG_CROSSBUILD != 1 ]; then
  288. bool 'Run a check/test for packages with support' ROCKCFG_DO_CHECK 0
  289. fi
  290. if [ $ROCKCFG_USE_CROSSCC != 1 ]; then
  291. pkgfilter sed 's,^\([XO] \)0,\1-,'
  292. fi
  293. if [ $ROCKCFG_DO_REBUILD_STAGE != 1 ]; then
  294. pkgfilter sed 's,^\([XO] [0-8-]*\)9 ,\1- ,'
  295. fi
  296. choice ROCKCFG_OPT size \
  297. smart 'Smart optimisiation using a profile database' \
  298. bizarre 'Inverse smart optimisation (this is bizarre)' \
  299. speed 'Hard optimise for speed (often pretty slow)' \
  300. size 'Hard optimise for size (recommended)' \
  301. lazy 'Lazy optimisiation (for debugging binaries)'
  302. bool 'Create binaries with debug symbols' ROCKCFG_DEBUG 0
  303. bool 'Create statically linked binaries' ROCKCFG_STATIC 0
  304. bool 'Disable exceptions and rtti in C++' ROCKCFG_LIMITCXX 0
  305. bool 'Enable c-compiler multilib support' ROCKCFG_MULTILIB 0
  306. bool 'Disable National Language Support' ROCKCFG_DISABLE_NLS 0
  307. if [ "$ROCKCFG_DISABLE_NLS" = 1 ] ; then
  308. pkgremove gettext
  309. fi
  310. bool 'Automatic documentation creation' ROCKCFG_CREATE_DOCS 1
  311. bool 'Create cache files after packages have been built' \
  312. ROCKCFG_CREATE_CACHE 1
  313. bool 'Run Paranoia Checks in Build-Target and Build-Pkg' \
  314. ROCKCFG_PARANOIA_CHECK 1
  315. bool 'Abbreviate ROCK Config ID with checksum' ROCKCFG_IDCKSUM 0
  316. block_end
  317. expert_end
  318. %include package/*/*/postconfig.in
  319. %include misc/*/postconfig.in
  320. %include architecture/*/postconfig.in
  321. %include target/*/postconfig.in
  322. pkgfilter sed '/^[XO] --* / d;'
  323. [ $ROCKCFG_EXPERT = 1 ] ||
  324. ROCKCFG_ID="`echo $ROCKCFG_ID | sed 's,-noexpert.*,,'`"
  325. [ "$ROCKCFG_IDCKSUM" = 1 ] &&
  326. ROCKCFG_ID="`echo $ROCKCFG_ID | cksum | cut -f1 -d' '`"
  327. const ROCKCFG_SHORTID "$ROCKCFG_ID"
  328. ROCKCFG_ID="$config-$ROCKCFG_ID"