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.

334 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. unset ${!CFGTEMP_*}
  73. bprof rockconfig_preconfig start
  74. if [ ! -e "$swpdir/preconfig.in.tmp" ] ; then
  75. grep -h -v "^#" architecture/*/preconfig.in \
  76. misc/*/preconfig.in \
  77. target/*/preconfig.in \
  78. package/*/*/preconfig.in \
  79. 2> /dev/null > "$swpdir/preconfig.in.tmp"
  80. fi
  81. include "$swpdir/preconfig.in.tmp"
  82. bprof rockconfig_preconfig stop
  83. bprof rockconfig_arch start
  84. comment_id '- Architecture, CPU and Optimization' COMMENT_ARCHCPUOPT
  85. block_begin 7
  86. choice ROCKCFG_ARCH $arch $CFGTEMP_ARCHLIST
  87. ROCKCFG_ID="$rockver-$ROCKCFG_ARCH"
  88. if [ -f architecture/$ROCKCFG_ARCH/config.in ]
  89. then . architecture/$ROCKCFG_ARCH/config.in ; fi
  90. expert_begin
  91. choice ROCKCFG_OPT size \
  92. smart 'Smart optimisation using a profile database' \
  93. bizarre 'Inverse smart optimisation (this is bizarre)' \
  94. speed 'Hard optimise for speed (often pretty slow)' \
  95. size 'Hard optimise for size (recommended)' \
  96. lazy 'Lazy optimisation (for debugging binaries)' \
  97. test 'Only optimize toolchain (for fast builds)'
  98. expert_end
  99. bool 'This is a cross-build between architectures' ROCKCFG_CROSSBUILD 0
  100. if [ "$ROCKCFG_CROSSBUILD" = 1 ] ; then
  101. block_begin
  102. bool 'Test-build the packages which are not known to cross build' \
  103. ROCKCFG_CROSS_TESTALL 0
  104. if [ $ROCKCFG_CROSS_TESTALL = 1 ]; then
  105. comment '-- WARNING: Test-building packages which are not known to cross build'
  106. comment '-- might cause damage on your build system if it is not read-only. So'
  107. comment '-- only run this if your /{bin,lib,usr,..} is somehow write-protected.'
  108. fi
  109. const ROCKCFG_PSEUDONATIVE 0
  110. block_end
  111. else
  112. bool 'This is a pseudo-native cross-build' ROCKCFG_PSEUDONATIVE 0
  113. if [ "$ROCKCFG_PSEUDONATIVE" = 1 ] ; then
  114. comment '-- WARNING: Doing pseudo native builds is a tricky thing.'
  115. comment '-- Better write the documentation first... ;-)'
  116. text 'IP of native host for command forwarding' \
  117. ROCKCFG_PSEUDONATIVE_NATIVEHOST ''
  118. text 'NFSROOT to be mounted on native host' \
  119. ROCKCFG_PSEUDONATIVE_NFSROOT "$HOSTNAME:$PWD"
  120. fi
  121. fi
  122. block_end
  123. bprof rockconfig_arch stop
  124. bprof rockconfig_target start
  125. comment ' '
  126. comment_id '- Target Distribution' COMMENT_TARGET
  127. block_begin 7
  128. choice ROCKCFG_TARGET crystal $CFGTEMP_TARGETLIST
  129. include target/$ROCKCFG_TARGET/config.in
  130. text 'Linguas (translations)' ROCKCFG_LINGUAS 'de es fr it ru'
  131. bool 'Show expert-only and experimental options' ROCKCFG_EXPERT 0
  132. bool 'Abbreviate ROCK Config ID with checksum' ROCKCFG_IDCKSUM 0
  133. block_end
  134. bprof rockconfig_target stop
  135. bprof rockconfig_buildsys start
  136. comment ' '
  137. comment_id '- Build System Configuration' COMMENT_BUILD_SYS_CONF
  138. block_begin 3
  139. bool 'Run Paranoia Checks in Build-Target and Build-Pkg' \
  140. ROCKCFG_PARANOIA_CHECK 1
  141. bool 'Make rebuild stage (stage 9)' ROCKCFG_DO_REBUILD_STAGE 1
  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. expert_begin
  174. bool 'Automatic documentation creation' ROCKCFG_CREATE_DOCS 1
  175. bool 'Create cache files after packages have been built' \
  176. ROCKCFG_CREATE_CACHE 1
  177. if [ $ROCKCFG_CROSSBUILD != 1 ]; then
  178. bool 'Run a check/test for packages with support' ROCKCFG_DO_CHECK 0
  179. fi
  180. comment ' '
  181. comment_id '- Flist detection technique' COMMENT_FLIST
  182. choice ROCKCFG_FLIST flwrapper \
  183. flwrapper 'Use the flist wrapper library for flist creation' \
  184. strace 'Use strace to get the file list' \
  185. find 'Use find on timestamp-file for flist creation'
  186. if [ "$ROCKCFG_FLIST" = strace ]; then
  187. pkgenable strace
  188. fi
  189. expert_end
  190. block_end
  191. bprof rockconfig_buildsys stop
  192. bprof rockconfig_noexpert start
  193. include "misc/*/noexpertconfig.in"
  194. bprof rockconfig_noexpert stop
  195. bprof rockconfig_expert start
  196. expert_begin
  197. comment ' '
  198. comment '- Binary package format'
  199. block_begin 3
  200. bool 'Create Checksums for installed files' ROCKCFG_CREATE_CKSUM 1
  201. bool 'Create *.tar.bz2 binary packages' ROCKCFG_CREATE_TARBZ2 0
  202. bool 'Create *.gem binary packages' ROCKCFG_CREATE_GEM 1
  203. bool 'Append version number to package files' ROCKCFG_PKGFILE_VER 1
  204. block_end
  205. comment ' '
  206. comment '- Package splitting'
  207. block_begin 3
  208. bool 'Create extra *:doc packages' ROCKCFG_SPLIT_DOC 1
  209. bool 'Create extra *:dev packages' ROCKCFG_SPLIT_DEV 1
  210. block_end
  211. comment ' '
  212. comment '- Compiler Options'
  213. block_begin 3
  214. bool 'Create binaries with debug symbols' ROCKCFG_DEBUG 0
  215. bool 'Create statically linked binaries' ROCKCFG_STATIC 0
  216. bool 'Enable C compiler multilib support' ROCKCFG_MULTILIB 0
  217. bool 'Disable exceptions and rtti in C++' ROCKCFG_LIMITCXX 0
  218. bool 'Use automatically precompiled C++ headers (EXPERIMENTAL)' ROCKCFG_AUTOPCH 0
  219. bool 'Disable National Language Support' ROCKCFG_DISABLE_NLS 0
  220. if [ "$ROCKCFG_DISABLE_NLS" = 1 ] ; then
  221. pkgremove gettext
  222. fi
  223. text 'Additional compiler flags' ROCKCFG_C_FLAGS ""
  224. block_end
  225. comment ' '
  226. comment '- Additional GNU Configure Options'
  227. block_begin 3
  228. editfile ROCKCFG_CONFOPT_FILE config/$config.$swpid/confopt \
  229. 'GNU Configure Options'
  230. if [ -f config/$config.$swpid/confopt ] ; then
  231. const ROCKCFG_CONFIGURE_OPTS "`tr '\n' ' ' \
  232. < config/$config.$swpid/confopt`"
  233. else
  234. const ROCKCFG_CONFIGURE_OPTS ""
  235. fi
  236. for option in $ROCKCFG_CONFIGURE_OPTS ; do
  237. if [ "${option#--with-}" = "$option" -a \
  238. "${option#--without-}" = "$option" ]
  239. then
  240. comment '---- Warning! The custom options may break packages!'
  241. break
  242. fi
  243. done
  244. block_end
  245. if [ ! -e "$swpdir/config.in.tmp" ] ; then
  246. ls package/*/*/config{,-*}.in ./misc/*/config{,-*}.in | \
  247. LC_ALL=C sort -k4,4 -t"/" | \
  248. xargs grep -h -v "^#" 2> /dev/null > "$swpdir/config.in.tmp"
  249. fi
  250. include "$swpdir/config.in.tmp"
  251. expert_end
  252. bprof rockconfig_expert stop
  253. bprof rockconfig_postconfig start
  254. [ "$ROCKCFG_CROSSBUILD" = 1 ] && ROCKCFG_ID="$ROCKCFG_ID-cross"
  255. [ "$ROCKCFG_PSEUDONATIVE" = 1 ] && ROCKCFG_ID="$ROCKCFG_ID-pseudonative"
  256. ROCKCFG_ID="$ROCKCFG_ID-$ROCKCFG_TARGET"
  257. [ $ROCKCFG_EXPERT == 1 ] && ROCKCFG_ID="$ROCKCFG_ID-expert"
  258. [ "$ROCKCFG_IDCKSUM" = 1 ] && \
  259. ROCKCFG_ID="`echo $ROCKCFG_ID | cksum | cut -f1 -d' '`"
  260. const ROCKCFG_SHORTID "$ROCKCFG_ID"
  261. ROCKCFG_ID="$config-$ROCKCFG_ID"
  262. const ROCKCFG_ID "$ROCKCFG_ID"
  263. if [ ! -e "$swpdir/postconfig.in.tmp" ] ; then
  264. {
  265. ls misc/*/postconfig{,-*}.in 2>/dev/null \
  266. | LC_ALL=C sort -k3,3 -t"/"
  267. ls package/*/*/postconfig.in
  268. } | xargs grep -h -v "^#" 2> /dev/null > "$swpdir/postconfig.in.tmp"
  269. fi
  270. include "$swpdir/postconfig.in.tmp"
  271. include architecture/$ROCKCFG_ARCH/postconfig.in
  272. include target/$ROCKCFG_TARGET/postconfig.in
  273. filterscript=""
  274. if [ "$ROCKCFG_CROSSBUILD" = 1 ] ; then
  275. var_append filterscript ' ' 's,^\(. ...\)[^ ]*,\1-------, ;'
  276. var_append filterscript ' ' 's,^\(. .\)?,\1-, ;'
  277. if [ $ROCKCFG_CROSS_TESTALL = 1 ]; then
  278. var_append filterscript ' ' 's,^\(. ..\)?,\12, ;'
  279. else
  280. var_append filterscript ' ' 's,^\(. ..\)?,\1-, ;'
  281. fi
  282. var_append filterscript ' ' 's,^\(. .\)X,\11, ; s,^\(. \)X,\1-, ; s,^\(. ..\)X,\12, ;'
  283. else
  284. var_append filterscript ' ' 's,^\(. .\)[?X],\1-, ; s,^\(. ..\)[?X],\1-, ;'
  285. if [ "$ROCKCFG_PSEUDONATIVE" = 1 ] ; then
  286. var_append filterscript ' ' 's,^\(. \)X,\10, ;'
  287. else
  288. var_append filterscript ' ' 's,^\(. \)X,\1-, ;'
  289. fi
  290. fi
  291. if [ "$ROCKCFG_MULTILIB" = 1 ] ; then
  292. var_append filterscript ' ' '/ MULTILIB / { h ; s,\(\( [^ ]*\)\{3\}\) \([^ ]*\),\1 \3=\3-32bit, ; G } ;'
  293. fi
  294. if [ $ROCKCFG_DO_REBUILD_STAGE != 1 ]; then
  295. var_append filterscript ' ' 's,^\([XO] [^ ]*\)9 ,\1- , ;'
  296. fi
  297. var_append filterscript ' ' '/^[XO] --* / d ;'
  298. pkgfilter sed -e "$filterscript"
  299. bprof rockconfig_postconfig stop