X-Git-Url: http://ncurses.scripts.mit.edu/?p=ncurses.git;a=blobdiff_plain;f=misc%2Fgen-pkgconfig.in;h=51a1a649533e740e3ddd61d5780c70ccfafe448f;hp=aacd681a743d8aaad93972eb44aa7fed612dda90;hb=34acd9acb118eac10d3135c6268f2d919b36b596;hpb=ac3f601c4de5d916f410c9ba4918194a47345e84 diff --git a/misc/gen-pkgconfig.in b/misc/gen-pkgconfig.in index aacd681a..51a1a649 100644 --- a/misc/gen-pkgconfig.in +++ b/misc/gen-pkgconfig.in @@ -1,5 +1,5 @@ #!@SHELL@ -# $Id: gen-pkgconfig.in,v 1.36 2019/09/28 12:53:53 tom Exp $ +# $Id: gen-pkgconfig.in,v 1.40 2019/10/12 22:27:10 tom Exp $ ############################################################################## # Copyright (c) 2009-2018,2019 Free Software Foundation, Inc. # # # @@ -70,20 +70,46 @@ CFLAGS="@PKG_CFLAGS@" if [ "$includedir" != "/usr/include" ]; then includetop=`echo "$includedir" | sed -e 's,/include/[^/]*$,/include,'` [ "$includetop" = "/usr/include" ] && includetop="$includedir" + CFLAGS="$CFLAGS -I\${includedir}" if [ "x$includetop" != "x$includedir" ] then CFLAGS="$CFLAGS -I${includetop}" fi - CFLAGS="$CFLAGS -I\${includedir}" fi -LDFLAGS= -if [ "$libdir" != "/usr/lib" ]; then - LDFLAGS="$LDFLAGS -L\${libdir}" -fi -if [ "x@EXTRA_LDFLAGS@" != "x" ]; then - LDFLAGS="$LDFLAGS @EXTRA_LDFLAGS@" -fi +lib_flags= +for opt in -L$libdir @LDFLAGS@ @EXTRA_LDFLAGS@ @LIBS@ +do + case $opt in + -l*) # LIBS is handled specially below + continue + ;; + -Wl,-z,*) # ignore flags used to manipulate shared image + continue + ;; + -L*) + [ -d ${opt##-L} ] || continue + case ${opt##-L} in + @LD_SEARCHPATH@) # skip standard libdir + continue + ;; + *) + found=no + for check in $lib_flags + do + if [ "x$check" = "x$opt" ] + then + found=yes + break + fi + done + [ $found = yes ] && continue + ;; + esac + ;; + esac + lib_flags="$lib_flags $opt" +done # Check if we should specify the tinfo library explicitly so that terminfo # functions or curses variables (which also reside in tinfo) can be linked @@ -106,6 +132,7 @@ do if [ $name = $MAIN_LIBRARY ]; then desc="$desc library" [ $NEED_TINFO = yes ] && LIBS="$LIBS -l$TINFO_ARG_SUFFIX" + [ -n "@LIBS@" ] && LIBS="$LIBS @LIBS@" elif [ $name = $SUB_LIBRARY ]; then desc="$desc terminal interface library" elif expr $name : ".*${CXX_NAME}.*" >/dev/null ; then @@ -149,7 +176,7 @@ Description: $desc Version: \${version} URL: https://invisible-island.net/ncurses Requires.private: $reqs -Libs: $LDFLAGS $LIBS +Libs: $lib_flags $LIBS Libs.private: @LIBS@ $main_libs Cflags: $CFLAGS EOF