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.

353 lines
10 KiB

  1. #!/bin/bash
  2. #
  3. # --- ROCK-COPYRIGHT-NOTE-BEGIN ---
  4. #
  5. # This copyright note is auto-generated by ./scripts/Create-CopyPatch.
  6. # Please add additional copyright information _after_ the line containing
  7. # the ROCK-COPYRIGHT-NOTE-END tag. Otherwise it might get removed by
  8. # the ./scripts/Create-CopyPatch script. Do not edit this copyright text!
  9. #
  10. # ROCK Linux: rock-src/scripts/config.in
  11. # ROCK Linux is Copyright (C) 1998 - 2006 Clifford Wolf
  12. #
  13. # This program is free software; you can redistribute it and/or modify
  14. # it under the terms of the GNU General Public License as published by
  15. # the Free Software Foundation; either version 2 of the License, or
  16. # (at your option) any later version. A copy of the GNU General Public
  17. # License can be found at Documentation/COPYING.
  18. #
  19. # Many people helped and are helping developing ROCK Linux. Please
  20. # have a look at http://www.rocklinux.org/ and the Documentation/TEAM
  21. # file for details.
  22. #
  23. # --- ROCK-COPYRIGHT-NOTE-END ---
  24. #
  25. # Main config script
  26. #
  27. # Execution of sub-scripts:
  28. #
  29. # - architecture/*/preconfig.in
  30. #
  31. # * Selecting Architecture
  32. # * architecture/$ROCKCFG_ARCH/config.in
  33. #
  34. # - misc/*/preconfig.in
  35. # - target/*/preconfig.in
  36. # - package/*/*/preconfig.in
  37. #
  38. # * Selecting Target
  39. # * target/$ROCKCFG_TARGET/config.in
  40. #
  41. # * misc/*/noexpertconfig.in
  42. #
  43. # * misc/*/config-*.in
  44. # * misc/*/config.in
  45. # * package/*/config-*.in
  46. # * package/*/config.in
  47. # * Various common build options
  48. #
  49. # - package/*/*/postconfig.in
  50. # - misc/*/postconfig.in
  51. # - architecture/$ROCKCFG_ARCH/postconfig.in
  52. # - target/$ROCKCFG_TARGET/postconfig.in
  53. #
  54. # Only procedures marked with '*' might interact with the user.
  55. #
  56. # Naming-scheme for extening config variables:
  57. #
  58. # Core: ROCKCFG_*
  59. # Archs: ROCKCFG_ARCH_<Arch-Name>_*
  60. # Targets: ROCKCFG_TRG_<Target-Name>_*
  61. # Packages: ROCKCFG_PKG_<Pkg-Name>_*
  62. #
  63. # Config-Internal Variables:
  64. #
  65. # Core: CFGTEMP_*
  66. # Archs: CFGTEMP_ARCH_<Arch-Name>_*
  67. # Targets: CFGTEMP_TRG_<Target-Name>_*
  68. # Packages: CFGTEMP_PKG_<Pkg-Name>_*
  69. #
  70. # Config Presets: ROCKCFGSET_*
  71. #
  72. CFGTEMP_ARCHLIST=""
  73. CFGTEMP_TARGETLIST=""
  74. include ()
  75. {
  76. local x
  77. for x in $@ ; do
  78. [ -f "$x" ] && . "./$x"
  79. done
  80. }
  81. include "architecture/*/preconfig.in"
  82. comment_id '- Architecture, CPU and Optimization' COMMENT_ARCHCPUOPT
  83. block_begin 7
  84. choice ROCKCFG_ARCH $ROCKCFG_ARCH $CFGTEMP_ARCHLIST
  85. ROCKCFG_ID="$ROCKCFG_ID-$ROCKCFG_ARCH"
  86. if [ -f architecture/$ROCKCFG_ARCH/config.in ]
  87. then . architecture/$ROCKCFG_ARCH/config.in ; fi
  88. bool 'This is a cross-build between architectures' ROCKCFG_CROSSBUILD 0
  89. if [ "$ROCKCFG_CROSSBUILD" = 1 ] ; then
  90. block_begin
  91. bool 'Test-build the packages which are not known to cross build' ROCKCFG_CROSS_TESTALL 0
  92. if [ $ROCKCFG_CROSS_TESTALL = 1 ]; then
  93. comment '-- WARNING: Test-building packages which are not known to cross build'
  94. comment '-- might cause damage on your build system if it is not read-only. So'
  95. comment '-- only run this if your /{bin,lib,usr,..} is somehow write-protected.'
  96. fi
  97. ROCKCFG_ID="$ROCKCFG_ID-cross" ; ROCKCFGSET_USE_CROSSCC=1
  98. const ROCKCFG_PSEUDONATIVE 0
  99. block_end
  100. else
  101. bool 'This is a pseudo-native cross-build' ROCKCFG_PSEUDONATIVE 0
  102. if [ "$ROCKCFG_PSEUDONATIVE" = 1 ] ; then
  103. comment '-- WARNING: Doing pseudo native builds is a tricky thing.'
  104. comment '-- Better write the documentation first... ;-)'
  105. text 'IP of native host for command forwarding' ROCKCFG_PSEUDONATIVE_NATIVEHOST ''
  106. text 'NFSROOT to be mounted on native host' ROCKCFG_PSEUDONATIVE_NFSROOT "$HOSTNAME:$PWD"
  107. ROCKCFG_ID="$ROCKCFG_ID-pseudonative" ; ROCKCFGSET_USE_CROSSCC=1
  108. fi
  109. fi
  110. block_end
  111. include "misc/*/preconfig.in"
  112. include "target/*/preconfig.in"
  113. include "package/*/*/preconfig.in"
  114. if [ "$ROCKCFG_CROSSBUILD" = 1 ] ; then
  115. pkgfilter sed -e 's,^\(. ..\)[^ ]*,\1--------, ;'
  116. if [ $ROCKCFG_CROSS_TESTALL = 1 ]; then
  117. pkgfilter sed -e 's,^\(. .\)?,\11, ;'
  118. else
  119. pkgfilter sed -e 's,^\(. .\)?,\1-, ;'
  120. fi
  121. pkgfilter sed -e 's,^\(. .\)X,\11, ; s,^\(. \)X,\1-, ;'
  122. else
  123. pkgfilter sed -e 's,^\(. .\)[?X],\1-, ;'
  124. if [ "$ROCKCFG_PSEUDONATIVE" = 1 ] ; then
  125. pkgfilter sed -e 's,^\(. \)X,\10, ;'
  126. else
  127. pkgfilter sed -e 's,^\(. \)X,\1-, ;'
  128. fi
  129. fi
  130. comment ' '
  131. comment_id '- Target Distribution' COMMENT_TARGET
  132. block_begin 7
  133. choice ROCKCFG_TARGET crystal $CFGTEMP_TARGETLIST
  134. ROCKCFG_ID="$ROCKCFG_ID-$ROCKCFG_TARGET"
  135. include target/$ROCKCFG_TARGET/config.in
  136. text 'Linguas (translations)' ROCKCFG_LINGUAS 'de es fr it ru'
  137. block_end
  138. echo "## BUILDENV_SETTINGS_BEGIN" >> config/$config.$swpid/config
  139. comment ' '
  140. comment_id '- Build System Configuration' COMMENT_BUILD_SYS_CONF
  141. block_begin 3
  142. bool 'Make a parallel (cluster) build' ROCKCFG_PARALLEL 0
  143. if [ "$ROCKCFG_PARALLEL" = 1 ] ; then
  144. block_begin 10
  145. ROCKCFG_PARALLEL_MAX="`echo $ROCKCFG_PARALLEL_MAX |
  146. sed 's,[^0-9],,g'`"
  147. text 'Maximum size of job queue' ROCKCFG_PARALLEL_MAX 10
  148. text 'Command for adding jobs' ROCKCFG_PARALLEL_ADDJOB ''
  149. block_end
  150. else
  151. bool 'Abort when a package-build fails' \
  152. ROCKCFG_ABORT_ON_ERROR 0
  153. fi
  154. bool 'Retry building broken packages' ROCKCFG_RETRY_BROKEN 0
  155. bool 'Disable packages which are marked as broken' \
  156. ROCKCFG_DISABLE_BROKEN 0
  157. bool 'Do not try building packages if deps failed' \
  158. ROCKCFG_NOBROKENDEPS 0
  159. bool 'Always clean up src dirs (even on pkg fail)' \
  160. ROCKCFG_ALWAYS_CLEAN 0
  161. bool 'Create debug information (xtrace) for builds' ROCKCFG_XTRACE 0
  162. bool 'Use tmpfs for building packages' ROCKCFG_SRC_TMPFS 0
  163. if [ "$ROCKCFG_SRC_TMPFS" = 1 ] ; then
  164. block_begin
  165. comment '! WARNING: This feature can hang your system, if'
  166. comment '! you do not have enough virtual memory!'
  167. text 'tmpfs mount options' ROCKCFG_SRC_TMPFS_OPT \
  168. 'size=1024M,nr_inodes=100k'
  169. bool 'Write tmpfs log to var/adm/rock-debug/tmpfslog.txt' \
  170. ROCKCFG_SRC_TMPFS_LOG 0
  171. block_end
  172. fi
  173. bool 'Send emails on special events' ROCKCFG_SENDMAIL 0
  174. if [ "$ROCKCFG_SENDMAIL" = 1 ] ; then
  175. block_begin
  176. text 'Sendmail program' ROCKCFG_SENDMAIL_BIN 'sendmail'
  177. text 'Recipient address' ROCKCFG_SENDMAIL_TO 'root'
  178. block_end
  179. fi
  180. bool 'HTTP GET request on special events' ROCKCFG_HTTP 0
  181. if [ "$ROCKCFG_HTTP" = 1 ] ; then
  182. block_begin
  183. text 'Website' ROCKCFG_HTTP_SITE 'http://pallas.crash-override.net/cgi-bin/rocklogbot?package=PACKAGE&config=CONFIG&status=STATUS&stage=STAGE'
  184. block_end
  185. fi
  186. block_end
  187. include "misc/*/noexpertconfig.in"
  188. echo "## BUILDENV_SETTINGS_END" >> config/$config.$swpid/config
  189. comment ' '
  190. block_begin 3
  191. bool 'Show expert-only and experimental options' ROCKCFG_EXPERT 0
  192. block_end
  193. if [ $ROCKCFG_EXPERT == 1 ] ; then
  194. ROCKCFG_ID="$ROCKCFG_ID-expert"
  195. else
  196. ROCKCFG_ID="$ROCKCFG_ID-noexpert"
  197. fi
  198. expert_begin
  199. comment ' '
  200. comment '- Binary package format'
  201. block_begin 3
  202. bool 'Create Checksums for installed files' ROCKCFG_CREATE_CKSUM 1
  203. bool 'Create *.tar.bz2 binary packages' ROCKCFG_CREATE_TARBZ2 0
  204. bool 'Create *.gem binary packages' ROCKCFG_CREATE_GEM 1
  205. bool 'Append version number to package files' ROCKCFG_PKGFILE_VER 1
  206. block_end
  207. comment ' '
  208. comment '- Package splitting'
  209. block_begin 3
  210. bool 'Create extra *:doc packages' ROCKCFG_SPLIT_DOC 1
  211. bool 'Create extra *:dev packages' ROCKCFG_SPLIT_DEV 1
  212. block_end
  213. comment ' '
  214. include "$(ls misc/*/config{,-*}.in 2>/dev/null \
  215. | LC_ALL=C sort -k3,3 -t"/" | tr '\n' ' ')"
  216. include "$(ls package/*/*/config{,-*}.in 2>/dev/null \
  217. | LC_ALL=C sort -k4,4 -t"/" | tr '\n' ' ')"
  218. comment ' '
  219. comment '- Additional GNU Configure Options'
  220. block_begin 5
  221. editfile ROCKCFG_CONFOPT_FILE config/$config.$swpid/confopt \
  222. 'GNU Configure Options'
  223. if [ -f config/$config.$swpid/confopt ] ; then
  224. const ROCKCFG_CONFIGURE_OPTS "`tr '\n' ' ' \
  225. < config/$config.$swpid/confopt`"
  226. else
  227. const ROCKCFG_CONFIGURE_OPTS ""
  228. fi
  229. for option in $ROCKCFG_CONFIGURE_OPTS ; do
  230. if [ "${option#--with-}" = "$option" -a \
  231. "${option#--without-}" = "$option" ]
  232. then
  233. comment '---- Warning! The custom options may
  234. break packages!'
  235. break
  236. fi
  237. done
  238. block_end
  239. comment ' '
  240. text 'Additional compiler flags' ROCKCFG_C_FLAGS ""
  241. comment ' '
  242. comment_id '- Flist detection technique' COMMENT_FLIST
  243. block_begin 5
  244. choice ROCKCFG_FLIST flwrapper \
  245. flwrapper 'Use the flist wrapper library for flist creation' \
  246. strace 'Use strace to get the file list' \
  247. find 'Use find on timestamp-file for flist creation'
  248. if [ "$ROCKCFG_FLIST" = strace ]; then
  249. pkgenable strace
  250. fi
  251. block_end
  252. comment ' '
  253. comment '- Various Options'
  254. block_begin 5
  255. bool 'Build and use a (pseudo-)cross compiler' ROCKCFG_USE_CROSSCC 1
  256. bool 'Make rebuild stage (stage 9)' ROCKCFG_DO_REBUILD_STAGE 1
  257. if [ $ROCKCFG_CROSSBUILD != 1 ]; then
  258. bool 'Run a check/test for packages with support' ROCKCFG_DO_CHECK 0
  259. fi
  260. if [ $ROCKCFG_USE_CROSSCC != 1 ]; then
  261. pkgfilter sed -e 's,^\([XO] \)0,\1-, ;'
  262. fi
  263. if [ $ROCKCFG_DO_REBUILD_STAGE != 1 ]; then
  264. pkgfilter sed -e 's,^\([XO] [^ ]*\)9 ,\1- , ;'
  265. fi
  266. choice ROCKCFG_OPT size \
  267. smart 'Smart optimisation using a profile database' \
  268. bizarre 'Inverse smart optimisation (this is bizarre)' \
  269. speed 'Hard optimise for speed (often pretty slow)' \
  270. size 'Hard optimise for size (recommended)' \
  271. lazy 'Lazy optimisiation (for debugging binaries)' \
  272. test 'Only optimize toolchain (for fast builds)'
  273. bool 'Create binaries with debug symbols' ROCKCFG_DEBUG 0
  274. bool 'Create statically linked binaries' ROCKCFG_STATIC 0
  275. bool 'Disable exceptions and rtti in C++' ROCKCFG_LIMITCXX 0
  276. bool 'Enable C compiler multilib support' ROCKCFG_MULTILIB 0
  277. bool 'Use automatically precompiled C++ headers' ROCKCFG_AUTOPCH 0
  278. bool 'Disable National Language Support' ROCKCFG_DISABLE_NLS 0
  279. if [ "$ROCKCFG_DISABLE_NLS" = 1 ] ; then
  280. pkgremove gettext
  281. fi
  282. bool 'Automatic documentation creation' ROCKCFG_CREATE_DOCS 1
  283. bool 'Create cache files after packages have been built' \
  284. ROCKCFG_CREATE_CACHE 1
  285. bool 'Run Paranoia Checks in Build-Target and Build-Pkg' \
  286. ROCKCFG_PARANOIA_CHECK 1
  287. bool 'Abbreviate ROCK Config ID with checksum' ROCKCFG_IDCKSUM 0
  288. block_end
  289. expert_end
  290. include "package/*/*/postconfig.in"
  291. include "misc/*/postconfig.in"
  292. include architecture/$ROCKCFG_ARCH/postconfig.in
  293. include target/$ROCKCFG_TARGET/postconfig.in
  294. if [ "$ROCKCFG_CROSSBUILD" = 1 ] ; then
  295. pkgfilter sed -e 's,^\(. ..\)[^ ]*,\1--------, ;'
  296. fi
  297. pkgfilter sed -e '/^[XO] --* / d ;'
  298. [ "$ROCKCFG_EXPERT" = 1 ] ||
  299. ROCKCFG_ID="`echo $ROCKCFG_ID | sed 's,-noexpert.*,,'`"
  300. [ "$ROCKCFG_IDCKSUM" = 1 ] &&
  301. ROCKCFG_ID="`echo $ROCKCFG_ID | cksum | cut -f1 -d' '`"
  302. const ROCKCFG_SHORTID "$ROCKCFG_ID"
  303. ROCKCFG_ID="$config-$ROCKCFG_ID"
  304. const ROCKCFG_ID "$ROCKCFG_ID"