ncurses 6.1 - patch 20190330
[ncurses.git] / misc / gen-pkgconfig.in
index 586f9949e38b30369c557f4d95a4655e1d01df60..a03dd24106cd1cc7d828ddd8ba39fe280b58bde8 100644 (file)
@@ -1,7 +1,7 @@
 #!@SHELL@
-# $Id: gen-pkgconfig.in,v 1.27 2015/05/04 09:15:46 tom Exp $
+# $Id: gen-pkgconfig.in,v 1.34 2018/06/09 22:21:33 tom Exp $
 ##############################################################################
-# Copyright (c) 2009-2014,2015 Free Software Foundation, Inc.                #
+# Copyright (c) 2009-2015,2018 Free Software Foundation, Inc.                #
 #                                                                            #
 # Permission is hereby granted, free of charge, to any person obtaining a    #
 # copy of this software and associated documentation files (the "Software"), #
@@ -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@"
@@ -66,16 +67,16 @@ FORM_LIBRARY="${FORM_NAME}@USE_ARG_SUFFIX@"
 
 CFLAGS="@PKG_CFLAGS@"
 if test "$includedir" != "/usr/include" ; then
-       includetop=`echo "$includedir" | sed -e 's,/include/[^/]*$,/include/,'`
+       includetop=`echo "$includedir" | sed -e 's,/include/[^/]*$,/include,'`
        test "$includetop" = "/usr/include" && includetop="$includedir"
-       if test "x$includetop" != "$includedir"
+       if test "x$includetop" != "x$includedir"
        then
                CFLAGS="$CFLAGS -I${includetop}"
        fi
        CFLAGS="$CFLAGS -I\${includedir}"
 fi
 
-LDFLAGS="@LDFLAGS@"
+LDFLAGS=
 if test "$libdir" != "/usr/lib" ; then
        LDFLAGS="$LDFLAGS -L\${libdir}"
 fi
@@ -90,18 +91,7 @@ NEED_TINFO=no
 if test "x@TINFO_LIBS@" != "x" && \
    test "x$TINFO_ARG_SUFFIX" != "x$MAIN_LIBRARY"
 then
-       case "x$LDFLAGS" in
-       (*--as-needed*)
-               NEED_TINFO=yes
-               ;;
-       esac
-       case "x$LDFLAGS" in
-       (*,-rpath,*)
-               ;;
-       (*)
-               NEED_TINFO=yes
-               ;;
-       esac
+       NEED_TINFO=yes
 fi
 
 for name in @PC_MODULES_TO_MAKE@
@@ -133,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`
@@ -149,10 +146,10 @@ version=@NCURSES_MAJOR@.@NCURSES_MINOR@.@NCURSES_PATCH@
 Name: ${name}${suffix}
 Description: $desc
 Version: \${version}
-URL: http://invisible-island.net/ncurses
+URL: https://invisible-island.net/ncurses
 Requires.private: $reqs
 Libs: $LDFLAGS $LIBS
-Libs.private: @LIBS@
+Libs.private: @LIBS@ $main_libs
 Cflags: $CFLAGS
 EOF