Skip to Content.
Sympa Menu

freetds - Re: [freetds] Patch to fix nasty HP-UX problem (was TSQL error -connect error: Not owner)

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: "ZIGLIO, Frediano, VF-IT" <Frediano.Ziglio AT vodafone.com>
  • To: "FreeTDS Development Group" <freetds AT lists.ibiblio.org>
  • Subject: Re: [freetds] Patch to fix nasty HP-UX problem (was TSQL error -connect error: Not owner)
  • Date: Fri, 15 Feb 2008 11:46:38 +0100

> >
> > ZIGLIO, Frediano, VF-IT wrote:
> > > I don't like all that code just to fix a problem for a
> > single system but
> > > this problem has to be fixed... and problem reside on the
> > system header
> > > so you are just writing a workaround...
> >
> > Agreed. In general it's better to test for the feature than
> > for the OS,
> > but there's another general rule: it's better to fix bugs
> > upstream than to
> > work around them, and workarounds don't have to be elegant.
> > Or general.
> > ;-)
> >
> > With that in mind, let me try to save you some work, or at
> > least offer a
> > better alternative. Please read
> >
> > http://h50236.www5.hp.com/solutions/copartner/IA64/reference/P
> > orting_Tuning/portguideipf.pdf
> > and http://www.docs.hp.com/en/B9106-90013/xopen_networking.7.html.
> >
> > It looks like defining _XOPEN_SOURCE might do the trick.
> Certainly HP
> > knows about the conflict.
> >
> > I suggest the OP go back to HP and see if there's some way to
> > define his
> > environment such that FreeTDS compiles without your patch. If he's
> > willing to do that but needs a clearer test case, would you
> > be willing to
> > create one?
> >
> > Regards,
> >
>
> Now I understood! If _XOPEN_SOURCE and _XOPEN_SOURCE_EXTENDED are
> defined Unix98 are defined but you have to link libxnet to get these
> functions. Are we sure however that using -lxnet will use these
> functions instead of libc one?? Even libc is defined... I'll try...
>
> If this works changing configure adding -lxnet for hp-ux will work.
>

Final version I'm going to commit:

diff -u -1 -0 -r1.29.2.6 configure.ac
--- configure.ac 27 Jan 2008 10:41:21 -0000 1.29.2.6
+++ configure.ac 15 Feb 2008 10:45:38 -0000
@@ -40,21 +40,20 @@
# Host-specific configuration
# ------------------------------------------------------------
AC_CANONICAL_HOST
netdb_reentrant=no
case $host in
*-*-osf*)
CPPFLAGS="$CPPFLAGS -D_OSF_SOURCE -D_XOPEN_SOURCE_EXTENDED
-D_POSIX_C_SOURCE=199506L"
netdb_reentrant=yes
;;
*-*-hpux11*)
- CPPFLAGS="$CPPFLAGS -D_XOPEN_SOURCE_EXTENDED"
netdb_reentrant=yes
;;
*-*-cygwin*)
netdb_reentrant=yes
;;
esac

case $host_os in
darwin* | rhapsody*)
AM_CONDITIONAL(MACOSX, true)
@@ -144,20 +143,41 @@
tds_mingw=yes
if test "$host_cpu" = "x86_64"; then
LIBS="-lws2_32"
elif test -r /usr/lib/w32api/libwsock32.a; then
LIBS="-L/usr/lib/w32api -lwsock32"
else
LIBS="-lwsock32"
fi
AM_CONDITIONAL(MINGW32, true)
;;
+*-*-hpux*)
+ # these lines are needed to fix a problem for HP-UX
+ # HP-UX define two versions of sockets, one BSD and one X/Open
+ # these versions are not binary compatible (BSD use int where
X/Open
+ # use socklen_t == size_t) and different libraries (BSD in libc
and
+ # X/Open in libxnet). X/Open is used if _XOPEN_SOURCE and
+ # _XOPEN_SOURCE_EXTENDED are defined. To complicate the things
gcc
+ # by default define _XOPEN_SOURCE_EXTENDED so define always both
+ # constants and link always libxnet!
+ CPPFLAGS="$CPPFLAGS -D_XOPEN_SOURCE -D_XOPEN_SOURCE_EXTENDED"
+ LIBS="$LIBS -lxnet"
+ AC_SEARCH_LIBS(gethostbyname, nsl)
+ if test "$enable_krb5" = "yes" ; then
+ AC_SEARCH_LIBS(gss_init_sec_context, [gssapi_krb5
gssapi])
+ if test "$ac_cv_search_gss_init_sec_context" != no; then
+ AC_DEFINE(ENABLE_KRB5, 1, [Defined if
--enable-krb5 used and library detected])
+ fi
+ fi
+
+ AM_CONDITIONAL(MINGW32, false)
+ ;;
*)
AC_SEARCH_LIBS(socket, socket)
AC_SEARCH_LIBS(gethostbyname, nsl)
if test "$enable_krb5" = "yes" ; then
AC_SEARCH_LIBS(gss_init_sec_context, [gssapi_krb5
gssapi])
if test "$ac_cv_search_gss_init_sec_context" != no; then
AC_DEFINE(ENABLE_KRB5, 1, [Defined if
--enable-krb5 used and library detected])
fi
fi


freddy77




Archive powered by MHonArc 2.6.24.

Top of Page