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.

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