OLD | NEW |
| (Empty) |
1 #!/bin/sh | |
2 | |
3 # Copyright (c) 2008 The Chromium Authors. All rights reserved. | |
4 # Use of this source code is governed by a BSD-style license that can be | |
5 # found in the LICENSE file. | |
6 | |
7 set -ex | |
8 | |
9 GENERATED_DIR="${CONFIGURATION_TEMP_DIR}/generated" | |
10 | |
11 PACKAGE=libxml2 | |
12 VERSION_MAJOR=2 | |
13 VERSION_MINOR=6 | |
14 VERSION_MICRO=31 | |
15 VERSION_STRING="${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_MICRO}" | |
16 VERSION_NUMBER=$(printf "%d%02d%02d" \ | |
17 "${VERSION_MAJOR}" \ | |
18 "${VERSION_MINOR}" \ | |
19 "${VERSION_EXTRA}") | |
20 | |
21 # Generate xmlversion.h the same way that "sh configure" would | |
22 mkdir -p "${GENERATED_DIR}/include/libxml" | |
23 XMLVERSION_H="${GENERATED_DIR}/include/libxml/xmlversion.h" | |
24 sed -e s/@VERSION@/"${VERSION_STRING}"/g \ | |
25 -e s/@LIBXML_VERSION_NUMBER@/"${VERSION_NUMBER}"/g \ | |
26 -e s/@LIBXML_VERSION_EXTRA@//g \ | |
27 -e s/@WITH_TRIO@/0/g \ | |
28 -e s/@WITH_THREADS@/1/g \ | |
29 -e s/@WITH_TREE@/1/g \ | |
30 -e s/@WITH_OUTPUT@/1/g \ | |
31 -e s/@WITH_PUSH@/1/g \ | |
32 -e s/@WITH_READER@/1/g \ | |
33 -e s/@WITH_PATTERN@/1/g \ | |
34 -e s/@WITH_WRITER@/1/g \ | |
35 -e s/@WITH_SAX1@/1/g \ | |
36 -e s/@WITH_FTP@/1/g \ | |
37 -e s/@WITH_HTTP@/1/g \ | |
38 -e s/@WITH_VALID@/1/g \ | |
39 -e s/@WITH_HTML@/1/g \ | |
40 -e s/@WITH_LEGACY@/1/g \ | |
41 -e s/@WITH_C14N@/1/g \ | |
42 -e s/@WITH_CATALOG@/1/g \ | |
43 -e s/@WITH_DOCB@/1/g \ | |
44 -e s/@WITH_XPATH@/1/g \ | |
45 -e s/@WITH_XPTR@/1/g \ | |
46 -e s/@WITH_XINCLUDE@/1/g \ | |
47 -e s/@WITH_ICONV@/0/g \ | |
48 -e s/@WITH_ICU@/1/g \ | |
49 -e s/@WITH_ISO8859X@/1/g \ | |
50 -e s/@WITH_DEBUG@/1/g \ | |
51 -e s/@WITH_MEM_DEBUG@/0/g \ | |
52 -e s/@WITH_RUN_DEBUG@/0/g \ | |
53 -e s/@WITH_REGEXPS@/1/g \ | |
54 -e s/@WITH_SCHEMAS@/1/g \ | |
55 -e s/@WITH_SCHEMATRON@/1/g \ | |
56 -e s/@WITH_MODULES@/1/g \ | |
57 -e s/@MODULE_EXTENSION@/.so/g \ | |
58 -e s/@WITH_ZLIB@/1/g \ | |
59 < include/libxml/xmlversion.h.in \ | |
60 > "${XMLVERSION_H}.new" | |
61 | |
62 # Only use the new file if it's different from the existing file (if any), | |
63 # preserving the existing file's timestamp when there are no changes to | |
64 # minimize unnecessary build activity. | |
65 if ! diff -q "${XMLVERSION_H}.new" "${XMLVERSION_H}" >& /dev/null ; then | |
66 mv "${XMLVERSION_H}.new" "${XMLVERSION_H}" | |
67 else | |
68 rm "${XMLVERSION_H}.new" | |
69 fi | |
70 | |
71 CONFIG_H="${GENERATED_DIR}/config.h" | |
72 sed -e s/'^#undef PACKAGE$'/"#define PACKAGE \"${PACKAGE}\""/ \ | |
73 -e s/'^#undef VERSION$'/"#define VERSION \"${VERSION_STRING}\""/ \ | |
74 -e s/'^#undef SUPPORT_IPV6$'/"#define SUPPORT_IPV6"/ \ | |
75 -e s/'^#undef HAVE_ARPA_INET_H$'/"#define HAVE_ARPA_INET_H 1"/ \ | |
76 -e s/'^#undef HAVE_ARPA_NAMESER_H$'/"#define HAVE_ARPA_NAMESER_H 1"/ \ | |
77 -e s/'^#undef HAVE_CTYPE_H$'/"#define HAVE_CTYPE_H 1"/ \ | |
78 -e s/'^#undef HAVE_DIRENT_H$'/"#define HAVE_DIRENT_H 1"/ \ | |
79 -e s/'^#undef HAVE_DLFCN_H$'/"#define HAVE_DLFCN_H 1"/ \ | |
80 -e s/'^#undef HAVE_DLOPEN$'/"#define HAVE_DLOPEN "/ \ | |
81 -e s/'^#undef HAVE_ERRNO_H$'/"#define HAVE_ERRNO_H 1"/ \ | |
82 -e s/'^#undef HAVE_FCNTL_H$'/"#define HAVE_FCNTL_H 1"/ \ | |
83 -e s/'^#undef HAVE_FINITE$'/"#define HAVE_FINITE 1"/ \ | |
84 -e s/'^#undef HAVE_FLOAT_H$'/"#define HAVE_FLOAT_H 1"/ \ | |
85 -e s/'^#undef HAVE_FPRINTF$'/"#define HAVE_FPRINTF 1"/ \ | |
86 -e s/'^#undef HAVE_FTIME$'/"#define HAVE_FTIME 1"/ \ | |
87 -e s/'^#undef HAVE_GETADDRINFO$'/"#define HAVE_GETADDRINFO "/ \ | |
88 -e s/'^#undef HAVE_GETTIMEOFDAY$'/"#define HAVE_GETTIMEOFDAY 1"/ \ | |
89 -e s/'^#undef HAVE_INTTYPES_H$'/"#define HAVE_INTTYPES_H 1"/ \ | |
90 -e s/'^#undef HAVE_ISINF$'/"#define HAVE_ISINF "/ \ | |
91 -e s/'^#undef HAVE_ISNAN$'/"#define HAVE_ISNAN "/ \ | |
92 -e s/'^#undef HAVE_LIBPTHREAD$'/"#define HAVE_LIBPTHREAD "/ \ | |
93 -e s/'^#undef HAVE_LIBZ$'/"#define HAVE_LIBZ 1"/ \ | |
94 -e s/'^#undef HAVE_LIMITS_H$'/"#define HAVE_LIMITS_H 1"/ \ | |
95 -e s/'^#undef HAVE_LOCALTIME$'/"#define HAVE_LOCALTIME 1"/ \ | |
96 -e s/'^#undef HAVE_MATH_H$'/"#define HAVE_MATH_H 1"/ \ | |
97 -e s/'^#undef HAVE_MEMORY_H$'/"#define HAVE_MEMORY_H 1"/ \ | |
98 -e s/'^#undef HAVE_NETDB_H$'/"#define HAVE_NETDB_H 1"/ \ | |
99 -e s/'^#undef HAVE_NETINET_IN_H$'/"#define HAVE_NETINET_IN_H 1"/ \ | |
100 -e s/'^#undef HAVE_PRINTF$'/"#define HAVE_PRINTF 1"/ \ | |
101 -e s/'^#undef HAVE_PTHREAD_H$'/"#define HAVE_PTHREAD_H "/ \ | |
102 -e s/'^#undef HAVE_RESOLV_H$'/"#define HAVE_RESOLV_H 1"/ \ | |
103 -e s/'^#undef HAVE_SIGNAL$'/"#define HAVE_SIGNAL 1"/ \ | |
104 -e s/'^#undef HAVE_SIGNAL_H$'/"#define HAVE_SIGNAL_H 1"/ \ | |
105 -e s/'^#undef HAVE_SNPRINTF$'/"#define HAVE_SNPRINTF 1"/ \ | |
106 -e s/'^#undef HAVE_SPRINTF$'/"#define HAVE_SPRINTF 1"/ \ | |
107 -e s/'^#undef HAVE_SSCANF$'/"#define HAVE_SSCANF 1"/ \ | |
108 -e s/'^#undef HAVE_STAT$'/"#define HAVE_STAT 1"/ \ | |
109 -e s/'^#undef HAVE_STDARG_H$'/"#define HAVE_STDARG_H 1"/ \ | |
110 -e s/'^#undef HAVE_STDINT_H$'/"#define HAVE_STDINT_H 1"/ \ | |
111 -e s/'^#undef HAVE_STDLIB_H$'/"#define HAVE_STDLIB_H 1"/ \ | |
112 -e s/'^#undef HAVE_STRDUP$'/"#define HAVE_STRDUP 1"/ \ | |
113 -e s/'^#undef HAVE_STRERROR$'/"#define HAVE_STRERROR 1"/ \ | |
114 -e s/'^#undef HAVE_STRFTIME$'/"#define HAVE_STRFTIME 1"/ \ | |
115 -e s/'^#undef HAVE_STRINGS_H$'/"#define HAVE_STRINGS_H 1"/ \ | |
116 -e s/'^#undef HAVE_STRING_H$'/"#define HAVE_STRING_H 1"/ \ | |
117 -e s/'^#undef HAVE_SYS_MMAN_H$'/"#define HAVE_SYS_MMAN_H 1"/ \ | |
118 -e s/'^#undef HAVE_SYS_SELECT_H$'/"#define HAVE_SYS_SELECT_H 1"/ \ | |
119 -e s/'^#undef HAVE_SYS_SOCKET_H$'/"#define HAVE_SYS_SOCKET_H 1"/ \ | |
120 -e s/'^#undef HAVE_SYS_STAT_H$'/"#define HAVE_SYS_STAT_H 1"/ \ | |
121 -e s/'^#undef HAVE_SYS_TIMEB_H$'/"#define HAVE_SYS_TIMEB_H 1"/ \ | |
122 -e s/'^#undef HAVE_SYS_TIME_H$'/"#define HAVE_SYS_TIME_H 1"/ \ | |
123 -e s/'^#undef HAVE_SYS_TYPES_H$'/"#define HAVE_SYS_TYPES_H 1"/ \ | |
124 -e s/'^#undef HAVE_TIME_H$'/"#define HAVE_TIME_H 1"/ \ | |
125 -e s/'^#undef HAVE_UNISTD_H$'/"#define HAVE_UNISTD_H 1"/ \ | |
126 -e s/'^#undef HAVE_VA_COPY$'/"#define HAVE_VA_COPY 1"/ \ | |
127 -e s/'^#undef HAVE_VFPRINTF$'/"#define HAVE_VFPRINTF 1"/ \ | |
128 -e s/'^#undef HAVE_VSNPRINTF$'/"#define HAVE_VSNPRINTF 1"/ \ | |
129 -e s/'^#undef HAVE_VSPRINTF$'/"#define HAVE_VSPRINTF 1"/ \ | |
130 -e s/'^#undef HAVE_ZLIB_H$'/"#define HAVE_ZLIB_H 1"/ \ | |
131 -e s/'^#undef PACKAGE_BUGREPORT$'/"#define PACKAGE_BUGREPORT \"\""/ \ | |
132 -e s/'^#undef PACKAGE_NAME$'/"#define PACKAGE_NAME \"\""/ \ | |
133 -e s/'^#undef PACKAGE_STRING$'/"#define PACKAGE_STRING \"\""/ \ | |
134 -e s/'^#undef PACKAGE_TARNAME$'/"#define PACKAGE_TARNAME \"\""/ \ | |
135 -e s/'^#undef PACKAGE_VERSION$'/"#define PACKAGE_VERSION \"\""/ \ | |
136 -e s/'^#undef PROTOTYPES$'/"#define PROTOTYPES 1"/ \ | |
137 -e s/'^#undef STDC_HEADERS$'/"#define STDC_HEADERS 1"/ \ | |
138 -e s/'^#undef SUPPORT_IP6$'/"#define SUPPORT_IP6 "/ \ | |
139 -e s/'^#undef XML_SOCKLEN_T$'/"#define XML_SOCKLEN_T socklen_t"/ \ | |
140 -e s/'^#undef __PROTOTYPES$'/"#define __PROTOTYPES 1"/ \ | |
141 -e s@'^\(#undef .*\)$'@'/* \1 */'@ \ | |
142 < config.h.in \ | |
143 > "${CONFIG_H}.new" | |
144 | |
145 if ! diff -q "${CONFIG_H}.new" "${CONFIG_H}" >& /dev/null ; then | |
146 mv "${CONFIG_H}.new" "${CONFIG_H}" | |
147 else | |
148 rm "${CONFIG_H}.new" | |
149 fi | |
OLD | NEW |