Compare commits
No commits in common. 'master' and 'srq_branch' have entirely different histories.
master
...
srq_branch
Before Width: | Height: | Size: 252 KiB |
Before Width: | Height: | Size: 105 KiB |
After Width: | Height: | Size: 150 KiB |
After Width: | Height: | Size: 74 KiB |
After Width: | Height: | Size: 10 KiB |
Before Width: | Height: | Size: 36 KiB After Width: | Height: | Size: 36 KiB |
After Width: | Height: | Size: 50 KiB |
Before Width: | Height: | Size: 12 KiB |
After Width: | Height: | Size: 88 KiB |
Before Width: | Height: | Size: 36 KiB After Width: | Height: | Size: 36 KiB |
Before Width: | Height: | Size: 32 KiB |
Before Width: | Height: | Size: 23 KiB |
Before Width: | Height: | Size: 23 KiB |
Before Width: | Height: | Size: 61 KiB |
Before Width: | Height: | Size: 21 KiB |
Before Width: | Height: | Size: 5.6 KiB |
Before Width: | Height: | Size: 14 KiB |
After Width: | Height: | Size: 9.8 KiB |
After Width: | Height: | Size: 10 KiB |
After Width: | Height: | Size: 20 KiB |
After Width: | Height: | Size: 20 KiB |
After Width: | Height: | Size: 24 KiB |
After Width: | Height: | Size: 19 KiB |
Before Width: | Height: | Size: 36 KiB |
Before Width: | Height: | Size: 23 KiB |
Before Width: | Height: | Size: 21 KiB |
Before Width: | Height: | Size: 38 KiB |
Before Width: | Height: | Size: 17 KiB |
Before Width: | Height: | Size: 23 KiB |
After Width: | Height: | Size: 12 KiB |
After Width: | Height: | Size: 14 KiB |
After Width: | Height: | Size: 13 KiB |
After Width: | Height: | Size: 29 KiB |
After Width: | Height: | Size: 45 KiB |
Before Width: | Height: | Size: 45 KiB |
Before Width: | Height: | Size: 16 KiB |
Before Width: | Height: | Size: 16 KiB |
Before Width: | Height: | Size: 20 KiB |
Before Width: | Height: | Size: 22 KiB |
Before Width: | Height: | Size: 27 KiB |
Before Width: | Height: | Size: 24 KiB |
@ -1,201 +0,0 @@
|
||||
(function() {
|
||||
/*
|
||||
|
||||
Copyright The Closure Library Authors.
|
||||
SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
'use strict';
|
||||
|
||||
function h(a) {
|
||||
var c = 0;
|
||||
return function() {
|
||||
return c < a.length ? {
|
||||
done: !1,
|
||||
value: a[c++]
|
||||
} : {
|
||||
done: !0
|
||||
}
|
||||
}
|
||||
}
|
||||
var l = "function" == typeof Object.defineProperties ? Object.defineProperty : function(a, c, b) {
|
||||
if (a == Array.prototype || a == Object.prototype) return a;
|
||||
a[c] = b.value;
|
||||
return a
|
||||
};
|
||||
|
||||
function m(a) {
|
||||
a = ["object" == typeof globalThis && globalThis, a, "object" == typeof window && window, "object" == typeof self && self, "object" == typeof global && global];
|
||||
for (var c = 0; c < a.length; ++c) {
|
||||
var b = a[c];
|
||||
if (b && b.Math == Math) return b
|
||||
}
|
||||
throw Error("Cannot find global object");
|
||||
}
|
||||
var n = m(this);
|
||||
|
||||
function p(a, c) {
|
||||
if (c) a: {
|
||||
var b = n;a = a.split(".");
|
||||
for (var d = 0; d < a.length - 1; d++) {
|
||||
var e = a[d];
|
||||
if (!(e in b)) break a;
|
||||
b = b[e]
|
||||
}
|
||||
a = a[a.length - 1];d = b[a];c = c(d);c != d && null != c && l(b, a, {
|
||||
configurable: !0,
|
||||
writable: !0,
|
||||
value: c
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
function q(a) {
|
||||
var c = "undefined" != typeof Symbol && Symbol.iterator && a[Symbol.iterator];
|
||||
return c ? c.call(a) : {
|
||||
next: h(a)
|
||||
}
|
||||
}
|
||||
var r = "function" == typeof Object.assign ? Object.assign : function(a, c) {
|
||||
for (var b = 1; b < arguments.length; b++) {
|
||||
var d = arguments[b];
|
||||
if (d)
|
||||
for (var e in d) Object.prototype.hasOwnProperty.call(d, e) && (a[e] = d[e])
|
||||
}
|
||||
return a
|
||||
};
|
||||
p("Object.assign", function(a) {
|
||||
return a || r
|
||||
});
|
||||
p("Array.prototype.fill", function(a) {
|
||||
return a ? a : function(c, b, d) {
|
||||
var e = this.length || 0;
|
||||
0 > b && (b = Math.max(0, e + b));
|
||||
if (null == d || d > e) d = e;
|
||||
d = Number(d);
|
||||
0 > d && (d = Math.max(0, e + d));
|
||||
for (b = Number(b || 0); b < d; b++) this[b] = c;
|
||||
return this
|
||||
}
|
||||
});
|
||||
|
||||
function t(a) {
|
||||
return a ? a : Array.prototype.fill
|
||||
}
|
||||
p("Int8Array.prototype.fill", t);
|
||||
p("Uint8Array.prototype.fill", t);
|
||||
p("Uint8ClampedArray.prototype.fill", t);
|
||||
p("Int16Array.prototype.fill", t);
|
||||
p("Uint16Array.prototype.fill", t);
|
||||
p("Int32Array.prototype.fill", t);
|
||||
p("Uint32Array.prototype.fill", t);
|
||||
p("Float32Array.prototype.fill", t);
|
||||
p("Float64Array.prototype.fill", t);
|
||||
var u = this || self;
|
||||
|
||||
function v(a, c) {
|
||||
a = a.split(".");
|
||||
var b = u;
|
||||
a[0] in b || "undefined" == typeof b.execScript || b.execScript("var " + a[0]);
|
||||
for (var d; a.length && (d = a.shift());) a.length || void 0 === c ? b[d] && b[d] !== Object.prototype[d] ? b = b[d] : b = b[d] = {} : b[d] = c
|
||||
};
|
||||
var w = {
|
||||
color: "white",
|
||||
lineWidth: 4,
|
||||
radius: 6,
|
||||
visibilityMin: .5
|
||||
};
|
||||
|
||||
function x(a) {
|
||||
a = a || {};
|
||||
return Object.assign(Object.assign(Object.assign({}, w), {
|
||||
fillColor: a.color
|
||||
}), a)
|
||||
}
|
||||
|
||||
function y(a, c) {
|
||||
return a instanceof Function ? a(c) : a
|
||||
}
|
||||
|
||||
function z(a, c, b) {
|
||||
return Math.max(Math.min(c, b), Math.min(Math.max(c, b), a))
|
||||
}
|
||||
v("clamp", z);
|
||||
v("drawLandmarks", function(a, c, b) {
|
||||
if (c) {
|
||||
b = x(b);
|
||||
a.save();
|
||||
var d = a.canvas,
|
||||
e = 0;
|
||||
c = q(c);
|
||||
for (var f = c.next(); !f.done; f = c.next())
|
||||
if (f = f.value, void 0 !== f && (void 0 === f.visibility || f.visibility > b.visibilityMin)) {
|
||||
a.fillStyle = y(b.fillColor, {
|
||||
index: e,
|
||||
from: f
|
||||
});
|
||||
a.strokeStyle = y(b.color, {
|
||||
index: e,
|
||||
from: f
|
||||
});
|
||||
a.lineWidth = y(b.lineWidth, {
|
||||
index: e,
|
||||
from: f
|
||||
});
|
||||
var g = new Path2D;
|
||||
g.arc(f.x * d.width, f.y * d.height, y(b.radius, {
|
||||
index: e,
|
||||
from: f
|
||||
}), 0, 2 * Math.PI);
|
||||
a.fill(g);
|
||||
a.stroke(g);
|
||||
++e
|
||||
} a.restore()
|
||||
}
|
||||
});
|
||||
v("drawConnectors", function(a, c, b, d) {
|
||||
if (c && b) {
|
||||
d = x(d);
|
||||
a.save();
|
||||
var e = a.canvas,
|
||||
f = 0;
|
||||
b = q(b);
|
||||
for (var g = b.next(); !g.done; g = b.next()) {
|
||||
var k = g.value;
|
||||
a.beginPath();
|
||||
g = c[k[0]];
|
||||
k = c[k[1]];
|
||||
g && k && (void 0 === g.visibility || g.visibility > d.visibilityMin) && (void 0 === k.visibility || k.visibility > d.visibilityMin) && (a.strokeStyle = y(d.color, {
|
||||
index: f,
|
||||
from: g,
|
||||
to: k
|
||||
}), a.lineWidth = y(d.lineWidth, {
|
||||
index: f,
|
||||
from: g,
|
||||
to: k
|
||||
}), a.moveTo(g.x * e.width, g.y * e.height), a.lineTo(k.x * e.width, k.y * e.height));
|
||||
++f;
|
||||
a.stroke()
|
||||
}
|
||||
a.restore()
|
||||
}
|
||||
});
|
||||
v("drawRectangle", function(a, c, b) {
|
||||
b = x(b);
|
||||
a.save();
|
||||
var d = a.canvas;
|
||||
a.beginPath();
|
||||
a.lineWidth = y(b.lineWidth, {});
|
||||
a.strokeStyle = y(b.color, {});
|
||||
a.fillStyle = y(b.fillColor, {});
|
||||
a.translate(c.xCenter * d.width, c.yCenter * d.height);
|
||||
a.rotate(c.rotation * Math.PI / 180);
|
||||
a.rect(-c.width / 2 * d.width, -c.height / 2 * d.height, c.width * d.width, c.height * d.height);
|
||||
a.translate(-c.xCenter * d.width, -c.yCenter * d.height);
|
||||
a.stroke();
|
||||
a.fill();
|
||||
a.restore()
|
||||
});
|
||||
v("lerp", function(a, c, b, d, e) {
|
||||
return z(d * (1 - (a - c) / (b - c)) + e * (1 - (b - a) / (b - c)), d, e)
|
||||
});
|
||||
}).call(this);
|
@ -1,194 +0,0 @@
|
||||
|
||||
var Module = typeof createMediapipeSolutionsPackedAssets !== 'undefined' ? createMediapipeSolutionsPackedAssets : {};
|
||||
|
||||
if (!Module.expectedDataFileDownloads) {
|
||||
Module.expectedDataFileDownloads = 0;
|
||||
}
|
||||
|
||||
Module.expectedDataFileDownloads++;
|
||||
(function() {
|
||||
// When running as a pthread, FS operations are proxied to the main thread, so we don't need to
|
||||
// fetch the .data bundle on the worker
|
||||
if (Module['ENVIRONMENT_IS_PTHREAD']) return;
|
||||
var loadPackage = function(metadata) {
|
||||
|
||||
var PACKAGE_PATH = '';
|
||||
if (typeof window === 'object') {
|
||||
PACKAGE_PATH = window['encodeURIComponent'](window.location.pathname.toString().substring(0, window.location.pathname.toString().lastIndexOf('/')) + '/');
|
||||
} else if (typeof process === 'undefined' && typeof location !== 'undefined') {
|
||||
// web worker
|
||||
PACKAGE_PATH = encodeURIComponent(location.pathname.toString().substring(0, location.pathname.toString().lastIndexOf('/')) + '/');
|
||||
}
|
||||
var PACKAGE_NAME = 'blaze-out/k8-opt/genfiles/third_party/mediapipe/web/solutions/hands/hands_solution_packed_assets.data';
|
||||
var REMOTE_PACKAGE_BASE = 'hands_solution_packed_assets.data';
|
||||
if (typeof Module['locateFilePackage'] === 'function' && !Module['locateFile']) {
|
||||
Module['locateFile'] = Module['locateFilePackage'];
|
||||
err('warning: you defined Module.locateFilePackage, that has been renamed to Module.locateFile (using your locateFilePackage for now)');
|
||||
}
|
||||
var REMOTE_PACKAGE_NAME = Module['locateFile'] ? Module['locateFile'](REMOTE_PACKAGE_BASE, '') : REMOTE_PACKAGE_BASE;
|
||||
|
||||
var REMOTE_PACKAGE_SIZE = metadata['remote_package_size'];
|
||||
var PACKAGE_UUID = metadata['package_uuid'];
|
||||
|
||||
function fetchRemotePackage(packageName, packageSize, callback, errback) {
|
||||
if (typeof process === 'object' && typeof process.versions === 'object' && typeof process.versions.node === 'string') {
|
||||
require('fs').readFile(packageName, function(err, contents) {
|
||||
if (err) {
|
||||
errback(err);
|
||||
} else {
|
||||
callback(contents.buffer);
|
||||
}
|
||||
});
|
||||
return;
|
||||
}
|
||||
var xhr = new XMLHttpRequest();
|
||||
xhr.open('GET', packageName, true);
|
||||
xhr.responseType = 'arraybuffer';
|
||||
xhr.onprogress = function(event) {
|
||||
var url = packageName;
|
||||
var size = packageSize;
|
||||
if (event.total) size = event.total;
|
||||
if (event.loaded) {
|
||||
if (!xhr.addedTotal) {
|
||||
xhr.addedTotal = true;
|
||||
if (!Module.dataFileDownloads) Module.dataFileDownloads = {};
|
||||
Module.dataFileDownloads[url] = {
|
||||
loaded: event.loaded,
|
||||
total: size
|
||||
};
|
||||
} else {
|
||||
Module.dataFileDownloads[url].loaded = event.loaded;
|
||||
}
|
||||
var total = 0;
|
||||
var loaded = 0;
|
||||
var num = 0;
|
||||
for (var download in Module.dataFileDownloads) {
|
||||
var data = Module.dataFileDownloads[download];
|
||||
total += data.total;
|
||||
loaded += data.loaded;
|
||||
num++;
|
||||
}
|
||||
total = Math.ceil(total * Module.expectedDataFileDownloads/num);
|
||||
if (Module['setStatus']) Module['setStatus']('Downloading data... (' + loaded + '/' + total + ')');
|
||||
} else if (!Module.dataFileDownloads) {
|
||||
if (Module['setStatus']) Module['setStatus']('Downloading data...');
|
||||
}
|
||||
};
|
||||
xhr.onerror = function(event) {
|
||||
throw new Error("NetworkError for: " + packageName);
|
||||
}
|
||||
xhr.onload = function(event) {
|
||||
if (xhr.status == 200 || xhr.status == 304 || xhr.status == 206 || (xhr.status == 0 && xhr.response)) { // file URLs can return 0
|
||||
var packageData = xhr.response;
|
||||
callback(packageData);
|
||||
} else {
|
||||
throw new Error(xhr.statusText + " : " + xhr.responseURL);
|
||||
}
|
||||
};
|
||||
xhr.send(null);
|
||||
};
|
||||
|
||||
function handleError(error) {
|
||||
console.error('package error:', error);
|
||||
};
|
||||
|
||||
var fetchedCallback = null;
|
||||
var fetched = Module['getPreloadedPackage'] ? Module['getPreloadedPackage'](REMOTE_PACKAGE_NAME, REMOTE_PACKAGE_SIZE) : null;
|
||||
|
||||
if (!fetched) fetchRemotePackage(REMOTE_PACKAGE_NAME, REMOTE_PACKAGE_SIZE, function(data) {
|
||||
if (fetchedCallback) {
|
||||
fetchedCallback(data);
|
||||
fetchedCallback = null;
|
||||
} else {
|
||||
fetched = data;
|
||||
}
|
||||
}, handleError);
|
||||
|
||||
function runWithFS() {
|
||||
|
||||
function assert(check, msg) {
|
||||
if (!check) throw msg + new Error().stack;
|
||||
}
|
||||
Module['FS_createPath']("/", "third_party", true, true);
|
||||
Module['FS_createPath']("/third_party", "mediapipe", true, true);
|
||||
Module['FS_createPath']("/third_party/mediapipe", "modules", true, true);
|
||||
Module['FS_createPath']("/third_party/mediapipe/modules", "palm_detection", true, true);
|
||||
Module['FS_createPath']("/third_party/mediapipe/modules", "hand_landmark", true, true);
|
||||
|
||||
/** @constructor */
|
||||
function DataRequest(start, end, audio) {
|
||||
this.start = start;
|
||||
this.end = end;
|
||||
this.audio = audio;
|
||||
}
|
||||
DataRequest.prototype = {
|
||||
requests: {},
|
||||
open: function(mode, name) {
|
||||
this.name = name;
|
||||
this.requests[name] = this;
|
||||
Module['addRunDependency']('fp ' + this.name);
|
||||
},
|
||||
send: function() {},
|
||||
onload: function() {
|
||||
var byteArray = this.byteArray.subarray(this.start, this.end);
|
||||
this.finish(byteArray);
|
||||
},
|
||||
finish: function(byteArray) {
|
||||
var that = this;
|
||||
|
||||
Module['FS_createPreloadedFile'](this.name, null, byteArray, true, true, function() {
|
||||
Module['removeRunDependency']('fp ' + that.name);
|
||||
}, function() {
|
||||
if (that.audio) {
|
||||
Module['removeRunDependency']('fp ' + that.name); // workaround for chromium bug 124926 (still no audio with this, but at least we don't hang)
|
||||
} else {
|
||||
err('Preloading file ' + that.name + ' failed');
|
||||
}
|
||||
}, false, true); // canOwn this data in the filesystem, it is a slide into the heap that will never change
|
||||
|
||||
this.requests[this.name] = null;
|
||||
}
|
||||
};
|
||||
|
||||
var files = metadata['files'];
|
||||
for (var i = 0; i < files.length; ++i) {
|
||||
new DataRequest(files[i]['start'], files[i]['end'], files[i]['audio'] || 0).open('GET', files[i]['filename']);
|
||||
}
|
||||
|
||||
function processPackageData(arrayBuffer) {
|
||||
assert(arrayBuffer, 'Loading data file failed.');
|
||||
assert(arrayBuffer instanceof ArrayBuffer, 'bad input to processPackageData');
|
||||
var byteArray = new Uint8Array(arrayBuffer);
|
||||
var curr;
|
||||
// Reuse the bytearray from the XHR as the source for file reads.
|
||||
DataRequest.prototype.byteArray = byteArray;
|
||||
var files = metadata['files'];
|
||||
for (var i = 0; i < files.length; ++i) {
|
||||
DataRequest.prototype.requests[files[i].filename].onload();
|
||||
} Module['removeRunDependency']('datafile_blaze-out/k8-opt/genfiles/third_party/mediapipe/web/solutions/hands/hands_solution_packed_assets.data');
|
||||
|
||||
};
|
||||
Module['addRunDependency']('datafile_blaze-out/k8-opt/genfiles/third_party/mediapipe/web/solutions/hands/hands_solution_packed_assets.data');
|
||||
|
||||
if (!Module.preloadResults) Module.preloadResults = {};
|
||||
|
||||
Module.preloadResults[PACKAGE_NAME] = {fromCache: false};
|
||||
if (fetched) {
|
||||
processPackageData(fetched);
|
||||
fetched = null;
|
||||
} else {
|
||||
fetchedCallback = processPackageData;
|
||||
}
|
||||
|
||||
}
|
||||
if (Module['calledRun']) {
|
||||
runWithFS();
|
||||
} else {
|
||||
if (!Module['preRun']) Module['preRun'] = [];
|
||||
Module["preRun"].push(runWithFS); // FS is not initialized yet, wait for it
|
||||
}
|
||||
|
||||
}
|
||||
loadPackage({"files": [{"filename": "/third_party/mediapipe/modules/palm_detection/palm_detection_lite.tflite", "start": 0, "end": 1985440}, {"filename": "/third_party/mediapipe/modules/palm_detection/palm_detection_full.tflite", "start": 1985440, "end": 4326720}, {"filename": "/third_party/mediapipe/modules/hand_landmark/handedness.txt", "start": 4326720, "end": 4326731}], "remote_package_size": 4326731, "package_uuid": "f2b11ac8-0259-41a9-b49f-d0fb8d91f87d"});
|
||||
|
||||
})();
|
@ -1,27 +0,0 @@
|
||||
{
|
||||
"name": "@mediapipe/hands",
|
||||
"version": "0.4.1646424915",
|
||||
"description": "Mediapipe Hands Solution",
|
||||
"main": "hands.js",
|
||||
"module": "hands.js",
|
||||
"jsdelivr": "hands.js",
|
||||
"unpkg": "hands.js",
|
||||
"types": "index.d.ts",
|
||||
"author": "mhays@google.com",
|
||||
"license": "Apache-2.0",
|
||||
"homepage": "https://google.github.io/mediapipe/solutions/hands",
|
||||
"keywords": [ "AR", "ML", "Augmented" ],
|
||||
"devDependencies": {
|
||||
},
|
||||
"scripts": {
|
||||
"test": "echo \"Error: no test specified\" && exit 1"
|
||||
},
|
||||
"dependencies": {
|
||||
},
|
||||
"browser": {
|
||||
"node-fetch": false,
|
||||
"util": false,
|
||||
"crypto": false
|
||||
},
|
||||
"sideEffects" : []
|
||||
}
|
@ -1,162 +0,0 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<script src="/static/hand/camera_utils.js" crossorigin="anonymous"></script>
|
||||
<script src="/static/hand/control_utils.js" crossorigin="anonymous"></script>
|
||||
<script src="/static/hand/drawing_utils.js" crossorigin="anonymous"></script>
|
||||
<script src="/static/hand/hands.js" crossorigin="anonymous"></script>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div class="container">
|
||||
<canvas class="output_canvas" width="1280px" height="720px"></canvas>
|
||||
</div>
|
||||
<button id="clean" onclick="clean()">清空</button>
|
||||
<div id="txtHint"></div>
|
||||
<script>
|
||||
function clean() {
|
||||
var obj = document.getElementById("txtHint");
|
||||
obj.innerHTML="";
|
||||
}
|
||||
</script>
|
||||
<script type="module">
|
||||
function ajax(str) {
|
||||
var xmlhttp;
|
||||
if (str.length==0)
|
||||
{
|
||||
document.getElementById("txtHint").innerHTML="";
|
||||
return;
|
||||
}
|
||||
if (window.XMLHttpRequest) xmlhttp=new XMLHttpRequest();
|
||||
else xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
|
||||
xmlhttp.onreadystatechange=function()
|
||||
{
|
||||
if (xmlhttp.readyState==4 && xmlhttp.status==200)
|
||||
{
|
||||
var xml = xmlhttp.responseText
|
||||
xml = xml.slice(33,xml.length-2);
|
||||
document.getElementById("txtHint").innerHTML+=xml;
|
||||
num=0
|
||||
}
|
||||
}
|
||||
xmlhttp.open("GET","/trans?str="+str,true)
|
||||
xmlhttp.send();
|
||||
}
|
||||
|
||||
const videoElement = document.createElement("video");
|
||||
const canvasElement = document.getElementsByClassName('output_canvas')[0];
|
||||
const canvasCtx = canvasElement.getContext('2d');
|
||||
var str =""
|
||||
var pre=str
|
||||
var num=2
|
||||
function onResults(results) {
|
||||
canvasCtx.save();
|
||||
canvasCtx.clearRect(0, 0, canvasElement.width, canvasElement.height);
|
||||
canvasCtx.drawImage(results.image, 0, 0, canvasElement.width, canvasElement.height);
|
||||
if (results.multiHandLandmarks) {
|
||||
var Left=[0,0,0,0,0,0,0,0,0]
|
||||
var Right=[0,0,0,0,0,0,0,0,0]
|
||||
for (let i = 0; i < results.multiHandLandmarks.length; i++) {
|
||||
var hand_lable=results.multiHandedness[i].label
|
||||
if (hand_lable=="Left"){
|
||||
Left[0]=1
|
||||
var wrist=results.multiHandLandmarks[i][0]
|
||||
var index_finger_mcp=results.multiHandLandmarks[i][5]
|
||||
var index_finger_tip=results.multiHandLandmarks[i][8]
|
||||
var middle_finger_mcp=results.multiHandLandmarks[i][9]
|
||||
var middle_finger_tip=results.multiHandLandmarks[i][12]
|
||||
var ring_finger_mcp=results.multiHandLandmarks[i][13]
|
||||
var ring_finger_tip=results.multiHandLandmarks[i][16]
|
||||
var pinky_mcp=results.multiHandLandmarks[i][17]
|
||||
var pinky_tip=results.multiHandLandmarks[i][20]
|
||||
|
||||
var one_x = index_finger_mcp.x-pinky_mcp.x
|
||||
var one_y = index_finger_mcp.y-pinky_mcp.y
|
||||
|
||||
if (Math.abs(one_x)>Math.abs(one_y)) {
|
||||
Left[3]=1;//平
|
||||
if (one_x>0) Left[1]=1;//正
|
||||
var tow = index_finger_mcp.y-wrist.y;
|
||||
if (tow<0) Left[2]=1;//上
|
||||
var length = Math.abs(middle_finger_mcp.y-wrist.y)/3;
|
||||
if (Math.abs(index_finger_tip.y-index_finger_mcp.y)>length) Left[5]=1;
|
||||
if (Math.abs(middle_finger_tip.y-middle_finger_mcp.y)>length) Left[6]=1;
|
||||
if (Math.abs(ring_finger_tip.y-ring_finger_mcp.y)>length) Left[7]=1;
|
||||
if (Math.abs(pinky_tip.y-pinky_mcp.y)>length) Left[8]=1;
|
||||
} else {
|
||||
var length = Math.abs(one_y)/3;
|
||||
if (Math.abs(index_finger_mcp.x-index_finger_tip.x)>length) Left[5]=1;
|
||||
if (Math.abs(middle_finger_mcp.x-middle_finger_tip.x)>length) Left[6]=1;
|
||||
if (Math.abs(ring_finger_mcp.x-ring_finger_tip.x)>length) Left[7]=1;
|
||||
if (Math.abs(pinky_mcp.x-pinky_tip.x)>length) Left[8]=1;
|
||||
}
|
||||
} else {
|
||||
Right[0]=1
|
||||
var wrist=results.multiHandLandmarks[i][0]
|
||||
var index_finger_mcp=results.multiHandLandmarks[i][5]
|
||||
var index_finger_tip=results.multiHandLandmarks[i][8]
|
||||
var middle_finger_mcp=results.multiHandLandmarks[i][9]
|
||||
var middle_finger_tip=results.multiHandLandmarks[i][12]
|
||||
var ring_finger_mcp=results.multiHandLandmarks[i][13]
|
||||
var ring_finger_tip=results.multiHandLandmarks[i][16]
|
||||
var pinky_mcp=results.multiHandLandmarks[i][17]
|
||||
var pinky_tip=results.multiHandLandmarks[i][20]
|
||||
|
||||
var one_x = index_finger_mcp.x-pinky_mcp.x
|
||||
var one_y = index_finger_mcp.y-pinky_mcp.y
|
||||
if (Math.abs(one_x)>Math.abs(one_y)) {
|
||||
Right[3]=1;//平
|
||||
if (one_x>0) Right[1]=1;//正
|
||||
var tow = index_finger_mcp.y-wrist.y;
|
||||
if (tow<0) Right[2]=1;//上
|
||||
var length = Math.abs(middle_finger_mcp.y-wrist.y)/3;
|
||||
if (Math.abs(index_finger_tip.y-index_finger_mcp.y)>length) Right[5]=1;
|
||||
if (Math.abs(middle_finger_tip.y-middle_finger_mcp.y)>length) Right[6]=1;
|
||||
if (Math.abs(ring_finger_tip.y-ring_finger_mcp.y)>length) Right[7]=1;
|
||||
if (Math.abs(pinky_tip.y-pinky_mcp.y)>length) Right[8]=1;
|
||||
} else {
|
||||
var length = Math.abs(one_y)/3;
|
||||
if (Math.abs(index_finger_mcp.x-index_finger_tip.x)>length) Right[5]=1;
|
||||
if (Math.abs(middle_finger_mcp.x-middle_finger_tip.x)>length) Right[6]=1;
|
||||
if (Math.abs(ring_finger_mcp.x-ring_finger_tip.x)>length) Right[7]=1;
|
||||
if (Math.abs(pinky_mcp.x-pinky_tip.x)>length) Right[8]=1;
|
||||
}
|
||||
}
|
||||
pre=str
|
||||
str=''
|
||||
for (let j = 0; j < Left.length; j++) str+=Left[j]
|
||||
str+='|'
|
||||
for (let j = 0; j < Right.length; j++) str+=Right[j]
|
||||
if (pre==str) num=num+1
|
||||
console.log(pre,str,num)
|
||||
if (num==20) ajax(str)
|
||||
drawConnectors(canvasCtx, results.multiHandLandmarks[i], HAND_CONNECTIONS,
|
||||
{color: '#00FF00', lineWidth: 5});
|
||||
drawLandmarks(canvasCtx, results.multiHandLandmarks[i], {color: '#FF0000', lineWidth: 2});
|
||||
}
|
||||
}
|
||||
canvasCtx.restore();
|
||||
}
|
||||
|
||||
const hands = new Hands({locateFile: (file) => {
|
||||
return `/static/hand/${file}`;
|
||||
}});
|
||||
hands.setOptions({
|
||||
maxNumHands: 2,
|
||||
modelComplexity: 1,
|
||||
minDetectionConfidence: 0.5,
|
||||
minTrackingConfidence: 0.5
|
||||
});
|
||||
hands.onResults(onResults);
|
||||
const camera = new Camera(videoElement, {
|
||||
onFrame: async () => {
|
||||
await hands.send({image: videoElement});
|
||||
},
|
||||
width: 1280,
|
||||
height: 720
|
||||
});
|
||||
camera.start();
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
@ -1,81 +0,0 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<script src="https://cdn.jsdelivr.net/npm/@mediapipe/camera_utils/camera_utils.js" crossorigin="anonymous"></script>
|
||||
<script src="https://cdn.jsdelivr.net/npm/@mediapipe/control_utils/control_utils.js" crossorigin="anonymous"></script>
|
||||
<script src="https://cdn.jsdelivr.net/npm/@mediapipe/drawing_utils/drawing_utils.js" crossorigin="anonymous"></script>
|
||||
<script src="https://cdn.jsdelivr.net/npm/@mediapipe/hands/hands.js" crossorigin="anonymous"></script>
|
||||
<title>手语翻译</title>
|
||||
<link rel="stylesheet" type="text/css" href="./main/test1.css">
|
||||
</head>
|
||||
<body>
|
||||
<div class="box">
|
||||
<div class="top">
|
||||
</div>
|
||||
<div class="container">
|
||||
<canvas class="output_canvas"></canvas>
|
||||
</div>
|
||||
<div class="container1">
|
||||
<script type="module">
|
||||
const videoElement = document.createElement("video");
|
||||
const canvasElement = document.getElementsByClassName('output_canvas')[0];
|
||||
const canvasCtx = canvasElement.getContext('2d');
|
||||
|
||||
function onResults(results) {
|
||||
canvasCtx.save();
|
||||
canvasCtx.clearRect(0, 0, canvasElement.width, canvasElement.height);
|
||||
canvasCtx.drawImage(results.image, 0, 0, canvasElement.width, canvasElement.height);
|
||||
if (results.multiHandLandmarks) {
|
||||
for (const landmarks of results.multiHandLandmarks) {
|
||||
console.log(landmarks)
|
||||
drawConnectors(canvasCtx, landmarks, HAND_CONNECTIONS,
|
||||
{color: '#00FF00', lineWidth: 5});
|
||||
drawLandmarks(canvasCtx, landmarks, {color: '#FF0000', lineWidth: 2});
|
||||
}
|
||||
}
|
||||
canvasCtx.restore();
|
||||
}
|
||||
|
||||
const hands = new Hands({locateFile: (file) => {
|
||||
return `https://cdn.jsdelivr.net/npm/@mediapipe/hands/${file}`;
|
||||
}});
|
||||
hands.setOptions({
|
||||
maxNumHands: 2,
|
||||
modelComplexity: 1,
|
||||
minDetectionConfidence: 0.5,
|
||||
minTrackingConfidence: 0.5
|
||||
});
|
||||
hands.onResults(onResults);
|
||||
const camera = new Camera(videoElement, {
|
||||
onFrame: async () => {
|
||||
await hands.send({image: videoElement});
|
||||
},
|
||||
width: 1280,
|
||||
height: 720
|
||||
});
|
||||
camera.start();
|
||||
|
||||
</script>
|
||||
</div>
|
||||
<div class="button1">
|
||||
<button>START</button>
|
||||
<button>DESTORY</button>
|
||||
<button>SUMIT</button>
|
||||
</div>
|
||||
<div class="output">
|
||||
<output name = "shuchu" type = "text"></output>
|
||||
</div>
|
||||
<div class="button2">
|
||||
<a href="./test1.html">
|
||||
<button id="btn4" class="btn">VIDEO</button>
|
||||
</a>
|
||||
<a href="./test2.html">
|
||||
<button id="btn5" class="btn">WORD</button>
|
||||
</a>
|
||||
</div>
|
||||
<script src="https://cdn.jsdelivr.net/npm/@mediapipe/hands/hands_solution_packed_assets_loader.js" crossorigin="anonymous"></script><script src="https://cdn.jsdelivr.net/npm/@mediapipe/hands/hands_solution_simd_wasm_bin.js" crossorigin="anonymous">
|
||||
</script>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
@ -1,36 +0,0 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>手语翻译</title>
|
||||
<link rel="stylesheet" type="text/css" href="./main/test2.css">
|
||||
<script src="https://code.jquery.com/jquery-3.2.1.min.js"></script>
|
||||
<script type="importmap">
|
||||
{
|
||||
"imports":{
|
||||
"three":"./main/three.module.js",
|
||||
"three/addons/":"./main/"
|
||||
}
|
||||
}
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<div class="box">
|
||||
<div id="container">
|
||||
</div>
|
||||
<div class="input">
|
||||
<input id="txt" type="text">
|
||||
<button type="button" id="btn" onclick="loadXMLDoc(txt.value)">start</button>
|
||||
</div>
|
||||
<div class="button2">
|
||||
<a href="./test1.html">
|
||||
<button id="btn4" class="btn4" onclick="add">VIDEO</button>
|
||||
</a>
|
||||
<a href="./test2.html">
|
||||
<button id="btn5" class="btn5">WORD</button>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
<script type="module" src="./main/main2_class2.js" ></script>
|
||||
</html>
|
@ -1,31 +0,0 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>手语翻译</title>
|
||||
<link rel="stylesheet" type="text/css" href="/static/1.css">
|
||||
<script src="/static/three.js-r122/build/three.js"></script>
|
||||
<script src="/static/three.js-r122/examples/jsm/controls/OrbitControls.js" type="module"></script>
|
||||
</head>
|
||||
<body>
|
||||
<div class="box">
|
||||
<div id="container">
|
||||
</div>
|
||||
<div class="input">
|
||||
<input type="text">
|
||||
</div>
|
||||
<div class="button2">
|
||||
<a href="./test1.html">
|
||||
<button id="btn4" class="btn4">VIDEO</button>
|
||||
</a>
|
||||
<a href="./test2.html">
|
||||
<button id="btn5" class="btn5">WORD</button>
|
||||
</a>
|
||||
<a href="./test3.html">
|
||||
<button id="btn6" class="btn6">SETTING</button>
|
||||
</a>
|
||||
</div>
|
||||
<script type="module" src="/static/three.js" ></script>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
@ -0,0 +1,26 @@
|
||||
/*
|
||||
* Copyright (C) 2002-2019 Igor Sysoev
|
||||
* Copyright (C) 2011-2019 Nginx, Inc.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*/
|
@ -0,0 +1,23 @@
|
||||
|
||||
default: build
|
||||
|
||||
clean:
|
||||
rm -rf Makefile objs
|
||||
|
||||
build:
|
||||
$(MAKE) -f objs/Makefile
|
||||
|
||||
install:
|
||||
$(MAKE) -f objs/Makefile install
|
||||
|
||||
modules:
|
||||
$(MAKE) -f objs/Makefile modules
|
||||
|
||||
upgrade:
|
||||
./build/sbin/nginx -t
|
||||
|
||||
kill -USR2 `cat ./build/logs/nginx.pid`
|
||||
sleep 1
|
||||
test -f ./build/logs/nginx.pid.oldbin
|
||||
|
||||
kill -QUIT `cat ./build/logs/nginx.pid.oldbin`
|
@ -0,0 +1,3 @@
|
||||
|
||||
Documentation is available at http://nginx.org
|
||||
|
@ -0,0 +1,14 @@
|
||||
|
||||
# Copyright (C) Igor Sysoev
|
||||
# Copyright (C) Nginx, Inc.
|
||||
|
||||
|
||||
# aCC: HP ANSI C++ B3910B A.03.55.02
|
||||
|
||||
# C89 mode
|
||||
|
||||
CFLAGS="$CFLAGS -Ae"
|
||||
CC_TEST_FLAGS="-Ae"
|
||||
|
||||
PCRE_OPT="$PCRE_OPT -Ae"
|
||||
ZLIB_OPT="$ZLIB_OPT -Ae"
|
@ -0,0 +1,71 @@
|
||||
|
||||
# Copyright (C) Igor Sysoev
|
||||
# Copyright (C) Nginx, Inc.
|
||||
|
||||
|
||||
# Borland C++ 5.5
|
||||
|
||||
# optimizations
|
||||
|
||||
# maximize speed
|
||||
CFLAGS="$CFLAGS -O2"
|
||||
|
||||
case $CPU in
|
||||
pentium)
|
||||
# optimize for Pentium and Athlon
|
||||
CPU_OPT="-5"
|
||||
;;
|
||||
|
||||
pentiumpro)
|
||||
# optimize for Pentium Pro, Pentium II and Pentium III
|
||||
CPU_OPT="-6"
|
||||
;;
|
||||
esac
|
||||
|
||||
# __stdcall
|
||||
#CPU_OPT="$CPU_OPT -ps"
|
||||
# __fastcall
|
||||
#CPU_OPT="$CPU_OPT -pr"
|
||||
|
||||
CFLAGS="$CFLAGS $CPU_OPT"
|
||||
|
||||
# multithreaded
|
||||
CFLAGS="$CFLAGS -tWM"
|
||||
|
||||
# stop on warning
|
||||
CFLAGS="$CFLAGS -w!"
|
||||
|
||||
# disable logo
|
||||
CFLAGS="$CFLAGS -q"
|
||||
|
||||
|
||||
# precompiled headers
|
||||
CORE_DEPS="$CORE_DEPS $NGX_OBJS/ngx_config.csm"
|
||||
NGX_PCH="$NGX_OBJS/ngx_config.csm"
|
||||
NGX_BUILD_PCH="-H=$NGX_OBJS/ngx_config.csm"
|
||||
NGX_USE_PCH="-Hu -H=$NGX_OBJS/ngx_config.csm"
|
||||
|
||||
|
||||
# Win32 GUI mode application
|
||||
#LINK="\$(CC) -laa"
|
||||
|
||||
|
||||
# the resource file
|
||||
NGX_RES="$NGX_OBJS/nginx.res"
|
||||
NGX_RCC="brcc32 -fo$NGX_OBJS/nginx.res \$(CORE_INCS) $NGX_WIN32_RC"
|
||||
# the pragma allows to link the resource file using bcc32 and
|
||||
# to avoid the direct ilink32 calling and the c0w32.obj's WinMain/main problem
|
||||
NGX_PRAGMA="#pragma resource \"$NGX_OBJS/nginx.res\""
|
||||
|
||||
|
||||
ngx_include_opt="-I"
|
||||
ngx_objout="-o"
|
||||
ngx_binout="-e"
|
||||
ngx_objext="obj"
|
||||
|
||||
ngx_long_start='@&&|
|
||||
'
|
||||
ngx_long_end='|'
|
||||
|
||||
ngx_regex_dirsep='\\'
|
||||
ngx_dirsep="\\"
|
@ -0,0 +1,46 @@
|
||||
|
||||
# Copyright (C) Igor Sysoev
|
||||
# Copyright (C) Nginx, Inc.
|
||||
|
||||
|
||||
# Compaq C V6.5-207
|
||||
|
||||
ngx_include_opt="-I"
|
||||
|
||||
# warnings
|
||||
|
||||
CFLAGS="$CFLAGS -msg_enable level6 -msg_fatal level6"
|
||||
|
||||
CFLAGS="$CFLAGS -msg_disable unknownmacro"
|
||||
CFLAGS="$CFLAGS -msg_disable unusedincl"
|
||||
CFLAGS="$CFLAGS -msg_disable unnecincl"
|
||||
CFLAGS="$CFLAGS -msg_disable nestincl"
|
||||
CFLAGS="$CFLAGS -msg_disable strctpadding"
|
||||
CFLAGS="$CFLAGS -msg_disable ansialiascast"
|
||||
CFLAGS="$CFLAGS -msg_disable inlinestoclsmod"
|
||||
CFLAGS="$CFLAGS -msg_disable cxxkeyword"
|
||||
CFLAGS="$CFLAGS -msg_disable longlongsufx"
|
||||
CFLAGS="$CFLAGS -msg_disable valuepres"
|
||||
|
||||
# STUB
|
||||
CFLAGS="$CFLAGS -msg_disable truncintcast"
|
||||
CFLAGS="$CFLAGS -msg_disable trunclongcast"
|
||||
|
||||
CFLAGS="$CFLAGS -msg_disable truncintasn"
|
||||
CFLAGS="$CFLAGS -msg_disable trunclongint"
|
||||
CFLAGS="$CFLAGS -msg_disable intconcastsgn"
|
||||
CFLAGS="$CFLAGS -msg_disable intconstsign"
|
||||
CFLAGS="$CFLAGS -msg_disable switchlong"
|
||||
CFLAGS="$CFLAGS -msg_disable subscrbounds2"
|
||||
|
||||
CFLAGS="$CFLAGS -msg_disable hexoctunsign"
|
||||
|
||||
CFLAGS="$CFLAGS -msg_disable ignorecallval"
|
||||
CFLAGS="$CFLAGS -msg_disable nonstandcast"
|
||||
CFLAGS="$CFLAGS -msg_disable embedcomment"
|
||||
CFLAGS="$CFLAGS -msg_disable unreachcode"
|
||||
CFLAGS="$CFLAGS -msg_disable questcompare2"
|
||||
CFLAGS="$CFLAGS -msg_disable unusedtop"
|
||||
CFLAGS="$CFLAGS -msg_disable unrefdecl"
|
||||
|
||||
CFLAGS="$CFLAGS -msg_disable bitnotint"
|
@ -0,0 +1,99 @@
|
||||
|
||||
# Copyright (C) Nginx, Inc.
|
||||
|
||||
|
||||
# clang
|
||||
|
||||
|
||||
NGX_CLANG_VER=`$CC -v 2>&1 | grep 'version' 2>&1 \
|
||||
| sed -n -e 's/^.*clang version \(.*\)/\1/p' \
|
||||
-e 's/^.*LLVM version \(.*\)/\1/p'`
|
||||
|
||||
echo " + clang version: $NGX_CLANG_VER"
|
||||
|
||||
have=NGX_COMPILER value="\"clang $NGX_CLANG_VER\"" . auto/define
|
||||
|
||||
|
||||
CC_TEST_FLAGS="-pipe"
|
||||
|
||||
|
||||
# optimizations
|
||||
|
||||
#NGX_CLANG_OPT="-O2"
|
||||
#NGX_CLANG_OPT="-Oz"
|
||||
NGX_CLANG_OPT="-O"
|
||||
|
||||
case $CPU in
|
||||
pentium)
|
||||
# optimize for Pentium
|
||||
CPU_OPT="-march=pentium"
|
||||
NGX_CPU_CACHE_LINE=32
|
||||
;;
|
||||
|
||||
pentiumpro | pentium3)
|
||||
# optimize for Pentium Pro, Pentium II and Pentium III
|
||||
CPU_OPT="-march=pentiumpro"
|
||||
NGX_CPU_CACHE_LINE=32
|
||||
;;
|
||||
|
||||
pentium4)
|
||||
# optimize for Pentium 4
|
||||
CPU_OPT="-march=pentium4"
|
||||
NGX_CPU_CACHE_LINE=128
|
||||
;;
|
||||
|
||||
athlon)
|
||||
# optimize for Athlon
|
||||
CPU_OPT="-march=athlon"
|
||||
NGX_CPU_CACHE_LINE=64
|
||||
;;
|
||||
|
||||
opteron)
|
||||
# optimize for Opteron
|
||||
CPU_OPT="-march=opteron"
|
||||
NGX_CPU_CACHE_LINE=64
|
||||
;;
|
||||
|
||||
esac
|
||||
|
||||
CC_AUX_FLAGS="$CC_AUX_FLAGS $CPU_OPT"
|
||||
|
||||
|
||||
CFLAGS="$CFLAGS -pipe $CPU_OPT"
|
||||
|
||||
if [ ".$PCRE_OPT" = "." ]; then
|
||||
PCRE_OPT="-O2 -pipe $CPU_OPT"
|
||||
else
|
||||
PCRE_OPT="$PCRE_OPT -pipe"
|
||||
fi
|
||||
|
||||
if [ ".$ZLIB_OPT" = "." ]; then
|
||||
ZLIB_OPT="-O2 -pipe $CPU_OPT"
|
||||
else
|
||||
ZLIB_OPT="$ZLIB_OPT -pipe"
|
||||
fi
|
||||
|
||||
|
||||
# warnings
|
||||
|
||||
CFLAGS="$CFLAGS $NGX_CLANG_OPT -Wall -Wextra -Wpointer-arith"
|
||||
CFLAGS="$CFLAGS -Wconditional-uninitialized"
|
||||
#CFLAGS="$CFLAGS -Wmissing-prototypes"
|
||||
|
||||
# we have a lot of unused function arguments
|
||||
CFLAGS="$CFLAGS -Wno-unused-parameter"
|
||||
|
||||
# deprecated system OpenSSL library on OS X
|
||||
if [ "$NGX_SYSTEM" = "Darwin" ]; then
|
||||
CFLAGS="$CFLAGS -Wno-deprecated-declarations"
|
||||
fi
|
||||
|
||||
# stop on warning
|
||||
CFLAGS="$CFLAGS -Werror"
|
||||
|
||||
# debug
|
||||
CFLAGS="$CFLAGS -g"
|
||||
|
||||
if [ ".$CPP" = "." ]; then
|
||||
CPP="$CC -E"
|
||||
fi
|
@ -0,0 +1,254 @@
|
||||
|
||||
# Copyright (C) Igor Sysoev
|
||||
# Copyright (C) Nginx, Inc.
|
||||
|
||||
|
||||
LINK="\$(CC)"
|
||||
|
||||
MAIN_LINK=
|
||||
MODULE_LINK="-shared"
|
||||
|
||||
ngx_include_opt="-I "
|
||||
ngx_compile_opt="-c"
|
||||
ngx_pic_opt="-fPIC"
|
||||
ngx_objout="-o "
|
||||
ngx_binout="-o "
|
||||
ngx_objext="o"
|
||||
ngx_binext=
|
||||
ngx_modext=".so"
|
||||
|
||||
ngx_long_start=
|
||||
ngx_long_end=
|
||||
|
||||
ngx_regex_dirsep="\/"
|
||||
ngx_dirsep='/'
|
||||
|
||||
ngx_regex_cont=' \\\
|
||||
'
|
||||
ngx_cont=' \
|
||||
'
|
||||
ngx_tab=' \
|
||||
'
|
||||
ngx_spacer=
|
||||
|
||||
ngx_long_regex_cont=$ngx_regex_cont
|
||||
ngx_long_cont=$ngx_cont
|
||||
|
||||
. auto/cc/name
|
||||
|
||||
if test -n "$CFLAGS"; then
|
||||
|
||||
CC_TEST_FLAGS="$CFLAGS $NGX_CC_OPT"
|
||||
|
||||
case $NGX_CC_NAME in
|
||||
|
||||
ccc)
|
||||
# Compaq C V6.5-207
|
||||
|
||||
ngx_include_opt="-I"
|
||||
;;
|
||||
|
||||
sunc)
|
||||
|
||||
MAIN_LINK=
|
||||
MODULE_LINK="-G"
|
||||
|
||||
case "$NGX_MACHINE" in
|
||||
|
||||
i86pc)
|
||||
NGX_AUX=" src/os/unix/ngx_sunpro_x86.il"
|
||||
;;
|
||||
|
||||
sun4u | sun4v)
|
||||
NGX_AUX=" src/os/unix/ngx_sunpro_sparc64.il"
|
||||
;;
|
||||
|
||||
esac
|
||||
|
||||
case $CPU in
|
||||
|
||||
amd64)
|
||||
NGX_AUX=" src/os/unix/ngx_sunpro_amd64.il"
|
||||
;;
|
||||
|
||||
esac
|
||||
;;
|
||||
|
||||
esac
|
||||
|
||||
else
|
||||
|
||||
case $NGX_CC_NAME in
|
||||
gcc)
|
||||
# gcc 2.7.2.3, 2.8.1, 2.95.4, egcs-1.1.2
|
||||
# 3.0.4, 3.1.1, 3.2.3, 3.3.2, 3.3.3, 3.3.4, 3.4.0, 3.4.2
|
||||
# 4.0.0, 4.0.1, 4.1.0
|
||||
|
||||
. auto/cc/gcc
|
||||
;;
|
||||
|
||||
clang)
|
||||
# Clang C compiler
|
||||
|
||||
. auto/cc/clang
|
||||
;;
|
||||
|
||||
icc)
|
||||
# Intel C++ compiler 7.1, 8.0, 8.1
|
||||
|
||||
. auto/cc/icc
|
||||
;;
|
||||
|
||||
sunc)
|
||||
# Sun C 5.7 Patch 117837-04 2005/05/11
|
||||
|
||||
. auto/cc/sunc
|
||||
;;
|
||||
|
||||
ccc)
|
||||
# Compaq C V6.5-207
|
||||
|
||||
. auto/cc/ccc
|
||||
;;
|
||||
|
||||
acc)
|
||||
# aCC: HP ANSI C++ B3910B A.03.55.02
|
||||
|
||||
. auto/cc/acc
|
||||
;;
|
||||
|
||||
msvc*)
|
||||
# MSVC++ 6.0 SP2, MSVC++ Toolkit 2003
|
||||
|
||||
. auto/cc/msvc
|
||||
;;
|
||||
|
||||
owc)
|
||||
# Open Watcom C 1.0, 1.2
|
||||
|
||||
. auto/cc/owc
|
||||
;;
|
||||
|
||||
bcc)
|
||||
# Borland C++ 5.5
|
||||
|
||||
. auto/cc/bcc
|
||||
;;
|
||||
|
||||
esac
|
||||
|
||||
CC_TEST_FLAGS="$CC_TEST_FLAGS $NGX_CC_OPT"
|
||||
|
||||
fi
|
||||
|
||||
CFLAGS="$CFLAGS $NGX_CC_OPT"
|
||||
NGX_TEST_LD_OPT="$NGX_LD_OPT"
|
||||
|
||||
if [ "$NGX_PLATFORM" != win32 ]; then
|
||||
|
||||
if test -n "$NGX_LD_OPT"; then
|
||||
ngx_feature=--with-ld-opt=\"$NGX_LD_OPT\"
|
||||
ngx_feature_name=
|
||||
ngx_feature_run=no
|
||||
ngx_feature_incs=
|
||||
ngx_feature_path=
|
||||
ngx_feature_libs=
|
||||
ngx_feature_test=
|
||||
. auto/feature
|
||||
|
||||
if [ $ngx_found = no ]; then
|
||||
echo $0: error: the invalid value in --with-ld-opt=\"$NGX_LD_OPT\"
|
||||
echo
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
|
||||
|
||||
ngx_feature="-Wl,-E switch"
|
||||
ngx_feature_name=
|
||||
ngx_feature_run=no
|
||||
ngx_feature_incs=
|
||||
ngx_feature_path=
|
||||
ngx_feature_libs=-Wl,-E
|
||||
ngx_feature_test=
|
||||
. auto/feature
|
||||
|
||||
if [ $ngx_found = yes ]; then
|
||||
MAIN_LINK="-Wl,-E"
|
||||
fi
|
||||
|
||||
|
||||
if [ "$NGX_CC_NAME" = "sunc" ]; then
|
||||
echo "checking for gcc builtin atomic operations ... disabled"
|
||||
else
|
||||
ngx_feature="gcc builtin atomic operations"
|
||||
ngx_feature_name=NGX_HAVE_GCC_ATOMIC
|
||||
ngx_feature_run=yes
|
||||
ngx_feature_incs=
|
||||
ngx_feature_path=
|
||||
ngx_feature_libs=
|
||||
ngx_feature_test="long n = 0;
|
||||
if (!__sync_bool_compare_and_swap(&n, 0, 1))
|
||||
return 1;
|
||||
if (__sync_fetch_and_add(&n, 1) != 1)
|
||||
return 1;
|
||||
if (n != 2)
|
||||
return 1;
|
||||
__sync_synchronize();"
|
||||
. auto/feature
|
||||
fi
|
||||
|
||||
|
||||
if [ "$NGX_CC_NAME" = "ccc" ]; then
|
||||
echo "checking for C99 variadic macros ... disabled"
|
||||
else
|
||||
ngx_feature="C99 variadic macros"
|
||||
ngx_feature_name="NGX_HAVE_C99_VARIADIC_MACROS"
|
||||
ngx_feature_run=yes
|
||||
ngx_feature_incs="#include <stdio.h>
|
||||
#define var(dummy, ...) sprintf(__VA_ARGS__)"
|
||||
ngx_feature_path=
|
||||
ngx_feature_libs=
|
||||
ngx_feature_test="char buf[30]; buf[0] = '0';
|
||||
var(0, buf, \"%d\", 1);
|
||||
if (buf[0] != '1') return 1"
|
||||
. auto/feature
|
||||
fi
|
||||
|
||||
|
||||
ngx_feature="gcc variadic macros"
|
||||
ngx_feature_name="NGX_HAVE_GCC_VARIADIC_MACROS"
|
||||
ngx_feature_run=yes
|
||||
ngx_feature_incs="#include <stdio.h>
|
||||
#define var(dummy, args...) sprintf(args)"
|
||||
ngx_feature_path=
|
||||
ngx_feature_libs=
|
||||
ngx_feature_test="char buf[30]; buf[0] = '0';
|
||||
var(0, buf, \"%d\", 1);
|
||||
if (buf[0] != '1') return 1"
|
||||
. auto/feature
|
||||
|
||||
|
||||
ngx_feature="gcc builtin 64 bit byteswap"
|
||||
ngx_feature_name="NGX_HAVE_GCC_BSWAP64"
|
||||
ngx_feature_run=no
|
||||
ngx_feature_incs=
|
||||
ngx_feature_path=
|
||||
ngx_feature_libs=
|
||||
ngx_feature_test="if (__builtin_bswap64(0)) return 1"
|
||||
. auto/feature
|
||||
|
||||
|
||||
# ngx_feature="inline"
|
||||
# ngx_feature_name=
|
||||
# ngx_feature_run=no
|
||||
# ngx_feature_incs="int inline f(void) { return 1 }"
|
||||
# ngx_feature_path=
|
||||
# ngx_feature_libs=
|
||||
# ngx_feature_test=
|
||||
# . auto/feature
|
||||
#
|
||||
# if [ $ngx_found = yes ]; then
|
||||
# fi
|
||||
|
||||
fi
|
@ -0,0 +1,179 @@
|
||||
|
||||
# Copyright (C) Igor Sysoev
|
||||
# Copyright (C) Nginx, Inc.
|
||||
|
||||
|
||||
# gcc 2.7.2.3, 2.8.1, 2.95.4, egcs-1.1.2
|
||||
# 3.0.4, 3.1.1, 3.2.3, 3.3.2, 3.3.3, 3.3.4, 3.4.0, 3.4.2
|
||||
# 4.0.0, 4.0.1, 4.1.0
|
||||
|
||||
|
||||
NGX_GCC_VER=`$CC -v 2>&1 | grep 'gcc version' 2>&1 \
|
||||
| sed -e 's/^.* version \(.*\)/\1/'`
|
||||
|
||||
echo " + gcc version: $NGX_GCC_VER"
|
||||
|
||||
have=NGX_COMPILER value="\"gcc $NGX_GCC_VER\"" . auto/define
|
||||
|
||||
|
||||
# Solaris 7's /usr/ccs/bin/as does not support "-pipe"
|
||||
|
||||
CC_TEST_FLAGS="-pipe"
|
||||
|
||||
ngx_feature="gcc -pipe switch"
|
||||
ngx_feature_name=
|
||||
ngx_feature_run=no
|
||||
ngx_feature_incs=
|
||||
ngx_feature_path=
|
||||
ngx_feature_libs=
|
||||
ngx_feature_test=
|
||||
. auto/feature
|
||||
|
||||
CC_TEST_FLAGS=
|
||||
|
||||
if [ $ngx_found = yes ]; then
|
||||
PIPE="-pipe"
|
||||
fi
|
||||
|
||||
|
||||
case "$NGX_MACHINE" in
|
||||
|
||||
sun4u | sun4v | sparc | sparc64 )
|
||||
# "-mcpu=v9" enables the "casa" assembler instruction
|
||||
CFLAGS="$CFLAGS -mcpu=v9"
|
||||
;;
|
||||
|
||||
esac
|
||||
|
||||
|
||||
# optimizations
|
||||
|
||||
#NGX_GCC_OPT="-O2"
|
||||
#NGX_GCC_OPT="-Os"
|
||||
NGX_GCC_OPT="-O"
|
||||
|
||||
#CFLAGS="$CFLAGS -fomit-frame-pointer"
|
||||
|
||||
case $CPU in
|
||||
pentium)
|
||||
# optimize for Pentium and Athlon
|
||||
CPU_OPT="-march=pentium"
|
||||
NGX_CPU_CACHE_LINE=32
|
||||
;;
|
||||
|
||||
pentiumpro | pentium3)
|
||||
# optimize for Pentium Pro, Pentium II and Pentium III
|
||||
CPU_OPT="-march=pentiumpro"
|
||||
NGX_CPU_CACHE_LINE=32
|
||||
;;
|
||||
|
||||
pentium4)
|
||||
# optimize for Pentium 4, gcc 3.x
|
||||
CPU_OPT="-march=pentium4"
|
||||
NGX_CPU_CACHE_LINE=128
|
||||
;;
|
||||
|
||||
athlon)
|
||||
# optimize for Athlon, gcc 3.x
|
||||
CPU_OPT="-march=athlon"
|
||||
NGX_CPU_CACHE_LINE=64
|
||||
;;
|
||||
|
||||
opteron)
|
||||
# optimize for Opteron, gcc 3.x
|
||||
CPU_OPT="-march=opteron"
|
||||
NGX_CPU_CACHE_LINE=64
|
||||
;;
|
||||
|
||||
sparc32)
|
||||
# build 32-bit UltraSparc binary
|
||||
CPU_OPT="-m32"
|
||||
CORE_LINK="$CORE_LINK -m32"
|
||||
NGX_CPU_CACHE_LINE=64
|
||||
;;
|
||||
|
||||
sparc64)
|
||||
# build 64-bit UltraSparc binary
|
||||
CPU_OPT="-m64"
|
||||
CORE_LINK="$CORE_LINK -m64"
|
||||
NGX_CPU_CACHE_LINE=64
|
||||
;;
|
||||
|
||||
ppc64)
|
||||
# build 64-bit PowerPC binary
|
||||
CPU_OPT="-m64"
|
||||
CPU_OPT="$CPU_OPT -falign-functions=32 -falign-labels=32"
|
||||
CPU_OPT="$CPU_OPT -falign-loops=32 -falign-jumps=32"
|
||||
CORE_LINK="$CORE_LINK -m64"
|
||||
NGX_CPU_CACHE_LINE=128
|
||||
;;
|
||||
|
||||
esac
|
||||
|
||||
CC_AUX_FLAGS="$CC_AUX_FLAGS $CPU_OPT"
|
||||
|
||||
case "$NGX_GCC_VER" in
|
||||
2.7*)
|
||||
# batch build
|
||||
CPU_OPT=
|
||||
;;
|
||||
esac
|
||||
|
||||
|
||||
CFLAGS="$CFLAGS $PIPE $CPU_OPT"
|
||||
|
||||
if [ ".$PCRE_OPT" = "." ]; then
|
||||
PCRE_OPT="-O2 -fomit-frame-pointer $PIPE $CPU_OPT"
|
||||
else
|
||||
PCRE_OPT="$PCRE_OPT $PIPE"
|
||||
fi
|
||||
|
||||
if [ ".$ZLIB_OPT" = "." ]; then
|
||||
ZLIB_OPT="-O2 -fomit-frame-pointer $PIPE $CPU_OPT"
|
||||
else
|
||||
ZLIB_OPT="$ZLIB_OPT $PIPE"
|
||||
fi
|
||||
|
||||
|
||||
# warnings
|
||||
|
||||
# -W requires at least -O
|
||||
CFLAGS="$CFLAGS ${NGX_GCC_OPT:--O} -W"
|
||||
|
||||
CFLAGS="$CFLAGS -Wall -Wpointer-arith"
|
||||
#CFLAGS="$CFLAGS -Wconversion"
|
||||
#CFLAGS="$CFLAGS -Winline"
|
||||
#CFLAGS="$CFLAGS -Wmissing-prototypes"
|
||||
|
||||
case "$NGX_GCC_VER" in
|
||||
2.*)
|
||||
# we have a lot of the unused function arguments
|
||||
CFLAGS="$CFLAGS -Wno-unused"
|
||||
;;
|
||||
|
||||
*)
|
||||
# we have a lot of the unused function arguments
|
||||
CFLAGS="$CFLAGS -Wno-unused-parameter"
|
||||
# 4.2.1 shows the warning in wrong places
|
||||
#CFLAGS="$CFLAGS -Wunreachable-code"
|
||||
|
||||
# deprecated system OpenSSL library on OS X
|
||||
if [ "$NGX_SYSTEM" = "Darwin" ]; then
|
||||
CFLAGS="$CFLAGS -Wno-deprecated-declarations"
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
|
||||
|
||||
# stop on warning
|
||||
CFLAGS="$CFLAGS -Werror"
|
||||
|
||||
# debug
|
||||
CFLAGS="$CFLAGS -g"
|
||||
|
||||
# DragonFly's gcc3 generates DWARF
|
||||
#CFLAGS="$CFLAGS -g -gstabs"
|
||||
|
||||
if [ ".$CPP" = "." ]; then
|
||||
CPP="$CC -E"
|
||||
fi
|
@ -0,0 +1,117 @@
|
||||
|
||||
# Copyright (C) Igor Sysoev
|
||||
# Copyright (C) Nginx, Inc.
|
||||
|
||||
|
||||
# Intel C++ compiler 7.1, 8.0, 8.1, 9.0, 11.1
|
||||
|
||||
NGX_ICC_VER=`$CC -V 2>&1 | grep 'Version' 2>&1 \
|
||||
| sed -e 's/^.* Version \([^ ]*\) *Build.*$/\1/'`
|
||||
|
||||
echo " + icc version: $NGX_ICC_VER"
|
||||
|
||||
have=NGX_COMPILER value="\"Intel C Compiler $NGX_ICC_VER\"" . auto/define
|
||||
|
||||
|
||||
# optimizations
|
||||
|
||||
CFLAGS="$CFLAGS -O"
|
||||
|
||||
CORE_LINK="$CORE_LINK -opt_report_file=$NGX_OBJS/opt_report_file"
|
||||
|
||||
|
||||
case $CPU in
|
||||
pentium)
|
||||
# optimize for Pentium and Athlon
|
||||
CPU_OPT="-march=pentium"
|
||||
;;
|
||||
|
||||
pentiumpro)
|
||||
# optimize for Pentium Pro, Pentium II and Pentium III
|
||||
CPU_OPT="-mcpu=pentiumpro -march=pentiumpro"
|
||||
;;
|
||||
|
||||
pentium4)
|
||||
# optimize for Pentium 4, default
|
||||
CPU_OPT="-march=pentium4"
|
||||
;;
|
||||
esac
|
||||
|
||||
CFLAGS="$CFLAGS $CPU_OPT"
|
||||
|
||||
if [ ".$PCRE_OPT" = "." ]; then
|
||||
PCRE_OPT="-O $CPU_OPT"
|
||||
fi
|
||||
|
||||
if [ ".$ZLIB_OPT" = "." ]; then
|
||||
ZLIB_OPT="-O $CPU_OPT"
|
||||
fi
|
||||
|
||||
|
||||
# warnings
|
||||
|
||||
CFLAGS="$CFLAGS -w2"
|
||||
|
||||
# disable some warnings
|
||||
|
||||
# invalid type conversion: "int" to "char *"
|
||||
CFLAGS="$CFLAGS -wd171"
|
||||
# argument is incompatible with corresponding format string conversion
|
||||
CFLAGS="$CFLAGS -wd181"
|
||||
# zero used for undefined preprocessing identifier
|
||||
CFLAGS="$CFLAGS -wd193"
|
||||
# the format string ends before this argument
|
||||
CFLAGS="$CFLAGS -wd268"
|
||||
# invalid format string conversion
|
||||
CFLAGS="$CFLAGS -wd269"
|
||||
# conversion from "long long" to "size_t" may lose significant bits
|
||||
CFLAGS="$CFLAGS -wd810"
|
||||
# parameter was never referenced
|
||||
CFLAGS="$CFLAGS -wd869"
|
||||
# attribute "unused" is only allowed in a function definition, warning on pTHX_
|
||||
CFLAGS="$CFLAGS -wd1301"
|
||||
|
||||
# STUB
|
||||
# enumerated type mixed with another type
|
||||
CFLAGS="$CFLAGS -wd188"
|
||||
# controlling expression is constant
|
||||
CFLAGS="$CFLAGS -wd279"
|
||||
# operands are evaluated in unspecified order
|
||||
CFLAGS="$CFLAGS -wd981"
|
||||
# external definition with no prior declaration
|
||||
CFLAGS="$CFLAGS -wd1418"
|
||||
# external declaration in primary source file
|
||||
CFLAGS="$CFLAGS -wd1419"
|
||||
|
||||
case "$NGX_ICC_VER" in
|
||||
9.*)
|
||||
# "cc" clobber ignored, warnings for Linux's htonl()/htons()
|
||||
CFLAGS="$CFLAGS -wd1469"
|
||||
# explicit conversion of a 64-bit integral type to a smaller
|
||||
# integral type
|
||||
CFLAGS="$CFLAGS -wd1683"
|
||||
# conversion from pointer to same-sized integral type,
|
||||
# warning on offsetof()
|
||||
CFLAGS="$CFLAGS -wd1684"
|
||||
# floating-point equality and inequality comparisons are unreliable,
|
||||
# warning on SvTRUE()
|
||||
CFLAGS="$CFLAGS -wd1572"
|
||||
;;
|
||||
|
||||
8.*)
|
||||
# "cc" clobber ignored, warnings for Linux's htonl()/htons()
|
||||
CFLAGS="$CFLAGS -wd1469"
|
||||
# floating-point equality and inequality comparisons are unreliable,
|
||||
# warning on SvTRUE()
|
||||
CFLAGS="$CFLAGS -wd1572"
|
||||
;;
|
||||
|
||||
*)
|
||||
;;
|
||||
esac
|
||||
|
||||
# stop on warning
|
||||
CFLAGS="$CFLAGS -Werror"
|
||||
|
||||
# debug
|
||||
CFLAGS="$CFLAGS -g"
|
@ -0,0 +1,156 @@
|
||||
|
||||
# Copyright (C) Igor Sysoev
|
||||
# Copyright (C) Nginx, Inc.
|
||||
|
||||
|
||||
# MSVC 6.0 SP2 cl 12.00
|
||||
# MSVC Toolkit 2003 (7.1) cl 13.10
|
||||
# MSVC 2005 Express Edition SP1 (8.0) cl 14.00
|
||||
# MSVC 2008 Express Edition (9.0) cl 15.00
|
||||
# MSVC 2010 (10.0) cl 16.00
|
||||
# MSVC 2015 (14.0) cl 19.00
|
||||
|
||||
|
||||
NGX_MSVC_VER=`$NGX_WINE $CC 2>&1 | grep 'Compiler Version' 2>&1 \
|
||||
| sed -e 's/^.* Version \(.*\)/\1/'`
|
||||
|
||||
echo " + cl version: $NGX_MSVC_VER"
|
||||
|
||||
have=NGX_COMPILER value="\"cl $NGX_MSVC_VER\"" . auto/define
|
||||
|
||||
|
||||
ngx_msvc_ver=`echo $NGX_MSVC_VER | sed -e 's/^\([0-9]*\).*/\1/'`
|
||||
|
||||
|
||||
# optimizations
|
||||
|
||||
# maximize speed, equivalent to -Og -Oi -Ot -Oy -Ob2 -Gs -GF -Gy
|
||||
CFLAGS="$CFLAGS -O2"
|
||||
|
||||
# enable global optimization
|
||||
#CFLAGS="$CFLAGS -Og"
|
||||
# enable intrinsic functions
|
||||
#CFLAGS="$CFLAGS -Oi"
|
||||
|
||||
# disable inline expansion
|
||||
#CFLAGS="$CFLAGS -Ob0"
|
||||
# explicit inline expansion
|
||||
#CFLAGS="$CFLAGS -Ob1"
|
||||
# explicit and implicit inline expansion
|
||||
#CFLAGS="$CFLAGS -Ob2"
|
||||
|
||||
# enable frame pointer omission
|
||||
#CFLAGS="$CFLAGS -Oy"
|
||||
# disable stack checking calls
|
||||
#CFLAGS="$CFLAGS -Gs"
|
||||
|
||||
# pools strings as read/write
|
||||
#CFLAGS="$CFLAGS -Gf"
|
||||
# pools strings as read-only
|
||||
#CFLAGS="$CFLAGS -GF"
|
||||
|
||||
|
||||
case $CPU in
|
||||
pentium)
|
||||
# optimize for Pentium and Athlon
|
||||
CPU_OPT="-G5"
|
||||
;;
|
||||
|
||||
pentiumpro)
|
||||
# optimize for Pentium Pro, Pentium II and Pentium III
|
||||
CPU_OPT="-G6"
|
||||
;;
|
||||
|
||||
pentium4)
|
||||
# optimize for Pentium 4, MSVC 7
|
||||
CPU_OPT="-G7"
|
||||
;;
|
||||
esac
|
||||
|
||||
# __cdecl, default, must be used with OpenSSL, md5 asm, and sha1 asm
|
||||
#CPU_OPT="$CPU_OPT -Gd"
|
||||
# __stdcall
|
||||
#CPU_OPT="$CPU_OPT -Gz"
|
||||
# __fastcall
|
||||
#CPU_OPT="$CPU_OPT -Gr"
|
||||
|
||||
|
||||
CFLAGS="$CFLAGS $CPU_OPT"
|
||||
|
||||
|
||||
# warnings
|
||||
|
||||
CFLAGS="$CFLAGS -W4"
|
||||
|
||||
# stop on warning
|
||||
CFLAGS="$CFLAGS -WX"
|
||||
|
||||
# disable logo
|
||||
CFLAGS="$CFLAGS -nologo"
|
||||
|
||||
# the link flags
|
||||
CORE_LINK="$CORE_LINK -link -verbose:lib"
|
||||
|
||||
# link with libcmt.lib, multithreaded
|
||||
LIBC="-MT"
|
||||
# link with msvcrt.dll
|
||||
# however, MSVC Toolkit 2003 has no MSVCRT.LIB
|
||||
#LIBC="-MD"
|
||||
|
||||
CFLAGS="$CFLAGS $LIBC"
|
||||
|
||||
CORE_LIBS="$CORE_LIBS kernel32.lib user32.lib"
|
||||
|
||||
# Win32 GUI mode application
|
||||
#CORE_LINK="$CORE_LINK -subsystem:windows -entry:mainCRTStartup"
|
||||
|
||||
# debug
|
||||
# msvc under Wine issues
|
||||
# C1902: Program database manager mismatch; please check your installation
|
||||
if [ -z "$NGX_WINE" ]; then
|
||||
CFLAGS="$CFLAGS -Zi -Fd$NGX_OBJS/nginx.pdb"
|
||||
CORE_LINK="$CORE_LINK -debug"
|
||||
fi
|
||||
|
||||
|
||||
# MSVC 2005 supports C99 variadic macros
|
||||
if [ "$ngx_msvc_ver" -ge 14 ]; then
|
||||
have=NGX_HAVE_C99_VARIADIC_MACROS . auto/have
|
||||
fi
|
||||
|
||||
|
||||
# precompiled headers
|
||||
CORE_DEPS="$CORE_DEPS $NGX_OBJS/ngx_config.pch"
|
||||
CORE_LINK="$CORE_LINK $NGX_OBJS/ngx_pch.obj"
|
||||
NGX_PCH="$NGX_OBJS/ngx_config.pch"
|
||||
NGX_BUILD_PCH="-Ycngx_config.h -Fp$NGX_OBJS/ngx_config.pch"
|
||||
NGX_USE_PCH="-Yungx_config.h -Fp$NGX_OBJS/ngx_config.pch"
|
||||
|
||||
|
||||
# the resource file
|
||||
NGX_RES="$NGX_OBJS/nginx.res"
|
||||
NGX_RCC="rc -fo$NGX_RES \$(CORE_INCS) $NGX_WIN32_RC"
|
||||
CORE_LINK="$NGX_RES $CORE_LINK"
|
||||
|
||||
|
||||
# dynamic modules
|
||||
#MAIN_LINK="-link -def:$NGX_OBJS/nginx.def"
|
||||
#MODULE_LINK="-LD $NGX_OBJS/nginx.lib"
|
||||
|
||||
|
||||
ngx_pic_opt=
|
||||
ngx_objout="-Fo"
|
||||
ngx_binout="-Fe"
|
||||
ngx_objext="obj"
|
||||
|
||||
ngx_long_start='@<<
|
||||
'
|
||||
ngx_long_end='<<'
|
||||
ngx_long_regex_cont=' \
|
||||
'
|
||||
ngx_long_cont='
|
||||
'
|
||||
|
||||
# MSVC understand / in path
|
||||
#ngx_regex_dirsep='\\'
|
||||
#ngx_dirsep="\\"
|
@ -0,0 +1,70 @@
|
||||
|
||||
# Copyright (C) Igor Sysoev
|
||||
# Copyright (C) Nginx, Inc.
|
||||
|
||||
|
||||
if [ "$NGX_PLATFORM" != win32 ]; then
|
||||
|
||||
ngx_feature="C compiler"
|
||||
ngx_feature_name=
|
||||
ngx_feature_run=yes
|
||||
ngx_feature_incs=
|
||||
ngx_feature_path=
|
||||
ngx_feature_libs=
|
||||
ngx_feature_test=
|
||||
. auto/feature
|
||||
|
||||
if [ $ngx_found = no ]; then
|
||||
echo
|
||||
echo $0: error: C compiler $CC is not found
|
||||
echo
|
||||
exit 1
|
||||
fi
|
||||
|
||||
fi
|
||||
|
||||
|
||||
if [ "$CC" = cl ]; then
|
||||
NGX_CC_NAME=msvc
|
||||
echo " + using Microsoft Visual C++ compiler"
|
||||
|
||||
elif [ "$CC" = wcl386 ]; then
|
||||
NGX_CC_NAME=owc
|
||||
echo " + using Open Watcom C compiler"
|
||||
|
||||
elif [ "$CC" = bcc32 ]; then
|
||||
NGX_CC_NAME=bcc
|
||||
echo " + using Borland C++ compiler"
|
||||
|
||||
elif `$CC -V 2>&1 | grep '^Intel(R) C' >/dev/null 2>&1`; then
|
||||
NGX_CC_NAME=icc
|
||||
echo " + using Intel C++ compiler"
|
||||
|
||||
elif `$CC -v 2>&1 | grep 'gcc version' >/dev/null 2>&1`; then
|
||||
NGX_CC_NAME=gcc
|
||||
echo " + using GNU C compiler"
|
||||
|
||||
elif `$CC -v 2>&1 | grep 'clang version' >/dev/null 2>&1`; then
|
||||
NGX_CC_NAME=clang
|
||||
echo " + using Clang C compiler"
|
||||
|
||||
elif `$CC -v 2>&1 | grep 'LLVM version' >/dev/null 2>&1`; then
|
||||
NGX_CC_NAME=clang
|
||||
echo " + using Clang C compiler"
|
||||
|
||||
elif `$CC -V 2>&1 | grep 'Sun C' >/dev/null 2>&1`; then
|
||||
NGX_CC_NAME=sunc
|
||||
echo " + using Sun C compiler"
|
||||
|
||||
elif `$CC -V 2>&1 | grep '^Compaq C' >/dev/null 2>&1`; then
|
||||
NGX_CC_NAME=ccc
|
||||
echo " + using Compaq C compiler"
|
||||
|
||||
elif `$CC -V 2>&1 | grep '^aCC: ' >/dev/null 2>&1`; then
|
||||
NGX_CC_NAME=acc
|
||||
echo " + using HP aC++ compiler"
|
||||
|
||||
else
|
||||
NGX_CC_NAME=unknown
|
||||
|
||||
fi
|
@ -0,0 +1,103 @@
|
||||
|
||||
# Copyright (C) Igor Sysoev
|
||||
# Copyright (C) Nginx, Inc.
|
||||
|
||||
|
||||
# Open Watcom C 1.0, 1.2, 1.3
|
||||
|
||||
# optimizations
|
||||
|
||||
# maximize speed
|
||||
CFLAGS="$CFLAGS -ot"
|
||||
# reorder instructions for best pipeline usage
|
||||
CFLAGS="$CFLAGS -op"
|
||||
# inline intrinsic functions
|
||||
CFLAGS="$CFLAGS -oi"
|
||||
# inline expansion
|
||||
CFLAGS="$CFLAGS -oe"
|
||||
# disable stack checking calls
|
||||
CFLAGS="$CFLAGS -s"
|
||||
|
||||
case $CPU in
|
||||
pentium)
|
||||
# optimize for Pentium and Athlon
|
||||
# register-based arguments passing conventions
|
||||
CPU_OPT="-5r"
|
||||
# stack-based arguments passing conventions
|
||||
#CPU_OPT="-5s"
|
||||
;;
|
||||
|
||||
pentiumpro)
|
||||
# optimize for Pentium Pro, Pentium II and Pentium III
|
||||
# register-based arguments passing conventions
|
||||
CPU_OPT="-6r"
|
||||
# stack-based arguments passing conventions
|
||||
#CPU_OPT="-6s"
|
||||
;;
|
||||
esac
|
||||
|
||||
CFLAGS="$CFLAGS $CPU_OPT"
|
||||
|
||||
|
||||
# warnings
|
||||
|
||||
# maximum level
|
||||
CFLAGS="$CFLAGS -wx"
|
||||
#CFLAGS="$CFLAGS -w3"
|
||||
|
||||
# stop on warning
|
||||
CFLAGS="$CFLAGS -we"
|
||||
|
||||
# built target is NT
|
||||
CFLAGS="$CFLAGS -bt=nt"
|
||||
|
||||
# multithreaded
|
||||
CFLAGS="$CFLAGS -bm"
|
||||
|
||||
# debug
|
||||
CFLAGS="$CFLAGS -d2"
|
||||
|
||||
# quiet
|
||||
CFLAGS="$CFLAGS -zq"
|
||||
|
||||
# Open Watcom C 1.2
|
||||
have=NGX_HAVE_C99_VARIADIC_MACROS . auto/have
|
||||
|
||||
|
||||
# the precompiled headers
|
||||
#CORE_DEPS="$CORE_DEPS $NGX_OBJS/ngx_config.pch"
|
||||
#NGX_PCH="$NGX_OBJS/ngx_config.pch"
|
||||
#NGX_BUILD_PCH="-fhq=$NGX_OBJS/ngx_config.pch"
|
||||
#NGX_USE_PCH="-fh=$NGX_OBJS/ngx_config.pch"
|
||||
|
||||
|
||||
# the link flags, built target is NT GUI mode application
|
||||
#CORE_LINK="$CORE_LINK -l=nt_win"
|
||||
|
||||
|
||||
# the resource file
|
||||
NGX_RCC="wrc \$(CORE_INCS) -fo=$NGX_OBJS/nginx.res "
|
||||
NGX_RCC="$NGX_RCC $NGX_WIN32_RC $NGX_OBJS/nginx.exe"
|
||||
|
||||
|
||||
ngx_include_opt="-i="
|
||||
ngx_objout="-fo"
|
||||
ngx_binout="-fe="
|
||||
ngx_objext="obj"
|
||||
|
||||
ngx_regex_dirsep='\\'
|
||||
ngx_dirsep="\\"
|
||||
|
||||
ngx_long_start=' '
|
||||
ngx_long_end=' '
|
||||
ngx_long_regex_cont=' \&\
|
||||
'
|
||||
ngx_long_cont=' &
|
||||
'
|
||||
|
||||
ngx_regex_cont=' \&\
|
||||
'
|
||||
ngx_cont=' &
|
||||
'
|
||||
ngx_tab=' &
|
||||
'
|
@ -0,0 +1,163 @@
|
||||
|
||||
# Copyright (C) Igor Sysoev
|
||||
# Copyright (C) Nginx, Inc.
|
||||
|
||||
|
||||
# Sun C 5.7 Patch 117837-04 2005/05/11 Sun Studio 10
|
||||
# Sun C 5.8 2005/10/13 Sun Studio 11
|
||||
# Sun C 5.9 SunOS_i386 2007/05/03 Sun Studio 12
|
||||
# Sun C 5.9 SunOS_sparc 2007/05/03
|
||||
# Sun C 5.10 SunOS_i386 2009/06/03 Sun Studio 12.1
|
||||
# Sun C 5.11 SunOS_i386 2010/08/13 Oracle Solaris Studio 12.2
|
||||
# Sun C 5.12 SunOS_i386 2011/11/16 Oracle Solaris Studio 12.3
|
||||
# Sun C 5.13 SunOS_i386 2014/10/20 Oracle Solaris Studio 12.4
|
||||
# Sun C 5.14 SunOS_i386 2016/05/31 Oracle Developer Studio 12.5
|
||||
|
||||
NGX_SUNC_VER=`$CC -V 2>&1 | grep 'Sun C' 2>&1 \
|
||||
| sed -e 's/^.* Sun C \(.*\)/\1/'`
|
||||
|
||||
echo " + Sun C version: $NGX_SUNC_VER"
|
||||
|
||||
have=NGX_COMPILER value="\"Sun C $NGX_SUNC_VER\"" . auto/define
|
||||
|
||||
|
||||
cat << END > $NGX_AUTOTEST.c
|
||||
|
||||
int main(void) {
|
||||
printf("%d", __SUNPRO_C);
|
||||
return 0;
|
||||
}
|
||||
|
||||
END
|
||||
|
||||
eval "$CC -o $NGX_AUTOTEST $NGX_AUTOTEST.c >> $NGX_ERR 2>&1"
|
||||
|
||||
if [ -x $NGX_AUTOTEST ]; then
|
||||
ngx_sunc_ver=`$NGX_AUTOTEST`
|
||||
fi
|
||||
|
||||
rm -rf $NGX_AUTOTEST*
|
||||
|
||||
# 1424 == 0x590, Sun Studio 12
|
||||
|
||||
if [ "$ngx_sunc_ver" -ge 1424 ]; then
|
||||
ngx_sparc32="-m32"
|
||||
ngx_sparc64="-m64"
|
||||
ngx_amd64="-m64"
|
||||
|
||||
else
|
||||
ngx_sparc32="-xarch=v8plus"
|
||||
ngx_sparc64="-xarch=v9"
|
||||
ngx_amd64="-xarch=amd64"
|
||||
fi
|
||||
|
||||
case "$NGX_MACHINE" in
|
||||
|
||||
i86pc)
|
||||
NGX_AUX=" src/os/unix/ngx_sunpro_x86.il"
|
||||
;;
|
||||
|
||||
sun4u | sun4v)
|
||||
NGX_AUX=" src/os/unix/ngx_sunpro_sparc64.il"
|
||||
;;
|
||||
|
||||
esac
|
||||
|
||||
MAIN_LINK=
|
||||
MODULE_LINK="-G"
|
||||
|
||||
|
||||
# optimizations
|
||||
|
||||
# 20736 == 0x5100, Sun Studio 12.1
|
||||
|
||||
if [ "$ngx_sunc_ver" -ge 20736 ]; then
|
||||
ngx_fast="-fast"
|
||||
|
||||
else
|
||||
# older versions had problems with bit-fields
|
||||
ngx_fast="-fast -xalias_level=any"
|
||||
fi
|
||||
|
||||
IPO=-xipo
|
||||
CFLAGS="$CFLAGS $ngx_fast $IPO"
|
||||
CORE_LINK="$CORE_LINK $ngx_fast $IPO"
|
||||
|
||||
|
||||
case $CPU in
|
||||
pentium)
|
||||
# optimize for Pentium and Athlon
|
||||
CPU_OPT="-xchip=pentium"
|
||||
;;
|
||||
|
||||
pentiumpro)
|
||||
# optimize for Pentium Pro, Pentium II
|
||||
CPU_OPT="-xchip=pentium_pro"
|
||||
;;
|
||||
|
||||
pentium3)
|
||||
# optimize for Pentium III
|
||||
CPU_OPT="-xchip=pentium3"
|
||||
#CPU_OPT="$CPU_OPT -xarch=sse"
|
||||
CPU_OPT="$CPU_OPT -xcache=16/32/4:256/32/4"
|
||||
;;
|
||||
|
||||
pentium4)
|
||||
# optimize for Pentium 4
|
||||
CPU_OPT="-xchip=pentium4"
|
||||
#CPU_OPT="$CPU_OPT -xarch=sse2"
|
||||
CPU_OPT="$CPU_OPT -xcache=8/64/4:256/128/8"
|
||||
;;
|
||||
|
||||
opteron)
|
||||
# optimize for Opteron
|
||||
CPU_OPT="-xchip=opteron"
|
||||
#CPU_OPT="$CPU_OPT -xarch=sse2"
|
||||
CPU_OPT="$CPU_OPT -xcache=64/64/2:1024/64/16"
|
||||
;;
|
||||
|
||||
sparc32)
|
||||
# build 32-bit UltraSparc binary
|
||||
CPU_OPT="$ngx_sparc32"
|
||||
CORE_LINK="$CORE_LINK $ngx_sparc32"
|
||||
CC_AUX_FLAGS="$CC_AUX_FLAGS $ngx_sparc32"
|
||||
NGX_CPU_CACHE_LINE=64
|
||||
;;
|
||||
|
||||
sparc64)
|
||||
# build 64-bit UltraSparc binary
|
||||
CPU_OPT="$ngx_sparc64"
|
||||
CORE_LINK="$CORE_LINK $ngx_sparc64"
|
||||
CC_AUX_FLAGS="$CC_AUX_FLAGS $ngx_sparc64"
|
||||
NGX_CPU_CACHE_LINE=64
|
||||
;;
|
||||
|
||||
amd64)
|
||||
# build 64-bit amd64 binary
|
||||
CPU_OPT="$ngx_amd64"
|
||||
CORE_LINK="$CORE_LINK $ngx_amd64"
|
||||
CC_AUX_FLAGS="$CC_AUX_FLAGS $ngx_amd64"
|
||||
NGX_AUX=" src/os/unix/ngx_sunpro_amd64.il"
|
||||
NGX_CPU_CACHE_LINE=64
|
||||
;;
|
||||
|
||||
esac
|
||||
|
||||
|
||||
CFLAGS="$CFLAGS $CPU_OPT"
|
||||
|
||||
|
||||
if [ ".$PCRE_OPT" = "." ]; then
|
||||
PCRE_OPT="$ngx_fast $IPO $CPU_OPT"
|
||||
fi
|
||||
|
||||
if [ ".$ZLIB_OPT" = "." ]; then
|
||||
ZLIB_OPT="$ngx_fast $IPO $CPU_OPT"
|
||||
fi
|
||||
|
||||
|
||||
# stop on warning
|
||||
CFLAGS="$CFLAGS -errwarn=%all"
|
||||
|
||||
# debug
|
||||
CFLAGS="$CFLAGS -g"
|
@ -0,0 +1,12 @@
|
||||
|
||||
# Copyright (C) Igor Sysoev
|
||||
# Copyright (C) Nginx, Inc.
|
||||
|
||||
|
||||
cat << END >> $NGX_AUTO_CONFIG_H
|
||||
|
||||
#ifndef $have
|
||||
#define $have $value
|
||||
#endif
|
||||
|
||||
END
|
@ -0,0 +1,50 @@
|
||||
|
||||
# Copyright (C) Igor Sysoev
|
||||
# Copyright (C) Nginx, Inc.
|
||||
|
||||
|
||||
echo $ngx_n "checking for system byte ordering ...$ngx_c"
|
||||
|
||||
cat << END >> $NGX_AUTOCONF_ERR
|
||||
|
||||
----------------------------------------
|
||||
checking for system byte ordering
|
||||
|
||||
END
|
||||
|
||||
|
||||
cat << END > $NGX_AUTOTEST.c
|
||||
|
||||
int main(void) {
|
||||
int i = 0x11223344;
|
||||
char *p;
|
||||
|
||||
p = (char *) &i;
|
||||
if (*p == 0x44) return 0;
|
||||
return 1;
|
||||
}
|
||||
|
||||
END
|
||||
|
||||
ngx_test="$CC $CC_TEST_FLAGS $CC_AUX_FLAGS \
|
||||
-o $NGX_AUTOTEST $NGX_AUTOTEST.c $NGX_LD_OPT $ngx_feature_libs"
|
||||
|
||||
eval "$ngx_test >> $NGX_AUTOCONF_ERR 2>&1"
|
||||
|
||||
if [ -x $NGX_AUTOTEST ]; then
|
||||
if $NGX_AUTOTEST >/dev/null 2>&1; then
|
||||
echo " little endian"
|
||||
have=NGX_HAVE_LITTLE_ENDIAN . auto/have
|
||||
else
|
||||
echo " big endian"
|
||||
fi
|
||||
|
||||
rm -rf $NGX_AUTOTEST*
|
||||
|
||||
else
|
||||
rm -rf $NGX_AUTOTEST*
|
||||
|
||||
echo
|
||||
echo "$0: error: cannot detect system byte ordering"
|
||||
exit 1
|
||||
fi
|
@ -0,0 +1,123 @@
|
||||
|
||||
# Copyright (C) Igor Sysoev
|
||||
# Copyright (C) Nginx, Inc.
|
||||
|
||||
|
||||
echo $ngx_n "checking for $ngx_feature ...$ngx_c"
|
||||
|
||||
cat << END >> $NGX_AUTOCONF_ERR
|
||||
|
||||
----------------------------------------
|
||||
checking for $ngx_feature
|
||||
|
||||
END
|
||||
|
||||
ngx_found=no
|
||||
|
||||
if test -n "$ngx_feature_name"; then
|
||||
ngx_have_feature=`echo $ngx_feature_name \
|
||||
| tr abcdefghijklmnopqrstuvwxyz ABCDEFGHIJKLMNOPQRSTUVWXYZ`
|
||||
fi
|
||||
|
||||
if test -n "$ngx_feature_path"; then
|
||||
for ngx_temp in $ngx_feature_path; do
|
||||
ngx_feature_inc_path="$ngx_feature_inc_path -I $ngx_temp"
|
||||
done
|
||||
fi
|
||||
|
||||
cat << END > $NGX_AUTOTEST.c
|
||||
|
||||
#include <sys/types.h>
|
||||
$NGX_INCLUDE_UNISTD_H
|
||||
$ngx_feature_incs
|
||||
|
||||
int main(void) {
|
||||
$ngx_feature_test;
|
||||
return 0;
|
||||
}
|
||||
|
||||
END
|
||||
|
||||
|
||||
ngx_test="$CC $CC_TEST_FLAGS $CC_AUX_FLAGS $ngx_feature_inc_path \
|
||||
-o $NGX_AUTOTEST $NGX_AUTOTEST.c $NGX_TEST_LD_OPT $ngx_feature_libs"
|
||||
|
||||
ngx_feature_inc_path=
|
||||
|
||||
eval "/bin/sh -c \"$ngx_test\" >> $NGX_AUTOCONF_ERR 2>&1"
|
||||
|
||||
|
||||
if [ -x $NGX_AUTOTEST ]; then
|
||||
|
||||
case "$ngx_feature_run" in
|
||||
|
||||
yes)
|
||||
# /bin/sh is used to intercept "Killed" or "Abort trap" messages
|
||||
if /bin/sh -c $NGX_AUTOTEST >> $NGX_AUTOCONF_ERR 2>&1; then
|
||||
echo " found"
|
||||
ngx_found=yes
|
||||
|
||||
if test -n "$ngx_feature_name"; then
|
||||
have=$ngx_have_feature . auto/have
|
||||
fi
|
||||
|
||||
else
|
||||
echo " found but is not working"
|
||||
fi
|
||||
;;
|
||||
|
||||
value)
|
||||
# /bin/sh is used to intercept "Killed" or "Abort trap" messages
|
||||
if /bin/sh -c $NGX_AUTOTEST >> $NGX_AUTOCONF_ERR 2>&1; then
|
||||
echo " found"
|
||||
ngx_found=yes
|
||||
|
||||
cat << END >> $NGX_AUTO_CONFIG_H
|
||||
|
||||
#ifndef $ngx_feature_name
|
||||
#define $ngx_feature_name `$NGX_AUTOTEST`
|
||||
#endif
|
||||
|
||||
END
|
||||
else
|
||||
echo " found but is not working"
|
||||
fi
|
||||
;;
|
||||
|
||||
bug)
|
||||
# /bin/sh is used to intercept "Killed" or "Abort trap" messages
|
||||
if /bin/sh -c $NGX_AUTOTEST >> $NGX_AUTOCONF_ERR 2>&1; then
|
||||
echo " not found"
|
||||
|
||||
else
|
||||
echo " found"
|
||||
ngx_found=yes
|
||||
|
||||
if test -n "$ngx_feature_name"; then
|
||||
have=$ngx_have_feature . auto/have
|
||||
fi
|
||||
fi
|
||||
;;
|
||||
|
||||
*)
|
||||
echo " found"
|
||||
ngx_found=yes
|
||||
|
||||
if test -n "$ngx_feature_name"; then
|
||||
have=$ngx_have_feature . auto/have
|
||||
fi
|
||||
;;
|
||||
|
||||
esac
|
||||
|
||||
else
|
||||
echo " not found"
|
||||
|
||||
echo "----------" >> $NGX_AUTOCONF_ERR
|
||||
cat $NGX_AUTOTEST.c >> $NGX_AUTOCONF_ERR
|
||||
echo "----------" >> $NGX_AUTOCONF_ERR
|
||||
echo $ngx_test >> $NGX_AUTOCONF_ERR
|
||||
echo "----------" >> $NGX_AUTOCONF_ERR
|
||||
fi
|
||||
|
||||
rm -rf $NGX_AUTOTEST*
|
@ -0,0 +1,12 @@
|
||||
|
||||
# Copyright (C) Igor Sysoev
|
||||
# Copyright (C) Nginx, Inc.
|
||||
|
||||
|
||||
cat << END >> $NGX_AUTO_CONFIG_H
|
||||
|
||||
#ifndef $have
|
||||
#define $have 1
|
||||
#endif
|
||||
|
||||
END
|
@ -0,0 +1,12 @@
|
||||
|
||||
# Copyright (C) Igor Sysoev
|
||||
# Copyright (C) Nginx, Inc.
|
||||
|
||||
|
||||
cat << END >> $NGX_AUTO_HEADERS_H
|
||||
|
||||
#ifndef $have
|
||||
#define $have 1
|
||||
#endif
|
||||
|
||||
END
|