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.

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