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.

343 lines
10 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. block_end
  130. %include misc/*/noexpertconfig.in
  131. comment ' '
  132. block_begin 3
  133. bool 'Show expert-only and experimental options' ROCKCFG_EXPERT 0
  134. block_end
  135. if [ $ROCKCFG_EXPERT = 1 ] ; then ROCKCFG_ID="$ROCKCFG_ID-expert"
  136. else ROCKCFG_ID="$ROCKCFG_ID-noexpert" ; fi
  137. expert_begin
  138. comment ' '
  139. comment '- Binary package format'
  140. block_begin 3
  141. bool 'Create *.tar.bz2 binary packages' ROCKCFG_CREATE_TARBZ2 0
  142. bool 'Create *.gem binary packages' ROCKCFG_CREATE_GEM 1
  143. bool 'Append version number to package files' ROCKCFG_PKGFILE_VER 1
  144. block_end
  145. comment ' '
  146. comment '- Additional Package Selection'
  147. block_begin 3
  148. choice ROCKCFG_PKGSEL_TPL none none 'No package preselection template' \
  149. $( cd misc/pkgsel; grep -H "^# TITLE: " *.in | tr ' ' '_' | sed 's,\.in:#_TITLE:_, ,' )
  150. if [ -f misc/pkgsel/${ROCKCFG_PKGSEL_TPL}.in ]; then
  151. . misc/pkgsel/${ROCKCFG_PKGSEL_TPL}.in
  152. fi
  153. bool 'Custom package selection' ROCKCFG_PKGSEL 0
  154. if [ "$ROCKCFG_PKGSEL" = 1 ] ; then
  155. menu_begin MENU_PKGSEL_RULES 'Edit package selection rules'
  156. # Active error checking: explicitly show an annoying popup
  157. filter=`printf "^[-xXoO][ \t]\+[a-zA-Z0-9_/*+.-]"`
  158. if grep -lvq "$filter" config/$config/pkgsel 2> /dev/null && \
  159. ./src/rockdialog.bin --title "Build Config" --yesno \
  160. "Invalid line(s) in package rule set. Remove?" 5 50
  161. then
  162. grep "$filter" < config/$config/pkgsel \
  163. > config/$config/pkgsel.new
  164. mv config/$config/pkgsel.new config/$config/pkgsel
  165. fi
  166. unset filter
  167. editfile ROCKCFG_PKGSEL_FILE config/$config/pkgsel \
  168. 'Package selection rules'
  169. echo "# created from 'pkgsel'" > config/$config/pkgsel.awk
  170. while read action patternlist ; do
  171. case "$action" in
  172. [xX])
  173. action='$1="X"' ;;
  174. [oO])
  175. action='$1="O"' ;;
  176. -)
  177. action='next' ;;
  178. *)
  179. echo '{ exit; }'
  180. continue ;;
  181. esac
  182. address="" ; first="(" ; others="&&"
  183. while read pattern ; do
  184. if [ -z "$address" ] && \
  185. [ "$pattern" = "!" ] ; then
  186. address="! " ; others="||"
  187. else
  188. pattern="$( echo "$pattern" | sed \
  189. -e 's,[^a-zA-Z0-9_/\*+\.-],,g' \
  190. -e 's,[/\.\+],\\&,g' \
  191. -e 's,\*,[^ ]*,g' )"
  192. [ "$pattern" ] || continue
  193. address="$address$first"
  194. address="$address / $pattern /"
  195. first=" $others"
  196. fi
  197. done < <( echo "$patternlist" | tr '\t ' '\n\n' )
  198. echo "$address ) { $action; }"
  199. done < config/$config/pkgsel >> config/$config/pkgsel.awk
  200. echo '{ print; }' >> config/$config/pkgsel.awk
  201. pkgout
  202. gawk -f config/$config/pkgsel.awk < config/$config/packages \
  203. > config/$config/packages.new 2> /dev/null
  204. if [ -s config/$config/packages.new ] ; then
  205. mv config/$config/packages.new config/$config/packages
  206. else
  207. rm -f config/$config/packages.new
  208. comment '---- Syntax error(s) in rule set!'
  209. fi
  210. pkgin
  211. menu_end
  212. else
  213. rm -f config/$config/pkgsel
  214. rm -f config/$config/pkgsel.awk
  215. fi
  216. startprog ROCKCFG_SHOW_PKGLIST 'Show the current package list' \
  217. "./src/rockdialog.bin --title 'ROCK Linux Config - Package List' \
  218. --backtitle 'ROCK Linux $rockver Configuration' \
  219. --textbox config/$config/packages.txt \
  220. $(( $lines - 4 )) $(( $columns - 5 ))"
  221. block_end
  222. comment ' '
  223. %include $( ls {package/*,misc}/*/config{,-*}.in 2>/dev/null | sed 's,\(.*/\)\([^/]*\),\2 \1\2,' | sort | cut -f2 -d' ' )
  224. comment ' '
  225. comment '- Additional GNU Configure Options'
  226. block_begin 5
  227. editfile ROCKCFG_CONFOPT_FILE config/$config/confopt \
  228. 'GNU Configure Options'
  229. if [ -f config/$config/confopt ] ; then
  230. const ROCKCFG_CONFIGURE_OPTS "`tr '\n' ' ' \
  231. < config/$config/confopt`"
  232. else
  233. const ROCKCFG_CONFIGURE_OPTS ""
  234. fi
  235. for option in $ROCKCFG_CONFIGURE_OPTS ; do
  236. if [ "${option#--with-}" = "$option" -a \
  237. "${option#--without-}" = "$option" ]
  238. then
  239. comment '---- Warning! The custom options may
  240. break packages!'
  241. break
  242. fi
  243. done
  244. block_end
  245. comment ' '
  246. text 'Additional compiler flags' ROCKCFG_C_FLAGS ""
  247. comment ' '
  248. comment_id '- Flist detection technique' COMMENT_FLIST
  249. block_begin 5
  250. choice ROCKCFG_FLIST flwrapper \
  251. flwrapper 'Use the flist wrapper library for flist creation' \
  252. strace 'Use strace to get the file list' \
  253. find 'Use find on timestamp-file for flist creation'
  254. block_end
  255. comment ' '
  256. comment '- Various Options'
  257. block_begin 5
  258. bool 'Build and use a (pseudo-)cross compiler' ROCKCFG_USE_CROSSCC 1
  259. bool 'Make rebuild stage (stage 9)' ROCKCFG_DO_REBUILD_STAGE 1
  260. if [ $ROCKCFG_CROSSBUILD != 1 ]; then
  261. bool 'Run a check/test for packages with support' ROCKCFG_DO_CHECK 0
  262. fi
  263. if [ $ROCKCFG_USE_CROSSCC != 1 ]; then
  264. pkgfilter sed 's,^\([XO] \)0,\1-,'
  265. fi
  266. if [ $ROCKCFG_DO_REBUILD_STAGE != 1 ]; then
  267. pkgfilter sed 's,^\([XO] [0-8-]*\)9 ,\1- ,'
  268. fi
  269. choice ROCKCFG_OPT size \
  270. smart 'Smart optimisiation using a profile database' \
  271. bizarre 'Inverse smart optimisation (this is bizarre)' \
  272. speed 'Hard optimise for speed (often pretty slow)' \
  273. size 'Hard optimise for size (recommended)' \
  274. lazy 'Lazy optimisiation (for debugging binaries)'
  275. bool 'Create binaries with debug symbols' ROCKCFG_DEBUG 0
  276. bool 'Create statically linked binaries' ROCKCFG_STATIC 0
  277. bool 'Disable exceptions and rtti in C++' ROCKCFG_LIMITCXX 0
  278. bool 'Enable c-compiler multilib support' ROCKCFG_MULTILIB 0
  279. bool 'Disable National Language Support' ROCKCFG_DISABLE_NLS 0
  280. if [ "$ROCKCFG_DISABLE_NLS" = 1 ] ; then
  281. pkgremove gettext
  282. fi
  283. bool 'Automatic documentation creation' ROCKCFG_CREATE_DOCS 1
  284. bool 'Create cache files after packages have been built' \
  285. ROCKCFG_CREATE_CACHE 1
  286. bool 'Run Paranoia Checks in Build-Target and Build-Pkg' \
  287. ROCKCFG_PARANOIA_CHECK 1
  288. bool 'Abbreviate ROCK Config ID with checksum' ROCKCFG_IDCKSUM 0
  289. block_end
  290. expert_end
  291. %include package/*/*/postconfig.in
  292. %include misc/*/postconfig.in
  293. %include architecture/*/postconfig.in
  294. %include target/*/postconfig.in
  295. pkgfilter sed '/^[XO] --* / d;'
  296. [ $ROCKCFG_EXPERT = 1 ] ||
  297. ROCKCFG_ID="`echo $ROCKCFG_ID | sed 's,-noexpert.*,,'`"
  298. [ "$ROCKCFG_IDCKSUM" = 1 ] &&
  299. ROCKCFG_ID="`echo $ROCKCFG_ID | cksum | cut -f1 -d' '`"
  300. const ROCKCFG_SHORTID "$ROCKCFG_ID"
  301. ROCKCFG_ID="$config-$ROCKCFG_ID"