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.

232 lines
6.2 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 - 2009 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. var_append confopt " " "--enable-kernel=2.6.18"
  33. # Disable glibc internal debuging but build debuging and profile
  34. # code so we can use this glibc to debug other programs.
  35. pkg_glibc_preconf(){
  36. configprefix='CFLAGS="$CFLAGS -g -DNDEBUG=1"'
  37. configscript="../configure"
  38. }
  39. hook_add preconf 3 "pkg_glibc_preconf"
  40. # We have to use an 'objdir' directory for building glibc and make its
  41. # name unique by appending $arch_target to distinguish while building
  42. # a multilib capable glibc using buildloops.
  43. pkg_glibc_objdir(){
  44. mkdir -p "objdir-$arch_target"
  45. cd "objdir-$arch_target"
  46. }
  47. hook_add preconf 9 "pkg_glibc_objdir"
  48. var_append confopt " " "--with-gnu-binutils --build=${arch_build} --host=${arch_target}"
  49. if pkginstalled libgd; then
  50. var_append confopt " " "--with-gd=/usr --with-gd-lib=/usr/lib --with-gd-include=/usr/include"
  51. fi
  52. # --enable-add-ons expects a comma seperated list of add-ons
  53. glibc_addons="ports"
  54. # ckeck whether to enable nptl if supported by the architecture
  55. if [ $SDECFG_PKG_GLIBC_TLS = 1 ]; then
  56. var_append glibc_addons "," "nptl"
  57. var_append extraconfopt " " "--with-tls"
  58. var_append extraconfopt " " "--with-__thread"
  59. else
  60. var_append glibc_addons "," "linuxthreads"
  61. var_append extraconfopt " " "--without-__thread"
  62. var_append extraconfopt " " "--disable-sanity-checks"
  63. [[ $arch = mips* ]] && \
  64. var_append extraconfopt " " "--without-tls"
  65. fi
  66. # ckeck whether to enable libidn support
  67. if [ $SDECFG_PKG_GLIBC_LIBIDN = 1 ]; then
  68. var_append glibc_addons "," "libidn"
  69. fi
  70. var_append extraconfopt " " "--enable-add-ons=$glibc_addons"
  71. # control whether to include profiling support
  72. if [ $SDECFG_PKG_GLIBC_ENABLE_PROFILE = 1 ] ; then
  73. var_append extraconfopt " " "--enable-profile"
  74. else
  75. var_append extraconfopt " " "--disable-profile"
  76. fi
  77. var_append makeopt " " "slibdir=/\$slibdir"
  78. var_append makeinstopt " " "slibdir=/\$slibdir install_root=\$root"
  79. glibc_prepatch() {
  80. local tarball= tarname=
  81. local addon= addons="ports"
  82. [ "$SDECFG_PKG_GLIBC_LIBIDN" != '1' ] || var_append addons ' ' 'libidn'
  83. ##[ "$SDECFG_PKG_GLIBC_TLS" = 1 ] || var_append addons ' ' 'linuxthreads'
  84. for addon in $addons; do
  85. tarball=$( match_source_file -p $addon )
  86. tarname=${tarball##*/}; tarname=${tarname%.tar.*}
  87. # extract each addon into the definitive folder
  88. mkdir -pv $addon
  89. ln -sv $addon $tarname
  90. tar -v ${taropt} $tarball
  91. rm $tarname
  92. done
  93. mkdir -p $root$includedir/gnu/
  94. if [ $pkg == glibc ]; then
  95. touch $root$includedir/gnu/stubs.h
  96. if [ $slibdir = lib64 ]; then
  97. touch $root$includedir/gnu/stubs{-32,-64}.h
  98. fi
  99. fi
  100. }
  101. glibc_postmake()
  102. {
  103. if atstage toolchain; then
  104. cp -v ../include/features.h $root$includedir
  105. mkdir -p $includedir/{bits,gnu}
  106. [ -e $root$includedir/bits/stdio_lim.h ] ||
  107. touch $root$includedir/bits/stdio_lim.h
  108. return
  109. fi
  110. ln -sf libbsd-compat.a $root/usr/$slibdir/libbsd.a
  111. # Misc. stuff
  112. #
  113. if atstage native; then
  114. # install locales
  115. #
  116. eval $MAKE localedata/install-locales
  117. cp ../localedata/SUPPORTED $root/usr/share/i18n/
  118. if [ "$SDECFG_PKG_GLIBC_TLS" != 1 ]; then
  119. # install linuxthread manpages
  120. #
  121. mkdir -p $root/usr/share/man/man3
  122. if [ -f /usr/bin/perl ]; then
  123. eval $MAKE -C ../linuxthreads/man \
  124. MANDIR=$root/usr/share/man/man3 all install
  125. fi
  126. # copy linuxthreads documentation
  127. #
  128. for x in ChangeLog Changes README FAQ.html Examples; do
  129. cp -a ../linuxthreads/$x \
  130. $docdir/$x.threads
  131. done
  132. fi
  133. # copy crypt documentation
  134. #
  135. cp ../crypt/README.ufc-crypt $docdir/README.crypt
  136. # NSCD Init script and config
  137. #
  138. cp $confdir/nscd.conf $confdir/nsswitch.conf $root/etc/
  139. fi
  140. # Install ld.so.conf
  141. #
  142. if [ "$SDECFG_MULTILIB" == 1 ] ; then
  143. cat > $root/etc/ld.so.conf <<-EOT
  144. /lib64
  145. /lib32
  146. /lib
  147. /usr/lib64
  148. /usr/lib32
  149. /usr/lib
  150. /usr/*/lib64
  151. /usr/*/lib32
  152. /usr/*/lib
  153. /opt/*/lib64
  154. /opt/*/lib32
  155. /opt/*/lib
  156. /usr/local/lib64
  157. /usr/local/lib32
  158. /usr/local/lib
  159. EOT
  160. else
  161. cat > $root/etc/ld.so.conf <<-EOT
  162. /lib
  163. /usr/lib
  164. /usr/*/lib
  165. /opt/*/lib
  166. /usr/local/lib
  167. EOT
  168. fi
  169. # Move 'ldconfig' and 'sln' binaries
  170. #
  171. if [ -f "$root/usr/sbin/ldconfig" ] ; then
  172. mv -v $root/usr/sbin/ldconfig $root/sbin/ldconfig
  173. fi
  174. if [ -f "$root/usr/sbin/sln" ] ; then
  175. mv -v $root/usr/sbin/sln $root/sbin/sln
  176. fi
  177. # Create /lib/ld-lsb.so.1 symlink
  178. #
  179. if [ -f $root/$slibdir/ld-linux-$arch_machine.so.2 ] ; then
  180. ln -vfs ld-linux-$arch_machine.so.2 $root/$slibdir/ld-lsb.so.1
  181. elif [ -f $root/$slibdir/ld-linux.so.2 ] ; then
  182. ln -vfs ld-linux.so.2 $root/$slibdir/ld-lsb.so.1
  183. fi
  184. }
  185. # in stage 0 we only extract the headers and all is a bit easier ...
  186. if atstage toolchain; then
  187. makeopt=
  188. makeinstopt="-k cross-compiling=yes install-headers"
  189. fi
  190. [[ $libdir = *lib64 ]] && slibdir=lib64 || slibdir=lib
  191. #if atstage cross; then
  192. # var_append patchfiles " " $confdir/no_path_in_glibcso.diff
  193. #fi
  194. hook_add prepatch 3 "glibc_prepatch"
  195. hook_add postmake 5 "glibc_postmake"