configure.ac 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. # file : configure.ac
  2. # copyright : Copyright (c) 2013-2014 Code Synthesis Tools CC
  3. # license : MIT; see accompanying LICENSE file
  4. AC_PREREQ(2.60)
  5. AC_INIT([libstudxml], [1.0.1], [studxml-users@codesynthesis.com])
  6. AC_CONFIG_AUX_DIR([config])
  7. AC_CONFIG_MACRO_DIR([m4])
  8. AC_CONFIG_SRCDIR([xml/exception])
  9. AM_INIT_AUTOMAKE([-Wall -Werror foreign nostdinc subdir-objects dist-bzip2 dist-zip tar-ustar])
  10. m4_ifdef([AM_PROG_AR], [AM_PROG_AR]) # Required by automake 1.12.
  11. LT_INIT([win32-dll])
  12. AC_CANONICAL_HOST
  13. # Check for diff.
  14. #
  15. DIFF_TOOL
  16. # Check for C++ compiler and use it to compile the tests.
  17. #
  18. AC_PROG_CXX
  19. AC_LANG(C++)
  20. # Create the libtool executable so that we can use it in further tests.
  21. #
  22. LT_OUTPUT
  23. # Check if we need to use external Expat.
  24. #
  25. AC_MSG_CHECKING([if we should use external expat])
  26. AC_ARG_WITH(
  27. [external-expat],
  28. [AC_HELP_STRING([--with-external-expat],[use external expat instead of the internal subset])],
  29. [external_expat=${withval}],
  30. [external_expat=no])
  31. if test x"$external_expat" != xno; then
  32. AC_MSG_RESULT([yes])
  33. # Check if we have Expat.
  34. #
  35. expat_found=yes
  36. LIBEXPAT([],[expat_found=no])
  37. if test x"$expat_found" = xno; then
  38. AC_MSG_ERROR([expat is not found; consider using CPPFLAGS/LDFLAGS to specify its location])
  39. fi
  40. AC_DEFINE([LIBSTUDXML_EXTERNAL_EXPAT], [1], [Use external expat.])
  41. else
  42. AC_MSG_RESULT([no])
  43. fi
  44. AM_CONDITIONAL([LIBSTUDXML_EXTERNAL_EXPAT], [test x"$external_expat" != xno])
  45. # If we have internal Expat, then determine the byteorder.
  46. #
  47. if test x"$external_expat" = xno; then
  48. AC_C_BIGENDIAN([byteorder=4321], [byteorder=1234])
  49. AC_DEFINE_UNQUOTED([LIBSTUDXML_BYTEORDER], [$byteorder], [1234 = little, 4321 = big])
  50. fi
  51. # Define LIBSTUDXML_STATIC_LIB if we are build static library on certain
  52. # platforms.
  53. #
  54. STATIC_LIB([LIBSTUDXML_STATIC_LIB], [Static library interface.])
  55. # Allow the user to specify the pkgconfig directory.
  56. #
  57. PKGCONFIG
  58. # Check if we should disable rpath.
  59. #
  60. DISABLE_RPATH
  61. # Output.
  62. #
  63. AC_CONFIG_HEADERS([xml/config.h xml/details/config.h])
  64. AC_CONFIG_FILES([ doc/Makefile examples/hybrid/Makefile examples/inheritance/Makefile examples/Makefile examples/performance/Makefile examples/persistence/Makefile examples/processing/Makefile examples/roundtrip/Makefile libstudxml.pc Makefile tester tests/Makefile tests/parser/Makefile tests/roundtrip/Makefile tests/serializer/Makefile xml/Makefile])
  65. AC_CONFIG_COMMANDS([tester-mode], [chmod +x tester])
  66. AC_OUTPUT