Get maemo-launcher flags using pkg-config from autoconf
authorAlberto Garcia <agarcia@igalia.com>
Tue, 18 Dec 2007 17:29:10 +0000 (17:29 +0000)
committerAlberto Garcia <agarcia@igalia.com>
Tue, 18 Dec 2007 17:29:10 +0000 (17:29 +0000)
pmo-trunk-r3938

configure.ac
debian/rules
src/Makefile.am

index fc82d1a..f7474d1 100644 (file)
@@ -103,6 +103,23 @@ if test "$MODEST_PLATFORM" = "detect"; then
        with_platform=$detected_platform
 fi
 
+
+dnl Whether to use maemo-launcher or not
+AC_ARG_ENABLE([maemo-launcher],
+             [AS_HELP_STRING([--enable-maemo-launcher],
+                             [build with maemo-launcher support])],
+                             [case "${enableval}" in
+                              yes) maemo_launcher=true ;;
+                              no)  maemo_launcher=false ;;
+                              *) AC_MSG_ERROR([bad value ${enableval} for --enable-maemo-launcher]) ;;
+                              esac], [maemo_launcher=false])
+if test x$maemo_launcher = xtrue
+then
+       PKG_CHECK_MODULES(MAEMO_LAUNCHER, [maemo-launcher-app])
+       AC_SUBST(MAEMO_LAUNCHER_CFLAGS)
+       AC_SUBST(MAEMO_LAUNCHER_LIBS)
+fi
+
 have_easysetup=false
 if test "x$with_platform" == "xgnome"; then
       PKG_CHECK_MODULES(MODEST_PLATFORM,libtinymail-gnome-desktop-1.0 libnm_glib glib-2.0 >= 2.8 gtk+-2.0 >= 2.10 libnotify)
@@ -450,6 +467,7 @@ echo "Build docs       : $build_docs"
 echo "Gettext Package  : $GETTEXT_PACKAGE"
 
 if test "x$with_platform" == "xmaemo"; then
+   echo "Maemo Launcher   : $maemo_launcher"
    echo "Editor lib       : $wpeditor"
    echo "Addressbook      : $have_abook"
    echo "Help lib         : $helplib"
index 2aa12e7..491fcc7 100755 (executable)
@@ -25,24 +25,17 @@ ifneq (,$(findstring thumb,$(DEB_BUILD_OPTIONS)))
         CFLAGS += -mthumb
 endif
 
-LAUNCHER = no
-#ifneq (,$(findstring maemo-launcher,$(DEB_BUILD_OPTIONS)))
-#      LAUNCHER = yes
-#endif
-
-ifeq "$(strip $(LAUNCHER))" "yes"
-       LAUNCHER_DEPENDS = -Vlauncher:Depends="maemo-launcher"
-       LAUNCHER_CFLAGS = -shared
-       LAUNCHER_LDFLAGS = -pie -shared -export-dynamic
-       CFLAGS += -fPIC
-endif
-
+# maemo-launcher support is not working properly yet, so leave it disabled
+# ifeq (,$(findstring nolauncher,$(DEB_BUILD_OPTIONS)))
+#      LAUNCHER = yes
+#      conf_opt := --enable-maemo-launcher
+# endif
 
 config.status: configure
        dh_testdir
        # commands to configure the package.
        if [ ! -x configure ]; then ./autogen.sh; fi
-       CFLAGS="$(CFLAGS)" ./configure --host=$(DEB_HOST_GNU_TYPE) --build=$(DEB_BUILD_GNU_TYPE) --prefix=/usr --sysconfdir=/etc --mandir=\$${prefix}/share/man --infodir=\$${prefix}/share/info
+       CFLAGS="$(CFLAGS)" ./configure --host=$(DEB_HOST_GNU_TYPE) --build=$(DEB_BUILD_GNU_TYPE) --prefix=/usr --sysconfdir=/etc --mandir=\$${prefix}/share/man --infodir=\$${prefix}/share/info $(conf_opt)
 
 configure: configure-stamp
 configure-stamp:
@@ -56,9 +49,7 @@ build-stamp:  config.status
        dh_testdir
 
         # commands to compile the package.
-       $(MAKE) \
-         MAEMO_LAUNCHER_CFLAGS="$(LAUNCHER_CFLAGS)" \
-         MAEMO_LAUNCHER_LDFLAGS="$(LAUNCHER_LDFLAGS)"
+       $(MAKE)
        touch build-stamp
 
 
index a1ef4b9..6bccb63 100644 (file)
@@ -134,7 +134,7 @@ endif
 
 
 modest_CFLAGS  = $(MAEMO_LAUNCHER_CFLAGS)
-modest_LDFLAGS = $(MAEMO_LAUNCHER_LDFLAGS)
+modest_LDFLAGS = $(MAEMO_LAUNCHER_LIBS)
 
 modest_LDADD =                                                 \
        $(MODEST_GSTUFF_LIBS)                           \