diff --git a/m4/check-package.m4 b/m4/check-package.m4
index e1da277de7bf0c8f5d4a133c27c9678a9787ceea..49157fa78660bfb1555fb83f15fb77706c08fc2c 100644
--- a/m4/check-package.m4
+++ b/m4/check-package.m4
@@ -48,8 +48,8 @@ else
 	DEFAULT_LIBDIR=$3
 fi
 AC_ARG_WITH($1-lib,
-[  --with-$1-lib=DIR   use $1 library below directory DIR
-                      (default: $3)],
+AC_HELP_STRING([  --with-$1-lib=DIR],
+               [use $1 library below directory DIR (default: $3)]),
 [case "$withval" in
     yes) AC_MSG_ERROR("option \"--with-$1-lib\" requires an argument")
 	;;
@@ -68,8 +68,8 @@ else
 	DEFAULT_INCDIR=$6
 fi
 AC_ARG_WITH($1-headers,
-[  --with-$1-headers=DIR   use $1 include files below directory DIR
-                          (default: $6)],
+AC_HELP_STRING([--with-$1-headers=DIR],
+               [use $1 include files below directory DIR (default: $6)])x,
 [case "$withval" in
     yes) AC_MSG_ERROR("option \"--with-$1-headers\" requires an argument")
 	;;
@@ -124,6 +124,7 @@ fi
 
 fi dnl disable fi
 
+AM_CONDITIONAL(m4_bpatsubst([$1],-,_), test -n "${m4_bpatsubst([$1],-,_)_LIB}")
 AC_SUBST(m4_bpatsubst([$1],-,_)_INCLUDE_PATH)
 AC_SUBST(m4_bpatsubst([$1],-,_)_LIB_PATH)
 AC_SUBST(m4_bpatsubst([$1],-,_)_LIB)