Re: Working with gtkmm libraries



Sean Kelley wrote:
While learning more about gtkmm, I've struggled initially to understand the automake and autoconf approach. I came across a few tutorials:


http://www.openismus.com/documents/linux/automake/automake.shtml
http://www.openismus.com/documents/linux/using_libraries/using_libraries.shtml

Interestingly enough, until I learned about pkg-config I could not get the deps to be autogenerated. Is it possible to do automake and autoconf without pkg-config? Once I added the PKG_CHECK.. and the DEPS_CFLAGS and the DEPS_LIBS flags it picked up the deps. I am just curious how one would make this work without having pkg-config.

Thanks,

Sean


configure.ac <http://configure.ac>
----------------
AC_INIT(hello.cc)

PKG_CHECK_MODULES(DEPS, gtkmm-2.4 )
AC_SUBST(DEPS_CFLAGS)
AC_SUBST(DEPS_LIBS)
AM_INIT_AUTOMAKE(hello,0.1)
AC_PROG_CC
AC_PROG_CXX
AC_OUTPUT(Makefile)

Makefile.am <http://Makefile.am>
----------------
INCLUDES = $(DEPS_CFLAGS)
LIBS = $(DEPS_LIBS)
bin_PROGRAMS = hello
hello_SOURCES = hello.cc


------------------------------------------------------------------------


Yes you can do it without pkg-config. Where pkg-config helps is not directly with autoconf but that you can pass it the "--libs" or "--cflags" to get all the right options for your system. That macro "PKG_CHECK_MODULES" is defined in the file "aclocal.m4". You can write your own method either in configure.ac or aclocal.m4 but be aware that the code in aclocal.m4 uses a blend of shell and M4 syntax. That's the sucky part.



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