Skip to content

Commit 32a3f7a

Browse files
committed
printf debug
1 parent 2e91d33 commit 32a3f7a

File tree

2 files changed

+105
-17
lines changed

2 files changed

+105
-17
lines changed

postgresql-libpq-configure/configure

Lines changed: 89 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1520,6 +1520,55 @@ printf "%s\n" "$ac_res" >&6; }
15201520
eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
15211521
15221522
} # ac_fn_c_check_header_compile
1523+
1524+
# ac_fn_c_try_link LINENO
1525+
# -----------------------
1526+
# Try to link conftest.$ac_ext, and return whether this succeeded.
1527+
ac_fn_c_try_link ()
1528+
{
1529+
as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
1530+
rm -f conftest.$ac_objext conftest.beam conftest$ac_exeext
1531+
if { { ac_try="$ac_link"
1532+
case "(($ac_try" in
1533+
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
1534+
*) ac_try_echo=$ac_try;;
1535+
esac
1536+
eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
1537+
printf "%s\n" "$ac_try_echo"; } >&5
1538+
echo "$ac_link"
1539+
"$ac_link" || true
1540+
(eval "$ac_link") 2>conftest.err
1541+
ac_status=$?
1542+
if test -s conftest.err; then
1543+
grep -v '^ *+' conftest.err >conftest.er1
1544+
cat conftest.er1 >&5
1545+
mv -f conftest.er1 conftest.err
1546+
fi
1547+
printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
1548+
test $ac_status = 0; } && {
1549+
test -z "$ac_c_werror_flag" ||
1550+
test ! -s conftest.err
1551+
} && test -s conftest$ac_exeext && {
1552+
test "$cross_compiling" = yes ||
1553+
test -x conftest$ac_exeext
1554+
}
1555+
then :
1556+
ac_retval=0
1557+
else $as_nop
1558+
printf "%s\n" "$as_me: failed program was:" >&5
1559+
sed 's/^/| /' conftest.$ac_ext >&5
1560+
1561+
ac_retval=1
1562+
fi
1563+
# Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information
1564+
# created by the PGI compiler (conftest_ipa8_conftest.oo), as it would
1565+
# interfere with the next link command; also delete a directory that is
1566+
# left behind by Apple's compiler. We do this before executing the actions.
1567+
rm -rf conftest.dSYM conftest_ipa8_conftest.oo
1568+
eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
1569+
as_fn_set_status $ac_retval
1570+
1571+
} # ac_fn_c_try_link
15231572
ac_configure_args_raw=
15241573
for ac_arg
15251574
do
@@ -3970,7 +4019,46 @@ fi
39704019
then :
39714020
break
39724021
fi
3973-
found_postgresql="$ac_cv_postgresql_found"
4022+
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for the PostgreSQL library linking is working" >&5
4023+
printf %s "checking for the PostgreSQL library linking is working... " >&6; }
4024+
if test ${ac_cv_postgresql_found+y}
4025+
then :
4026+
printf %s "(cached) " >&6
4027+
else $as_nop
4028+
4029+
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
4030+
/* end confdefs.h. */
4031+
4032+
4033+
#include <libpq-fe.h>
4034+
4035+
int
4036+
main (void)
4037+
{
4038+
4039+
char conninfo[]="dbname = postgres";
4040+
PGconn *conn;
4041+
conn = PQconnectdb(conninfo);
4042+
4043+
4044+
;
4045+
return 0;
4046+
}
4047+
4048+
_ACEOF
4049+
if ac_fn_c_try_link "$LINENO"
4050+
then :
4051+
ac_cv_postgresql_found=yes
4052+
else $as_nop
4053+
ac_cv_postgresql_found=no
4054+
fi
4055+
rm -f core conftest.err conftest.$ac_objext conftest.beam \
4056+
conftest$ac_exeext conftest.$ac_ext
4057+
4058+
fi
4059+
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_postgresql_found" >&5
4060+
printf "%s\n" "$ac_cv_postgresql_found" >&6; }
4061+
found_postgresql="$ac_cv_postgresql_found"
39744062
if test "X$found_postgresql" = "Xno"
39754063
then :
39764064
break

postgresql-libpq-configure/m4/ax_lib_postgresql.m4

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -206,22 +206,22 @@ AC_DEFUN([AX_LIB_POSTGRESQL],
206206
AC_CHECK_HEADER([libpq-fe.h],[],[found_postgresql=no])
207207
AS_IF([test "X$found_postgresql" = "Xno"],[break])
208208
dnl try now to link
209-
dnl AC_CACHE_CHECK([for the PostgreSQL library linking is working],[ac_cv_postgresql_found],
210-
dnl [
211-
dnl AC_LINK_IFELSE([
212-
dnl AC_LANG_PROGRAM(
213-
dnl [
214-
dnl #include <libpq-fe.h>
215-
dnl ],
216-
dnl [[
217-
dnl char conninfo[]="dbname = postgres";
218-
dnl PGconn *conn;
219-
dnl conn = PQconnectdb(conninfo);
220-
dnl ]]
221-
dnl )
222-
dnl ],[ac_cv_postgresql_found=yes],
223-
dnl [ac_cv_postgresql_found=no])
224-
dnl ])
209+
AC_CACHE_CHECK([for the PostgreSQL library linking is working],[ac_cv_postgresql_found],
210+
[
211+
AC_LINK_IFELSE([
212+
AC_LANG_PROGRAM(
213+
[
214+
#include <libpq-fe.h>
215+
],
216+
[[
217+
char conninfo[]="dbname = postgres";
218+
PGconn *conn;
219+
conn = PQconnectdb(conninfo);
220+
]]
221+
)
222+
],[ac_cv_postgresql_found=yes],
223+
[ac_cv_postgresql_found=no])
224+
])
225225
found_postgresql="$ac_cv_postgresql_found"
226226
AS_IF([test "X$found_postgresql" = "Xno"],[break])
227227
break

0 commit comments

Comments
 (0)