michael@0: /* michael@0: * env.c michael@0: * michael@0: * prints out a brief report on the build environment michael@0: * michael@0: * David McGrew michael@0: * Cisco Systems, Inc. michael@0: */ michael@0: /* michael@0: * michael@0: * Copyright (c) 2001-2006 Cisco Systems, Inc. michael@0: * All rights reserved. michael@0: * michael@0: * Redistribution and use in source and binary forms, with or without michael@0: * modification, are permitted provided that the following conditions michael@0: * are met: michael@0: * michael@0: * Redistributions of source code must retain the above copyright michael@0: * notice, this list of conditions and the following disclaimer. michael@0: * michael@0: * Redistributions in binary form must reproduce the above michael@0: * copyright notice, this list of conditions and the following michael@0: * disclaimer in the documentation and/or other materials provided michael@0: * with the distribution. michael@0: * michael@0: * Neither the name of the Cisco Systems, Inc. nor the names of its michael@0: * contributors may be used to endorse or promote products derived michael@0: * from this software without specific prior written permission. michael@0: * michael@0: * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS michael@0: * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT michael@0: * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS michael@0: * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE michael@0: * COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, michael@0: * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES michael@0: * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR michael@0: * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) michael@0: * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, michael@0: * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) michael@0: * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED michael@0: * OF THE POSSIBILITY OF SUCH DAMAGE. michael@0: * michael@0: */ michael@0: michael@0: #include michael@0: #include /* for srtcmp() */ michael@0: #include "config.h" michael@0: michael@0: int michael@0: main(void) { michael@0: int err_count = 0; michael@0: char *str; michael@0: michael@0: #ifdef WORDS_BIGENDIAN michael@0: printf("CPU set to big-endian\t\t\t(WORDS_BIGENDIAN == 1)\n"); michael@0: #else michael@0: printf("CPU set to little-endian\t\t(WORDS_BIGENDIAN == 0)\n"); michael@0: #endif michael@0: michael@0: #ifdef CPU_RISC michael@0: printf("CPU set to RISC\t\t\t\t(CPU_RISC == 1)\n"); michael@0: #elif defined(CPU_CISC) michael@0: printf("CPU set to CISC\t\t\t\t(CPU_CISC == 1)\n"); michael@0: #else michael@0: printf("CPU set to an unknown type, probably due to a configuration error\n"); michael@0: err_count++; michael@0: #endif michael@0: michael@0: #ifdef CPU_ALTIVEC michael@0: printf("CPU set to ALTIVEC\t\t\t\t(CPU_ALTIVEC == 0)\n"); michael@0: #endif michael@0: michael@0: #ifndef NO_64BIT_MATH michael@0: printf("using native 64-bit type\t\t(NO_64_BIT_MATH == 0)\n"); michael@0: #else michael@0: printf("using built-in 64-bit math\t\t(NO_64_BIT_MATH == 1)\n"); michael@0: #endif michael@0: michael@0: #ifdef ERR_REPORTING_STDOUT michael@0: printf("using stdout for error reporting\t(ERR_REPORTING_STDOUT == 1)\n"); michael@0: #endif michael@0: michael@0: #ifdef DEV_URANDOM michael@0: str = DEV_URANDOM; michael@0: #else michael@0: str = ""; michael@0: #endif michael@0: printf("using %s as a random source\t(DEV_URANDOM == %s)\n", michael@0: str, str); michael@0: if (strcmp("", str) == 0) { michael@0: err_count++; michael@0: } michael@0: michael@0: if (err_count) michael@0: printf("warning: configuration is probably in error " michael@0: "(found %d problems)\n", err_count); michael@0: michael@0: return err_count; michael@0: }