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.

230 lines
6.1 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. var_append extraconfopt " " "--with-tls"
  57. var_append extraconfopt " " "--with-__thread"
  58. else
  59. var_append glibc_addons "," "linuxthreads"
  60. var_append extraconfopt " " "--without-__thread"
  61. var_append extraconfopt " " "--disable-sanity-checks"
  62. [[ $arch = mips* ]] && \
  63. var_append extraconfopt " " "--without-tls"
  64. fi
  65. # ckeck whether to enable libidn support
  66. if [ $SDECFG_PKG_GLIBC_LIBIDN = 1 ]; then
  67. var_append glibc_addons "," "libidn"
  68. fi
  69. var_append extraconfopt " " "--enable-add-ons=$glibc_addons"
  70. # control whether to include profiling support
  71. if [ $SDECFG_PKG_GLIBC_ENABLE_PROFILE = 1 ] ; then
  72. var_append extraconfopt " " "--enable-profile"
  73. else
  74. var_append extraconfopt " " "--disable-profile"
  75. fi
  76. var_append makeopt " " "slibdir=/\$slibdir"
  77. var_append makeinstopt " " "slibdir=/\$slibdir install_root=\$root"
  78. glibc_prepatch() {
  79. local tarball= tarname=
  80. local addon= addons="ports"
  81. [ "$SDECFG_PKG_GLIBC_LIBIDN" != '1' ] || var_append addons ' ' 'libidn'
  82. [ "$SDECFG_PKG_GLIBC_TLS" = 1 ] || var_append addons ' ' 'linuxthreads'
  83. for addon in $addons; do
  84. tarball=$( match_source_file -p $addon )
  85. tarname=${tarball##*/}; tarname=${tarname%.tar.*}
  86. # extract each addon into the definitive folder
  87. mkdir -pv $addon
  88. ln -sv $addon $tarname
  89. tar -v ${taropt} $tarball
  90. rm $tarname
  91. done
  92. mkdir -p $root$includedir/gnu/
  93. if [ $pkg == glibc ]; then
  94. touch $root$includedir/gnu/stubs.h
  95. if [ $slibdir = lib64 ]; then
  96. touch $root$includedir/gnu/stubs{-32,-64}.h
  97. fi
  98. fi
  99. }
  100. glibc_postmake()
  101. {
  102. if atstage toolchain; then
  103. cp -v ../include/features.h $root$includedir
  104. mkdir -p $includedir/{bits,gnu}
  105. [ -e $root$includedir/bits/stdio_lim.h ] ||
  106. touch $root$includedir/bits/stdio_lim.h
  107. return
  108. fi
  109. ln -sf libbsd-compat.a $root/usr/$slibdir/libbsd.a
  110. # Misc. stuff
  111. #
  112. if atstage native; then
  113. # install locales
  114. #
  115. eval $MAKE localedata/install-locales
  116. cp ../localedata/SUPPORTED $root/usr/share/i18n/
  117. if [ "$SDECFG_PKG_GLIBC_TLS" != 1 ]; then
  118. # install linuxthread manpages
  119. #
  120. mkdir -p $root/usr/share/man/man3
  121. if [ -f /usr/bin/perl ]; then
  122. eval $MAKE -C ../linuxthreads/man \
  123. MANDIR=$root/usr/share/man/man3 all install
  124. fi
  125. # copy linuxthreads documentation
  126. #
  127. for x in ChangeLog Changes README FAQ.html Examples; do
  128. cp -a ../linuxthreads/$x \
  129. $docdir/$x.threads
  130. done
  131. fi
  132. # copy crypt documentation
  133. #
  134. cp ../crypt/README.ufc-crypt $docdir/README.crypt
  135. # NSCD Init script and config
  136. #
  137. cp $confdir/nscd.conf $confdir/nsswitch.conf $root/etc/
  138. fi
  139. # Install ld.so.conf
  140. #
  141. if [ "$SDECFG_MULTILIB" == 1 ] ; then
  142. cat > $root/etc/ld.so.conf <<-EOT
  143. /lib64
  144. /lib32
  145. /lib
  146. /usr/lib64
  147. /usr/lib32
  148. /usr/lib
  149. /usr/*/lib64
  150. /usr/*/lib32
  151. /usr/*/lib
  152. /opt/*/lib64
  153. /opt/*/lib32
  154. /opt/*/lib
  155. /usr/local/lib64
  156. /usr/local/lib32
  157. /usr/local/lib
  158. EOT
  159. else
  160. cat > $root/etc/ld.so.conf <<-EOT
  161. /lib
  162. /usr/lib
  163. /usr/*/lib
  164. /opt/*/lib
  165. /usr/local/lib
  166. EOT
  167. fi
  168. # Move 'ldconfig' and 'sln' binaries
  169. #
  170. if [ -f "$root/usr/sbin/ldconfig" ] ; then
  171. mv -v $root/usr/sbin/ldconfig $root/sbin/ldconfig
  172. fi
  173. if [ -f "$root/usr/sbin/sln" ] ; then
  174. mv -v $root/usr/sbin/sln $root/sbin/sln
  175. fi
  176. # Create /lib/ld-lsb.so.1 symlink
  177. #
  178. if [ -f $root/$slibdir/ld-linux-$arch_machine.so.2 ] ; then
  179. ln -vfs ld-linux-$arch_machine.so.2 $root/$slibdir/ld-lsb.so.1
  180. elif [ -f $root/$slibdir/ld-linux.so.2 ] ; then
  181. ln -vfs ld-linux.so.2 $root/$slibdir/ld-lsb.so.1
  182. fi
  183. }
  184. # in stage 0 we only extract the headers and all is a bit easier ...
  185. if atstage toolchain; then
  186. makeopt=
  187. makeinstopt="-k cross-compiling=yes install-headers"
  188. fi
  189. [[ $libdir = *lib64 ]] && slibdir=lib64 || slibdir=lib
  190. #if atstage cross; then
  191. # var_append patchfiles " " $confdir/no_path_in_glibcso.diff
  192. #fi
  193. hook_add prepatch 3 "glibc_prepatch"
  194. hook_add postmake 5 "glibc_postmake"