|
625 | 625 | # End libcurl-related stanza |
626 | 626 | ### |
627 | 627 |
|
628 | | -### |
629 | | -# Libxml2 control block. |
630 | | -### |
631 | | - |
632 | | -AC_MSG_CHECKING([whether to search for and use external libxml2]) |
633 | | -AC_ARG_ENABLE([libxml2], |
634 | | - [AS_HELP_STRING([--disable-libxml2], |
635 | | - [disable detection and use of libxml2 in favor of the bundled xml parser])]) |
636 | | -test "x$enable_libxml2" = xno || enable_libxml2=yes |
637 | | -AC_MSG_RESULT([$enable_libxml2]) |
638 | | - |
639 | | -# We can optionally use libxml2 for DAP4 and nch5comms, if enabled |
640 | | -have_libxml2=no |
641 | | -if test "x$enable_libxml2" = xyes; then |
642 | | - AC_CHECK_PROGS([NC_XML2_CONFIG], [xml2-config]) |
643 | | - if test -z "$NC_XML2_CONFIG"; then |
644 | | - AC_MSG_ERROR([Cannot find xml2-config utility. Either install the libxml2 development package, or re-run configure with --disable-libxml2 to use the bundled xml2 parser]) |
645 | | - fi |
646 | | - AC_CHECK_LIB([xml2],[xmlReadMemory],[have_libxml2=yes],[have_libxml2=no]) |
647 | | - if test "x$have_libxml2" = "xyes" ; then |
648 | | - AC_SEARCH_LIBS([xmlReadMemory],[xml2 xml2.dll cygxml2.dll], [],[]) |
649 | | - fi |
650 | | - if test "x$have_libxml2" = xyes; then |
651 | | - XML2FLAGS=`xml2-config --cflags` |
652 | | - AC_SUBST([XML2FLAGS],${XML2FLAGS}) |
653 | | - AC_DEFINE([HAVE_LIBXML2], [1], [if true, use libxml2]) |
654 | | - fi |
655 | | -fi |
656 | | - |
657 | | -if test "x$enable_libxml2" = xyes; then |
658 | | -XMLPARSER="libxml2" |
659 | | -else |
660 | | -XMLPARSER="tinyxml2 (bundled)" |
661 | | -fi |
662 | | - |
663 | | -# Need a condition and subst for this |
664 | | -AM_CONDITIONAL(NETCDF_ENABLE_LIBXML2, [test "x$enable_libxml2" = xyes]) |
665 | | -AC_SUBST([XMLPARSER],[${XMLPARSER}]) |
666 | | - |
667 | | -### |
668 | | -# End Libxml2 block |
669 | | -### |
670 | 628 |
|
671 | 629 | ## |
672 | 630 | # Should quantize be enabled? |
@@ -787,6 +745,66 @@ if test "x$enable_nczarr" = xyes; then |
787 | 745 | fi |
788 | 746 | AM_CONDITIONAL(NETCDF_ENABLE_NCZARR, [test x$enable_nczarr = xyes]) |
789 | 747 |
|
| 748 | + |
| 749 | +### |
| 750 | +# End nczarr, dap block |
| 751 | +### |
| 752 | + |
| 753 | +### |
| 754 | +# Libxml2 control block. |
| 755 | +### |
| 756 | + |
| 757 | +AC_MSG_CHECKING([whether to search for and use external libxml2]) |
| 758 | +AC_ARG_ENABLE([libxml2], |
| 759 | + [AS_HELP_STRING([--disable-libxml2], |
| 760 | + [disable detection and use of libxml2 in favor of the bundled xml parser])]) |
| 761 | +test "x$enable_libxml2" = xno || enable_libxml2=yes |
| 762 | +AC_MSG_RESULT([$enable_libxml2]) |
| 763 | + |
| 764 | +# We can optionally use libxml2 for DAP4 and nch5comms, if enabled |
| 765 | +have_libxml2=no |
| 766 | +if test "x$enable_libxml2" = xyes; then |
| 767 | + AC_CHECK_PROGS([NC_XML2_CONFIG], [xml2-config]) |
| 768 | + if test -z "$NC_XML2_CONFIG"; then |
| 769 | + AC_MSG_ERROR([Cannot find xml2-config utility. Either install the libxml2 development package, or re-run configure with --disable-libxml2 to use the bundled xml2 parser]) |
| 770 | + fi |
| 771 | + AC_CHECK_LIB([xml2],[xmlReadMemory],[have_libxml2=yes],[have_libxml2=no]) |
| 772 | + if test "x$have_libxml2" = "xyes" ; then |
| 773 | + AC_SEARCH_LIBS([xmlReadMemory],[xml2 xml2.dll cygxml2.dll], [],[]) |
| 774 | + fi |
| 775 | + if test "x$have_libxml2" = xyes; then |
| 776 | + XML2FLAGS=`xml2-config --cflags` |
| 777 | + AC_SUBST([XML2FLAGS],${XML2FLAGS}) |
| 778 | + AC_DEFINE([HAVE_LIBXML2], [1], [if true, use libxml2]) |
| 779 | + fi |
| 780 | +fi |
| 781 | + |
| 782 | +### |
| 783 | +# See https://github.com/Unidata/netcdf-c/issues/2851 |
| 784 | +# There is a condition where we can avoid compiling libxml2 *and* tinyxml2, if we don't need nczarr or DAP4. |
| 785 | +### |
| 786 | +XMLPARSER="none required" |
| 787 | +AM_CONDITIONAL(NETCDF_ENABLE_XML2,[test "$enable_nczarr" = yes || test "$enable_dap4" = yes || test "$enable_libxml2" = yes]) |
| 788 | +if test "$enable_nczarr" = yes || test "$enable_dap4" = yes || test "$enable_libxml2" = yes ; then |
| 789 | + |
| 790 | + if test "x$enable_libxml2" = xyes; then |
| 791 | + XMLPARSER="libxml2" |
| 792 | + else |
| 793 | + XMLPARSER="tinyxml2 (bundled)" |
| 794 | + fi |
| 795 | +fi |
| 796 | + |
| 797 | +# Need a condition and subst for this |
| 798 | +AM_CONDITIONAL(NETCDF_ENABLE_LIBXML2, [test "x$enable_libxml2" = xyes]) |
| 799 | + |
| 800 | +AC_SUBST([XMLPARSER],[${XMLPARSER}]) |
| 801 | + |
| 802 | +### |
| 803 | +# End Libxml2 block |
| 804 | +### |
| 805 | + |
| 806 | + |
| 807 | + |
790 | 808 | ########## |
791 | 809 | # Look for Standardized libraries |
792 | 810 | ########## |
|
0 commit comments