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.

294 lines
9.4 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. comment_id '- Architecture, CPU and Optimization' COMMENT_ARCHCPUOPT
  73. block_begin 7
  74. choice ROCKCFG_ARCH $CFGTEMP_ARCH $CFGTEMP_ARCHLIST
  75. if [ -f architecture/$ROCKCFG_ARCH/config.in ]
  76. then . architecture/$ROCKCFG_ARCH/config.in ; fi
  77. expert_begin
  78. choice ROCKCFG_OPT size \
  79. smart 'Smart optimisation using a profile database' \
  80. bizarre 'Inverse smart optimisation (this is bizarre)' \
  81. speed 'Hard optimise for speed (often pretty slow)' \
  82. size 'Hard optimise for size (recommended)' \
  83. lazy 'Lazy optimisation (for debugging binaries)' \
  84. test 'Only optimize toolchain (for fast builds)'
  85. bool 'Build and use a (pseudo-)cross compiler' ROCKCFG_USE_CROSSCC 1
  86. expert_end
  87. bool 'This is a cross-build between architectures' ROCKCFG_CROSSBUILD 0
  88. if [ "$ROCKCFG_CROSSBUILD" = 1 ] ; then
  89. block_begin
  90. bool 'Test-build the packages which are not known to cross build' \
  91. 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. 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' \
  106. ROCKCFG_PSEUDONATIVE_NATIVEHOST ''
  107. text 'NFSROOT to be mounted on native host' \
  108. ROCKCFG_PSEUDONATIVE_NFSROOT "$HOSTNAME:$PWD"
  109. ROCKCFGSET_USE_CROSSCC=1
  110. fi
  111. fi
  112. block_end
  113. comment ' '
  114. comment_id '- Target Distribution' COMMENT_TARGET
  115. block_begin 7
  116. choice ROCKCFG_TARGET crystal $CFGTEMP_TARGETLIST
  117. include target/$ROCKCFG_TARGET/config.in
  118. text 'Linguas (translations)' ROCKCFG_LINGUAS 'de es fr it ru'
  119. bool 'Show expert-only and experimental options' ROCKCFG_EXPERT 0
  120. bool 'Abbreviate ROCK Config ID with checksum' ROCKCFG_IDCKSUM 0
  121. block_end
  122. comment ' '
  123. comment_id '- Build System Configuration' COMMENT_BUILD_SYS_CONF
  124. block_begin 3
  125. bool 'Run Paranoia Checks in Build-Target and Build-Pkg' \
  126. ROCKCFG_PARANOIA_CHECK 1
  127. bool 'Make rebuild stage (stage 9)' ROCKCFG_DO_REBUILD_STAGE 1
  128. bool 'Make a parallel (cluster) build' ROCKCFG_PARALLEL 0
  129. if [ "$ROCKCFG_PARALLEL" = 1 ] ; then
  130. block_begin 10
  131. ROCKCFG_PARALLEL_MAX="`echo $ROCKCFG_PARALLEL_MAX |
  132. sed 's,[^0-9],,g'`"
  133. text 'Maximum size of job queue' ROCKCFG_PARALLEL_MAX 10
  134. text 'Command for adding jobs' ROCKCFG_PARALLEL_ADDJOB ''
  135. block_end
  136. else
  137. bool 'Abort when a package-build fails' \
  138. ROCKCFG_ABORT_ON_ERROR 0
  139. fi
  140. bool 'Retry building broken packages' ROCKCFG_RETRY_BROKEN 0
  141. bool 'Disable packages which are marked as broken' \
  142. ROCKCFG_DISABLE_BROKEN 0
  143. bool 'Do not try building packages if deps failed' \
  144. ROCKCFG_NOBROKENDEPS 0
  145. bool 'Always clean up src dirs (even on pkg fail)' \
  146. ROCKCFG_ALWAYS_CLEAN 0
  147. bool 'Create debug information (xtrace) for builds' ROCKCFG_XTRACE 0
  148. bool 'Use tmpfs for building packages' ROCKCFG_SRC_TMPFS 0
  149. if [ "$ROCKCFG_SRC_TMPFS" = 1 ] ; then
  150. block_begin
  151. comment '! WARNING: This feature can hang your system, if'
  152. comment '! you do not have enough virtual memory!'
  153. text 'tmpfs mount options' ROCKCFG_SRC_TMPFS_OPT \
  154. 'size=1024M,nr_inodes=100k'
  155. bool 'Write tmpfs log to var/adm/rock-debug/tmpfslog.txt' \
  156. ROCKCFG_SRC_TMPFS_LOG 0
  157. block_end
  158. fi
  159. expert_begin
  160. bool 'Automatic documentation creation' ROCKCFG_CREATE_DOCS 1
  161. bool 'Create cache files after packages have been built' \
  162. ROCKCFG_CREATE_CACHE 1
  163. if [ $ROCKCFG_CROSSBUILD != 1 ]; then
  164. bool 'Run a check/test for packages with support' ROCKCFG_DO_CHECK 0
  165. fi
  166. comment ' '
  167. comment_id '- Flist detection technique' COMMENT_FLIST
  168. choice ROCKCFG_FLIST flwrapper \
  169. flwrapper 'Use the flist wrapper library for flist creation' \
  170. strace 'Use strace to get the file list' \
  171. find 'Use find on timestamp-file for flist creation'
  172. if [ "$ROCKCFG_FLIST" = strace ]; then
  173. pkgenable strace
  174. fi
  175. expert_end
  176. block_end
  177. include "misc/*/noexpertconfig.in"
  178. expert_begin
  179. comment ' '
  180. comment '- Binary package format'
  181. block_begin 3
  182. bool 'Create Checksums for installed files' ROCKCFG_CREATE_CKSUM 1
  183. bool 'Create *.tar.bz2 binary packages' ROCKCFG_CREATE_TARBZ2 0
  184. bool 'Create *.gem binary packages' ROCKCFG_CREATE_GEM 1
  185. bool 'Append version number to package files' ROCKCFG_PKGFILE_VER 1
  186. block_end
  187. comment ' '
  188. comment '- Package splitting'
  189. block_begin 3
  190. bool 'Create extra *:doc packages' ROCKCFG_SPLIT_DOC 1
  191. bool 'Create extra *:dev packages' ROCKCFG_SPLIT_DEV 1
  192. block_end
  193. comment ' '
  194. comment '- Compiler Options'
  195. block_begin 3
  196. bool 'Create binaries with debug symbols' ROCKCFG_DEBUG 0
  197. bool 'Create statically linked binaries' ROCKCFG_STATIC 0
  198. bool 'Enable C compiler multilib support' ROCKCFG_MULTILIB 0
  199. bool 'Disable exceptions and rtti in C++' ROCKCFG_LIMITCXX 0
  200. bool 'Use automatically precompiled C++ headers (EXPERIMENTAL)' ROCKCFG_AUTOPCH 0
  201. bool 'Disable National Language Support' ROCKCFG_DISABLE_NLS 0
  202. if [ "$ROCKCFG_DISABLE_NLS" = 1 ] ; then
  203. pkgremove gettext
  204. fi
  205. text 'Additional compiler flags' ROCKCFG_C_FLAGS ""
  206. block_end
  207. comment ' '
  208. comment '- Additional GNU Configure Options'
  209. block_begin 3
  210. editfile ROCKCFG_CONFOPT_FILE config/$config.$swpid/confopt \
  211. 'GNU Configure Options'
  212. if [ -f config/$config.$swpid/confopt ] ; then
  213. const ROCKCFG_CONFIGURE_OPTS "`tr '\n' ' ' \
  214. < config/$config.$swpid/confopt`"
  215. else
  216. const ROCKCFG_CONFIGURE_OPTS ""
  217. fi
  218. for option in $ROCKCFG_CONFIGURE_OPTS ; do
  219. if [ "${option#--with-}" = "$option" -a \
  220. "${option#--without-}" = "$option" ]
  221. then
  222. comment '---- Warning! The custom options may break packages!'
  223. break
  224. fi
  225. done
  226. block_end
  227. if [ ! -e "$swpdir/config.in.tmp" ] ; then
  228. ls package/*/*/config{,-*}.in ./misc/*/config{,-*}.in | \
  229. LC_ALL=C sort -k4,4 -t"/" | tr '\n' ' ' | xargs cat | \
  230. grep -v "^#" > "$swpdir/config.in.tmp"
  231. fi
  232. include "$swpdir/config.in.tmp"
  233. expert_end
  234. filterscript=""
  235. if [ "$ROCKCFG_CROSSBUILD" = 1 ] ; then
  236. var_append filterscript ' ' 's,^\(. ..\)[^ ]*,\1--------, ;'
  237. if [ $ROCKCFG_CROSS_TESTALL = 1 ]; then
  238. var_append filterscript ' ' 's,^\(. .\)?,\11, ;'
  239. else
  240. var_append filterscript ' ' 's,^\(. .\)?,\1-, ;'
  241. fi
  242. var_append filterscript ' ' 's,^\(. .\)X,\11, ; s,^\(. \)X,\1-, ;'
  243. else
  244. var_append filterscript ' ' 's,^\(. .\)[?X],\1-, ;'
  245. if [ "$ROCKCFG_PSEUDONATIVE" = 1 ] ; then
  246. var_append filterscript ' ' 's,^\(. \)X,\10, ;'
  247. else
  248. var_append filterscript ' ' 's,^\(. \)X,\1-, ;'
  249. fi
  250. fi
  251. if [ $ROCKCFG_USE_CROSSCC != 1 ]; then
  252. var_append filterscript ' ' 's,^\([XO] \)0,\1-, ;'
  253. fi
  254. if [ $ROCKCFG_DO_REBUILD_STAGE != 1 ]; then
  255. var_append filterscript ' ' 's,^\([XO] [^ ]*\)9 ,\1- , ;'
  256. fi
  257. var_append filterscript ' ' '/^[XO] --* / d ;'
  258. pkgfilter sed -e "$filterscript"
  259. ROCKCFG_ID="$CFGTEMP_ID-$ROCKCFG_ARCH-$ROCKCFG_TARGET"
  260. [ "$ROCKCFG_CROSSBUILD" = 1 ] && ROCKCFG_ID="$ROCKCFG_ID-cross"
  261. [ "$ROCKCFG_PSEUDONATIVE" = 1 ] && ROCKCFG_ID="$ROCKCFG_ID-pseudonative"
  262. [ $ROCKCFG_EXPERT == 1 ] && ROCKCFG_ID="$ROCKCFG_ID-expert"
  263. [ "$ROCKCFG_IDCKSUM" = 1 ] && \
  264. ROCKCFG_ID="`echo $ROCKCFG_ID | cksum | cut -f1 -d' '`"
  265. const ROCKCFG_SHORTID "$ROCKCFG_ID"
  266. ROCKCFG_ID="$config-$ROCKCFG_ID"
  267. const ROCKCFG_ID "$ROCKCFG_ID"