Skip to content

Commit

Permalink
Create a dummy module to prevent warnings with gtk2 apps
Browse files Browse the repository at this point in the history
  • Loading branch information
nomeata committed Jun 24, 2011
1 parent 96c0a7c commit 1eb700c
Show file tree
Hide file tree
Showing 4 changed files with 54 additions and 4 deletions.
8 changes: 5 additions & 3 deletions Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ libgtk_vector_screenshot_la_SOURCES = gtk-vector-screenshot.c

libgtk_vector_screenshot_la_LDFLAGS = \
-rpath $(moduledir) -module -avoid-version -export-dynamic\
$(GTK_LIBS) \
$(GTK3_LIBS) \
$(X_LIBS) \
@LDFLAGS@

Expand All @@ -15,16 +15,18 @@ module_LTLIBRARIES = libgtk-vector-screenshot.la
take_vector_screenshot_SOURCES = take-vector-screenshot.c

take_vector_screenshot_LDFLAGS = \
$(GTK_LIBS) \
$(GTK3_LIBS) \
@LDFLAGS@

bin_PROGRAMS = take-vector-screenshot

INCLUDES = \
$(GTK_CFLAGS) \
$(GTK3_CFLAGS) \
$(X_CFLAGS)

take_screenshotdir = $(datadir)/applications
dist_take_screenshot_DATA = take-vector-screenshot.desktop

EXTRA_DIST = 52load-gtk-vector-screenshot-gtk-module

SUBDIRS = dummy-module
7 changes: 6 additions & 1 deletion configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,14 @@ AC_C_CONST
AC_TYPE_SIZE_T
AC_EXEEXT

PKG_CHECK_MODULES(GTK, [gtk+-3.0 >= 2.90])
PKG_CHECK_MODULES(GTK3, [gtk+-3.0 >= 2.90])
AC_SUBST(GTK_CFLAGS)
AC_SUBST(GTK_LIBS)

PKG_CHECK_MODULES(GTK2, [gtk+-2.0])
AC_SUBST(GTK3_CFLAGS)
AC_SUBST(GTK3_LIBS)

PKG_CHECK_MODULES(X, [x11])
AC_SUBST(X_CFLAGS)
AC_SUBST(X_LIBS)
Expand All @@ -53,6 +57,7 @@ dnl # Output the Makefiles
dnl ################################################################
AC_CONFIG_FILES([
Makefile
dummy-module/Makefile
])

AC_OUTPUT
15 changes: 15 additions & 0 deletions dummy-module/Makefile.am
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
moduledir = $(libdir)/gtk-2.0/modules

libgtk_vector_screenshot_la_SOURCES = dummy-module.c

libgtk_vector_screenshot_la_LDFLAGS = \
-rpath $(moduledir) -module -avoid-version -export-dynamic\
$(GTK2_LIBS) \
@LDFLAGS@

libgtk_vector_screenshot_la_LIBADD =

module_LTLIBRARIES = libgtk-vector-screenshot.la

INCLUDES = \
$(GTK2_CFLAGS)
28 changes: 28 additions & 0 deletions dummy-module/dummy-module.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
/*
* © 2011 Joachim Breitner <mail@joachim-breitner.de>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/

#include <gtk/gtk.h>

/*
* Module setup function
*/
int
gtk_module_init(gint argc, char *argv[])
{
return FALSE;
}

0 comments on commit 1eb700c

Please sign in to comment.