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.

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