Re: the *-config scripts



Ok, so I have collected all these ideas and put them in
one package. Interested people can find a test version at:

http://www.gnome.org/~martijn/pkgconfig-0.1.0.tar.gz
 

Included in the archive are the pkg-config script, an m4 macro
and some sample .pc files

To use the m4 macro is as simple as doing

PKG_CHECK_MODULES(GTK, glib:1.2.8 gtk)
AC_SUBST(GTK_CFLAGS)
AC_SUBST(GTK_LIBS)

this will check for glib version 1.2.8 or newer, and gtk (any version) plus
all its dependencies

the .pc files look like this (before being filled in by the configure of
the appropriate package:

-- gtk.pc.in --

prefix=@prefix@
exec_prefix=@exec_prefix@

includedir=@includedir@
libdir=@libdir@


VERSION=@GTK_VERSION@
REQUIRES="glib gmodule gdk"
CFLAGS="-I${includedir}"
LIBS="-L${libdir} -lgtk -lm"

#NAME="GTK+"
#DESCRIPTION="Gimp ToolKit. A widget library"


-- end --

I've added the VERSION flag, so the macro can check for versions, and
also added are the NAME and DESCRIPTION fields. These are comments out
because they're not being used by the build process. I've added them
so applications trying to provide a nicer environment for creating
the build config files than just $EDITOR can display some sensible
information.

It currently doesn't do the ordering as suggested by Tim, but I'll work
on that as soon as someone tells me where the -rdynamic flag should go.

Hope this will be an acceptable solution for everyone. Comments would
be appreciated


Martijn




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