diff options
author | Rafael G. Martins <rafael@rafaelmartins.eng.br> | 2019-09-02 23:38:48 +0200 |
---|---|---|
committer | Rafael G. Martins <rafael@rafaelmartins.eng.br> | 2019-09-02 23:51:15 +0200 |
commit | 4763814c683c50f8a3697b74e764f19c3dacccd5 (patch) | |
tree | 386ff43f024705a32310b882f2161b5f86d8820a /m4 | |
parent | c12bdb94ecdc44f200a8030dfde4a5ec46053ea6 (diff) | |
download | blogc-feature/squareball.tar.gz blogc-feature/squareball.tar.bz2 blogc-feature/squareball.zip |
migrate codebase to use squareball. again :)feature/squareball
Diffstat (limited to 'm4')
-rw-r--r-- | m4/squareball.m4 | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/m4/squareball.m4 b/m4/squareball.m4 new file mode 100644 index 0000000..297701d --- /dev/null +++ b/m4/squareball.m4 @@ -0,0 +1,46 @@ +# squareball: A general-purpose library for C99. +# Copyright (C) 2014-2018 Rafael G. Martins <rafael@rafaelmartins.eng.br> +# +# This program can be distributed under the terms of the BSD License. +# See the file LICENSE. + +# SQUAREBALL_INIT([VERSION_ATOM]) +# +# This should be added to Makefile.am +# +# if INTERNAL_SQUAREBALL +# SUBDIRS = squareball +# endif +# +# The following variables will be exported to be used in the Makefile.am: +# +# - SQUAREBALL_CFLAGS +# - SQUAREBALL_LIBS +# +# This macro requires squareball to be installed as a git submodule in the +# top source dir. +# ---------------------------------- +AC_DEFUN([SQUAREBALL_INIT], [ + AC_ARG_WITH([squareball], [AS_HELP_STRING([--with-squareball=@<:@internal/system@:>@], + [whether to use library squareball from system [default=internal]])]) + AS_IF([test "x$with_squareball" = "xsystem"], [ + SQUAREBALL="system" + PKG_CHECK_MODULES([SQUAREBALL], [squareball$1], , [ + AC_MSG_ERROR([library squareball requested from system but not found]) + ]) + ], [ + SQUAREBALL="internal" + SQUAREBALL_CFLAGS='-I$(top_srcdir)/squareball/src' + SQUAREBALL_LIBS='$(top_builddir)/squareball/libsquareball.la' + AC_SUBST(SQUAREBALL_LIBS) + AC_SUBST(SQUAREBALL_CFLAGS) + ac_configure_args_pre="$ac_configure_args" + ac_configure_args_post="$ac_configure_args --enable-bundleme" + ac_configure_args="$ac_configure_args_post" + AC_CONFIG_COMMANDS_PRE([ac_configure_args="$ac_configure_args_pre"]) + AC_CONFIG_COMMANDS_POST([ac_configure_args="$ac_configure_args_post"]) + AC_CONFIG_SUBDIRS([squareball]) + ac_configure_args="$ac_configure_args_pre" + ]) + AM_CONDITIONAL(INTERNAL_SQUAREBALL, [test "x$with_squareball" != "xsystem"]) +]) |