@samp{zlib} is only used when the system installed library is not available.
@end table
+@subheading COBOL-Specific Options
+
+The following options apply to the build of the COBOL runtime library.
+
+@table @code
+@item --with-target-libxml2=@var{list}
+@itemx --with-target-libxml2-include=@var{list}
+@itemx --with-target-libxml2-lib=@var{list}
+Specify search directories for the libxml2 header files and
+libraries. @var{list} is a comma separated list of key value pairs of the
+form @samp{@var{multilibdir}=@var{path}}, where the default multilib key
+is named as @samp{.} (dot), or is omitted (e.g.@:
+@samp{--with-target-libxml2=/opt/libxml2,32=/opt-libxml2-32}).
+
+The options @option{--with-target-libxml2-include} and
+@option{--with-target-libxml2-lib} must always be specified together
+for each multilib variant and they take precedence over
+@option{--with-target-libxml2}. If @option{--with-target-libxml2-include}
+is missing values for a multilib, then the value for the default
+multilib is used (e.g.@: @samp{--with-target-libxml2-include=/opt/libxml2/include}
+@samp{--with-target-libxml2-lib=/opt/libxml2/lib64,32=/opt-libxml2/lib32}).
+If none of these options are specified, the library is assumed in
+default locations.
+@end table
+
@html
<hr />
<p>
WARN_CFLAGS = -W -Wall -Wwrite-strings
AM_CPPFLAGS = -I. -I posix/shim $(LIBQUADINCLUDE)
-AM_CPPFLAGS += -I /usr/include/libxml2
+AM_CPPFLAGS += $(LIBXML2_CPPFLAGS)
AM_CFLAGS = $(XCFLAGS)
AM_CXXFLAGS = $(XCFLAGS)
libgcobol_la_LINK = $(CXXLINK) $(libgcobol_la_LDFLAGS)
version_arg = -version-info $(LIBGCOBOL_VERSION)
libgcobol_la_LDFLAGS = $(LTLDFLAGS) $(LIBQUADLIB) $(LTLIBICONV) \
- $(extra_ldflags_libgcobol) $(LIBS) $(version_arg)
+ $(extra_ldflags_libgcobol) $(LIBS) $(LIBXML2_LIBS) $(version_arg)
libgcobol_la_DEPENDENCIES = libgcobol.spec $(LIBQUADLIB_DEP)
endif BUILD_LIBGCOBOL
LIBQUADSPEC = @LIBQUADSPEC@
LIBS = @LIBS@
LIBTOOL = @LIBTOOL@
+LIBXML2_CPPFLAGS = @LIBXML2_CPPFLAGS@
+LIBXML2_LIBS = @LIBXML2_LIBS@
LIPO = @LIPO@
LLVM_CONFIG = @LLVM_CONFIG@
LN_S = @LN_S@
@BUILD_LIBGCOBOL_TRUE@WARN_CFLAGS = -W -Wall -Wwrite-strings
@BUILD_LIBGCOBOL_TRUE@AM_CPPFLAGS = -I. -I posix/shim \
-@BUILD_LIBGCOBOL_TRUE@ $(LIBQUADINCLUDE) -I \
-@BUILD_LIBGCOBOL_TRUE@ /usr/include/libxml2
+@BUILD_LIBGCOBOL_TRUE@ $(LIBQUADINCLUDE) $(LIBXML2_CPPFLAGS)
@BUILD_LIBGCOBOL_TRUE@AM_CFLAGS = $(XCFLAGS)
@BUILD_LIBGCOBOL_TRUE@AM_CXXFLAGS = $(XCFLAGS) $(WARN_CFLAGS) \
@BUILD_LIBGCOBOL_TRUE@ -DIN_TARGET_LIBS -fstrict-aliasing \
@BUILD_LIBGCOBOL_TRUE@libgcobol_la_LINK = $(CXXLINK) $(libgcobol_la_LDFLAGS)
@BUILD_LIBGCOBOL_TRUE@version_arg = -version-info $(LIBGCOBOL_VERSION)
@BUILD_LIBGCOBOL_TRUE@libgcobol_la_LDFLAGS = $(LTLDFLAGS) $(LIBQUADLIB) $(LTLIBICONV) \
-@BUILD_LIBGCOBOL_TRUE@ $(extra_ldflags_libgcobol) $(LIBS) $(version_arg)
+@BUILD_LIBGCOBOL_TRUE@ $(extra_ldflags_libgcobol) $(LIBS) $(LIBXML2_LIBS) $(version_arg)
@BUILD_LIBGCOBOL_TRUE@libgcobol_la_DEPENDENCIES = libgcobol.spec $(LIBQUADLIB_DEP)
all: config.h
/* Define to 1 if you have the `random_r' function. */
#undef HAVE_RANDOM_R
-/* Define to 1 if you have the `xmlParseChunk' function. */
-#undef HAVE_SAX_XML_PARSER
-
/* Define to 1 if you have the `setstate_r' function. */
#undef HAVE_SETSTATE_R
LIBQUADLIB_DEP
LIBQUADLIB
LIBQUADSPEC
+LIBXML2_LIBS
+LIBXML2_CPPFLAGS
extra_ldflags_libgcobol
LIBGCOBOL_VERSION
BUILD_LIBGCOBOL_FALSE
enable_rpath
with_libiconv_prefix
with_libiconv_type
+with_target_libxml2
+with_target_libxml2_include
+with_target_libxml2_lib
enable_libquadmath
with_gcc_major_version_only
'
--with-libiconv-prefix[=DIR] search for libiconv in DIR/include and DIR/lib
--without-libiconv-prefix don't search for libiconv in includedir and libdir
--with-libiconv-type=TYPE type of library to search for (auto/static/shared)
+ --with-target-libxml2=PATHLIST
+ specify prefix directory for installed libxml2
+ package. Equivalent to
+ --with-target-libxml2-include=PATH/include plus
+ --with-target-libxml2-lib=PATH/lib
+ --with-target-libxml2-include=PATHLIST
+ specify directories for installed libxml2 include
+ files
+ --with-target-libxml2-lib=PATHLIST
+ specify directories for installed libxml2 library
--with-gcc-major-version-only
use only GCC major number in filesystem paths
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<_LT_EOF
-#line 12202 "configure"
+#line 12217 "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<_LT_EOF
-#line 12308 "configure"
+#line 12323 "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
# These are libxml2.
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for xmlSAXUserParseMemory in -lxml2" >&5
-$as_echo_n "checking for xmlSAXUserParseMemory in -lxml2... " >&6; }
-if ${ac_cv_lib_xml2_xmlSAXUserParseMemory+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- ac_check_lib_save_LIBS=$LIBS
-LIBS="-lxml2 $LIBS"
-if test x$gcc_no_link = xyes; then
- as_fn_error $? "Link tests are not allowed after GCC_NO_EXECUTABLES." "$LINENO" 5
-fi
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-/* Override any GCC internal prototype to avoid an error.
- Use char because int might match the return type of a GCC
- builtin and then its argument prototype would still apply. */
-#ifdef __cplusplus
-extern "C"
-#endif
-char xmlSAXUserParseMemory ();
-int
-main ()
-{
-return xmlSAXUserParseMemory ();
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_cxx_try_link "$LINENO"; then :
- ac_cv_lib_xml2_xmlSAXUserParseMemory=yes
-else
- ac_cv_lib_xml2_xmlSAXUserParseMemory=no
-fi
-rm -f core conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
+# Check whether --with-target-libxml2 was given.
+if test "${with_target_libxml2+set}" = set; then :
+ withval=$with_target_libxml2;
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_xml2_xmlSAXUserParseMemory" >&5
-$as_echo "$ac_cv_lib_xml2_xmlSAXUserParseMemory" >&6; }
-if test "x$ac_cv_lib_xml2_xmlSAXUserParseMemory" = xyes; then :
- LIBS="-lxml2 $LIBS"
-$as_echo "#define HAVE_SAX_XML_PARSER 1" >>confdefs.h
+# Check whether --with-target-libxml2-include was given.
+if test "${with_target_libxml2_include+set}" = set; then :
+ withval=$with_target_libxml2_include;
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for xmlParseChunk in -lxml2" >&5
-$as_echo_n "checking for xmlParseChunk in -lxml2... " >&6; }
-if ${ac_cv_lib_xml2_xmlParseChunk+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- ac_check_lib_save_LIBS=$LIBS
-LIBS="-lxml2 $LIBS"
-if test x$gcc_no_link = xyes; then
- as_fn_error $? "Link tests are not allowed after GCC_NO_EXECUTABLES." "$LINENO" 5
-fi
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-/* Override any GCC internal prototype to avoid an error.
- Use char because int might match the return type of a GCC
- builtin and then its argument prototype would still apply. */
-#ifdef __cplusplus
-extern "C"
-#endif
-char xmlParseChunk ();
-int
-main ()
-{
-return xmlParseChunk ();
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_cxx_try_link "$LINENO"; then :
- ac_cv_lib_xml2_xmlParseChunk=yes
-else
- ac_cv_lib_xml2_xmlParseChunk=no
-fi
-rm -f core conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
+# Check whether --with-target-libxml2-lib was given.
+if test "${with_target_libxml2_lib+set}" = set; then :
+ withval=$with_target_libxml2_lib;
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_xml2_xmlParseChunk" >&5
-$as_echo "$ac_cv_lib_xml2_xmlParseChunk" >&6; }
-if test "x$ac_cv_lib_xml2_xmlParseChunk" = xyes; then :
- LIBS="-lxml2 $LIBS"
-$as_echo "#define HAVE_SAX_XML_PARSER 1" >>confdefs.h
+if test "x$use_libgcobol" = xyes && test "x$libgcobol_cv_have_int128" = xyes; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libxml2" >&5
+$as_echo_n "checking for libxml2... " >&6; }
+ if test "x$with_target_libxml2$with_target_libxml2_include$with_target_libxml2_lib" = x; then
+ LIBXML2_CPPFLAGS="-I /usr/include/libxml2"
+ LIBXML2_LIBS="-lxml2"
+ else
+ if test "x$with_target_libxml2_include" = x && test "x$with_target_libxml2_lib" != x; then
+ as_fn_error $? "found --with-target-libxml2-lib but --with-target-libxml2-include missing" "$LINENO" 5
+ elif test "x$with_target_libxml2_include" != x && test "x$with_target_libxml2_lib" = x; then
+ as_fn_error $? "found --with-target-libxml2-include but --with-target-libxml2-lib missing" "$LINENO" 5
+ else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: using paths configured with --with-target-libxml2 options" >&5
+$as_echo "using paths configured with --with-target-libxml2 options" >&6; }
+ fi
+ mldir=`${CC-gcc} --print-multi-directory 2>/dev/null`
+ libxml2_val=
+ if test "x$with_target_libxml2" != x; then
+ for i in `echo $with_target_libxml2 | tr ',' ' '`; do
+ case "$i" in
+ *=*) sd=${i%%=*}; d=${i#*=} ;;
+ *) sd=.; d=$i ;;
+ esac
+ if test "$mldir" = "$sd"; then
+ libxml2_val=$d
+ fi
+ done
+ if test "x$libxml2_val" = x; then
+ as_fn_error $? "no multilib path ($mldir) found in --with-target-libxml2" "$LINENO" 5
+ fi
+ libxml2_inc_dir="$libxml2_val/include"
+ libxml2_lib_dir="$libxml2_val/lib"
+ fi
+ libxml2_val=
+ if test "x$with_target_libxml2_include" != x; then
+ for i in `echo $with_target_libxml2_include | tr ',' ' '`; do
+ case "$i" in
+ *=*) sd=${i%%=*}; d=${i#*=} ;;
+ *) sd=.; d=$i; fallback=$i ;;
+ esac
+ if test "$mldir" = "$sd"; then
+ libxml2_val=$d
+ fi
+ done
+ if test "x$libxml2_val" = x && test "x$libxml2_inc_dir" = x && test "x$fallback" != x; then
+ libxml2_inc_dir="$fallback"
+ elif test "x$libxml2_val" = x; then
+ as_fn_error $? "no multilib path ($mldir) found in --with-target-libxml2-include" "$LINENO" 5
+ else
+ libxml2_inc_dir="$libxml2_val"
+ fi
+ fi
+ libxml2_val=
+ if test "x$with_target_libxml2_lib" != x; then
+ for i in `echo $with_target_libxml2_lib | tr ',' ' '`; do
+ case "$i" in
+ *=*) sd=${i%%=*}; d=${i#*=} ;;
+ *) sd=.; d=$i ;;
+ esac
+ if test "$mldir" = "$sd"; then
+ libxml2_val=$d
+ fi
+ done
+ if test "x$libxml2_val" = x; then
+ as_fn_error $? "no multilib path ($mldir) found in --with-target-libxml2-lib" "$LINENO" 5
+ fi
+ libxml2_lib_dir="$libxml2_val"
+ fi
+ if test "x$libxml2_inc_dir" = x; then
+ as_fn_error $? "no multilib path ($mldir) found in --with-target-libxml2-include" "$LINENO" 5
+ fi
+ if test "x$libxml2_lib_dir" = x; then
+ as_fn_error $? "no multilib path ($mldir) found in --with-target-libxml2-lib" "$LINENO" 5
+ fi
+ LIBXML2_CPPFLAGS="-I$libxml2_inc_dir"
+ LIBXML2_LIBS="-L$libxml2_lib_dir -lxml2"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: found" >&5
+$as_echo "found" >&6; }
+ fi
+else
+ LIBXML2_CPPFLAGS=
+ LIBXML2_LIBS=
fi
+
# Copied from gcc/configure.ac. 2025-06-05 R.J.Dubner
# At least for glibc, clock_gettime is in librt. But don't pull that
# in if it still doesn't give us the function we want.
AC_SEARCH_LIBS([cacosf128], [c m], libgcobol_have_cacosf128=yes)
# These are libxml2.
-AC_CHECK_LIB(xml2, xmlSAXUserParseMemory,
- [LIBS="-lxml2 $LIBS"
- AC_DEFINE(HAVE_SAX_XML_PARSER, 1,
- [Define to 1 if you have the `xmlSAXUserParseMemory' function.])])
-AC_CHECK_LIB(xml2, xmlParseChunk,
- [LIBS="-lxml2 $LIBS"
- AC_DEFINE(HAVE_SAX_XML_PARSER, 1,
- [Define to 1 if you have the `xmlParseChunk' function.])])
+AC_ARG_WITH([target-libxml2],
+[AS_HELP_STRING([--with-target-libxml2=PATHLIST],
+ [specify prefix directory for installed libxml2 package.
+ Equivalent to --with-target-libxml2-include=PATH/include
+ plus --with-target-libxml2-lib=PATH/lib])])
+AC_ARG_WITH([target-libxml2-include],
+[AS_HELP_STRING([--with-target-libxml2-include=PATHLIST],
+ [specify directories for installed libxml2 include files])])
+AC_ARG_WITH([target-libxml2-lib],
+[AS_HELP_STRING([--with-target-libxml2-lib=PATHLIST],
+ [specify directories for installed libxml2 library])])
+
+if test "x$use_libgcobol" = xyes && test "x$libgcobol_cv_have_int128" = xyes; then
+ AC_MSG_CHECKING([for libxml2])
+ if test "x$with_target_libxml2$with_target_libxml2_include$with_target_libxml2_lib" = x; then
+ dnl no libxml2 options, assuming libxml2 in default locations
+ LIBXML2_CPPFLAGS="-I /usr/include/libxml2"
+ LIBXML2_LIBS="-lxml2"
+ else
+ dnl libxml2 options passed by configure flags
+ if test "x$with_target_libxml2_include" = x && test "x$with_target_libxml2_lib" != x; then
+ AC_MSG_ERROR([found --with-target-libxml2-lib but --with-target-libxml2-include missing])
+ elif test "x$with_target_libxml2_include" != x && test "x$with_target_libxml2_lib" = x; then
+ AC_MSG_ERROR([found --with-target-libxml2-include but --with-target-libxml2-lib missing])
+ else
+ AC_MSG_RESULT([using paths configured with --with-target-libxml2 options])
+ fi
+ mldir=`${CC-gcc} --print-multi-directory 2>/dev/null`
+ libxml2_val=
+ if test "x$with_target_libxml2" != x; then
+ for i in `echo $with_target_libxml2 | tr ',' ' '`; do
+ case "$i" in
+ *=*) sd=${i%%=*}; d=${i#*=} ;;
+ *) sd=.; d=$i ;;
+ esac
+ if test "$mldir" = "$sd"; then
+ libxml2_val=$d
+ fi
+ done
+ if test "x$libxml2_val" = x; then
+ AC_MSG_ERROR([no multilib path ($mldir) found in --with-target-libxml2])
+ fi
+ libxml2_inc_dir="$libxml2_val/include"
+ libxml2_lib_dir="$libxml2_val/lib"
+ fi
+ libxml2_val=
+ if test "x$with_target_libxml2_include" != x; then
+ for i in `echo $with_target_libxml2_include | tr ',' ' '`; do
+ case "$i" in
+ *=*) sd=${i%%=*}; d=${i#*=} ;;
+ *) sd=.; d=$i; fallback=$i ;;
+ esac
+ if test "$mldir" = "$sd"; then
+ libxml2_val=$d
+ fi
+ done
+ if test "x$libxml2_val" = x && test "x$libxml2_inc_dir" = x && test "x$fallback" != x; then
+ libxml2_inc_dir="$fallback"
+ elif test "x$libxml2_val" = x; then
+ AC_MSG_ERROR([no multilib path ($mldir) found in --with-target-libxml2-include])
+ else
+ libxml2_inc_dir="$libxml2_val"
+ fi
+ fi
+ libxml2_val=
+ if test "x$with_target_libxml2_lib" != x; then
+ for i in `echo $with_target_libxml2_lib | tr ',' ' '`; do
+ case "$i" in
+ *=*) sd=${i%%=*}; d=${i#*=} ;;
+ *) sd=.; d=$i ;;
+ esac
+ if test "$mldir" = "$sd"; then
+ libxml2_val=$d
+ fi
+ done
+ if test "x$libxml2_val" = x; then
+ AC_MSG_ERROR([no multilib path ($mldir) found in --with-target-libxml2-lib])
+ fi
+ libxml2_lib_dir="$libxml2_val"
+ fi
+ if test "x$libxml2_inc_dir" = x; then
+ AC_MSG_ERROR([no multilib path ($mldir) found in --with-target-libxml2-include])
+ fi
+ if test "x$libxml2_lib_dir" = x; then
+ AC_MSG_ERROR([no multilib path ($mldir) found in --with-target-libxml2-lib])
+ fi
+ LIBXML2_CPPFLAGS="-I$libxml2_inc_dir"
+ LIBXML2_LIBS="-L$libxml2_lib_dir -lxml2"
+ AC_MSG_RESULT([found])
+ fi
+else
+ LIBXML2_CPPFLAGS=
+ LIBXML2_LIBS=
+fi
+AC_SUBST(LIBXML2_CPPFLAGS)
+AC_SUBST(LIBXML2_LIBS)
# Copied from gcc/configure.ac. 2025-06-05 R.J.Dubner
# At least for glibc, clock_gettime is in librt. But don't pull that