Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nginx/nginx.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/auto/fmt
diff options
context:
space:
mode:
authorIgor Sysoev <igor@sysoev.ru>2003-11-25 23:44:56 +0300
committerIgor Sysoev <igor@sysoev.ru>2003-11-25 23:44:56 +0300
commita8fa0a6a37b6e90324e0dcbf4733324199623841 (patch)
tree1a7edec9aa04946afc22299bf587823488fb492f /auto/fmt
parentd9d0ca12688034d481e2f1f5cf13a098338ec31d (diff)
nginx-0.0.1-2003-11-25-23:44:56 import
Diffstat (limited to 'auto/fmt')
-rw-r--r--auto/fmt/fmt34
-rw-r--r--auto/fmt/longlong45
2 files changed, 23 insertions, 56 deletions
diff --git a/auto/fmt/fmt b/auto/fmt/fmt
index 695dd33b4..bd66b4114 100644
--- a/auto/fmt/fmt
+++ b/auto/fmt/fmt
@@ -1,22 +1,27 @@
-echo "Checking for $NGX_TYPE printf() format"
+echo "checking for $NGX_TYPE printf() format"
NGX_FMT=NO
for FMT in $NGX_FORMATS
do
- echo "#include <unistd.h>" > autotest.c
echo "#include <stdio.h>" >> autotest.c
echo "#include <sys/types.h>" >> autotest.c
echo "int main() {" >> autotest.c
echo "printf(\"${FMT}\", ($NGX_TYPE) $NGX_MAX_SIZE);" >> autotest.c
echo "return 0; }" >> autotest.c
- eval "${CC_WARN} -o autotest autotest.c > /dev/null 2>&1"
+ eval "$CC_WARN $CC_TEST_FLAGS -o autotest autotest.c > /dev/null 2>&1"
+
+ MAX_SIZE=`echo $NGX_MAX_SIZE | sed -e "s/L*\$//"`
if [ -x ./autotest ]; then
- if [ "`./autotest`" = $NGX_MAX_SIZE ]; then
- echo " + \"${FMT}\" used"
+ if [ "`./autotest`" = $MAX_SIZE ]; then
+ if [ $NGX_FMT_COLLECT = YES ]; then
+ echo " + \"${FMT}\" is appropriate"
+ else
+ echo " + \"${FMT}\" used"
+ fi
NGX_FMT=$FMT
fi
fi
@@ -24,7 +29,12 @@ do
rm autotest*
if [ $NGX_FMT != NO ]; then
- break
+ if [ $NGX_FMT_COLLECT = YES ]; then
+ eval "NGX_${NGX_BYTES}_FMT=\"\${NGX_${NGX_BYTES}_FMT} \$NGX_FMT\""
+ continue
+ else
+ break
+ fi
fi
echo " + \"${FMT}\" is not appropriate"
@@ -32,12 +42,14 @@ done
if [ $NGX_FMT = NO ]; then
- echo "printf() $NGX_TYPE format not found"
+ echo "$0: error: printf() $NGX_TYPE format not found"
exit 1
fi
-echo "#ifndef $NGX_FMT_NAME" >> $NGX_AUTO_CONFIG_H
-echo "#define $NGX_FMT_NAME \"$NGX_FMT\"" >> $NGX_AUTO_CONFIG_H
-echo "#endif" >> $NGX_AUTO_CONFIG_H
-echo >> $NGX_AUTO_CONFIG_H
+if [ $NGX_FMT_COLLECT = NO ]; then
+ echo "#ifndef $NGX_FMT_NAME" >> $NGX_AUTO_CONFIG_H
+ echo "#define $NGX_FMT_NAME \"$NGX_FMT\"" >> $NGX_AUTO_CONFIG_H
+ echo "#endif" >> $NGX_AUTO_CONFIG_H
+ echo >> $NGX_AUTO_CONFIG_H
+fi
diff --git a/auto/fmt/longlong b/auto/fmt/longlong
deleted file mode 100644
index 4a5e0844a..000000000
--- a/auto/fmt/longlong
+++ /dev/null
@@ -1,45 +0,0 @@
-
-echo "Checking for printf() long long format"
-
-NGX_LONG_LONG_FMT=NO
-
- echo "int main() {" > autotest.c
- echo "printf(\"%llu\", (unsigned long long) -1);" >> autotest.c
- echo "return 0; }" >> autotest.c
-
- eval "${CC} -o autotest autotest.c > /dev/null 2>&1"
-
- if [ -x ./autotest -a "`./autotest`" = $NGX_MAX_LONG_LONG ]; then
- echo " + \"%ll\" used"
- NGX_LONG_LONG_FMT="ll"
- else
- echo " + \"%ll\" is not appropriate"
- fi
-
- rm autotest*
-
-
-if [ $NGX_LONG_LONG_FMT = NO ]; then
-
- echo "int main() {" > autotest.c
- echo "printf(\"%qu\", (unsigned long long) -1);" >> autotest.c
- echo "return 0; }" >> autotest.c
-
- eval "${CC} -o autotest autotest.c > /dev/null 2>&1"
-
- if [ -x ./autotest -a "`./autotest`" = $NGX_MAX_LONG_LONG ]; then
- echo " + \"%q\" used"
- NGX_LONG_LONG_FMT="q"
- else
- echo " + \"%q\" is not appropriate"
- fi
-
- rm autotest*
-
-fi
-
-
-if [ $NGX_LONG_LONG_FMT = NO ]; then
- echo "printf() long long format not found"
- exit 1
-fi