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.

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