]> ncurses.scripts.mit.edu Git - ncurses.git/blobdiff - misc/ncurses-config.in
ncurses 6.5 - patch 20240622
[ncurses.git] / misc / ncurses-config.in
index 7b02ac27dc30faaa8c4e612a943a9c0ab8deb062..b17f68428d5056852f7c011b0d88f9dce2ce8dde 100644 (file)
@@ -1,7 +1,7 @@
 #!@SHELL@
-# $Id: ncurses-config.in,v 1.50 2021/08/07 21:36:14 tom Exp $
+# $Id: ncurses-config.in,v 1.53 2024/06/22 20:52:02 tom Exp $
 ##############################################################################
-# Copyright 2018-2020,2021 Thomas E. Dickey                                  #
+# Copyright 2018-2022,2024 Thomas E. Dickey                                  #
 # Copyright 2006-2015,2017 Free Software Foundation, Inc.                    #
 #                                                                            #
 # Permission is hereby granted, free of charge, to any person obtaining a    #
@@ -107,12 +107,15 @@ do
        -specs*) # ignore linker specs-files which were used to build library
                continue
                ;;
-       -Wl,-z,*) # ignore flags used to manipulate shared image
+       -Wl,-z*) # ignore flags used to manipulate shared image
                continue
                ;;
        -Wl,--dynamic-linker*) # ignore ELF interpreter
                continue
                ;;
+       -Wl,--as-needed|-Wl,--build-id=*|-Wl,-dT,*|-Wl,-T,*)
+               continue
+               ;;
        -L*)
                lib_check=`echo "x$opt" | sed -e 's/^.-L//'`
                [ -d "$lib_check" ] || continue
@@ -170,7 +173,7 @@ do
        lib_flags="$lib_flags $opt"
 done
 
-[ $# = 0 ] && exec @SHELL@ $0 --error
+[ $# = 0 ] && exec @SHELL@ "$0" --error
 
 while [ $# -gt 0 ]; do
        case "$1" in
@@ -183,16 +186,57 @@ while [ $# -gt 0 ]; do
                ;;
        # compile/link
        --cflags)
-               INCS="@PKG_CFLAGS@"
-               if [ "x@WITH_OVERWRITE@" = xno ]; then
-                       INCS="$INCS -I${includesubdir}"
-               fi
-               if [ "${includedir}" != /usr/include ]; then
-                       INCS="$INCS -I${includedir}"
-               fi
-               sed -e 's,^[ ]*,,' -e 's, [ ]*, ,g' -e 's,[ ]*$,,' <<-ENDECHO
-                       $INCS
-ENDECHO
+               OPTS=
+               for opt in @PKG_CFLAGS@
+               do
+                       case "x$opt" in
+                       x-[DIU]*)
+                               OPTS="$OPTS $opt"
+                               ;;
+                       x-Wl,*)
+                               OPTS="$OPTS $opt"
+                               ;;
+                       x-[OW]*)
+                               ;;
+                       *)
+                               OPTS="$OPTS $opt"
+                               ;;
+                       esac
+               done
+               printf "%s\n" "$OPTS"
+               ;;
+       --cflags-only-I)
+               OPTS=
+               for opt in @PKG_CFLAGS@
+               do
+                       case "x$opt" in
+                       x-[DIU]*)
+                               OPTS="$OPTS $opt"
+                               ;;
+                       *)
+                               ;;
+                       esac
+               done
+               printf "%s\n" "$OPTS"
+               ;;
+       --cflags-only-other)
+               OPTS=
+               for opt in @PKG_CFLAGS@
+               do
+                       case "x$opt" in
+                       x-[DIU]*)
+                               ;;
+                       x-Wl,*)
+                               OPTS="$OPTS $opt"
+                               ;;
+                       x-[OW]*)
+                               ;;
+                       *)
+                               OPTS="$OPTS $opt"
+                               ;;
+                       esac
+               done
+               printf "%s\n" "$OPTS"
                ;;
        --libs)
                OPTS=
@@ -201,7 +245,7 @@ ENDECHO
                        [ -n "$OPTS" ] && OPTS="$OPTS "
                        OPTS="${OPTS}${opt}"
                done
-               printf "%s\n" "$OPTS"
+               printf '%s\n' "$OPTS"
                ;;
        --libs-only-L)
                OPTS=
@@ -214,7 +258,7 @@ ENDECHO
                                ;;
                        esac
                done
-               printf "%s\n" "$OPTS"
+               printf '%s\n' "$OPTS"
                ;;
        --libs-only-l)
                OPTS=
@@ -227,7 +271,7 @@ ENDECHO
                                ;;
                        esac
                done
-               printf "%s\n" "$OPTS"
+               printf '%s\n' "$OPTS"
                ;;
        --libs-only-other)
                OPTS=
@@ -242,7 +286,7 @@ ENDECHO
                                ;;
                        esac
                done
-               printf "%s\n" "$OPTS"
+               printf '%s\n' "$OPTS"
                ;;
        # identification
        --version)
@@ -268,7 +312,7 @@ ENDECHO
                elif [ "${includedir}" != /usr/include ]; then
                        INCS="${includedir}"
                fi
-               echo $INCS
+               echo "$INCS"
                ;;
        --libdir)
                echo "${libdir}"
@@ -288,37 +332,39 @@ ENDECHO
        # general info
        --help)
                cat <<ENDHELP
-Usage: `basename $0` [options]
+Usage: `basename "$0"` [options]
 
 Options:
-  --prefix           echos the package-prefix of ${THIS}
-  --exec-prefix      echos the executable-prefix of ${THIS}
+  --prefix            echos the package-prefix of ${THIS}
+  --exec-prefix       echos the executable-prefix of ${THIS}
 
-  --cflags           echos the C compiler flags needed to compile with ${THIS}
-  --libs             echos the libraries needed to link with ${THIS}
+  --cflags            echos the C compiler flags needed to compile for ${THIS}
+  --cflags-only-I     echos only -I C compiler flags needed with ${THIS}
+  --cflags-only-other echos only C compiler flags other than -I for ${THIS}
+  --libs              echos the libraries needed to link with ${THIS}
 
-  --libs-only-L      echos -L linker options (search path) for ${THIS}
-  --libs-only-l      echos -l linker options (libraries) for ${THIS}
-  --libs-only-other  echos linker options other than -L/-l
+  --libs-only-L       echos -L linker options (search path) for ${THIS}
+  --libs-only-l       echos -l linker options (libraries) for ${THIS}
+  --libs-only-other   echos linker options other than -L/-l
 
-  --version          echos the release+patchdate version of ${THIS}
-  --abi-version      echos the ABI version of ${THIS}
-  --mouse-version    echos the mouse-interface version of ${THIS}
+  --version           echos the release+patchdate version of ${THIS}
+  --abi-version       echos the ABI version of ${THIS}
+  --mouse-version     echos the mouse-interface version of ${THIS}
 
-  --bindir           echos the directory containing ${THIS} programs
-  --datadir          echos the directory containing ${THIS} data
-  --includedir       echos the directory containing ${THIS} header files
-  --libdir           echos the directory containing ${THIS} libraries
-  --mandir           echos the directory containing ${THIS} manpages
-  --terminfo         echos the \$TERMINFO terminfo database path
-  --terminfo-dirs    echos the \$TERMINFO_DIRS directory list
-  --termpath         echos the \$TERMPATH termcap list
+  --bindir            echos the directory containing ${THIS} programs
+  --datadir           echos the directory containing ${THIS} data
+  --includedir        echos the directory containing ${THIS} header files
+  --libdir            echos the directory containing ${THIS} libraries
+  --mandir            echos the directory containing ${THIS} manpages
+  --terminfo          echos the \$TERMINFO terminfo database path
+  --terminfo-dirs     echos the \$TERMINFO_DIRS directory list
+  --termpath          echos the \$TERMPATH termcap list
 
-  --help             prints this message
+  --help              prints this message
 ENDHELP
                ;;
        --error|*)
-               @SHELL@ $0 --help 1>&2
+               @SHELL@ "$0" --help 1>&2
                exit 1
                ;;
        esac