ncursesw6-config 8.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331
  1. #!/bin/sh
  2. # $Id: ncurses-config.in,v 1.50 2021/08/07 21:36:14 tom Exp $
  3. ##############################################################################
  4. # Copyright 2018-2020,2021 Thomas E. Dickey #
  5. # Copyright 2006-2015,2017 Free Software Foundation, Inc. #
  6. # #
  7. # Permission is hereby granted, free of charge, to any person obtaining a #
  8. # copy of this software and associated documentation files (the "Software"), #
  9. # to deal in the Software without restriction, including without limitation #
  10. # the rights to use, copy, modify, merge, publish, distribute, distribute #
  11. # with modifications, sublicense, and/or sell copies of the Software, and to #
  12. # permit persons to whom the Software is furnished to do so, subject to the #
  13. # following conditions: #
  14. # #
  15. # The above copyright notice and this permission notice shall be included in #
  16. # all copies or substantial portions of the Software. #
  17. # #
  18. # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR #
  19. # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, #
  20. # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL #
  21. # THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER #
  22. # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING #
  23. # FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER #
  24. # DEALINGS IN THE SOFTWARE. #
  25. # #
  26. # Except as contained in this notice, the name(s) of the above copyright #
  27. # holders shall not be used in advertising or otherwise to promote the sale, #
  28. # use or other dealings in this Software without prior written #
  29. # authorization. #
  30. ##############################################################################
  31. #
  32. # Author: Thomas E. Dickey, 2006-on
  33. LANG=C; export LANG
  34. LANGUAGE=C; export LANGUAGE
  35. LC_ALL=C; export LC_ALL
  36. LC_CTYPE=C; export LC_CTYPE
  37. prefix="$(cygpath -m "/mingw64")"
  38. exec_prefix="${prefix}"
  39. bindir="${exec_prefix}/bin"
  40. includedir="${prefix}/include"
  41. libdir="${exec_prefix}/lib"
  42. datarootdir="${prefix}/share"
  43. datadir="${datarootdir}"
  44. mandir="$(cygpath -m "/mingw64/share/man")"
  45. THIS="ncursesw"
  46. TINFO_LIB="ncursesw"
  47. RPATH_LIST="${libdir}"
  48. includesubdir="${prefix}/include/${THIS}"
  49. # Ensure that RPATH_LIST contains only absolute pathnames, if it is nonempty.
  50. # We cannot filter it out within the build-process since the variable is used
  51. # in some special cases of installation using a relative path.
  52. if [ -n "$RPATH_LIST" ]
  53. then
  54. save_IFS="$IFS"
  55. IFS=':'
  56. filtered=
  57. for item in $RPATH_LIST
  58. do
  59. case "$item" in
  60. ./*|../*|*/..|*/../*)
  61. ;;
  62. *)
  63. [ -n "$filtered" ] && filtered="${filtered}:"
  64. filtered="${filtered}${item}"
  65. ;;
  66. esac
  67. done
  68. IFS="$save_IFS"
  69. # if the result is empty, there is little we can do to fix it
  70. RPATH_LIST="$filtered"
  71. fi
  72. # with --disable-overwrite, we installed into a subdirectory, but transformed
  73. # the headers to include like this:
  74. # <ncursesw/curses.h>
  75. if [ xno = xno ]; then
  76. case $includedir in
  77. $prefix/include/ncursesw)
  78. includedir=`echo "$includedir" | sed -e 's,/[^/]*$,,'`
  79. ;;
  80. esac
  81. fi
  82. LIBS="-lsystre -ltre -lintl -liconv "
  83. if [ "ncurses" = "ncurses" ]; then
  84. LIBS="-l${THIS} $LIBS"
  85. else
  86. LIBS="-l${THIS} -l${TINFO_LIB} $LIBS"
  87. fi
  88. # Ignore -L options which do not correspond to an actual directory, or which
  89. # are standard library directories (i.e., the linker is supposed to search
  90. # those directories).
  91. #
  92. # There is no portable way to find the list of standard library directories.
  93. # Require a POSIX shell anyway, to keep this simple.
  94. lib_flags=
  95. for opt in -L$libdir $LIBS
  96. do
  97. case $opt in
  98. -specs*) # ignore linker specs-files which were used to build library
  99. continue
  100. ;;
  101. -Wl,-z,*) # ignore flags used to manipulate shared image
  102. continue
  103. ;;
  104. -Wl,--dynamic-linker*) # ignore ELF interpreter
  105. continue
  106. ;;
  107. -L*)
  108. lib_check=`echo "x$opt" | sed -e 's/^.-L//'`
  109. [ -d "$lib_check" ] || continue
  110. case "$lib_check" in
  111. /mingw64/x86_64-w64-mingw32/lib|/mingw64/lib|/usr/lib) # skip standard libdir
  112. if [ "$lib_check" = "$libdir" ]
  113. then
  114. lib_first=yes
  115. IFS_save="$IFS"
  116. IFS='|'
  117. LIBDIRS="/mingw64/x86_64-w64-mingw32/lib|/mingw64/lib|/usr/lib"
  118. for lib_check in $LIBDIRS
  119. do
  120. if [ -d "$lib_check" ]
  121. then
  122. if [ "$lib_check" != "$libdir" ]
  123. then
  124. lib_first=no
  125. fi
  126. break
  127. fi
  128. done
  129. IFS="$IFS_save"
  130. [ $lib_first = yes ] && continue
  131. found=no
  132. for check in $lib_flags
  133. do
  134. if [ "x$check" = "x$opt" ]
  135. then
  136. found=yes
  137. break
  138. fi
  139. done
  140. [ $found = yes ] && continue
  141. :
  142. else
  143. continue
  144. fi
  145. ;;
  146. $libdir) # skip standard libdir
  147. continue
  148. ;;
  149. *)
  150. found=no
  151. for check in $lib_flags
  152. do
  153. if [ "x$check" = "x$opt" ]
  154. then
  155. found=yes
  156. break
  157. fi
  158. done
  159. [ $found = yes ] && continue
  160. ;;
  161. esac
  162. ;;
  163. esac
  164. lib_flags="$lib_flags $opt"
  165. done
  166. [ $# = 0 ] && exec /bin/sh $0 --error
  167. while [ $# -gt 0 ]; do
  168. case "$1" in
  169. # basic configuration
  170. --prefix)
  171. echo "$prefix"
  172. ;;
  173. --exec-prefix)
  174. echo "$exec_prefix"
  175. ;;
  176. # compile/link
  177. --cflags)
  178. INCS=" -D_XOPEN_SOURCE=600 -D_POSIX_C_SOURCE=199506L"
  179. if [ "xno" = xno ]; then
  180. INCS="$INCS -I${includesubdir}"
  181. fi
  182. if [ "${includedir}" != /usr/include ]; then
  183. INCS="$INCS -I${includedir}"
  184. fi
  185. sed -e 's,^[ ]*,,' -e 's, [ ]*, ,g' -e 's,[ ]*$,,' <<-ENDECHO
  186. $INCS
  187. ENDECHO
  188. ;;
  189. --libs)
  190. OPTS=
  191. for opt in $lib_flags
  192. do
  193. [ -n "$OPTS" ] && OPTS="$OPTS "
  194. OPTS="${OPTS}${opt}"
  195. done
  196. printf "%s\n" "$OPTS"
  197. ;;
  198. --libs-only-L)
  199. OPTS=
  200. for opt in $lib_flags
  201. do
  202. case "x$opt" in
  203. x-L*)
  204. [ -n "$OPTS" ] && OPTS="$OPTS "
  205. OPTS="${OPTS}${opt}"
  206. ;;
  207. esac
  208. done
  209. printf "%s\n" "$OPTS"
  210. ;;
  211. --libs-only-l)
  212. OPTS=
  213. for opt in $lib_flags
  214. do
  215. case "x$opt" in
  216. x-l*)
  217. [ -n "$OPTS" ] && OPTS="$OPTS "
  218. OPTS="${OPTS}${opt}"
  219. ;;
  220. esac
  221. done
  222. printf "%s\n" "$OPTS"
  223. ;;
  224. --libs-only-other)
  225. OPTS=
  226. for opt in $lib_flags
  227. do
  228. case "x$opt" in
  229. x-[lL]*)
  230. ;;
  231. *)
  232. [ -n "$OPTS" ] && OPTS="$OPTS "
  233. OPTS="${OPTS}${opt}"
  234. ;;
  235. esac
  236. done
  237. printf "%s\n" "$OPTS"
  238. ;;
  239. # identification
  240. --version)
  241. echo "6.3.20211021"
  242. ;;
  243. --abi-version)
  244. echo "6"
  245. ;;
  246. --mouse-version)
  247. echo "2"
  248. ;;
  249. # locations
  250. --bindir)
  251. echo "${bindir}"
  252. ;;
  253. --datadir)
  254. echo "${datadir}"
  255. ;;
  256. --includedir)
  257. INCS=
  258. if [ "xno" = xno ]; then
  259. INCS="${includesubdir}"
  260. elif [ "${includedir}" != /usr/include ]; then
  261. INCS="${includedir}"
  262. fi
  263. echo $INCS
  264. ;;
  265. --libdir)
  266. echo "${libdir}"
  267. ;;
  268. --mandir)
  269. echo "${mandir}"
  270. ;;
  271. --terminfo)
  272. echo "$(cygpath -m "/mingw64/share/terminfo")"
  273. ;;
  274. --terminfo-dirs)
  275. echo "$(cygpath -m "/mingw64/share/terminfo")"
  276. ;;
  277. --termpath)
  278. echo "$(cygpath -m "")"
  279. ;;
  280. # general info
  281. --help)
  282. cat <<ENDHELP
  283. Usage: `basename $0` [options]
  284. Options:
  285. --prefix echos the package-prefix of ${THIS}
  286. --exec-prefix echos the executable-prefix of ${THIS}
  287. --cflags echos the C compiler flags needed to compile with ${THIS}
  288. --libs echos the libraries needed to link with ${THIS}
  289. --libs-only-L echos -L linker options (search path) for ${THIS}
  290. --libs-only-l echos -l linker options (libraries) for ${THIS}
  291. --libs-only-other echos linker options other than -L/-l
  292. --version echos the release+patchdate version of ${THIS}
  293. --abi-version echos the ABI version of ${THIS}
  294. --mouse-version echos the mouse-interface version of ${THIS}
  295. --bindir echos the directory containing ${THIS} programs
  296. --datadir echos the directory containing ${THIS} data
  297. --includedir echos the directory containing ${THIS} header files
  298. --libdir echos the directory containing ${THIS} libraries
  299. --mandir echos the directory containing ${THIS} manpages
  300. --terminfo echos the \$TERMINFO terminfo database path
  301. --terminfo-dirs echos the \$TERMINFO_DIRS directory list
  302. --termpath echos the \$TERMPATH termcap list
  303. --help prints this message
  304. ENDHELP
  305. ;;
  306. --error|*)
  307. /bin/sh $0 --help 1>&2
  308. exit 1
  309. ;;
  310. esac
  311. shift
  312. done
  313. # vi:ts=4 sw=4
  314. # vile:shmode