X-Recipient: archive-cygwin AT delorie DOT com X-SWARE-Spam-Status: No, hits=-6.8 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_HI,SPF_HELO_PASS,TW_BK,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Message-ID: <4C73CA22.8020307@redhat.com> Date: Tue, 24 Aug 2010 07:33:22 -0600 From: Eric Blake User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.8) Gecko/20100806 Fedora/3.1.2-1.fc13 Mnenhy/0.8.3 Thunderbird/3.1.2 MIME-Version: 1.0 To: cygwin AT cygwin DOT com, "bug-autoconf AT gnu DOT org" , bug-gnulib Subject: Re: Building Emacs-trunk with gcc >= 4.5.1 and libelf installed References: <4C7304CB DOT 2020001 AT alice DOT it> <1282624631 DOT 5256 DOT 40 DOT camel AT YAAKOV04> In-Reply-To: <1282624631.5256.40.camel@YAAKOV04> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-IsSubscribed: yes Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com [adding autoconf and gnulib; replies can drop cygwin] On 08/23/2010 10:37 PM, Yaakov (Cygwin/X) wrote: > On Tue, 2010-08-24 at 01:31 +0200, Angelo Graziosi wrote: >> Trying to build Emacs-trunk on Cygwin with GCC>= 4.5.1, I have found a >> problem if also the package 'libelf0' is installed. > [snip] >> and the following test in 'configure' script is true: > [snip] >> i.e. SVR4 is _defined_. But... 'src/xfaces.c' includes indirectly via >> '/usr/include/X11/Xos.h' the header '/usr/include/X11/Xarch.h', which has: > [snip] >> i.e. finding SVR4 defined, it searches for 'byteorder.h' in >> '/usr/include/sys' and not in '/usr/include/asm', where it lives (*as on >> GNU/Linux*[1]), and this leads to the above failure. > > This is coming from autoconf's AC_FUNC_GETLOADAVG, which tries to find > several different getloadavg(3) implementations (which Cygwin doesn't > provide), otherwise it points to an AC_LIBOBJ from gnulib. On Solaris, > the gnulib getloadavg uses kvm_open(3) and friends, and libkvm requires > libelf, hence the check for the latter. According to gnulib, AC_FUNC_GETLOADAVG is obsolescent (in part because it uses AC_LIBOBJ in a manner that is not easily extensible by gnulib). If emacs is using modern gnulib, then it is _not_ using AC_FUNC_GETLOADAVG from autoconf, but rather the more up-to-date gl_GETLOADAVG from the gnulib module getloadavg. Either way: > > AFAICS the proper solution is, in _AC_LIBOBJ_GETLOADAVG: > > if test $ac_have_func = no&& test "$ac_cv_lib_elf_elf_begin" = yes; > then > ac_have_func=yes > AC_DEFINE(SVR4, 1, [Define to 1 on System V Release 4.]) > fi > > to add<< && test "$ac_cv_lib_kvm_kvm_open" = yes>> to the conditional. Yes, autoconf's AC_FUNC_GETLOADAVG should be updated in this manner, and that should also be reflected into gnulib's gl_GETLOADAVG. Thanks for the analysis. -- Eric Blake eblake AT redhat DOT com +1-801-349-2682 Libvirt virtualization library http://libvirt.org -- Problem reports: http://cygwin.com/problems.html FAQ: http://cygwin.com/faq/ Documentation: http://cygwin.com/docs.html Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple