1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/netwerk/srtp/src/crypto/test/env.c Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,99 @@ 1.4 +/* 1.5 + * env.c 1.6 + * 1.7 + * prints out a brief report on the build environment 1.8 + * 1.9 + * David McGrew 1.10 + * Cisco Systems, Inc. 1.11 + */ 1.12 +/* 1.13 + * 1.14 + * Copyright (c) 2001-2006 Cisco Systems, Inc. 1.15 + * All rights reserved. 1.16 + * 1.17 + * Redistribution and use in source and binary forms, with or without 1.18 + * modification, are permitted provided that the following conditions 1.19 + * are met: 1.20 + * 1.21 + * Redistributions of source code must retain the above copyright 1.22 + * notice, this list of conditions and the following disclaimer. 1.23 + * 1.24 + * Redistributions in binary form must reproduce the above 1.25 + * copyright notice, this list of conditions and the following 1.26 + * disclaimer in the documentation and/or other materials provided 1.27 + * with the distribution. 1.28 + * 1.29 + * Neither the name of the Cisco Systems, Inc. nor the names of its 1.30 + * contributors may be used to endorse or promote products derived 1.31 + * from this software without specific prior written permission. 1.32 + * 1.33 + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 1.34 + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 1.35 + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 1.36 + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 1.37 + * COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, 1.38 + * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 1.39 + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 1.40 + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 1.41 + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, 1.42 + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 1.43 + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED 1.44 + * OF THE POSSIBILITY OF SUCH DAMAGE. 1.45 + * 1.46 + */ 1.47 + 1.48 +#include <stdio.h> 1.49 +#include <string.h> /* for srtcmp() */ 1.50 +#include "config.h" 1.51 + 1.52 +int 1.53 +main(void) { 1.54 + int err_count = 0; 1.55 + char *str; 1.56 + 1.57 +#ifdef WORDS_BIGENDIAN 1.58 + printf("CPU set to big-endian\t\t\t(WORDS_BIGENDIAN == 1)\n"); 1.59 +#else 1.60 + printf("CPU set to little-endian\t\t(WORDS_BIGENDIAN == 0)\n"); 1.61 +#endif 1.62 + 1.63 +#ifdef CPU_RISC 1.64 + printf("CPU set to RISC\t\t\t\t(CPU_RISC == 1)\n"); 1.65 +#elif defined(CPU_CISC) 1.66 + printf("CPU set to CISC\t\t\t\t(CPU_CISC == 1)\n"); 1.67 +#else 1.68 + printf("CPU set to an unknown type, probably due to a configuration error\n"); 1.69 + err_count++; 1.70 +#endif 1.71 + 1.72 +#ifdef CPU_ALTIVEC 1.73 + printf("CPU set to ALTIVEC\t\t\t\t(CPU_ALTIVEC == 0)\n"); 1.74 +#endif 1.75 + 1.76 +#ifndef NO_64BIT_MATH 1.77 + printf("using native 64-bit type\t\t(NO_64_BIT_MATH == 0)\n"); 1.78 +#else 1.79 + printf("using built-in 64-bit math\t\t(NO_64_BIT_MATH == 1)\n"); 1.80 +#endif 1.81 + 1.82 +#ifdef ERR_REPORTING_STDOUT 1.83 + printf("using stdout for error reporting\t(ERR_REPORTING_STDOUT == 1)\n"); 1.84 +#endif 1.85 + 1.86 +#ifdef DEV_URANDOM 1.87 + str = DEV_URANDOM; 1.88 +#else 1.89 + str = ""; 1.90 +#endif 1.91 + printf("using %s as a random source\t(DEV_URANDOM == %s)\n", 1.92 + str, str); 1.93 + if (strcmp("", str) == 0) { 1.94 + err_count++; 1.95 + } 1.96 + 1.97 + if (err_count) 1.98 + printf("warning: configuration is probably in error " 1.99 + "(found %d problems)\n", err_count); 1.100 + 1.101 + return err_count; 1.102 +}