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.

249 lines
6.7 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 - 2011 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. # if $HOSTCC is a gcc < 4.3 we need 'cpuid.h'
  26. if ! $HOSTCC -dumpversion | grep -q '^4\.[345]' ; then
  27. echo_warning "Old gcc detected: Working around cpuid.h support"
  28. var_append SYSCC_WRAPPER_APPEND ' ' "-I$confdir/include-old-gcc"
  29. fi
  30. else
  31. var_append confopt " " "--with-headers=$root/usr/include"
  32. fi
  33. # use at least "-O" when build without optimisation for debugging ...
  34. var_insert GCC_WRAPPER_INSERT " " "-O"
  35. # glibc does not like -ffast-math
  36. var_insert GCC_WRAPPER_REMOVE " " "-ffast-math"
  37. var_append confopt " " "--enable-kernel=2.6.18"
  38. # Disable glibc internal debuging but build debuging and profile
  39. # code so we can use this glibc to debug other programs.
  40. pkg_glibc_preconf(){
  41. configprefix='CFLAGS="$CFLAGS -g -DNDEBUG=1"'
  42. configscript="../configure"
  43. }
  44. hook_add preconf 3 "pkg_glibc_preconf"
  45. # We have to use an 'objdir' directory for building glibc and make its
  46. # name unique by appending $arch_target to distinguish while building
  47. # a multilib capable glibc using buildloops.
  48. pkg_glibc_objdir(){
  49. mkdir -p "objdir-$arch_target"
  50. cd "objdir-$arch_target"
  51. }
  52. hook_add preconf 9 "pkg_glibc_objdir"
  53. var_append confopt " " "--with-gnu-binutils --build=${arch_build} --host=${arch_target}"
  54. if pkginstalled libgd; then
  55. var_append confopt " " "--with-gd=/usr --with-gd-lib=/usr/lib --with-gd-include=/usr/include"
  56. fi
  57. # --enable-add-ons expects a comma seperated list of add-ons
  58. glibc_addons="ports"
  59. # ckeck whether to enable nptl if supported by the architecture
  60. if [ $SDECFG_PKG_GLIBC_TLS = 1 ]; then
  61. var_append glibc_addons "," "nptl"
  62. var_append extraconfopt " " "--with-tls"
  63. var_append extraconfopt " " "--with-__thread"
  64. else
  65. var_append glibc_addons "," "linuxthreads"
  66. var_append extraconfopt " " "--without-__thread"
  67. var_append extraconfopt " " "--disable-sanity-checks"
  68. [[ $arch = mips* ]] && \
  69. var_append extraconfopt " " "--without-tls"
  70. fi
  71. var_append extraconfopt " " "--enable-add-ons=$glibc_addons"
  72. # control whether to include profiling support
  73. if [ $SDECFG_PKG_GLIBC_ENABLE_PROFILE = 1 ] ; then
  74. var_append extraconfopt " " "--enable-profile"
  75. else
  76. var_append extraconfopt " " "--disable-profile"
  77. fi
  78. var_append makeopt " " "slibdir=/\$slibdir"
  79. var_append makeinstopt " " "slibdir=/\$slibdir install_root=\$root"
  80. glibc_prepatch() {
  81. local tarball= tarname=
  82. local addon= addons="ports"
  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 --dereference ${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. # TODO
  143. # We should migrate to a more modular approach here, moving to package
  144. # based configuration in '/etc/ld.so.conf.d/$pkg.conf' and including all
  145. # dedicated conf files in a generic main 'ld.so.conf' like this:
  146. #
  147. # include /etc/ld.so.conf.d/*.conf
  148. #
  149. case $arch_machine in
  150. powerpc64|sparc64|x86_64|mips64)
  151. cat > $root/etc/ld.so.conf <<-EOT
  152. /lib64
  153. /lib
  154. /usr/lib64
  155. /usr/lib
  156. /usr/lib64/*/
  157. /usr/lib/*/
  158. /usr/*/lib64
  159. /usr/*/lib
  160. /opt/*/lib64
  161. /opt/*/lib
  162. /usr/local/lib64
  163. /usr/local/lib
  164. EOT
  165. if [ "$SDECFG_MULTILIB" == 1 ] ; then
  166. cat >> $root/etc/ld.so.conf <<-EOT
  167. /lib32
  168. /usr/lib32
  169. /usr/lib32/*/
  170. /usr/*/lib32
  171. /opt/*/lib32
  172. /usr/local/lib32
  173. EOT
  174. fi
  175. ;;
  176. *) cat > $root/etc/ld.so.conf <<-EOT
  177. /lib
  178. /usr/lib
  179. /usr/lib/*/
  180. /usr/*/lib
  181. /opt/*/lib
  182. /usr/local/lib
  183. EOT
  184. ;;
  185. esac
  186. # Move 'ldconfig' and 'sln' binaries
  187. #
  188. if [ -f "$root/usr/sbin/ldconfig" ] ; then
  189. mv -v $root/usr/sbin/ldconfig $root/sbin/ldconfig
  190. fi
  191. if [ -f "$root/usr/sbin/sln" ] ; then
  192. mv -v $root/usr/sbin/sln $root/sbin/sln
  193. fi
  194. # Create /lib/ld-lsb.so.1 symlink
  195. #
  196. if [ -f $root/$slibdir/ld-linux-$arch_machine.so.2 ] ; then
  197. ln -vfs ld-linux-$arch_machine.so.2 $root/$slibdir/ld-lsb.so.1
  198. elif [ -f $root/$slibdir/ld-linux.so.2 ] ; then
  199. ln -vfs ld-linux.so.2 $root/$slibdir/ld-lsb.so.1
  200. fi
  201. }
  202. # in stage 0 we only extract the headers and all is a bit easier ...
  203. if atstage toolchain; then
  204. makeopt=
  205. makeinstopt="-k cross-compiling=yes install-headers"
  206. fi
  207. [[ $libdir = *lib64 ]] && slibdir=lib64 || slibdir=lib
  208. #if atstage cross; then
  209. # var_append patchfiles " " $confdir/no_path_in_glibcso.diff
  210. #fi
  211. hook_add prepatch 3 "glibc_prepatch"
  212. hook_add postmake 5 "glibc_postmake"