Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
8269131: Update libxml2 to version 2.9.12
Reviewed-by: kcr, jvos
  • Loading branch information
arapte committed Jul 6, 2021
1 parent 47c2ec3 commit 52c076c
Show file tree
Hide file tree
Showing 62 changed files with 2,772 additions and 2,552 deletions.
21 changes: 20 additions & 1 deletion modules/javafx.web/src/main/legal/libxml2.md
@@ -1,4 +1,4 @@
## xmlsoft.org: libxml2 v2.9.10
## xmlsoft.org: libxml2 v2.9.12

### libxml2 License
```
Expand Down Expand Up @@ -27,4 +27,23 @@ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
=== copyright notices for hash.c, list.c, and the trio files ===
hash.c:
* Copyright (C) 2000,2012 Bjorn Reese and Daniel Veillard.
list.c:
* Copyright (C) 2000 Gary Pennington and Daniel Veillard.
the trio files:
* Copyright (C) 1998 Bjorn Reese and Daniel Stenberg.
=== license text for hash.c, list.c, and the trio files ===
*
* Permission to use, copy, modify, and distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies.
*
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE AUTHORS AND
* CONTRIBUTORS ACCEPT NO RESPONSIBILITY IN ANY CONCEIVABLE MANNER.
*
```

This file was deleted.

@@ -0,0 +1,51 @@
Updating libxml in OpenJFX:

1. Download respective libxml source tarball from here: http://xmlsoft.org/sources.
Alternatively we can also clone the libxml repo from github. (url- https://gitlab.gnome.org/GNOME/libxml2.git)

2. Extract contents into `modules/javafx.web/src/main/native/Source/ThirdParty/libxml/src` directory.

3. We do not have any local changes in the libxml source but libxml source needs to be configured before integrating into JavaFX. Below are platform wise steps to configure.

- For windows
4. Configure libxml.
> cd modules/javafx.web/src/main/native/Source/ThirdParty/libxml/src/win32
> cscript configure.js compiler=msvc catalog=no xml_debug=no docb=no ftp=no http=no iconv=no legacy=no mem_debug=no modules=no regexps=no run_debug=no schemas=no schematron=no valid=no xinclude=no xptr=no zlib=no

- Above command generates a header file `libxml\src\include\libxml\xmlversion.h` and may update the `src/config.h` file. (on all platforms)
4.1 Copy `libxml\src\include\libxml\xmlversion.h` to `libxml\win32\include\libxml\xmlversion.h'. xmlversion.h file defines several macros to control libxml features. We do not require all of the features to be enabled. Compare the generated `libxml\src\include\libxml\xmlversion.h` with existing `libxml\win32\include\libxml\xmlversion.h' and retain macro definitions from the later.

4.2 Copy `libxml\src\config.h` to `libxml\win32\config.h`

5. Remove files & directories which are not relevant to JavaFX WebKit.

- For Mac
6. Configure libxml.
> cd modules/javafx.web/src/main/native/Source/ThirdParty/libxml/src
> ./configure

6.1 Copy `libxml\src\include\libxml\xmlversion.h` to `libxml\mac\include\libxml\xmlversion.h` and follow same guidelines as Windows to retain changes from our repo.

6.2 Copy libxml\src\config.h to libxml\mac\config.h

- For Linux
7. Configure libxml.
> cd modules/javafx.web/src/main/native/Source/ThirdParty/libxml/src
> ./configure

7.1 Copy `libxml\src\include\libxml\xmlversion.h` to `libxml\linux\include\libxml\xmlversion.h` and follow same guidelines as Windows to retain changes from our repo.

7.2 Copy libxml\src\config.h to libxml\linux\config.h

8. Helper commands for removing tabs and trailing whitespaces from source files(.h and .c).

8.1 > cd modules/javafx.web/src/main/native/Source/ThirdParty/libxml

8.2 Remove tabs from source files:
> sudo apt install moreutils
> find src/ -name "*.c" -type f -exec bash -c 'expand -t 4 "$0" | sponge "$0"' {} \;
> find src/ -name "*.h" -type f -exec bash -c 'expand -t 4 "$0" | sponge "$0"' {} \;

8.3 Remove trailing whitespaces from source files:
> find src/ -name “*.c” -type f -exec sed --in-place 's/[[:space:]]\+$//' {} \+
> find src/ -name “*.h” -type f -exec sed --in-place 's/[[:space:]]\+$//' {} \+
@@ -1,6 +1,9 @@
/* config.h. Generated from config.h.in by configure. */
/* config.h.in. Generated from configure.ac by autoheader. */

/* A form that will not confuse apibuild.py */
#define ATTRIBUTE_DESTRUCTOR __attribute__((destructor))

/* Type cast for the gethostbyname() argument */
#define GETHOSTBYNAME_ARG_CAST /**/

Expand All @@ -10,6 +13,9 @@
/* Define to 1 if you have the <arpa/nameser.h> header file. */
#define HAVE_ARPA_NAMESER_H 1

/* Define if __attribute__((destructor)) is accepted */
#define HAVE_ATTRIBUTE_DESTRUCTOR 1

/* Whether struct sockaddr::__ss_family exists */
/* #undef HAVE_BROKEN_SS_FAMILY */

Expand Down Expand Up @@ -124,7 +130,7 @@
#define HAVE_RAND 1

/* Define to 1 if you have the `rand_r' function. */

/* #undef HAVE_RAND_R 1 */

/* Define to 1 if you have the <resolv.h> header file. */
#define HAVE_RESOLV_H 1
Expand Down Expand Up @@ -230,8 +236,7 @@
/* Define as const if the declaration of iconv() needs const. */
/* #undef ICONV_CONST */

/* Define to the sub-directory in which libtool stores uninstalled libraries.
*/
/* Define to the sub-directory where libtool stores uninstalled libraries. */
#define LT_OBJDIR ".libs/"

/* Name of package */
Expand Down Expand Up @@ -268,7 +273,7 @@
#define VA_LIST_IS_ARRAY 1

/* Version number of package */
#define VERSION "2.9.10"
#define VERSION "2.9.12"

/* Determine what socket length (socklen_t) data type is */
#define XML_SOCKLEN_T socklen_t
Expand Down
@@ -1,6 +1,6 @@
/*
* Summary: compile-time version informations
* Description: compile-time version informations for the XML library
* Summary: compile-time version information
* Description: compile-time version information for the XML library
*
* Copy: See Copyright for the status of this software.
*
Expand Down Expand Up @@ -29,21 +29,21 @@ XMLPUBFUN void XMLCALL xmlCheckVersion(int version);
*
* the version string like "1.2.3"
*/
#define LIBXML_DOTTED_VERSION "2.9.10"
#define LIBXML_DOTTED_VERSION "2.9.12"

/**
* LIBXML_VERSION:
*
* the version number: 1.2.3 value is 10203
*/
#define LIBXML_VERSION 20910
#define LIBXML_VERSION 20912

/**
* LIBXML_VERSION_STRING:
*
* the version number string, 1.2.3 value is "10203"
*/
#define LIBXML_VERSION_STRING "20910"
#define LIBXML_VERSION_STRING "20912"

/**
* LIBXML_VERSION_EXTRA:
Expand All @@ -58,7 +58,7 @@ XMLPUBFUN void XMLCALL xmlCheckVersion(int version);
* Macro to check that the libxml version in use is compatible with
* the version the software has been compiled against
*/
#define LIBXML_TEST_VERSION xmlCheckVersion(20910);
#define LIBXML_TEST_VERSION xmlCheckVersion(20912);

#ifndef VMS
#if 0
Expand Down
@@ -1,6 +1,9 @@
/* config.h. Generated from config.h.in by configure. */
/* config.h.in. Generated from configure.ac by autoheader. */

/* A form that will not confuse apibuild.py */
#define ATTRIBUTE_DESTRUCTOR __attribute__((destructor))

/* Type cast for the gethostbyname() argument */
#define GETHOSTBYNAME_ARG_CAST /**/

Expand All @@ -10,6 +13,9 @@
/* Define to 1 if you have the <arpa/nameser.h> header file. */
#define HAVE_ARPA_NAMESER_H 1

/* Define if __attribute__((destructor)) is accepted */
#define HAVE_ATTRIBUTE_DESTRUCTOR 1

/* Whether struct sockaddr::__ss_family exists */
/* #undef HAVE_BROKEN_SS_FAMILY */

Expand Down Expand Up @@ -124,7 +130,7 @@
#define HAVE_RAND 1

/* Define to 1 if you have the `rand_r' function. */

/* #undef HAVE_RAND_R 1 */

/* Define to 1 if you have the <resolv.h> header file. */
#define HAVE_RESOLV_H 1
Expand Down Expand Up @@ -267,7 +273,7 @@
#define VA_LIST_IS_ARRAY 1

/* Version number of package */
#define VERSION "2.9.10"
#define VERSION "2.9.12"

/* Determine what socket length (socklen_t) data type is */
#define XML_SOCKLEN_T socklen_t
Expand Down
@@ -1,6 +1,6 @@
/*
* Summary: compile-time version informations
* Description: compile-time version informations for the XML library
* Summary: compile-time version information
* Description: compile-time version information for the XML library
*
* Copy: See Copyright for the status of this software.
*
Expand Down Expand Up @@ -29,21 +29,21 @@ XMLPUBFUN void XMLCALL xmlCheckVersion(int version);
*
* the version string like "1.2.3"
*/
#define LIBXML_DOTTED_VERSION "2.9.10"
#define LIBXML_DOTTED_VERSION "2.9.12"

/**
* LIBXML_VERSION:
*
* the version number: 1.2.3 value is 10203
*/
#define LIBXML_VERSION 20910
#define LIBXML_VERSION 20912

/**
* LIBXML_VERSION_STRING:
*
* the version number string, 1.2.3 value is "10203"
*/
#define LIBXML_VERSION_STRING "20910"
#define LIBXML_VERSION_STRING "20912"

/**
* LIBXML_VERSION_EXTRA:
Expand All @@ -58,7 +58,7 @@ XMLPUBFUN void XMLCALL xmlCheckVersion(int version);
* Macro to check that the libxml version in use is compatible with
* the version the software has been compiled against
*/
#define LIBXML_TEST_VERSION xmlCheckVersion(20910);
#define LIBXML_TEST_VERSION xmlCheckVersion(20912);

#ifndef VMS
#if 0
Expand Down

1 comment on commit 52c076c

@openjdk-notifier
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.