Skip to content

Commit

Permalink
Autotools: do not use the PKG_CHECK_MODULES macro
Browse files Browse the repository at this point in the history
  • Loading branch information
Sébastien Wilmet committed Nov 17, 2012
1 parent 616b760 commit 71781c5
Show file tree
Hide file tree
Showing 4 changed files with 39 additions and 22 deletions.
50 changes: 38 additions & 12 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -93,18 +93,46 @@ AC_DEFUN([AM_PROG_VALAC_CUSTOM],
AM_PROG_VALAC_CUSTOM([${VALA_REQUIRED_VERSION}])

# Checks for dependencies
PKG_CHECK_MODULES([LATEXILA], [
glib-2.0 >= ${GLIB_REQUIRED_VERSION}
gio-2.0 >= ${GLIB_REQUIRED_VERSION}
gtk+-3.0 >= ${GTK_REQUIRED_VERSION}
gtksourceview-3.0 >= ${GTKSOURCEVIEW_REQUIRED_VERSION}

if ! pkg-config --atleast-version=${GLIB_REQUIRED_VERSION} glib-2.0; then
AC_MSG_ERROR([glib-2.0 >= ${GLIB_REQUIRED_VERSION} required.])
fi

if ! pkg-config --atleast-version=${GLIB_REQUIRED_VERSION} gio-2.0; then
AC_MSG_ERROR([gio-2.0 >= ${GLIB_REQUIRED_VERSION} required.])
fi

if ! pkg-config --atleast-version=${GTK_REQUIRED_VERSION} gtk+-3.0; then
AC_MSG_ERROR([gtk+-3.0 >= ${GTK_REQUIRED_VERSION} required.])
fi

if ! pkg-config --atleast-version=${GTKSOURCEVIEW_REQUIRED_VERSION} gtksourceview-3.0; then
AC_MSG_ERROR([gtksourceview-3.0 >= ${GTKSOURCEVIEW_REQUIRED_VERSION} required.])
fi

if ! pkg-config gsettings-desktop-schemas; then
AC_MSG_ERROR([gsettings-desktop-schemas required.])
fi

if ! pkg-config gee-1.0; then
AC_MSG_ERROR([gee-1.0 required.])
fi

if ! pkg-config enchant; then
AC_MSG_ERROR([enchant required.])
fi

dependencies="
glib-2.0
gio-2.0
gtk+-3.0
gtksourceview-3.0
gsettings-desktop-schemas
gee-1.0
enchant
])
enchant"

AC_SUBST([LATEXILA_CFLAGS])
AC_SUBST([LATEXILA_LIBS])
CFLAGS="$CFLAGS `pkg-config --cflags ${dependencies}`"
LIBS="$LIBS `pkg-config --libs ${dependencies}`"

# Native Language Support
IT_PROG_INTLTOOL([0.40.0])
Expand All @@ -122,10 +150,8 @@ AC_DEFINE_UNQUOTED([LOCALE_DIR],
["${LOCALE_DIR}"],
[locale directory])

# Help documentation
# Misc
YELP_HELP_INIT

# GSettings
GLIB_GSETTINGS

# Generate files
Expand Down
5 changes: 1 addition & 4 deletions src/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -73,10 +73,7 @@ latexila_SOURCES = \
latexila_CPPFLAGS = \
-I$(top_srcdir) \
-I$(srcdir)/gedit \
-I$(srcdir)/gtkspell \
$(LATEXILA_CFLAGS)

latexila_LDFLAGS = $(LATEXILA_LIBS)
-I$(srcdir)/gtkspell

latexila_LDADD = \
gedit/libgedit.la \
Expand Down
3 changes: 0 additions & 3 deletions src/gedit/Makefile.am
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
noinst_LTLIBRARIES = libgedit.la

libgedit_la_CPPFLAGS = $(LATEXILA_CFLAGS)
libgedit_la_LDFLAGS = $(LATEXILA_LIBS)

libgedit_la_SOURCES = \
gedit-close-button.c \
gedit-close-button.h
Expand Down
3 changes: 0 additions & 3 deletions src/gtkspell/Makefile.am
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
noinst_LTLIBRARIES = libgtkspell.la

libgtkspell_la_CPPFLAGS = $(LATEXILA_CFLAGS)
libgtkspell_la_LDFLAGS = $(LATEXILA_LIBS)

libgtkspell_la_SOURCES = gtkspell.c gtkspell.h

-include $(top_srcdir)/git.mk

0 comments on commit 71781c5

Please sign in to comment.