Permalink
Browse files

Added readline support to configure.

  • Loading branch information...
blipvert committed Mar 17, 2013
1 parent ead3ba9 commit de995bbae1f201f702df714427db3644b031d875
Showing with 26 additions and 0 deletions.
  1. +3 −0 configure.ac
  2. +21 −0 m4/fontforge_arg_with.m4
  3. +2 −0 m4/fontforge_my_flags_and_libs.m4
View
@@ -88,6 +88,7 @@ libspiro_url="http://libspiro.sourceforge.net/"
libuninameslist_url="https://github.com/fontforge/libuninameslist"
libunicodenames_url="https://github.com/sortsmill/libunicodenames"
libzmq_url="http://www.zeromq.org/"
+libreadline_url="http://www.gnu.org/software/readline"
# Point to the Wikipedia page, primarily because one may want
# libjpeg-turbo rather than the reference implementation.
@@ -254,6 +255,7 @@ FONTFORGE_ARG_WITH_LIBUNINAMESLIST
FONTFORGE_ARG_WITH_LIBUNICODENAMES
FONTFORGE_ARG_WITH_ICONV
FONTFORGE_ARG_WITH_ZEROMQ
+FONTFORGE_ARG_WITH_LIBREADLINE
# We have both libraries but did not choose which one to use yet
if test x"${i_do_have_libuninameslist}" = xyes; then
@@ -420,6 +422,7 @@ Summary of optional dependencies:
libuninameslist ${i_do_have_libuninameslist} ${libuninameslist_url}
libunicodenames ${i_do_have_libunicodenames} ${libunicodenames_url}
zeromq ${i_do_have_libzmq} ${libzmq_url}
+ libreadline ${i_do_have_libreadline} ${libreadline_url}
X Window System ${i_do_have_x}
])
View
@@ -130,6 +130,27 @@ FONTFORGE_ARG_WITH([libxml],
[_NO_LIBXML])
])
+dnl FONTFORGE_ARG_WITH_LIBREADLINE
+dnl --------------------------
+AC_DEFUN([FONTFORGE_ARG_WITH_LIBREADLINE],
+[
+AC_ARG_VAR([LIBREADLINE_CFLAGS],[C compiler flags for LIBREADLINE, overriding the automatic detection])
+AC_ARG_VAR([LIBREADLINE_LIBS],[linker flags for LIBREADLINE, overriding the automatic detection])
+AC_ARG_WITH([libreadline],[AS_HELP_STRING([--without-libreadline],[build without READLINE support])],
+ [i_do_have_libreadline="${withval}"],[i_do_have_libreadline=yes])
+if test x"${i_do_have_libreadline}" = xyes -a x"${LIBREADLINE_LIBS}" = x; then
+ FONTFORGE_SEARCH_LIBS([rl_readline_version],[readline],
+ [AC_SUBST([LIBREADLINE_LIBS],["${found_lib}"])],
+ [i_do_have_libreadline=no])
+fi
+if test x"${i_do_have_libreadline}" = xyes -a x"${LIBREADLINE_CFLAGS}" = x; then
+ AC_CHECK_HEADER([readline/readline.h],[AC_SUBST([LIBREADLINE_CFLAGS],[""])],[i_do_have_libreadline=no])
+fi
+if test x"${i_do_have_libreadline}" != xyes; then
+ FONTFORGE_WARN_PKG_NOT_FOUND([LIBREADLINE])
+ AC_DEFINE([_NO_LIBREADLINE],1,[Define if not using libreadline.])
+fi
+])
dnl A macro that will not be needed if we can count on libspiro
dnl having a pkg-config file.
@@ -26,6 +26,7 @@ my_cflags="${my_cflags} ${LIBUNICODENAMES_CFLAGS}"
my_cflags="${my_cflags} ${LIBXML_CFLAGS}"
my_cflags="${my_cflags} ${PYTHON_CFLAGS}"
my_cflags="${my_cflags} ${PTHREAD_CFLAGS}"
+my_cflags="${my_cflags} ${LIBREADLINE_CFLAGS}"
test x"${SDK}" = x || my_cflags="${my_cflags} -I${SDK}"
test x"${LTDLINCL}" = x || my_cflags="${my_cflags} -I${LTDLINCL}"
AC_SUBST([MY_CFLAGS],[${my_cflags}])
@@ -48,6 +49,7 @@ test x"${i_do_have_cairo}" = xyes && my_libs="${my_libs} ${CAIRO_LIBS}"
test x"${i_do_have_cairo}" = xyes && my_libs="${my_libs} ${PANGOCAIRO_LIBS}"
test x"${i_do_have_gui}" = xyes && my_libs="${my_libs} ${PANGO_LIBS}"
test x"${i_do_have_x}" = xyes && my_libs="${my_libs} ${X_PRE_LIBS} ${X_LIBS} ${X_EXTRA_LIBS}"
+test x"${i_do_have_libreadline}" = xyes && my_libs="${my_libs} ${LIBREADLINE_LIBS}"
my_libs="${my_libs} ${FREETYPE_LIBS}"
my_libs="${my_libs} ${PTHREAD_LIBS}"
my_libs="${my_libs} ${ZLIB_LIBS}"

0 comments on commit de995bb

Please sign in to comment.