From xemacs-m  Sat Apr 19 08:34:55 1997
Received: from server21.digital.fr (server21.digital.fr [193.56.15.21])
	by xemacs.org (8.8.5/8.8.5) with ESMTP id IAA21588
	for <xemacs-beta@xemacs.org>; Sat, 19 Apr 1997 08:34:54 -0500 (CDT)
Received: from mail.vbo.dec.com (mail.vbo.dec.com [16.36.208.34]) by server21.digital.fr (8.7.5/8.7) with ESMTP id PAA06442 for <xemacs-beta@xemacs.org>; Sat, 19 Apr 1997 15:40:40 +0200 (MET DST)
Received: from vbormc.vbo.dec.com (vbormc.vbo.dec.com [16.36.208.94]) by mail.vbo.dec.com (8.7.3/8.7) with ESMTP id PAA04578 for <xemacs-beta@xemacs.org>; Sat, 19 Apr 1997 15:34:54 +0200 (MET DST)
Received: from clusaz.gvc.dec.com ([16.184.176.21]) by vbormc.vbo.dec.com (8.7.3/8.7) with SMTP id LAA17100 for <xemacs-beta@xemacs.org>; Fri, 18 Apr 1997 11:54:29 +0200
Received: from fornet.gvc.dec.com by clusaz.gvc.dec.com (5.65v3.2/1.1.10.5/04Jan97-0611PM)
	id AA12526; Fri, 18 Apr 1997 12:01:57 +0200
Received: by fornet.gvc.dec.com; (5.65v3.2/1.1.8.2/23Sep96-1024AM)
	id AA02908; Fri, 18 Apr 1997 12:01:56 +0200
Date: Fri, 18 Apr 1997 12:01:56 +0200
Message-Id: <9704181001.AA02908@fornet.gvc.dec.com>
From: Steve Carney <carney@gvc.dec.com>
To: XEmacs Beta Test <xemacs-beta@xemacs.org>
Subject: RE: -ldnet autodetection and suppression
In-Reply-To: <199704180300.UAA07524@xemacs.eng.sun.com>
References: <199704180300.UAA07524@xemacs.eng.sun.com>
X-Mailer: VM 6.27 under 20.1 XEmacs Lucid
Reply-To: carney@gvc.dec.com
X-Face: (d*XRr}%:j,s*8+_o];-"-<<Sd1>H?Ds*>_vV}6DVjhNkjSRW0z^9[WBrbtMma>lyW6u>r(
 9U_m6J0kh7U=q?(h[7<YtS!Cu[Yl)D_XSCy5+tw>_2qr&4S=n|A*ScV]5BR{3]YXk$!,4l2vh9B]}&
 0p"&#\I

mrb@Eng.Sun.COM (Martin Buchholz) writes,
in <199704180300.UAA07524@xemacs.eng.sun.com>:

>Autoconf2 has a macro AC_PATH_XTRA, which I am using.  It looks like
>it will add -dnet automatically if present.  So we will actually need
>to remove -ldnet from the relevant list of libraries if -with-dnet=no.
>
>The presence of dnet_stub clouds the issue.  Can you shed some more light?
>
>Here's a comment from the Autoconf2 sources:
>
>    # Martyn.Johnson@cl.cam.ac.uk says this is needed for Ultrix, if the X
>    # libraries were built with DECnet support.  

Dubious, but I guess it's possible.

>                                                  And karl@cs.umb.edu says
>    # the Alpha needs dnet_stub (dnet does not exist).
                                 ^^^^^^^^^^^^^^^^^^^^^
Not true.  dnet exists if DECnet is installed on DUNIX.  dnet_stub is
always present and what you'd expect, a library of stubs to link with if
dnet is not there.

>    AC_CHECK_LIB(dnet, dnet_ntoa, [X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet"])
>    if test $ac_cv_lib_dnet_dnet_ntoa = no; then
>      AC_CHECK_LIB(dnet_stub, dnet_ntoa,
>	[X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet_stub"])
>    fi

The basic autodetection logic in the above fragment is fine.  When
adding the --with-dnet configure option, we need to do something like
(assuming a true value for AC_CHECK_LIB also defines HAVE_LIB*):

case "${with_dnet}" in
  yes )
      AC_CHECK_LIB(dnet, dnet_ntoa, [X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet"])
      if test $ac_cv_lib_dnet_dnet_ntoa = no; then
        echo "Cannot find required library dnet.";
        exit -1;
      fi
      ;;

  no  )
      # Add dnet-stub if it's present
      AC_CHECK_LIB(dnet_stub, dnet_ntoa,
       [X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet_stub"])
      ;;

  *   )
      AC_CHECK_LIB(dnet, dnet_ntoa, [X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet"])
      if test $ac_cv_lib_dnet_dnet_ntoa = no; then
        AC_CHECK_LIB(dnet_stub, dnet_ntoa,
         [X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet_stub"])
      fi
      ;;
  esac

I'm not really familiar with autoconf.  I'm sorry if the above isn't of
much help.

        Steve

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Steve Carney        TEL:[41](22)782.90.60  http://www-digital.cern.ch/carney/
carney@gvc.dec.com  FAX:[41](22)782.94.92 

