summaryrefslogtreecommitdiff
path: root/m4
diff options
context:
space:
mode:
authorBruno Haible <bruno@clisp.org>2019-03-20 00:35:11 +0100
committerBruno Haible <bruno@clisp.org>2019-03-20 00:35:11 +0100
commitc23dae8c0231543a241bd54f6e5af0f348f70d99 (patch)
tree35a5ddba3df04d6bfcba43c5c4160c979d680d6c /m4
parent4a7bec23342ecb43d6e367ed43d067e2a0507f6d (diff)
downloadgnulib-c23dae8c0231543a241bd54f6e5af0f348f70d99.tar.gz
libtextstyle-optional: New module.
* lib/textstyle.in.h: New file, based on libtextstyle's textstyle.h. * m4/libtextstyle-optional.m4: New file, based on m4/libtextstyle.m4. * modules/libtextstyle-optional: New file.
Diffstat (limited to 'm4')
-rw-r--r--m4/libtextstyle-optional.m430
1 files changed, 30 insertions, 0 deletions
diff --git a/m4/libtextstyle-optional.m4 b/m4/libtextstyle-optional.m4
new file mode 100644
index 0000000000..16c8f1677c
--- /dev/null
+++ b/m4/libtextstyle-optional.m4
@@ -0,0 +1,30 @@
+# libtextstyle-optional.m4 serial 1
+dnl Copyright (C) 2019 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+dnl From Bruno Haible.
+
+dnl gl_LIBTEXTSTYLE_OPTIONAL
+dnl Searches for an installed libtextstyle or uses the included source code
+dnl parts that define only part of the API and does not do any styling.
+dnl If found, it sets and AC_SUBSTs HAVE_LIBTEXTSTYLE=yes and the LIBTEXTSTYLE
+dnl and LTLIBTEXTSTYLE variables, and augments the CPPFLAGS variable, and
+dnl #defines HAVE_LIBTEXTSTYLE to 1.
+dnl Otherwise, it sets and AC_SUBSTs HAVE_LIBTEXTSTYLE=no and LIBTEXTSTYLE and
+dnl LTLIBTEXTSTYLE to empty.
+
+AC_DEFUN([gl_LIBTEXTSTYLE_OPTIONAL],
+[
+ AC_REQUIRE([gl_LIBTEXTSTYLE])
+ if test $HAVE_LIBTEXTSTYLE = yes; then
+ TEXTSTYLE_H=
+ else
+ TEXTSTYLE_H=textstyle.h
+ AC_REQUIRE([AC_C_INLINE])
+ AC_CHECK_FUNCS_ONCE([tcdrain])
+ fi
+ AC_SUBST([TEXTSTYLE_H])
+ AM_CONDITIONAL([GL_GENERATE_TEXTSTYLE_H], [test -n "$TEXTSTYLE_H"])
+])