?RCS: $Id: glibconfig.U 12214 2006-11-04 02:04:04Z cbiere $ ?RCS: ?RCS: @COPYRIGHT@ ?RCS: ?MAKE:glibconfig glibcflags glibldflags d_glib: glibpackage cc ccflags \ ldflags cat rm gtkversion Warn d_headless glibversion ?MAKE: -pick add $@ %< ?S:glibconfig: ?S: This variable holds the command to use to grab information about glib. ?S: Typically something like "pkg-config glib" or "glib-config". ?S:. ?S:glibcflags: ?S: This variable holds the compiler flags required to compile with glib. ?S:. ?S:glibldflags: ?S: This variable holds the linker flags required to link against glib. ?S:. ?S:d_glib: ?S: This variable is set if compiling against GLib works. ?S:. ?T:modver version : how can we find information about glib? echo " " echo "Checking how we can gather information about glib..." >&4 d_glib="$undef" if pkg-config $glibpackage --cflags >/dev/null 2>&1; then glibconfig="pkg-config $glibpackage" modver=--modversion elif glib-config --cflags >/dev/null 2>&1; then glibconfig='glib-config' modver=--version else echo "You've got problems! Do you have glib installed?" >&4 glibconfig='false' modver='' fi echo "(I'll use '$glibconfig' to gather that information.)" glibcflags=`$glibconfig --cflags` glibldflags=`$glibconfig --libs` ?X: ?X: check that we've got the version they asked for ?X: version=`$glibconfig $modver` echo " " echo "Checking whether glib.h can be compiled against..." $cat >try.c < #ifndef GLIB_MAJOR_VERSION #error "glib.h not found?" EOC case "$d_headless" in "$define") ;; *) $cat >>try.c <>try.c <= 2 #include #endif int main(void) { gpointer p; #if $glibversion >= 2 p = g_object_new(G_TYPE_OBJECT, "blah", (void *) 0); #else p = g_malloc(23); #endif if (!p) return 1; return 0; } EOC if $cc -o try try.c $ccflags $ldflags $glibcflags $glibldflags >/dev/null 2>&1; then d_glib="$define" echo "We'll be using glib version $version." else ./warn "Cannot compile against glib version '$version'" fi $rm -f try try.c