command-plugin.m4 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. command_deps="no"
  2. if test "$enable_command" != ""; then
  3. if test "$TOOLKIT" != "gtk"; then
  4. command_deps="no"
  5. AC_MSG_WARN([command plugin: only supported on UNIX/gtk platforms])
  6. else
  7. # stolen from the original plugin.m4 in abiword-plugins
  8. AC_CHECK_HEADER(readline/readline.h,[
  9. AC_CHECK_HEADER(readline/history.h,[
  10. AC_CHECK_LIB(readline,readline,[
  11. command_deps="yes"
  12. ],[ AC_CHECK_LIB(readline,rl_initialize,[
  13. command_deps="yes"
  14. ],,)
  15. ],)
  16. ])
  17. ])
  18. fi
  19. fi
  20. if test "$enable_command" = "yes" || \
  21. test "$command_deps" = "yes"; then
  22. if test "$enable_command_builtin" = "yes"; then
  23. AC_MSG_ERROR([command plugin: static linking not supported])
  24. fi
  25. AC_MSG_CHECKING([command plugin: for readline and friends])
  26. if test "$command_deps" != "yes"; then
  27. AC_MSG_ERROR([no])
  28. else
  29. AC_MSG_RESULT([yes])
  30. COMMAND_LIBS="-lreadline -lhistory $COMMAND_LIBS"
  31. fi
  32. test "$enable_command" = "auto" && PLUGINS="$PLUGINS command"
  33. COMMAND_CFLAGS="$COMMAND_CFLAGS "'${PLUGIN_CFLAGS}'
  34. COMMAND_LIBS="$COMMAND_LIBS "'${PLUGIN_LIBS}'
  35. fi
  36. AC_SUBST([COMMAND_CFLAGS])
  37. AC_SUBST([COMMAND_LIBS])