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.

192 lines
5.1 KiB

  1. # --- SDE-COPYRIGHT-NOTE-BEGIN ---
  2. # This copyright note is auto-generated by ./scripts/Create-CopyPatch.
  3. #
  4. # Filename: package/.../ncurses/ncurses.conf
  5. # Copyright (C) 2006 - 2011 The OpenSDE Project
  6. # Copyright (C) 2004 - 2006 The T2 SDE Project
  7. # Copyright (C) 1998 - 2003 Clifford Wolf
  8. #
  9. # More information can be found in the files COPYING and README.
  10. #
  11. # This program is free software; you can redistribute it and/or modify
  12. # it under the terms of the GNU General Public License as published by
  13. # the Free Software Foundation; version 2 of the License. A copy of the
  14. # GNU General Public License can be found in the file COPYING.
  15. # --- SDE-COPYRIGHT-NOTE-END ---
  16. prefix=
  17. set_confopt
  18. if ! atstage native; then
  19. var_append extraconfopt " " "--without-cxx --without-cxx-binding --with-build-cppflags=-D_GNU_SOURCE"
  20. fi
  21. # saving our local patches and empty the patchfiles variable
  22. localpatches=$patchfiles
  23. patchfiles=
  24. # append official patches
  25. for x in `match_source_file -p 'patch'` ; do
  26. var_append patchfiles " " "$x"
  27. done
  28. # append our local patches
  29. var_append patchfiles " " "$localpatches"
  30. # on dietlibc we won't use NLS
  31. [ "$SDECFG_LIBC" != dietlibc ] || SDECFG_DISABLE_NLS=1
  32. # custmain for toolchain stage
  33. tic_only() {
  34. mkdir build-tic
  35. cd build-tic
  36. # build a standalone termlib and dependendencyless ticlib
  37. ../configure --prefix=$root --without-debug --with-termlib \
  38. --with-ticlib --disable-tic-depends --with-shared
  39. # build needed header files
  40. make -C include
  41. # build and install a tic which is linked against libtinfo
  42. # and libtic only
  43. make -C progs tic
  44. cp -a lib/libtinfo.so* $root/lib
  45. cp -a lib/libtic.so* $root/lib
  46. cp -a progs/tic $root/bin
  47. }
  48. ncurses_preconf() {
  49. if [ $buildloop -eq 1 ]; then
  50. # first loop is easy, always simply narrowc
  51. mkdir -p narrowc
  52. cd narrowc
  53. # generate separate tic library
  54. var_append confopt ' ' "--with-ticlib"
  55. else
  56. # suppress to build programs
  57. var_append confopt ' ' "--without-progs"
  58. cd ..
  59. # then the things get a bit uglier
  60. if [ "$SDECFG_DISABLE_NLS" != 1 ]; then
  61. # NLS support
  62. if [ $buildloop -eq 2 ]; then
  63. # loop 2: normal wide
  64. mkdir -p widec
  65. cd widec
  66. var_append confopt " " "--enable-widec"
  67. var_append makeinstopt " " "includedir=$includedir/ncursesw"
  68. elif [ $buildloop -eq 3 ]; then
  69. # loop 3: altered arch, narrow.
  70. var_remove GCC_WRAPPER_INSERT ' ' '-m64'
  71. alter_arch
  72. mkdir -p narrowc_32
  73. cd narrowc_32
  74. var_remove makeinstopt " " "includedir=$includedir/ncursesw"
  75. else
  76. # loop 4: alreday altered arch, wide.
  77. mkdir -p widec_32
  78. cd widec_32
  79. var_append confopt " " "--enable-widec"
  80. var_append makeinstopt " " "includedir=$includedir/ncursesw"
  81. fi
  82. else
  83. # no NLS support
  84. # loop 2: altered arch, narrow.
  85. var_remove GCC_WRAPPER_INSERT ' ' '-m64'
  86. alter_arch
  87. mkdir -p narrowc_32
  88. cd narrowc_32
  89. fi
  90. fi
  91. }
  92. # create compatibility symlinks for curses
  93. make_curses_symlinks() {
  94. echo "Creating compatibility symlinks for curses."
  95. if [ "$SDECFG_STATIC" != 1 ]; then
  96. ln -svf "$( readlink $root$libdir/libncurses.so )" $root$libdir/libcurses.so
  97. fi
  98. ln -svf libncurses.a $root$libdir/libcurses.a
  99. }
  100. # functions we use when termcap package is installed
  101. remove_include_termcap() {
  102. echo "Removing 'termcap.h' from include/Makefile for 'make install'."
  103. sed -i 's,termcap.h,,g' include/Makefile
  104. }
  105. make_termcap_symlinks() {
  106. echo "Creating compatibility symlinks for termcap."
  107. if [ "$SDECFG_STATIC" != 1 ]; then
  108. ln -svf "$( readlink $root$libdir/libtinfo.so )" $root$libdir/libtermcap.so
  109. fi
  110. ln -svf libtinfo.a $root$libdir/libtermcap.a
  111. }
  112. if atstage toolchain; then
  113. buildloops=1
  114. custmain='tic_only'
  115. else
  116. # on systems having NLS support we build ncurses twice
  117. if [ "$SDECFG_DISABLE_NLS" != 1 ]; then
  118. buildloops=2
  119. fi
  120. # sparc64 may need extra love
  121. if [ "$arch" == "sparc64" -a "$SDECFG_SPARC64_32BIT" = 1 ]; then
  122. # double the loops
  123. buildloops=$( expr $buildloops \* 2 )
  124. fi
  125. configscript="../configure"
  126. hook_add preconf 3 "ncurses_preconf"
  127. [ "$SDECFG_STATIC" != 1 ] && var_append extraconfopt " " "--with-shared"
  128. var_append extraconfopt " " "--with-normal"
  129. # Fine-Tuning:
  130. #
  131. # make tic use symbolic links not hard links
  132. var_append extraconfopt " " "--enable-symlinks"
  133. # Extensions:
  134. #
  135. # compile with SIGWINCH handler
  136. var_append extraconfopt " " "--enable-sigwinch"
  137. # Development Code:
  138. #
  139. # compile with hard-tabs code
  140. var_append extraconfopt " " "--enable-hard-tabs"
  141. # Experimental Code:
  142. #
  143. # compile with $COLORFGBG code
  144. var_append extraconfopt " " "--enable-colorfgbg"
  145. # always create compatibility symlinks for curses
  146. hook_add postmake 5 "make_curses_symlinks"
  147. if pkginstalled termcap ; then
  148. echo_status "Found termcap package ->" \
  149. "disable ncurses internal termcap library."
  150. var_append extraconfopt " " "--disable-termcap"
  151. hook_add inmake 5 "remove_include_termcap"
  152. else
  153. # generate separate terminfo library
  154. var_append extraconfopt " " "--with-termlib"
  155. hook_add postmake 6 "make_termcap_symlinks"
  156. fi
  157. # generate and install .pc files for pkg-config
  158. if pkginstalled pkgconfig; then
  159. var_append extraconfopt " " "--enable-pc-files"
  160. fi
  161. fi