Re: gtk + autoconf



On Sat, Apr 05, 2008 at 01:22:25PM -0700, Daniel Fetchinson wrote:
AC_PREREQ([2.57])
AC_INIT(myprog,[0.1], [http://mysite/],myprog)
AM_INIT_AUTOMAKE([dist-bzip2])
AM_MAINTAINER_MODE

AM_CONFIG_HEADER(config.h)
I think AC_CONFIG_HEADERS should be fine above.

AC_PROG_CC
AC_PROG_INSTALL

PKG_CHECK_MODULES(XRANDR, xrandr >= 1.2.0 xrender x11)
Well, PKG_CHECK_MODULES(GTK, gtk+-2.0) should be OK, unless you need a
more recent version.
AC_SUBST(XRANDR_CFLAGS)
AC_SUBST(XRANDR_LIBS)
I think that PKG_CHECK_MODULES already does AC_SUBST on those two
variables.

XORG_MANPAGE_SECTIONS
XORG_RELEASE_VERSION

AC_OUTPUT([Makefile])
In recent autoconf, that's:
AC_CONFIG_FILES([Makefile])
AC_OUTPUT
Of course, your version works too, it's just that infopages suggest this
form now.

After that in Makefile.am add:
bin_PROGRAMS = yourprog
yourprog_CPPFLAGS = @GTK_CFLAGS@ @XRANDR_CFLAGS@
yourprog_LDADD = @GTK_LIBS@ @XRANDR_LIBS@

and the rest of lines required for automake.




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