Branch: refs/heads/master Author: Colomban Wendling ban@herbesfolles.org Committer: Matthew Brush matt@geany.org Date: Mon, 04 Mar 2013 01:27:50 UTC Commit: be48f09750c1ec2282405d9f70e8f77799e82cbd https://github.com/geany/geany-plugins/commit/be48f09750c1ec2282405d9f70e8f7...
Log Message: ----------- Markdown: Fix Autotools to support bundled peg-markdown
Default is to try and use system's Discount library and if not available or configured with --enable-peg-markdown, use the bundled peg-markdown library.
Modified Paths: -------------- build/markdown.m4 markdown/Makefile.am markdown/peg-markdown/Makefile.am markdown/peg-markdown/peg-0.1.9/Makefile.am markdown/src/Makefile.am markdown/src/viewer.c
Modified: build/markdown.m4 45 files changed, 44 insertions(+), 1 deletions(-) =================================================================== @@ -1,6 +1,50 @@ +dnl _CHECK_LIBMARKDOWN([action-if-found], [action-if-not-found]) +dnl Searches for libmarkdown and define HAVE_MKDIO_H, LIBMARKDOWN_LIBS and +dnl LIBMARKDOWN_CFLAGS +AC_DEFUN([_CHECK_LIBMARKDOWN], +[ + old_LIBS=$LIBS + LIBS= + LIBMARKDOWN_LIBS= + LIBMARKDOWN_CFLAGS= + AC_SEARCH_LIBS([mkd_compile], [markdown], + [AC_CHECK_HEADERS([mkdio.h], + [LIBMARKDOWN_LIBS=$LIBS + LIBMARKDOWN_CFLAGS= + $1], + [$2])], + [$2]) + AC_SUBST([LIBMARKDOWN_CFLAGS]) + AC_SUBST([LIBMARKDOWN_LIBS]) + LIBS=$old_LIBS +]) + AC_DEFUN([GP_CHECK_MARKDOWN], [ GP_ARG_DISABLE([markdown], [auto]) + AC_ARG_ENABLE([peg-markdown], + [AS_HELP_STRING([--enable-peg-markdown], + [Whether to use Peg-Markdown library [[default=auto]]])], + [enable_peg_markdown=$enableval], + [enable_peg_markdown=auto]) + + dnl check which markdown library to use + AS_IF([test "x$enable_markdown" != xno && + test "x$enable_peg_markdown" != xyes], + [_CHECK_LIBMARKDOWN([enable_peg_markdown=no], + [AS_IF([test "x$enable_peg_markdown" != xno], + [enable_peg_markdown=yes], + [test "x$enable_markdown" = xyes], + [AC_MSG_ERROR([libmarkdown not found])], + [enable_markdown=no + AC_MSG_WARN([libmarkdown not found, disabling Markdown plugin])])])]) + AM_CONDITIONAL([MARKDOWN_PEG_MARKDOWN], + [test "x$enable_peg_markdown" = xyes]) + dnl fancy status + AS_IF([test "x$enable_peg_markdown" = xyes], + [markdown_library=peg-markdown], + [markdown_library=libmarkdown]) + GP_STATUS_FEATURE_ADD([Markdown library], [$markdown_library])
GTK_VERSION=2.16 WEBKIT_VERSION=1.1.13 @@ -14,7 +58,6 @@ AC_DEFUN([GP_CHECK_MARKDOWN],
AC_CONFIG_FILES([ markdown/Makefile - markdown/discount/Makefile markdown/src/Makefile markdown/docs/Makefile markdown/peg-markdown/Makefile
Modified: markdown/Makefile.am 8 files changed, 7 insertions(+), 1 deletions(-) =================================================================== @@ -1,5 +1,11 @@ include $(top_srcdir)/build/vars.auxfiles.mk
-SUBDIRS = peg-markdown src docs +SUBDIRS = + +if MARKDOWN_PEG_MARKDOWN +SUBDIRS += peg-markdown +endif + +SUBDIRS += src docs
plugin = markdown
Modified: markdown/peg-markdown/Makefile.am 2 files changed, 2 insertions(+), 0 deletions(-) =================================================================== @@ -17,3 +17,5 @@ LEG = peg-0.1.9/leg
markdown_parser.c: markdown_parser.leg $(LEG) $(AM_V_GEN)$(LEG) -o $@ $< + +EXTRA_DIST = markdown_parser.leg
Modified: markdown/peg-markdown/peg-0.1.9/Makefile.am 3 files changed, 1 insertions(+), 2 deletions(-) =================================================================== @@ -7,5 +7,4 @@ leg_SOURCES = \ tree.h \ version.h
-EXTRA_DIST = \ - leg.leg +EXTRA_DIST = leg.leg
Modified: markdown/src/Makefile.am 14 files changed, 10 insertions(+), 4 deletions(-) =================================================================== @@ -18,11 +18,17 @@ markdown_la_CFLAGS = \ $(MARKDOWN_CFLAGS) \ -DMARKDOWN_DATA_DIR="$(pkgdatadir)/markdown" \ -DMARKDOWN_DOC_DIR="$(docdir)/markdown" \ - -DMARKDOWN_HELP_FILE="$(docdir)/markdown/html/help.html" \ - -I$(top_srcdir)/markdown/peg-markdown + -DMARKDOWN_HELP_FILE="$(docdir)/markdown/html/help.html"
markdown_la_LIBADD = \ - $(MARKDOWN_LIBS) \ - $(top_builddir)/markdown/peg-markdown/libpegmarkdown.la + $(MARKDOWN_LIBS) + +if MARKDOWN_PEG_MARKDOWN +markdown_la_CFLAGS += -DFULL_PRICE -I$(top_srcdir)/markdown/peg-markdown +markdown_la_LIBADD += $(top_builddir)/markdown/peg-markdown/libpegmarkdown.la +else +markdown_la_CFLAGS += $(LIBMARKDOWN_CFLAGS) +markdown_la_LIBADD += $(LIBMARKDOWN_LIBS) +endif
include $(top_srcdir)/build/cppcheck.mk
Modified: markdown/src/viewer.c 1 files changed, 1 insertions(+), 0 deletions(-) =================================================================== @@ -19,6 +19,7 @@ * MA 02110-1301, USA. */
+#include "config.h" #include <string.h> #include <gtk/gtk.h> #include <webkit/webkitwebview.h>
-------------- This E-Mail was brought to you by github_commit_mail.py (Source: https://github.com/geany/infrastructure).
plugins-commits@lists.geany.org