Hex Artifact Content

Artifact 7f8d7b27ab29f0c428c207e67b0dbc4b9500cc1f:


0000: 23 21 20 2f 62 69 6e 2f 62 61 73 68 0a 0a 23 20  #! /bin/bash..# 
0010: 49 66 20 77 65 20 61 72 65 20 6e 6f 74 20 63 72  If we are not cr
0020: 6f 73 73 2d 63 6f 6d 70 69 6c 69 6e 67 20 74 68  oss-compiling th
0030: 65 6e 20 64 6f 6e 27 74 20 77 6f 72 72 79 20 61  en don't worry a
0040: 62 6f 75 74 20 72 65 70 6c 61 63 69 6e 67 20 22  bout replacing "
0050: 78 6d 6b 6d 66 22 20 77 69 74 68 20 61 20 77 72  xmkmf" with a wr
0060: 61 70 70 65 72 0a 69 66 20 5b 20 2d 7a 20 22 24  apper.if [ -z "$
0070: 7b 4b 43 5f 43 52 4f 53 53 43 4f 4d 50 49 4c 45  {KC_CROSSCOMPILE
0080: 7d 22 20 5d 3b 20 74 68 65 6e 0a 09 23 23 20 49  }" ]; then..## I
0090: 66 20 4b 43 5f 43 52 4f 53 53 43 4f 4d 50 49 4c  f KC_CROSSCOMPIL
00a0: 45 20 77 61 73 20 75 6e 73 70 65 63 69 66 69 65  E was unspecifie
00b0: 64 2c 20 74 72 79 20 74 6f 20 61 75 74 6f 64 65  d, try to autode
00c0: 74 65 63 74 0a 09 69 66 20 5b 20 2d 7a 20 22 24  tect..if [ -z "$
00d0: 7b 43 43 7d 22 20 5d 3b 20 74 68 65 6e 0a 09 09  {CC}" ]; then...
00e0: 65 78 69 74 20 30 0a 09 66 69 0a 0a 09 63 61 73  exit 0..fi...cas
00f0: 65 20 22 24 28 62 61 73 65 6e 61 6d 65 20 22 24  e "$(basename "$
0100: 7b 43 43 7d 22 29 22 20 69 6e 0a 09 09 2a 2d 2a  {CC}")" in...*-*
0110: 2d 2a 29 0a 09 09 09 3b 3b 0a 09 09 2a 29 0a 09  -*)....;;...*)..
0120: 09 09 65 78 69 74 20 30 0a 09 65 73 61 63 0a 65  ..exit 0..esac.e
0130: 6c 73 65 0a 09 23 23 20 49 66 20 4b 43 5f 43 52  lse..## If KC_CR
0140: 4f 53 53 43 4f 4d 50 49 4c 45 20 77 61 73 20 73  OSSCOMPILE was s
0150: 70 65 63 69 66 69 65 64 20 61 73 20 30 2c 20 77  pecified as 0, w
0160: 65 20 61 72 65 20 6e 6f 74 20 63 72 6f 73 73 2d  e are not cross-
0170: 63 6f 6d 70 69 6c 69 6e 67 0a 09 69 66 20 5b 20  compiling..if [ 
0180: 22 24 7b 4b 43 5f 43 52 4f 53 53 43 4f 4d 50 49  "${KC_CROSSCOMPI
0190: 4c 45 7d 22 20 3d 20 27 30 27 20 5d 3b 20 74 68  LE}" = '0' ]; th
01a0: 65 6e 0a 09 09 65 78 69 74 20 30 0a 09 66 69 0a  en...exit 0..fi.
01b0: 0a 09 23 23 20 4f 74 68 65 72 77 69 73 65 2c 20  ..## Otherwise, 
01c0: 77 65 20 61 72 65 20 63 72 6f 73 73 2d 63 6f 6d  we are cross-com
01d0: 70 69 6c 69 6e 67 0a 66 69 0a 0a 23 20 43 72 65  piling.fi..# Cre
01e0: 61 74 65 20 61 6e 20 22 78 6d 6b 6d 66 22 20 77  ate an "xmkmf" w
01f0: 72 61 70 70 65 72 20 77 68 69 63 68 20 65 78 69  rapper which exi
0200: 74 73 20 69 6e 20 66 61 69 6c 75 72 65 20 73 6f  ts in failure so
0210: 20 74 68 61 74 20 61 75 74 6f 63 6f 6e 66 20 77   that autoconf w
0220: 69 6c 6c 20 74 72 79 0a 23 20 74 6f 20 6c 6f 63  ill try.# to loc
0230: 61 74 65 20 68 65 61 64 65 72 73 2f 6c 69 62 72  ate headers/libr
0240: 61 72 69 65 73 20 6e 6f 72 6d 61 6c 6c 79 0a 6d  aries normally.m
0250: 6b 64 69 72 20 66 61 6b 65 2d 62 69 6e 20 3e 2f  kdir fake-bin >/
0260: 64 65 76 2f 6e 75 6c 6c 20 32 3e 2f 64 65 76 2f  dev/null 2>/dev/
0270: 6e 75 6c 6c 0a 0a 63 61 74 20 3c 3c 20 5c 5f 45  null..cat << \_E
0280: 4f 46 5f 20 3e 20 66 61 6b 65 2d 62 69 6e 2f 78  OF_ > fake-bin/x
0290: 6d 6b 6d 66 0a 23 21 20 2f 62 69 6e 2f 62 61 73  mkmf.#! /bin/bas
02a0: 68 0a 65 78 69 74 20 31 0a 5f 45 4f 46 5f 0a 0a  h.exit 1._EOF_..
02b0: 63 68 6d 6f 64 20 2b 78 20 66 61 6b 65 2d 62 69  chmod +x fake-bi
02c0: 6e 2f 78 6d 6b 6d 66 0a                          n/xmkmf.