-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA512 Here's the full Makefile.am (myprog is the name of my program):
bin_PROGRAMS = myprog myprog_SOURCES = main.c main.h database.c database.h exec_button.c exec_button.h myprog_CFLAGS = $(GTK_CFLAGS) myprog_CFLAGS += $(GMODULE_CFLAGS) myprog_CFLAGS += $(SQLITE_CFLAGS) myprog_CFLAGS += `pkg-config --cflags sqlite3 gmodule-2.0` myprog_LDADD = $(GTK_LIBS) myprog_LDADD += $(SQLITE_LIBS) myprog_LDADD += $(GMODULE_LIBS) myprog_LDFLAGS = `pkg-config --libs sqlite3 gmodule-2.0` myprog_LDFLAGS += -Wl,-export-dynamic GMODULE was added and seems to ail from the same problems as SQLITE (though, in this case, the program compiles, but I get a lot of errors saying event handlers couldn't be found -- as one would expect if they don't link glib with a gtk+ program). So, in this case... bin_PROGRAMS = myprog myprog_SOURCES = main.c main.h database.c database.h exec_button.c exec_button.h myprog_CFLAGS = $(GTK_CFLAGS) myprog_CFLAGS += $(GMODULE_CFLAGS) myprog_CFLAGS += $(SQLITE_CFLAGS) myprog_LDADD = $(GTK_LIBS) myprog_LDADD += $(SQLITE_LIBS) myprog_LDADD += $(GMODULE_LIBS) myprog_LDFLAGS += -Wl,-export-dynamic ...I get compile errors for sqlite. If I add in the lines... myprog_CFLAGS += `pkg-config --cflags sqlite3` myprog_LDFLAGS = `pkg-config --libs sqlite3` ...but leave out `pkg-config ... glib-2.0` I get errors like the following: Gtk-WARNING **: Could not find signal handler blah_blah_blah() ...which is what I should expect from not linking glib I also don't see a pkg.m4 file (I'm assuming it's a file, and that it's not generated by autoreconf). I apologize if I sound like a newbie. Still trying to wrap my head around automake... Thanks for all your help. Diego Elio Pettenò: > > On Wed, Dec 18, 2013 at 9:26 PM, Jordan H. <jorda...@fastmail.fm <mailto:jorda...@fastmail.fm>> wrote: > > Makefile.am: > > program_CFLAGS += @SQLITE_CFLAGS@ > program_LDADD += @SQLITE_LIBS@ > > > First you should not need to use AC_SUBST() for these variables at all if you have the right pkg.m4. > > Second, can you please post the full Makefile.am? If you haven't defined program_LDADD and program_CFLAGS before using += they are not going to work. > > Third, you want to use $(SQLITE_CFLAGS) rather than the @@ replacement. > > A bit of documentation for PKG_CHECK_MODULES can be found on my Autotools Mythbuster: https://www.flameeyes.eu/autotools-mythbuster/pkgconfig/pkg_check_modules.html > > > Diego Elio Pettenò — Flameeyes > flamee...@flameeyes.eu <mailto:flamee...@flameeyes.eu> — http://blog.flameeyes.eu/ -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.14 (GNU/Linux) Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQEcBAEBCgAGBQJSsifnAAoJEOT99oqiSuRNg5gIAKpe3UvCP0K2xNVmR3PHyPbE w0zwHHRv/MW9DxMfl7hf/pDvTQYb7bArlD7AV1tur0A0Ky8smgGgngfJVVr7rjQJ mt+Q/0b+2ooNEYfHtpxtTCyWLRiqEelXkc13k0k5wQcY+DncaRVqibiV3z0QEIOx eHpziYXC4GbuL1YOs6YYX6Gspkmhulqz7cQK+M9oTfsfNrUgLo2PWDT20166NXKn OTTb6LhyTsfMLtM5FpH2LivMp9pjH2J4UoZHqLJhxJJE8QYebQMqJv43QgYrUUlv Y5R08W8pFArzJ0CcNHdQ+SP15A1NZbaRM/no5u/qtaL41UxkYYhV0Y6kBaMCi/Q= =DbQB -----END PGP SIGNATURE-----