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.

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