On Tue, Jun 14, 2011 at 6:45 AM, Gaetan Nadon <[email protected]> wrote: > On Tue, 2011-06-14 at 10:56 +0200, Diego Elio Pettenò wrote: > > Il giorno lun, 13/06/2011 alle 19.43 -0400, Gaetan Nadon ha scritto: >> >> Using m4 to check for macro defined by the xserver to ensure it is >> installed >> will work as long as the macro is not removed. The preferred way of >> checking >> for dependencies is to use PKG_CHECK_MODULE. > > Different moment to check for them: > > - PKG_CHECK_MODULE check presence when running ./configure > - m4_ifndef when autoconf is executed. > > If you build autotools for the package on a system that has no > xorg-server installed, you'll receive a broken configure script, thus > why I wanted to make it explicit that you need to have it around at > autoconf time. > > What is the benefit of having: > > autoreconf: running: aclocal -I /home/nadon/xorg/src/inst/share/aclocal > --force > configure.ac:51: error: must install xorg-server development files before > running autoconf/autogen > > over having: > > checking for XORG... no > configure: error: Package requirements (xorg-server >= 1.6) were not met: > > Dan is also of the opinion that it is preferable, but I just can't see why. > In a distro building world perhaps?
It's simple: XORG_DRIVER_CHECK_EXT is required at autoconf time whereas PKG_CHECK_MODULES doesn't operate until build time. You could generate a broken configure script if the macro isn't available. IMO, it's just good practice to catch errors at the appropriate time. I don't see a drawback to checking whether an external macro is available when it needs to be used. > One drawback is the m4 test "fails to fail" when the server is uninstalled > after synaptics have been configured as the XORG macro is cached. The > following PKG_CHECK_MODULE will stop on error, however. Maybe this is the > way it should work. How would it "fail to fail"? If xorg-server.h isn't installed anymore, then you won't get the extension. The macro is intended to check if an extension is available in the server, and it does just that. I guess you want it to fail harder if the xserver can't be found at all. -- Dan _______________________________________________ [email protected]: X.Org development Archives: http://lists.x.org/archives/xorg-devel Info: http://lists.x.org/mailman/listinfo/xorg-devel
