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.

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