<!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 20:42 -0500, Gaetan Nadon wrote:<BR>
<BLOCKQUOTE TYPE=CITE>
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 <<A HREF="mailto:alan.coopersmith@oracle.com">alan.coopersmith@oracle.com</A>></FONT></TT><BR>
<TT><FONT COLOR="#3c3c3c">---</FONT></TT><BR>
<TT><FONT COLOR="#3c3c3c"> configure.ac | 38 +++++---------------------</FONT></TT><BR>
<TT><FONT COLOR="#3c3c3c"> hw/dmx/config/Makefile.am | 3 --</FONT></TT><BR>
<TT><FONT COLOR="#3c3c3c"> hw/vfb/InitOutput.c | 26 +++++++++---------</FONT></TT><BR>
<TT><FONT COLOR="#3c3c3c"> hw/xwin/win.h | 4 +-</FONT></TT><BR>
<TT><FONT COLOR="#3c3c3c"> include/dix-config.h.in | 65 +++++++++++++++++++++++---------------------</FONT></TT><BR>
<TT><FONT COLOR="#3c3c3c"> include/os.h | 8 +++---</FONT></TT><BR>
<TT><FONT COLOR="#3c3c3c"> include/xkb-config.h.in | 3 --</FONT></TT><BR>
<TT><FONT COLOR="#3c3c3c"> mi/mibitblt.c | 2 +-</FONT></TT><BR>
<TT><FONT COLOR="#3c3c3c"> os/Makefile.am | 16 +---------</FONT></TT><BR>
<TT><FONT COLOR="#3c3c3c"> os/access.c | 28 +++++++++---------</FONT></TT><BR>
<TT><FONT COLOR="#3c3c3c"> os/connection.c | 6 ++--</FONT></TT><BR>
<TT><FONT COLOR="#3c3c3c"> os/osdep.h | 6 ----</FONT></TT><BR>
<TT><FONT COLOR="#3c3c3c"> os/strcasecmp.c | 4 +-</FONT></TT><BR>
<TT><FONT COLOR="#3c3c3c"> os/strcasestr.c | 2 +-</FONT></TT><BR>
<TT><FONT COLOR="#3c3c3c"> os/strlcpy.c | 2 +</FONT></TT><BR>
<TT><FONT COLOR="#3c3c3c"> 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 ../../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 --tag=CC --mode=compile 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 -o access.lo access.c<BR>
libtool: compile: 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 -fPIC -DPIC -o .libs/access.o<BR>
mv -f .deps/access.Tpo .deps/access.Plo<BR>
/bin/bash ../libtool --tag=CC --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 -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 -o libos.la 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 -lrt<BR>
<BR>
<FONT COLOR="#ff0000">*** Warning: Linking the shared library libos.la against the non-libtool</FONT><BR>
<FONT COLOR="#ff0000">*** objects strlcat.o strlcpy.o is not portable!</FONT><BR>
<BR>
</BLOCKQUOTE>
<BR>
This os Makefile.am should read:<BR>
<BR>
libos_la_LIBADD = @SHA1_LIBS@ $(DLOPEN_LIBS) $(LTLIBOBJS) --> Use LTLIBOBJS rather than LIBOBJS<BR>
<BR>
I get a successful build now.<BR>
<BR>
It links with .lo files now:
<BLOCKQUOTE>
<PRE>
[...] -lcrypto -ldl strlcat.lo strlcpy.lo -lm -lrt
</PRE>
</BLOCKQUOTE>
<BR>
<BLOCKQUOTE TYPE=CITE>
libtool: link: rm -fr .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 ".libs" && rm -f "libos.la" && ln -s "../libos.la" "libos.la" )<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.
<PRE>
_______________________________________________
<A HREF="mailto:xorg-devel@lists.x.org">xorg-devel@lists.x.org</A>: X.Org development
Archives: <A HREF="http://lists.x.org/archives/xorg-devel">http://lists.x.org/archives/xorg-devel</A>
Info: <A HREF="http://lists.x.org/mailman/listinfo/xorg-devel">http://lists.x.org/mailman/listinfo/xorg-devel</A>
</PRE>
</BLOCKQUOTE>
<BR>
</BODY>
</HTML>