3 # ngIRCd -- The Next Generation IRC Daemon
4 # Copyright (c)2001-2010 Alexander Barton <alex@barton.de>
6 # This program is free software; you can redistribute it and/or modify
7 # it under the terms of the GNU General Public License as published by
8 # the Free Software Foundation; either version 2 of the License, or
9 # (at your option) any later version.
10 # Please read the file COPYING, README and AUTHORS for more information.
13 # This script analyzes the build process of ngIRCd and generates output
14 # suitable for inclusion in doc/Platforms.txt -- please send reports
15 # to the ngIRCd mailing list: <ngircd-ml@ngircd.barton.de>.
23 DATE=`date "+%y-%m-%d"`
31 while [ $# -gt 0 ]; do
37 echo "Usage: $NAME [-v]"
43 echo "$NAME: Checking ngIRCd base source directory ..."
44 grep "ngIRCd" ./ChangeLog >/dev/null 2>&1
46 grep "ngIRCd" ../ChangeLog >/dev/null 2>&1
48 echo "$NAME: ngIRCd base source directory not found!?"
54 echo "$NAME: Checking for \"./autogen.sh\" script ..."
55 if [ -r ./autogen.sh ]; then
56 echo "$NAME: Running \"./autogen.sh\" ..."
57 [ -n "$VERBOSE" ] && ./autogen.sh || ./autogen.sh >/dev/null
60 if [ -r ./configure ]; then
61 echo "$NAME: Running \"./configure\" script ..."
62 [ -n "$VERBOSE" ] && ./configure || ./configure >/dev/null
63 if [ $? -eq 0 -a -r ./Makefile ]; then
65 echo "$NAME: Running \"make\" ..."
66 [ -n "$VERBOSE" ] && make || make >/dev/null
67 if [ $? -eq 0 -a -x src/ngircd/ngircd ]; then
69 echo "$NAME: Running \"make check\" ..."
70 [ -n "$VERBOSE" ] && make check || make check >/dev/null
75 ./src/ngircd/ngircd --help 2>/dev/null \
76 | grep "^ngircd" >/dev/null
83 # Get target platform information
84 if [ -r "src/config.h" ]; then
85 CPU=`grep "TARGET_CPU" "src/config.h" | cut -d'"' -f2`
86 OS=`grep "TARGET_OS" "src/config.h" | cut -d'"' -f2`
87 VENDOR=`grep "TARGET_VENDOR" "src/config.h" | cut -d'"' -f2`
88 PLATFORM="$CPU/$VENDOR/$OS"
90 if [ -z "$PLATFORM" ]; then
91 PLATFORM="`uname 2>/dev/null` `uname -r 2>/dev/null`, `uname -m 2>/dev/null`"
94 # Get compiler information
95 if [ -r "Makefile" ]; then
96 CC=$(grep "^CC = " Makefile | cut -d' ' -f3)
97 $CC --version 2>&1 | grep -i "GCC" >/dev/null
99 COMPILER=$($CC --version | head -1 | awk "{ print \$3 }" \
101 COMPILER="gcc $COMPILER"
105 v="`$CC --version 2>/dev/null | head -1`"
106 [ -n "$v" ] && COMPILER="gcc $v"
112 # Get ngIRCd version information
113 eval $(grep "^VERSION = " Makefile | sed -e 's/ //g')
116 VERSION=`echo "$VERSION" | cut -d'-' -f3 | cut -b2-`
119 [ -n "$VERSION" ] || VERSION="unknown"
121 # Get IO interface information
122 if [ "$OS" = "linux-gnu" ]; then
125 grep "^#define HAVE_SYS_DEVPOLL_H 1" src/config.h >/dev/null 2>&1
126 [ $? -eq 0 ] && COMMENT="(4)"
127 grep "^#define HAVE_EPOLL_CREATE 1" src/config.h >/dev/null 2>&1
128 [ $? -eq 0 ] && COMMENT="(5)"
129 grep "^#define HAVE_KQUEUE 1" src/config.h >/dev/null 2>&1
130 [ $? -eq 0 ] && COMMENT="(3)"
133 [ -n "$CONFIGURE" ] && C="Y" || C="N"
134 [ -n "$MAKE" ] && M="Y" || M="N"
135 [ -n "$CHECK" ] && T="Y" || T="N"
136 [ -n "$RUN" ] && R="Y" || R="N"
137 [ -n "$COMMENT" ] && COMMENT=" $COMMENT"
140 echo " the executable works (\"runs\") as expected --+"
141 echo " tests run successfully (\"make check\") --+ |"
142 echo " ngIRCd compiles (\"make\") --+ | |"
143 echo " ./configure works --+ | | |"
145 echo "Platform Compiler ngIRCd Date Tester C M T R See"
146 echo "--------------------------- ------------ ---------- -------- ------ - - - - ---"
147 type printf >/dev/null 2>&1
148 if [ $? -eq 0 ]; then
149 printf "%-27s %-12s %-10s %s %-6s %s %s %s %s%s" \
150 "$PLATFORM" "$COMPILER" "$VERSION" "$DATE" "$USER" \
151 "$C" "$M" "$T" "$R" "$COMMENT"
153 echo "$PLATFORM $COMPILER $VERSION $DATE $USER" \
154 "$C" "$M" "$T" "$R" "$COMMENT"