X-Git-Url: https://ncurses.scripts.mit.edu/?p=ncurses.git;a=blobdiff_plain;f=misc%2Fncurses-config.in;h=eae39a516ff3bbd9f99723939434023d8eaa1bc2;hp=9028fc5e10c1d719b0deac8ac1b39d0ca7dde470;hb=9a9dd79463eba7af0b06b6a1f7e580b632ec1be1;hpb=d479dbaecb05c5d5fbd064835c930c468898c7b1 diff --git a/misc/ncurses-config.in b/misc/ncurses-config.in index 9028fc5e..eae39a51 100644 --- a/misc/ncurses-config.in +++ b/misc/ncurses-config.in @@ -1,7 +1,8 @@ #!@SHELL@ -# $Id: ncurses-config.in,v 1.42 2019/12/25 00:54:55 tom Exp $ +# $Id: ncurses-config.in,v 1.46 2021/01/23 23:47:46 tom Exp $ ############################################################################## -# Copyright (c) 2006-2018,2019 Free Software Foundation, Inc. # +# Copyright 2018-2020,2021 Thomas E. Dickey # +# Copyright 2006-2015,2017 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"), # @@ -100,7 +101,7 @@ fi # There is no portable way to find the list of standard library directories. # Require a POSIX shell anyway, to keep this simple. lib_flags= -for opt in -L$libdir @LDFLAGS@ @EXTRA_LDFLAGS@ $LIBS +for opt in -L$libdir @LDFLAGS@ @EXTRA_PKG_LDFLAGS@ $LIBS do case $opt in -specs*) # ignore linker specs-files which were used to build library @@ -110,10 +111,43 @@ do continue ;; -L*) - [ -d ${opt##-L} ] || continue - case ${opt##-L} in + lib_check=${opt##-L} + [ -d "$lib_check" ] || continue + case "$lib_check" in @LD_SEARCHPATH@) # skip standard libdir - continue + if [ "$lib_check" = "$libdir" ] + then + lib_first=yes + IFS_save="$IFS" + IFS='|' + LIBDIRS="@LD_SEARCHPATH@" + for lib_check in $LIBDIRS + do + if [ -d "$lib_check" ] + then + if [ "$lib_check" != "$libdir" ] + then + lib_first=no + fi + break + fi + done + IFS="$IFS_save" + [ $lib_first = yes ] && continue + found=no + for check in $lib_flags + do + if [ "x$check" = "x$opt" ] + then + found=yes + break + fi + done + [ $found = yes ] && continue + : + else + continue + fi ;; *) found=no