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.

222 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 - 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=
  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. # if there are add-ons defined append a proper list of add-ons to the
  61. # extraconfopt's
  62. [[ -z $glibc_addons ]] || \
  63. var_append extraconfopt " " "--enable-add-ons=$glibc_addons"
  64. # control whether to include profiling support
  65. if [ $SDECFG_PKG_GLIBC_ENABLE_PROFILE = 1 ] ; then
  66. var_append extraconfopt " " "--enable-profile"
  67. else
  68. var_append extraconfopt " " "--disable-profile"
  69. fi
  70. var_append makeopt " " "slibdir=/\$slibdir"
  71. var_append makeinstopt " " "slibdir=/\$slibdir install_root=\$root"
  72. glibc_prepatch() {
  73. local tarball= tarname=
  74. for tarball in `match_source_file -p ports` \
  75. `match_source_file -p libidn` \
  76. `match_source_file -p linuxthread`
  77. do
  78. tarname=${tarball##*/}; tarname=${tarname%.tar.*}
  79. # do not overwrite the configure script and such
  80. case "$tarball" in
  81. *ports*)
  82. ln -sv . $tarname
  83. tar -v ${taropt} $tarball ${tarname}/sysdeps
  84. ;;
  85. *libidn*)
  86. mkdir -pv libidn
  87. ln -sv libidn $tarname
  88. tar -v ${taropt} $tarball
  89. ;;
  90. *)
  91. tar -v ${taropt} $tarball linuxthreads
  92. ;;
  93. esac
  94. # remove CVS from the newly extracted files, glibc tries to
  95. # automatically commit newly generated files :-!
  96. find -name CVS | xargs rm -rfv
  97. done
  98. mkdir -p $root$includedir/gnu/
  99. if [ $pkg == glibc ]; then
  100. touch $root$includedir/gnu/stubs.h
  101. if [ $slibdir = lib64 ]; then
  102. touch $root$includedir/gnu/stubs{-32,-64}.h
  103. fi
  104. fi
  105. }
  106. glibc_postmake()
  107. {
  108. if atstage toolchain; then
  109. cp -v ../include/features.h $root$includedir
  110. mkdir -p $includedir/{bits,gnu}
  111. [ -e $root$includedir/bits/stdio_lim.h ] ||
  112. touch $root$includedir/bits/stdio_lim.h
  113. return
  114. fi
  115. ln -sf libbsd-compat.a $root/usr/$slibdir/libbsd.a
  116. # Misc. stuff
  117. #
  118. if atstage native; then
  119. # install locales and linuxthread manpages
  120. #
  121. eval $MAKE localedata/install-locales
  122. cp ../localedata/SUPPORTED $root/usr/share/i18n/
  123. mkdir -p $root/usr/share/man/man3
  124. if [ -f /usr/bin/perl ] ; then
  125. eval $MAKE -C ../linuxthreads/man \
  126. MANDIR=$root/usr/share/man/man3 all install
  127. fi
  128. # copy linuxthreads and crypt documentation
  129. #
  130. cp ../linuxthreads/ChangeLog $docdir/ChangeLog.threads
  131. cp ../linuxthreads/Changes $docdir/Changes.threads
  132. cp ../linuxthreads/README $docdir/README.threads
  133. cp ../linuxthreads/FAQ.html $docdir/FAQ-threads.html
  134. cp -r ../linuxthreads/Examples $docdir/examples.threads
  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 [ $slibdir = lib64 ] ; then
  143. cat > $root/etc/ld.so.conf <<-EOT
  144. /lib64
  145. /lib
  146. /usr/lib64
  147. /usr/lib
  148. /usr/*/lib64
  149. /usr/*/lib
  150. /opt/*/lib64
  151. /opt/*/lib
  152. /usr/local/lib64
  153. /usr/local/lib
  154. EOT
  155. else
  156. cat > $root/etc/ld.so.conf <<-EOT
  157. /lib
  158. /usr/lib
  159. /usr/*/lib
  160. /opt/*/lib
  161. /usr/local/lib
  162. EOT
  163. fi
  164. # Move 'ldconfig' and 'sln' binaries
  165. #
  166. if [ -f "$root/usr/sbin/ldconfig" ] ; then
  167. mv -v $root/usr/sbin/ldconfig $root/sbin/ldconfig
  168. fi
  169. if [ -f "$root/usr/sbin/sln" ] ; then
  170. mv -v $root/usr/sbin/sln $root/sbin/sln
  171. fi
  172. # Create /lib/ld-lsb.so.1 symlink
  173. #
  174. if [ -f $root/$slibdir/ld-linux-$arch_machine.so.2 ] ; then
  175. ln -vfs ld-linux-$arch_machine.so.2 $root/$slibdir/ld-lsb.so.1
  176. elif [ -f $root/$slibdir/ld-linux.so.2 ] ; then
  177. ln -vfs ld-linux.so.2 $root/$slibdir/ld-lsb.so.1
  178. fi
  179. }
  180. # in stage 0 we only extract the headers and all is a bit easier ...
  181. if atstage toolchain; then
  182. makeopt=""
  183. makeinstopt="-k cross-compiling=yes install-headers"
  184. fi
  185. [[ $libdir = *lib64 ]] && slibdir=lib64 || slibdir=lib
  186. #if atstage cross; then
  187. # var_append patchfiles " " $confdir/no_path_in_glibcso.diff
  188. #fi
  189. hook_add prepatch 3 "glibc_prepatch"
  190. hook_add postmake 5 "glibc_postmake"