OpenSDE Packages Database (without history before r20070)
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.

247 lines
6.6 KiB

  1. # --- SDE-COPYRIGHT-NOTE-BEGIN ---
  2. # This copyright note is auto-generated by ./scripts/Create-CopyPatch.
  3. #
  4. # Filename: package/.../glibc/glibc.conf
  5. # Copyright (C) 2006 - 2008 The OpenSDE Project
  6. # Copyright (C) 2004 - 2006 The T2 SDE Project
  7. #
  8. # More information can be found in the files COPYING and README.
  9. #
  10. # This program is free software; you can redistribute it and/or modify
  11. # it under the terms of the GNU General Public License as published by
  12. # the Free Software Foundation; version 2 of the License. A copy of the
  13. # GNU General Public License can be found in the file COPYING.
  14. # --- SDE-COPYRIGHT-NOTE-END ---
  15. # overwrite prefix to not point to the tools, but the real root for the headers
  16. if atstage toolchain; then
  17. # hack due to sane variable not available and prefix is tools prefix
  18. # -ReneR
  19. confopt="--prefix=$base/build/$SDECFG_ID/usr \
  20. --with-headers=$base/build/$SDECFG_ID/usr/include \$extraconfopt"
  21. includedir="/../../usr/include"
  22. # MIPS injects -mabi - the host CC does not know about it for header gen
  23. var_append SYSCC_WRAPPER_REMOVE ' ' '-mabi*'
  24. var_append SYSCPP_WRAPPER_REMOVE ' ' '-mabi*'
  25. else
  26. var_append confopt " " "--with-headers=$root/usr/include"
  27. fi
  28. # use at least "-O" when build without optimisation for debugging ...
  29. var_insert GCC_WRAPPER_INSERT " " "-O"
  30. # glibc does not like -ffast-math
  31. var_insert GCC_WRAPPER_REMOVE " " "-ffast-math"
  32. # Disable glibc internal debuging but build debuging and profile
  33. # code so we can use this glibc to debug other programs.
  34. pkg_glibc_preconf(){
  35. configprefix='CFLAGS="$CFLAGS -g -DNDEBUG=1"'
  36. configscript="../configure"
  37. }
  38. hook_add preconf 3 "pkg_glibc_preconf"
  39. # We have to use an 'objdir' directory for building glibc and make its
  40. # name unique by appending $arch_target to distinguish while building
  41. # a multilib capable glibc using buildloops.
  42. pkg_glibc_objdir(){
  43. mkdir -p "objdir-$arch_target"
  44. cd "objdir-$arch_target"
  45. }
  46. hook_add preconf 9 "pkg_glibc_objdir"
  47. var_append confopt " " "--with-gnu-binutils --build=${arch_build} --host=${arch_target}"
  48. if pkginstalled libgd; then
  49. var_append confopt " " "--with-gd=/usr --with-gd-lib=/usr/lib --with-gd-include=/usr/include"
  50. fi
  51. # --enable-add-ons expects a comma seperated list of add-ons
  52. glibc_addons="ports"
  53. # ckeck whether to enable nptl if supported by the architecture
  54. if [ $SDECFG_PKG_GLIBC_TLS = 1 ]; then
  55. var_append glibc_addons "," "nptl"
  56. if ! atstage native ; then
  57. # tls config.cache tweaks for toolchain stage
  58. if atstage toolchain ; then
  59. case "$arch" in
  60. sparc64)
  61. tls_arch=sparc64
  62. ;;
  63. esac
  64. var_append configcache ' ' "libc_cv_${tls_arch}_tls=yes"
  65. else
  66. # extra configure options for cross stage
  67. var_append extraconfopt " " "--with-tls"
  68. var_append extraconfopt " " "--with-__thread"
  69. fi
  70. # tls config.cache tweaks for toolchain and cross stage
  71. var_append configcache ' ' "libc_cv_forced_unwind=yes"
  72. var_append configcache ' ' "libc_cv_c_cleanup=yes"
  73. fi
  74. else
  75. var_append glibc_addons "," "linuxthreads"
  76. var_append extraconfopt " " "--without-__thread"
  77. var_append extraconfopt " " "--disable-sanity-checks"
  78. [[ $arch = mips* ]] && \
  79. var_append extraconfopt " " "--without-tls"
  80. fi
  81. # ckeck whether to enable libidn support
  82. if [ $SDECFG_PKG_GLIBC_LIBIDN = 1 ]; then
  83. var_append glibc_addons "," "libidn"
  84. fi
  85. var_append extraconfopt " " "--enable-add-ons=$glibc_addons"
  86. # control whether to include profiling support
  87. if [ $SDECFG_PKG_GLIBC_ENABLE_PROFILE = 1 ] ; then
  88. var_append extraconfopt " " "--enable-profile"
  89. else
  90. var_append extraconfopt " " "--disable-profile"
  91. fi
  92. var_append makeopt " " "slibdir=/\$slibdir"
  93. var_append makeinstopt " " "slibdir=/\$slibdir install_root=\$root"
  94. glibc_prepatch() {
  95. local tarball= tarname=
  96. local addon= addons="ports"
  97. [ "$SDECFG_PKG_GLIBC_LIBIDN" != '1' ] || var_append addons ' ' 'libidn'
  98. [ "$SDECFG_PKG_GLIBC_TLS" = 1 ] || var_append addons ' ' 'linuxthreads'
  99. for addon in $addons; do
  100. tarball=$( match_source_file -p $addon )
  101. tarname=${tarball##*/}; tarname=${tarname%.tar.*}
  102. # extract each addon into the definitive folder
  103. mkdir -pv $addon
  104. ln -sv $addon $tarname
  105. tar -v ${taropt} $tarball
  106. rm $tarname
  107. done
  108. mkdir -p $root$includedir/gnu/
  109. if [ $pkg == glibc ]; then
  110. touch $root$includedir/gnu/stubs.h
  111. if [ $slibdir = lib64 ]; then
  112. touch $root$includedir/gnu/stubs{-32,-64}.h
  113. fi
  114. fi
  115. }
  116. glibc_postmake()
  117. {
  118. if atstage toolchain; then
  119. cp -v ../include/features.h $root$includedir
  120. mkdir -p $includedir/{bits,gnu}
  121. [ -e $root$includedir/bits/stdio_lim.h ] ||
  122. touch $root$includedir/bits/stdio_lim.h
  123. return
  124. fi
  125. ln -sf libbsd-compat.a $root/usr/$slibdir/libbsd.a
  126. # Misc. stuff
  127. #
  128. if atstage native; then
  129. # install locales
  130. #
  131. eval $MAKE localedata/install-locales
  132. cp ../localedata/SUPPORTED $root/usr/share/i18n/
  133. if [ "$SDECFG_PKG_GLIBC_TLS" != 1 ]; then
  134. # install linuxthread manpages
  135. #
  136. mkdir -p $root/usr/share/man/man3
  137. if [ -f /usr/bin/perl ]; then
  138. eval $MAKE -C ../linuxthreads/man \
  139. MANDIR=$root/usr/share/man/man3 all install
  140. fi
  141. # copy linuxthreads documentation
  142. #
  143. for x in ChangeLog Changes README FAQ.html Examples; do
  144. cp -a ../linuxthreads/$x \
  145. $docdir/$x.threads
  146. done
  147. fi
  148. # copy crypt documentation
  149. #
  150. cp ../crypt/README.ufc-crypt $docdir/README.crypt
  151. # NSCD Init script and config
  152. #
  153. cp $confdir/nscd.conf $confdir/nsswitch.conf $root/etc/
  154. fi
  155. # Install ld.so.conf
  156. #
  157. if [ "$SDECFG_MULTILIB" == 1 ] ; then
  158. cat > $root/etc/ld.so.conf <<-EOT
  159. /lib64
  160. /lib32
  161. /lib
  162. /usr/lib64
  163. /usr/lib32
  164. /usr/lib
  165. /usr/*/lib64
  166. /usr/*/lib32
  167. /usr/*/lib
  168. /opt/*/lib64
  169. /opt/*/lib32
  170. /opt/*/lib
  171. /usr/local/lib64
  172. /usr/local/lib32
  173. /usr/local/lib
  174. EOT
  175. else
  176. cat > $root/etc/ld.so.conf <<-EOT
  177. /lib
  178. /usr/lib
  179. /usr/*/lib
  180. /opt/*/lib
  181. /usr/local/lib
  182. EOT
  183. fi
  184. # Move 'ldconfig' and 'sln' binaries
  185. #
  186. if [ -f "$root/usr/sbin/ldconfig" ] ; then
  187. mv -v $root/usr/sbin/ldconfig $root/sbin/ldconfig
  188. fi
  189. if [ -f "$root/usr/sbin/sln" ] ; then
  190. mv -v $root/usr/sbin/sln $root/sbin/sln
  191. fi
  192. # Create /lib/ld-lsb.so.1 symlink
  193. #
  194. if [ -f $root/$slibdir/ld-linux-$arch_machine.so.2 ] ; then
  195. ln -vfs ld-linux-$arch_machine.so.2 $root/$slibdir/ld-lsb.so.1
  196. elif [ -f $root/$slibdir/ld-linux.so.2 ] ; then
  197. ln -vfs ld-linux.so.2 $root/$slibdir/ld-lsb.so.1
  198. fi
  199. }
  200. # in stage 0 we only extract the headers and all is a bit easier ...
  201. if atstage toolchain; then
  202. makeopt=
  203. makeinstopt="-k cross-compiling=yes install-headers"
  204. fi
  205. [[ $libdir = *lib64 ]] && slibdir=lib64 || slibdir=lib
  206. #if atstage cross; then
  207. # var_append patchfiles " " $confdir/no_path_in_glibcso.diff
  208. #fi
  209. hook_add prepatch 3 "glibc_prepatch"
  210. hook_add postmake 5 "glibc_postmake"