ncurses 6.1 - patch 20190330
[ncurses.git] / misc / gen-pkgconfig.in
index 9230b6fc40c0b282b7bc381946763b35de0ad1e4..a03dd24106cd1cc7d828ddd8ba39fe280b58bde8 100644 (file)
@@ -1,5 +1,5 @@
 #!@SHELL@
-# $Id: gen-pkgconfig.in,v 1.33 2018/01/01 22:51:23 tom Exp $
+# $Id: gen-pkgconfig.in,v 1.34 2018/06/09 22:21:33 tom Exp $
 ##############################################################################
 # Copyright (c) 2009-2015,2018 Free Software Foundation, Inc.                #
 #                                                                            #
@@ -46,6 +46,7 @@ CXX_NAME=@CXX_NAME@
 DFT_DEP_SUFFIX=@DFT_DEP_SUFFIX@
 TINFO_ARG_SUFFIX=@TINFO_ARG_SUFFIX@
 CXX_LIB_SUFFIX=@CXX_LIB_SUFFIX@
+PRIVATE_LIBS="@PRIVATE_LIBS@"
 
 suffix=@PC_MODULE_SUFFIX@
 prefix="@prefix@"
@@ -122,6 +123,13 @@ do
                reqs="${reqs}${SUB_LIBRARY}${suffix}"
        fi
 
+       if test $name = $MAIN_LIBRARY
+       then
+               main_libs="$PRIVATE_LIBS"
+       else
+               main_libs=
+       fi
+
        echo "** creating ${name}${suffix}.pc"
        cat >${name}${suffix}.pc <<EOF
 # pkg-config file generated by `basename $0`
@@ -141,7 +149,7 @@ Version: \${version}
 URL: https://invisible-island.net/ncurses
 Requires.private: $reqs
 Libs: $LDFLAGS $LIBS
-Libs.private: @LIBS@ @PTHREAD@
+Libs.private: @LIBS@ $main_libs
 Cflags: $CFLAGS
 EOF