Modify nc-config --libs and --static arguments in support of https://github.com/Unidata/netcdf-c/issues/3032

This commit is contained in:
Ward Fisher 2024-10-01 16:54:38 -05:00
parent 0ad7164de0
commit 042c0b7cbd
3 changed files with 20 additions and 10 deletions

View File

@ -2038,7 +2038,7 @@ else
NC_LIBS="$with_netcdf_c_lib"
fi
if test "x$enable_shared" != xyes; then
NC_LIBS="$LDFLAGS $NC_LIBS $LIBS"
NC_LIBS="$LDFLAGS $NC_LIBS"
fi
case "x$target_os" in

View File

@ -14,7 +14,8 @@ cc="@CMAKE_C_COMPILER@"
cflags="-I@CMAKE_INSTALL_PREFIX@/@CMAKE_INSTALL_INCLUDEDIR@"
libs="-L@CMAKE_INSTALL_PREFIX@/@CMAKE_INSTALL_LIBDIR@ @NC_LIBS@"
libsprivate="@LIBS@"
HAS_STATIC=""
HAS_STATIC="FALSE"
PRINTLIBS="FALSE"
has_dap2="@NETCDF_ENABLE_DAP2@"
if [ -z $has_dap2 -o "$has_dap2" = "OFF" ]; then
@ -228,6 +229,9 @@ fi
for i in "$@"; do
case $i in
--libs)
PRINTLIBS="TRUE"
;;
--static)
HAS_STATIC="TRUE"
;;
@ -349,7 +353,7 @@ while test $# -gt 0; do
--libs)
if [ "x$HAS_STATIC" = "xTRUE" ]; then
echo $libs $libsprivate
echo $LDFLAGS $libs $libsprivate
else
echo $libs
fi
@ -369,7 +373,9 @@ while test $# -gt 0; do
;;
--static)
if [ "x$PRINTLIBS" != "xTRUE" ]; then
echo $LDFLAGS $libs $libsprivate
fi
;;
--prefix)

View File

@ -38,8 +38,8 @@ has_multifilters="yes"
has_quantize="@HAS_QUANTIZE@"
has_stdfilters="@STD_FILTERS@"
version="@PACKAGE_NAME@ @PACKAGE_VERSION@"
HAS_STATIC=""
HAS_STATIC="FALSE"
PRINTLIBS="FALSE"
usage()
{
cat <<EOF
@ -128,6 +128,9 @@ fi
for i in "$@"; do
case $i in
--libs)
PRINTLIBS="TRUE"
;;
--static)
HAS_STATIC="TRUE"
;;
@ -249,10 +252,11 @@ while test $# -gt 0; do
echo $libs
fi
;;
--static)
;;
--static)
if [ "x$PRINTLIBS" != "xTRUE" ]; then
echo $libs $libsprivate
fi
;;
--prefix)
echo "${prefix}"
;;