This is an automake question.  Please remove the autoconf list from
replies.  Thank you.

* Matt Hull wrote on Sat, Jan 07, 2006 at 11:02:09PM CET:
> i have a simple hello world i am trying to get working.  i have:
> 
> src/main.c
> src/gtk/gtkmain.c
> src/gtk/gtkmain.h
> 
> i almost got it working except that when it tries to build gtkmain it
> fails with undefined reference to main.  looks like its trying to build a
> final appllication and link it together.  but the gtkmain is only enabled
> when the user selects it from configure as such:

> how can i build the dependencies without linking ?

Just put

  bin_PROGRAMS = mine
  mine_SOURCES = main.c gtk/gtk.c gtk/gtk.h

in src/Makefile.am.

If you're dying to have another Makefile in src/gtk, you can create a
library as an intermediate step (add AC_PROG_RANLIB in configure.ac
then):

src/Makefile.am:
bin_PROGRAMS = mine
mine_SOURCES = main.c
mine_LDADD = gtk/libgtkstuff.a

src/gtk/makefile.am has
noinst_LIBRARIES = libgtkstuff.a
libgtkstuff_a_SOURCES = gtk.c gtk.h

But I really recommend the first variant.

Cheers,
Ralf


_______________________________________________
Autoconf mailing list
Autoconf@gnu.org
http://lists.gnu.org/mailman/listinfo/autoconf

Reply via email to