diff options
author | Rusty Lynch <rusty.lynch@intel.com> | 2013-04-27 15:51:49 -0700 |
---|---|---|
committer | Rusty Lynch <rusty.lynch@intel.com> | 2013-04-27 16:04:04 -0700 |
commit | 68abf147acb239a9bf3f14cc5f1a1d0383958342 (patch) | |
tree | 91cd7b955f87ec9294528a046fe83cfe868d767c | |
parent | 2dd765b6da065be95ffeba1875d1839202ff6225 (diff) | |
download | ico-uxf-device-input-controller-68abf147acb239a9bf3f14cc5f1a1d0383958342.tar.gz ico-uxf-device-input-controller-68abf147acb239a9bf3f14cc5f1a1d0383958342.tar.bz2 ico-uxf-device-input-controller-68abf147acb239a9bf3f14cc5f1a1d0383958342.zip |
Correctly use autoconf to detect CFLAGS/LIBS
By using the PKG_CHECK_MODULES macro in configure.ac, then both
the developer is given a heads up when she is missing a required
build time dependency, and hard coded flags do not break when
attempting to build after a platform level change like building
in 64bit mode where system libraries are installed in a different
location.
-rw-r--r-- | configure.ac | 4 | ||||
-rw-r--r-- | joystick_gtforce/Makefile.am | 7 | ||||
-rw-r--r-- | tests/Makefile.am | 3 |
3 files changed, 7 insertions, 7 deletions
diff --git a/configure.ac b/configure.ac index 61e9d3b..445afaa 100644 --- a/configure.ac +++ b/configure.ac @@ -28,6 +28,10 @@ AC_ARG_ENABLE(setuid-install, [ --enable-setuid-install],, enable_setuid_install=yes) AM_CONDITIONAL(ENABLE_SETUID_INSTALL, test x$enable_setuid_install = xyes) +PKG_PROG_PKG_CONFIG + +PKG_CHECK_MODULES([GLIB], [glib-2.0]) + SHARED_LIBS= SHARED_CFLAGS= AC_SUBST(SHARED_LIBS) diff --git a/joystick_gtforce/Makefile.am b/joystick_gtforce/Makefile.am index 6f3f8ed..3256caf 100644 --- a/joystick_gtforce/Makefile.am +++ b/joystick_gtforce/Makefile.am @@ -1,14 +1,11 @@ export abs_builddir -glib_inc = -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/lib/i386-linux-gnu/glib-2.0/include -glib_lib = -lgobject-2.0 -lgthread-2.0 -lrt -lglib-2.0 - wayland_client_lib = -lwayland-client wayland_ivi_client_lib = -lico-uxf-weston-plugin wayland_ivi_client_inc = -I/usr/include/ico-uxf-weston-plugin AM_CFLAGS = $(GCC_CFLAGS) -AM_CPPFLAGS = -I$(top_srcdir)/src $(wayland_ivi_client_inc) $(glib_inc) $(COMPOSITOR_CFLAGS) +AM_CPPFLAGS = -I$(top_srcdir)/src $(wayland_ivi_client_inc) $(GLIB_CFLAGS) $(COMPOSITOR_CFLAGS) bin_PROGRAMS = \ ico_ictl-joystick_gtforce @@ -16,7 +13,7 @@ bin_PROGRAMS = \ check_LTLIBRARIES = $(TESTS) check_PROGRAMS = ico_ictl-joystick -AM_LDFLAGS = -module -avoid-version -rpath $(libdir) $(glib_lib) +AM_LDFLAGS = -module -avoid-version -rpath $(libdir) $(GLIB_LIBS) ico_ictl_joystick_gtforce_SOURCES = \ ico_ictl-joystick.c \ diff --git a/tests/Makefile.am b/tests/Makefile.am index eee4ee5..5e15f3a 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -2,8 +2,7 @@ TESTS_ENVIRONMENT = $(SHELL) $(top_srcdir)/tests/weston-plugin-test export abs_builddir -EFL_INCLUDE = `pkg-config --cflags ecore-evas ecore evas ecore-wayland elementary` -AM_CFLAGS = $(GCC_CFLAGS) $(EFL_INCLUDE) +AM_CFLAGS = $(GCC_CFLAGS) AM_CPPFLAGS = -I$(top_srcdir)/src -DUNIT_TEST $(COMPOSITOR_CFLAGS) noinst_PROGRAMS = \ |