summaryrefslogtreecommitdiffhomepage
path: root/auto/endian
diff options
context:
space:
mode:
Diffstat (limited to 'auto/endian')
-rw-r--r--auto/endian31
1 files changed, 31 insertions, 0 deletions
diff --git a/auto/endian b/auto/endian
new file mode 100644
index 00000000..cb23639b
--- /dev/null
+++ b/auto/endian
@@ -0,0 +1,31 @@
+# Copyright (C) Igor Sysoev
+# Copyright (C) Andrew Clayton
+# Copyright (C) Nginx, Inc.
+
+
+nxt_feature="endianness"
+nxt_feature_name=
+nxt_feature_run=value
+nxt_feature_incs=
+nxt_feature_libs=
+nxt_feature_test="#include <stdint.h>
+ #include <stdio.h>
+
+ int main(void) {
+ int i = 0x11223344;
+ uint8_t *p;
+
+ p = (uint8_t *)&i;
+ if (*p == 0x44)
+ printf(\"little endian\");
+ else
+ printf(\"big endian\");
+ return 0;
+ }"
+. auto/feature
+
+if [ "$nxt_feature_value" = "little endian" ]; then
+ nxt_have=NXT_HAVE_LITTLE_ENDIAN . auto/have
+else
+ nxt_have=NXT_HAVE_BIG_ENDIAN . auto/have
+fi