1
0
mirror of https://github.com/postgres/postgres.git synced 2025-06-13 07:41:39 +03:00

Make an attempt at fixing our current Solaris 11 breakage: add a configure

probe for opterr (exactly like the one for optreset) and have getopt.c
define the variables only if configure doesn't find them in libc.
This commit is contained in:
Tom Lane
2009-04-04 21:55:50 +00:00
parent 090173a3f9
commit 1d26226d95
4 changed files with 88 additions and 4 deletions

59
configure vendored
View File

@ -18655,6 +18655,65 @@ fi
fi
{ echo "$as_me:$LINENO: checking for opterr" >&5
echo $ECHO_N "checking for opterr... $ECHO_C" >&6; }
if test "${pgac_cv_var_int_opterr+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
#include <unistd.h>
int
main ()
{
extern int opterr; opterr = 1;
;
return 0;
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (ac_try="$ac_link"
case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
(eval "$ac_link") 2>conftest.er1
ac_status=$?
grep -v '^ *+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } && {
test -z "$ac_c_werror_flag" ||
test ! -s conftest.err
} && test -s conftest$ac_exeext &&
$as_test_x conftest$ac_exeext; then
pgac_cv_var_int_opterr=yes
else
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
pgac_cv_var_int_opterr=no
fi
rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
conftest$ac_exeext conftest.$ac_ext
fi
{ echo "$as_me:$LINENO: result: $pgac_cv_var_int_opterr" >&5
echo "${ECHO_T}$pgac_cv_var_int_opterr" >&6; }
if test x"$pgac_cv_var_int_opterr" = x"yes"; then
cat >>confdefs.h <<\_ACEOF
#define HAVE_INT_OPTERR 1
_ACEOF
fi
{ echo "$as_me:$LINENO: checking for optreset" >&5
echo $ECHO_N "checking for optreset... $ECHO_C" >&6; }
if test "${pgac_cv_var_int_optreset+set}" = set; then