@@ -6045,19 +6045,70 @@ _ACEOF
60456045
60466046fi
60476047
6048-
6049- echo " $as_me :$LINENO : checking for main in -lgetopt" >&5
6050- echo $ECHO_N " checking for main in -lgetopt...$ECHO_C " >&6
6051- if test " ${ac_cv_lib_getopt_main+set} " =set ; then
6048+ echo " $as_me :$LINENO : checking for library containing getopt_long" >&5
6049+ echo $ECHO_N " checking for library containing getopt_long...$ECHO_C " >&6
6050+ if test " ${ac_cv_search_getopt_long+set} " =set ; then
60526051echo $ECHO_N " (cached)$ECHO_C " >&6
60536052else
6054- ac_check_lib_save_LIBS =$LIBS
6055- LIBS= " -lgetopt $LIBS "
6053+ ac_func_search_save_LIBS =$LIBS
6054+ ac_cv_search_getopt_long=no
60566055cat> conftest.$ac_ext << _ACEOF
60576056#line$LINENO "configure"
60586057#include "confdefs.h"
60596058
6059+ /* Override any gcc2 internal prototype to avoid an error. */
6060+ #ifdef __cplusplus
6061+ extern "C"
6062+ #endif
6063+ /* We use char because int might match the return type of a gcc2
6064+ builtin and then its argument prototype would still apply. */
6065+ char getopt_long ();
6066+ #ifdef F77_DUMMY_MAIN
6067+ # ifdef __cplusplus
6068+ extern "C"
6069+ # endif
6070+ int F77_DUMMY_MAIN() { return 1; }
6071+ #endif
6072+ int
6073+ main ()
6074+ {
6075+ getopt_long ();
6076+ ;
6077+ return 0;
6078+ }
6079+ _ACEOF
6080+ rm -f conftest.$ac_objext conftest$ac_exeext
6081+ if { (evalecho " $as_me :$LINENO :\" $ac_link \" " )>&5
6082+ (eval$ac_link )2>&5
6083+ ac_status=$?
6084+ echo " $as_me :$LINENO :\$ ? =$ac_status " >&5
6085+ (exit$ac_status ); }&&
6086+ { ac_try=' test -s conftest$ac_exeext'
6087+ { (evalecho " $as_me :$LINENO :\" $ac_try \" " )>&5
6088+ (eval$ac_try )2>&5
6089+ ac_status=$?
6090+ echo " $as_me :$LINENO :\$ ? =$ac_status " >&5
6091+ (exit$ac_status ); }; }; then
6092+ ac_cv_search_getopt_long=" none required"
6093+ else
6094+ echo " $as_me : failed program was:" >&5
6095+ cat conftest.$ac_ext >&5
6096+ fi
6097+ rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6098+ if test " $ac_cv_search_getopt_long " = no; then
6099+ for ac_lib in getopt; do
6100+ LIBS=" -l$ac_lib $ac_func_search_save_LIBS "
6101+ cat> conftest.$ac_ext << _ACEOF
6102+ #line$LINENO "configure"
6103+ #include "confdefs.h"
60606104
6105+ /* Override any gcc2 internal prototype to avoid an error. */
6106+ #ifdef __cplusplus
6107+ extern "C"
6108+ #endif
6109+ /* We use char because int might match the return type of a gcc2
6110+ builtin and then its argument prototype would still apply. */
6111+ char getopt_long ();
60616112#ifdef F77_DUMMY_MAIN
60626113# ifdef __cplusplus
60636114 extern "C"
@@ -6067,7 +6118,7 @@ cat >conftest.$ac_ext <<_ACEOF
60676118int
60686119main ()
60696120{
6070- main ();
6121+ getopt_long ();
60716122 ;
60726123 return 0;
60736124}
@@ -6084,23 +6135,21 @@ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
60846135 ac_status=$?
60856136echo " $as_me :$LINENO :\$ ? =$ac_status " >&5
60866137 (exit$ac_status ); }; }; then
6087- ac_cv_lib_getopt_main=yes
6138+ ac_cv_search_getopt_long=" -l$ac_lib "
6139+ break
60886140else
60896141echo " $as_me : failed program was:" >&5
60906142cat conftest.$ac_ext >&5
6091- ac_cv_lib_getopt_main=no
60926143fi
60936144rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6094- LIBS= $ac_check_lib_save_LIBS
6145+ done
60956146fi
6096- echo " $as_me :$LINENO : result:$ac_cv_lib_getopt_main " >&5
6097- echo " ${ECHO_T} $ac_cv_lib_getopt_main " >&6
6098- if test $ac_cv_lib_getopt_main = yes; then
6099- cat>> confdefs.h<< _ACEOF
6100- #define HAVE_LIBGETOPT 1
6101- _ACEOF
6102-
6103- LIBS=" -lgetopt$LIBS "
6147+ LIBS=$ac_func_search_save_LIBS
6148+ fi
6149+ echo " $as_me :$LINENO : result:$ac_cv_search_getopt_long " >&5
6150+ echo " ${ECHO_T} $ac_cv_search_getopt_long " >&6
6151+ if test " $ac_cv_search_getopt_long " ! = no; then
6152+ test " $ac_cv_search_getopt_long " =" none required" || LIBS=" $ac_cv_search_getopt_long $LIBS "
61046153
61056154fi
61066155