Re: Question about Makefile templates for gtk



On Sun, Nov 07, 1999 at 12:32:43AM -0500, Craig Rodrigues wrote:
> On Sat, Nov 06, 1999 at 11:33:00PM -0500, Havoc Pennington wrote:
> > 
> > Makefile.in is autogenerated from Makefile.am, then Makefile is generated
> > from Makefile.in. If gdk wasn't linked it would have to be a bug in one of
> > the build tools, maybe libtool or automake; gdk is specified in
> > Makefile.am.

    It is commented out in Makefile.am, just like glib is commented out
in glib/{gmodule,gthread}/Makefile.am.  This is to get around some build
issues in libtool.  Namely, libtool does not support linking aginst 
relative paths.  If you included ../gdk/libgdk.la on the gtk link line
libtool would link with "gcc -o libgtk.so.x.y $(objects) -L ../gdk/.libs
-lgdk $(OTHER LIBS)".  If you are not careful, this will hardcode
"../gdk/libs" as a library search path into libgtk.  This can be fixed
on most platforms (-rpath on solaris, -blibpath on AIX, etc), but
libtool long ago gave up trying, and instead just prints an error and
exits.
    I have a personal copy of libtool that handles this correctly.  If
you want it, I can send it to you.  It is against libtool 1.2b, because
frankly I haven't had the time to merge against the largely new 1.3
(which still gets this wrong last I checked).  All you need to do is
uncomment those pesky libgdk.la lines and off you go.

> @STRIP_END@
> #       $(top_builddir)/gdk/libgdk.la                              
> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> 
> Why is this line commented out?  I think this is what caused me loads of
> grief.

    See above.

> I have a related question regarding the configure.in file in the glib

> subdirectory, lines 796-807:
> 
>                 if test "$ac_cv_func_getpwuid_r" = "yes"; then
>                         AC_MSG_CHECKING(whether getpwuid_r is posix like)
>                         # getpwuid_r(0, NULL, NULL, 0) is the signature on
>                         # solaris, if that is not found, the prog below won't
>                         # compile, then the posix signature is assumed as
>                         # the default.
>                         AC_TRY_COMPILE([#include <pwd.h>],
>                                 [getpwuid_r(0, NULL, NULL, 0);],
>                                 [AC_MSG_RESULT(no)],
>                                 [AC_MSG_RESULT(yes)
>                                 AC_DEFINE(HAVE_GETPWUID_R_POSIX)])
>                 fi                                                   
> The AIX xlc compiler has a brain-dead behavior, where
> if it finds a function with an incorrect number of arguments,
> it will flag it as an error, will still return an errno of 0.

    This is because (IIRC) it is a macro on AIX.  Yes, I agree this
should still return 1 (and if you increase the error level it will),
but it doesn't.  I've been planning to find a change that will error
on AIX, but still pass on Solaris (maybe non-NULL values?), but I've
been lazy.
    Short answer to this one is to let it fail in configure, then
edit config.h to define HAVE_GETPWUID_R_POSIX.

Joel

-- 

"Hell is other people." 
        - Jean-Paul Sartre 

                                  jlbec@evilplan.org
                                  http://ocala.cs.miami.edu/~jlbec



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]