<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 TRANSITIONAL//EN">
<HTML>
<HEAD>
  <META HTTP-EQUIV="Content-Type" CONTENT="text/html; CHARSET=UTF-8">
  <META NAME="GENERATOR" CONTENT="GtkHTML/3.32.2">
</HEAD>
<BODY>
On Fri, 2011-12-02 at 10:48 -0800, Alan Coopersmith wrote:<BR>
<BLOCKQUOTE TYPE=CITE>
    <TT><FONT COLOR="#3c3c3c">Replace multiple methods of checking for funcs calls with AC_CHECK_FUNCS</FONT></TT><BR>
    <TT><FONT COLOR="#3c3c3c">Replace multiple methods of selecting fallback funcs with AC_REPLACE_FUNCS</FONT></TT><BR>
</BLOCKQUOTE>
A feature of autoconf I had not encountered yet. AC_REPLACE_FUNCS uses AC_LIBOBJ which in turns sets up the LIBOBJS and LTLIBOBJS variables in the Makefile.<BR>
<BLOCKQUOTE TYPE=CITE>
    <TT><FONT COLOR="#3c3c3c">Replace HAS_* and NEED_* #defines with autogenerated HAVE_*</FONT></TT><BR>
    <BR>
    <TT><FONT COLOR="#3c3c3c">Signed-off-by: Alan Coopersmith &lt;<A HREF="mailto:alan.coopersmith@oracle.com">alan.coopersmith@oracle.com</A>&gt;</FONT></TT><BR>
    <TT><FONT COLOR="#3c3c3c">---</FONT></TT><BR>
    <TT><FONT COLOR="#3c3c3c">&nbsp;configure.ac&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; |&nbsp;&nbsp; 38 +++++---------------------</FONT></TT><BR>
    <TT><FONT COLOR="#3c3c3c">&nbsp;hw/dmx/config/Makefile.am |&nbsp;&nbsp;&nbsp; 3 --</FONT></TT><BR>
    <TT><FONT COLOR="#3c3c3c">&nbsp;hw/vfb/InitOutput.c&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; |&nbsp;&nbsp; 26 +++++++++---------</FONT></TT><BR>
    <TT><FONT COLOR="#3c3c3c">&nbsp;hw/xwin/win.h&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; |&nbsp;&nbsp;&nbsp; 4 +-</FONT></TT><BR>
    <TT><FONT COLOR="#3c3c3c">&nbsp;include/dix-config.h.in&nbsp;&nbsp; |&nbsp;&nbsp; 65 +++++++++++++++++++++++---------------------</FONT></TT><BR>
    <TT><FONT COLOR="#3c3c3c">&nbsp;include/os.h&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; |&nbsp;&nbsp;&nbsp; 8 +++---</FONT></TT><BR>
    <TT><FONT COLOR="#3c3c3c">&nbsp;include/xkb-config.h.in&nbsp;&nbsp; |&nbsp;&nbsp;&nbsp; 3 --</FONT></TT><BR>
    <TT><FONT COLOR="#3c3c3c">&nbsp;mi/mibitblt.c&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; |&nbsp;&nbsp;&nbsp; 2 +-</FONT></TT><BR>
    <TT><FONT COLOR="#3c3c3c">&nbsp;os/Makefile.am&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; |&nbsp;&nbsp; 16 +---------</FONT></TT><BR>
    <TT><FONT COLOR="#3c3c3c">&nbsp;os/access.c&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; |&nbsp;&nbsp; 28 +++++++++---------</FONT></TT><BR>
    <TT><FONT COLOR="#3c3c3c">&nbsp;os/connection.c&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; |&nbsp;&nbsp;&nbsp; 6 ++--</FONT></TT><BR>
    <TT><FONT COLOR="#3c3c3c">&nbsp;os/osdep.h&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; |&nbsp;&nbsp;&nbsp; 6 ----</FONT></TT><BR>
    <TT><FONT COLOR="#3c3c3c">&nbsp;os/strcasecmp.c&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; |&nbsp;&nbsp;&nbsp; 4 +-</FONT></TT><BR>
    <TT><FONT COLOR="#3c3c3c">&nbsp;os/strcasestr.c&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; |&nbsp;&nbsp;&nbsp; 2 +-</FONT></TT><BR>
    <TT><FONT COLOR="#3c3c3c">&nbsp;os/strlcpy.c&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; |&nbsp;&nbsp;&nbsp; 2 +</FONT></TT><BR>
    <TT><FONT COLOR="#3c3c3c">&nbsp;15 files changed, 85 insertions(+), 128 deletions(-)</FONT></TT><BR>
    <BR>
    <BR>
    <BR>
</BLOCKQUOTE>
<BR>
I got a compiler error (full build). Note that my system does not have strlcpy or strlcat. These two objects are available to all Makefiles $LIBOBJS appended near the end of the gcc command. <BR>
<BR>
make[2]: Entering directory `/home/nadon/xorg/src/xserver/hw/xfree86'<BR>
libtool: link: gcc -std=gnu99 -DHAVE_DIX_CONFIG_H -Wall -Wpointer-arith -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Wnested-externs -fno-strict-aliasing -Wbad-function-cast -Wformat=2 -Wold-style-definition -Wdeclaration-after-statement -fno-strict-aliasing -D_BSD_SOURCE -DHAS_FCHOWN -DHAS_STICKY_DIR_BIT -I/home/nadon/xorg/src/inst/include -I/home/nadon/xorg/src/inst/include/pixman-1 -I/usr/include/freetype2 -I../../include -I../../include -I../../Xext -I../../composite -I../../damageext -I../../xfixes -I../../Xi -I../../mi -I../../miext/sync -I../../miext/shadow -I../../miext/damage -I../../render -I../../randr -I../../fb -DHAVE_XORG_CONFIG_H -I/home/nadon/xorg/src/inst/include -DXF86PM -I/home/nadon/xorg/src/inst/include -g -O2 -o Xorg sdksyms.o ../../dix/dix.O ../../os/os.O -Wl,--export-dynamic&nbsp; ../../dix/.libs/libmain.a loader/.libs/libloader.a common/.libs/libcommon.a os-support/.libs/libxorgos.a parser/.libs/libxf86config_internal.a dixmods/.libs/libdixmods.a modes/.libs/libxf86modes.a ramdac/.libs/libramdac.a ddc/.libs/libddc.a i2c/.libs/libi2c.a dixmods/.libs/libxorgxkb.a ../../composite/.libs/libcomposite.a ../../xfixes/.libs/libxfixes.a ../../Xext/.libs/libXextbuiltin.a ../../glx/.libs/libglx.a ../../randr/.libs/librandr.a ../../render/.libs/librender.a ../../damageext/.libs/libdamageext.a ../../miext/sync/.libs/libsync.a ../../miext/damage/.libs/libdamage.a ../../miext/shadow/.libs/libshadow.a ../../Xi/.libs/libXi.a ../../xkb/.libs/libxkb.a ../../mi/.libs/libmi.a ../../os/.libs/libos.a -lcrypto -ldl -L/home/nadon/xorg/src/inst/lib /home/nadon/xorg/src/inst/lib/libpciaccess.so -lpthread /home/nadon/xorg/src/inst/lib/libpixman-1.so /home/nadon/xorg/src/inst/lib/libXfont.so /home/nadon/xorg/src/inst/lib/libXau.so /home/nadon/xorg/src/inst/lib/libXdmcp.so -lm -lrt -Wl,-rpath -Wl,/home/nadon/xorg/src/inst/lib -Wl,-rpath -Wl,/home/nadon/xorg/src/inst/lib<BR>
<BR>
<FONT COLOR="#ff0000">sdksyms.o:(.data+0x388): undefined reference to `strlcpy'</FONT><BR>
<FONT COLOR="#ff0000">sdksyms.o:(.data+0x390): undefined reference to `strlcat'</FONT><BR>
<BR>
../../os/os.O: In function `siHostnameAddrMatch':<BR>
/home/nadon/xorg/src/xserver/os/access.c:1759: undefined reference to `strlcpy'<BR>
../../os/os.O: In function `AuthAudit':<BR>
/home/nadon/xorg/src/xserver/os/connection.c:518: undefined reference to `strlcpy'<BR>
/home/nadon/xorg/src/xserver/os/connection.c:536: undefined reference to `strlcpy'<BR>
../../os/os.O: In function `VAuditF':<BR>
/home/nadon/xorg/src/xserver/os/log.c:576: undefined reference to `strlcpy'<BR>
common/.libs/libcommon.a(xf86Config.o): In function `xf86ValidateFontPath':<BR>
/home/nadon/xorg/src/xserver/hw/xfree86/common/xf86Config.c:198: undefined reference to `strlcpy'<BR>
common/.libs/libcommon.a(xf86Xinput.o):/home/nadon/xorg/src/xserver/hw/xfree86/common/xf86Xinput.c:463: more undefined references to `strlcpy' follow<BR>
collect2: ld returned 1 exit status<BR>
make[2]: *** [Xorg] Error 1<BR>
make[2]: Leaving directory `/home/nadon/xorg/src/xserver/hw/xfree86'<BR>
make[1]: *** [all-recursive] Error 1<BR>
make[1]: Leaving directory `/home/nadon/xorg/src/xserver/hw/xfree86'<BR>
make: *** [all] Error 2<BR>
<BR>
=======================================================================================================<BR>
<BR>
<A HREF="mailto:nadon@ubuntu">nadon@ubuntu</A>:~/xorg/src/xserver/os$ make<BR>
/bin/bash ../libtool&nbsp; --tag=CC&nbsp;&nbsp; --mode=compile gcc -std=gnu99 -DHAVE_CONFIG_H -I. -I../include&nbsp;&nbsp;&nbsp; -DHAVE_DIX_CONFIG_H -Wall -Wpointer-arith -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Wnested-externs -fno-strict-aliasing -Wbad-function-cast -Wformat=2 -Wold-style-definition -Wdeclaration-after-statement -fno-strict-aliasing -D_BSD_SOURCE -DHAS_FCHOWN -DHAS_STICKY_DIR_BIT -I/home/nadon/xorg/src/inst/include -I/home/nadon/xorg/src/inst/include/pixman-1 -I/usr/include/freetype2&nbsp;&nbsp; -I../include -I../include -I../Xext -I../composite -I../damageext -I../xfixes -I../Xi -I../mi -I../miext/sync -I../miext/shadow&nbsp; -I../miext/damage -I../render -I../randr -I../fb&nbsp; -g -O2 -MT access.lo -MD -MP -MF .deps/access.Tpo -c -o access.lo access.c<BR>
libtool: compile:&nbsp; gcc -std=gnu99 -DHAVE_CONFIG_H -I. -I../include -DHAVE_DIX_CONFIG_H -Wall -Wpointer-arith -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Wnested-externs -fno-strict-aliasing -Wbad-function-cast -Wformat=2 -Wold-style-definition -Wdeclaration-after-statement -fno-strict-aliasing -D_BSD_SOURCE -DHAS_FCHOWN -DHAS_STICKY_DIR_BIT -I/home/nadon/xorg/src/inst/include -I/home/nadon/xorg/src/inst/include/pixman-1 -I/usr/include/freetype2 -I../include -I../include -I../Xext -I../composite -I../damageext -I../xfixes -I../Xi -I../mi -I../miext/sync -I../miext/shadow -I../miext/damage -I../render -I../randr -I../fb -g -O2 -MT access.lo -MD -MP -MF .deps/access.Tpo -c access.c&nbsp; -fPIC -DPIC -o .libs/access.o<BR>
mv -f .deps/access.Tpo .deps/access.Plo<BR>
/bin/bash ../libtool&nbsp; --tag=CC&nbsp;&nbsp; --mode=link gcc -std=gnu99 -DHAVE_DIX_CONFIG_H -Wall -Wpointer-arith -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Wnested-externs -fno-strict-aliasing -Wbad-function-cast -Wformat=2 -Wold-style-definition -Wdeclaration-after-statement -fno-strict-aliasing -D_BSD_SOURCE -DHAS_FCHOWN -DHAS_STICKY_DIR_BIT -I/home/nadon/xorg/src/inst/include -I/home/nadon/xorg/src/inst/include/pixman-1 -I/usr/include/freetype2&nbsp;&nbsp; -I../include -I../include -I../Xext -I../composite -I../damageext -I../xfixes -I../Xi -I../mi -I../miext/sync -I../miext/shadow&nbsp; -I../miext/damage -I../render -I../randr -I../fb&nbsp; -g -O2&nbsp;&nbsp; -o libos.la&nbsp; WaitFor.lo access.lo auth.lo backtrace.lo client.lo connection.lo io.lo mitauth.lo oscolor.lo osinit.lo utils.lo xdmauth.lo xsha1.lo xstrans.lo xprintf.lo log.lo rpcauth.lo xdmcp.lo -lcrypto -ldl strlcat.o strlcpy.o -lm&nbsp; -lrt<BR>
<BR>
<FONT COLOR="#ff0000">*** Warning: Linking the shared library libos.la against the non-libtool</FONT><BR>
<FONT COLOR="#ff0000">*** objects&nbsp; strlcat.o strlcpy.o is not portable!</FONT><BR>
<BR>
libtool: link: rm -fr&nbsp; .libs/libos.a .libs/libos.la<BR>
libtool: link: ar cru .libs/libos.a .libs/WaitFor.o .libs/access.o .libs/auth.o .libs/backtrace.o .libs/client.o .libs/connection.o .libs/io.o .libs/mitauth.o .libs/oscolor.o .libs/osinit.o .libs/utils.o .libs/xdmauth.o .libs/xsha1.o .libs/xstrans.o .libs/xprintf.o .libs/log.o .libs/rpcauth.o .libs/xdmcp.o <BR>
libtool: link: ranlib .libs/libos.a<BR>
libtool: link: ( cd &quot;.libs&quot; &amp;&amp; rm -f &quot;libos.la&quot; &amp;&amp; ln -s &quot;../libos.la&quot; &quot;libos.la&quot; )<BR>
/usr/bin/dtrace -G -C -o dtrace.o -s ../dix/Xserver.d .libs/*.o ../dix/.libs/*.o<BR>
ld -r -o os.O dtrace.o .libs/*.o<BR>
<BR>
I hope it is not just a glitch on my system, I'll try digging more.
</BODY>
</HTML>