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.

185 lines
4.8 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. else
  54. cd ..
  55. # then the things get a bit uglier
  56. if [ "$SDECFG_DISABLE_NLS" != 1 ]; then
  57. # NLS support
  58. if [ $buildloop -eq 2 ]; then
  59. # loop 2: normal wide
  60. mkdir -p widec
  61. cd widec
  62. var_append confopt " " "--enable-widec"
  63. var_append makeinstopt " " "includedir=$includedir/ncursesw"
  64. elif [ $buildloop -eq 3 ]; then
  65. # loop 3: altered arch, narrow.
  66. var_remove GCC_WRAPPER_INSERT ' ' '-m64'
  67. alter_arch
  68. mkdir -p narrowc_32
  69. cd narrowc_32
  70. var_remove makeinstopt " " "includedir=$includedir/ncursesw"
  71. else
  72. # loop 4: alreday altered arch, wide.
  73. mkdir -p widec_32
  74. cd widec_32
  75. var_append confopt " " "--enable-widec"
  76. var_append makeinstopt " " "includedir=$includedir/ncursesw"
  77. fi
  78. else
  79. # no NLS support
  80. # loop 2: altered arch, narrow.
  81. var_remove GCC_WRAPPER_INSERT ' ' '-m64'
  82. alter_arch
  83. mkdir -p narrowc_32
  84. cd narrowc_32
  85. fi
  86. fi
  87. }
  88. # create compatibility symlinks for curses
  89. make_curses_symlinks() {
  90. echo "Creating compatibility symlinks for curses."
  91. if [ "$SDECFG_STATIC" != 1 ]; then
  92. ln -svf libncurses.so $root$libdir/libcurses.so
  93. fi
  94. ln -svf libncurses.a $root$libdir/libcurses.a
  95. }
  96. # functions we use when termcap package is installed
  97. remove_include_termcap() {
  98. echo "Removing 'termcap.h' from include/Makefile for 'make install'."
  99. sed -i 's,termcap.h,,g' include/Makefile
  100. }
  101. make_termcap_symlinks() {
  102. echo "Creating compatibility symlinks for termcap."
  103. if [ "$SDECFG_STATIC" != 1 ]; then
  104. ln -svf libncurses.so $root$libdir/libtermcap.so
  105. fi
  106. ln -svf libncurses.a $root$libdir/libtermcap.a
  107. }
  108. if atstage toolchain; then
  109. buildloops=1
  110. custmain='tic_only'
  111. else
  112. # on systems having NLS support we build ncurses twice
  113. if [ "$SDECFG_DISABLE_NLS" != 1 ]; then
  114. buildloops=2
  115. fi
  116. # sparc64 may need extra love
  117. if [ "$arch" == "sparc64" -a "$SDECFG_SPARC64_32BIT" = 1 ]; then
  118. # double the loops
  119. buildloops=$( expr $buildloops \* 2 )
  120. fi
  121. configscript="../configure"
  122. hook_add preconf 3 "ncurses_preconf"
  123. [ "$SDECFG_STATIC" != 1 ] && var_append extraconfopt " " "--with-shared"
  124. var_append extraconfopt " " "--with-normal"
  125. # Fine-Tuning:
  126. #
  127. # make tic use symbolic links not hard links
  128. var_append extraconfopt " " "--enable-symlinks"
  129. # Extensions:
  130. #
  131. # compile with SIGWINCH handler
  132. var_append extraconfopt " " "--enable-sigwinch"
  133. # Development Code:
  134. #
  135. # compile with hard-tabs code
  136. var_append extraconfopt " " "--enable-hard-tabs"
  137. # Experimental Code:
  138. #
  139. # compile with $COLORFGBG code
  140. var_append extraconfopt " " "--enable-colorfgbg"
  141. # always create compatibility symlinks for curses
  142. hook_add postmake 5 "make_curses_symlinks"
  143. if pkginstalled termcap ; then
  144. echo_status "Found termcap package ->" \
  145. "disable ncurses internal termcap library."
  146. var_append extraconfopt " " "--disable-termcap"
  147. hook_add inmake 5 "remove_include_termcap"
  148. else
  149. hook_add postmake 6 "make_termcap_symlinks"
  150. fi
  151. # generate and install .pc files for pkg-config
  152. if pkginstalled pkgconfig; then
  153. var_append extraconfopt " " "--enable-pc-files"
  154. fi
  155. fi