OLD | NEW |
1 #!/bin/sh | 1 #!/bin/sh |
2 | 2 |
3 # Copyright (c) 2008 The Chromium Authors. All rights reserved. | 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 | 4 # Use of this source code is governed by a BSD-style license that can be |
5 # found in the LICENSE file. | 5 # found in the LICENSE file. |
6 | 6 |
7 set -ex | 7 set -ex |
8 | 8 |
9 GENERATED_DIR="${CONFIGURATION_TEMP_DIR}/generated" | 9 GENERATED_DIR="${CONFIGURATION_TEMP_DIR}/generated" |
10 | 10 |
11 # Generate config.h the same way that "sh configure" would | 11 # Generate config.h the same way that "sh configure" would |
12 mkdir -p "${GENERATED_DIR}" | 12 mkdir -p "${GENERATED_DIR}" |
13 | 13 |
14 CONFIG_H_IN="$1" | 14 CONFIG_H_IN="$1" |
15 if test "X${CONFIG_H_IN}" = "X"; then | 15 if test "X${CONFIG_H_IN}" = "X"; then |
16 CONFIG_H_IN="open_vcdiff/depot/opensource/open-vcdiff/src/config.h.in" | 16 CONFIG_H_IN="open-vcdiff/src/config.h.in" |
17 fi | 17 fi |
18 | 18 |
19 CONFIG_H="${GENERATED_DIR}/config.h" | 19 CONFIG_H="${GENERATED_DIR}/config.h" |
20 sed -e s/'^#undef HAVE_DLFCN_H$'/'#define HAVE_DLFCN_H 1'/ \ | 20 sed -e s/'^#undef HAVE_DLFCN_H$'/'#define HAVE_DLFCN_H 1'/ \ |
21 -e s/'^#undef HAVE_FNMATCH_H$'/'#define HAVE_FNMATCH_H 1'/ \ | 21 -e s/'^#undef HAVE_FNMATCH_H$'/'#define HAVE_FNMATCH_H 1'/ \ |
22 -e s/'^#undef HAVE_GETOPT_H$'/'#define HAVE_GETOPT_H 1'/ \ | 22 -e s/'^#undef HAVE_GETOPT_H$'/'#define HAVE_GETOPT_H 1'/ \ |
23 -e s/'^#undef HAVE_GETTIMEOFDAY$'/'#define HAVE_GETTIMEOFDAY 1'/ \ | 23 -e s/'^#undef HAVE_GETTIMEOFDAY$'/'#define HAVE_GETTIMEOFDAY 1'/ \ |
24 -e s/'^#undef HAVE_INTTYPES_H$'/'#define HAVE_INTTYPES_H 1'/ \ | 24 -e s/'^#undef HAVE_INTTYPES_H$'/'#define HAVE_INTTYPES_H 1'/ \ |
25 -e s/'^#undef HAVE_MEMORY_H$'/'#define HAVE_MEMORY_H 1'/ \ | 25 -e s/'^#undef HAVE_MEMORY_H$'/'#define HAVE_MEMORY_H 1'/ \ |
26 -e s/'^#undef HAVE_MPROTECT$'/'#define HAVE_MPROTECT 1'/ \ | 26 -e s/'^#undef HAVE_MPROTECT$'/'#define HAVE_MPROTECT 1'/ \ |
(...skipping 23 matching lines...) Expand all Loading... |
50 -e s/'^#undef VERSION$'/'#define VERSION "0.1"'/ \ | 50 -e s/'^#undef VERSION$'/'#define VERSION "0.1"'/ \ |
51 -e s@'^\(#undef .*\)$'@'/* \1 */'@ \ | 51 -e s@'^\(#undef .*\)$'@'/* \1 */'@ \ |
52 < "${CONFIG_H_IN}" \ | 52 < "${CONFIG_H_IN}" \ |
53 > "${CONFIG_H}.new" | 53 > "${CONFIG_H}.new" |
54 | 54 |
55 if ! diff -q "${CONFIG_H}.new" "${CONFIG_H}" >& /dev/null ; then | 55 if ! diff -q "${CONFIG_H}.new" "${CONFIG_H}" >& /dev/null ; then |
56 mv "${CONFIG_H}.new" "${CONFIG_H}" | 56 mv "${CONFIG_H}.new" "${CONFIG_H}" |
57 else | 57 else |
58 rm "${CONFIG_H}.new" | 58 rm "${CONFIG_H}.new" |
59 fi | 59 fi |
OLD | NEW |