automake
[Top][All Lists]
Advanced

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

Re: beginners question ?


From: Bob Proulx
Subject: Re: beginners question ?
Date: Mon, 28 Oct 2002 09:38:31 -0700
User-agent: Mutt/1.4i

Lars Segerlund <address@hidden> [2002-10-28 17:14:18 +0100]:
> 
>  I'm just starting to use gnu autotools, and I have some small
> problems, I have figured out how to build in some subdirs and to
> have resonable include paths, but how do I link with X11 , I'm using
> automake and autoconf and have a subdir which contains the source
> and an Makefile.am something like this:
> 
>  src/Makefile.am
> 
>  <contains>
> 
> INCLUDES        = -I$(top_builddir) -I$(top_builddir)/lib

I believe those should be top_srcdir and not top_builddir.  Using
configure you may build in a completely different directory from your
source and then you would notice this as a problem at that time.

  INCLUDES        = -I$(top_srcdir) -I$(top_srcdir)/lib

> bin_PROGRAMS = prog
> prog_SOURCES = prog.c prog2.c prog2.h.
> 
>  And I want it linked with -lX11 ??
>  Do I add to this file or the toplevel Makefile.am or toplevel 
> configure.ac ?

Use LDADD to add libraries to your link phase.

  LDADD = -lX11

Frequently this is:

  LDADD = ../lib/libmystuff.a -lX11

The local library specification is always relative, as opposed to the
$(top_srcdir) above, so that it operates out of the build area.

Bob




reply via email to

[Prev in Thread] Current Thread [Next in Thread]