5 # $Date: 2010/04/14 08:59:02 $
6 ######################################################
10 release=`uname -r | cut -b1`
12 CONFFILE="../../Makefile.conf"
22 MAKEOPTS="$MAKEOPTS -j1"
23 CFLAGS="$CFLAGS -ggdb3 -W -Wall -Wextra"
24 CXXFLAGS="$CXXFLAGS -ggdb3 -W -Wall -Wextra"
31 CFLAGS="$CFLAGS -I/usr/local/include"
32 CXXFLAGS="$CXXFLAGS -I/usr/local/include"
33 LDFLAGS="$LDFLAGS -L/usr/local/lib"
35 if [ "$sys" = "Linux" ]
42 if [ "$sys" = "FreeBSD" ]
54 if [ "$OS" = "unknown" ]
56 printf "#############################################################################\n"
57 printf "# Sorry, but sgauth currently supported by Linux, FreeBSD 4.x, 5.x, 6.x #\n"
58 printf "#############################################################################\n"
62 printf "#############################################################################\n"
63 printf " Building sgauth for $sys $release\n"
64 printf "#############################################################################\n"
71 if [ "$OS" = "linux" ]
78 DEFS="$DEFS -DFREE_BSD"
81 DEFS="$DEFS -DFREE_BSD5"
101 printf "Checking CC... "
102 $CC --version > /dev/null 2> /dev/null
106 printf "$CC not found\n"
110 printf "Checking CXX... "
111 $CXX --version > /dev/null 2> /dev/null
115 printf "$CXX not found\n"
120 printf "Checking endianess... "
121 printf "int main() { int probe = 0x00000001; return *(char *)&probe; }\n" > build_check.c
122 $CC $CFLAGS $LDFLAGS build_check.c -o fake > /dev/null 2> /dev/null
126 printf "Endianess checking failed\n"
133 CXXFLAGS="$CXXFLAGS -DARCH_LE"
134 CFLAGS="$CFLAGS -DARCH_LE"
135 printf "Little Endian\n"
138 CXXFLAGS="$CXXFLAGS -DARCH_BE"
139 CFLAGS="$CFLAGS -DARCH_BE"
140 printf "Big Endian\n"
146 printf "OS=$OS\n" > $CONFFILE
147 printf "STG_TIME=yes\n" >> $CONFFILE
148 printf "DEBUG=$DEBUG\n" >> $CONFFILE
149 printf "DIR_BUILD=$BUILD_DIR\n" >> $CONFFILE
150 printf "DIR_LIB=\$(DIR_BUILD)/../../lib\n" >> $CONFFILE
151 printf "DIR_LIBSRC=\$(DIR_BUILD)/../../stglibs\n" >> $CONFFILE
152 printf "DIR_INCLUDE=\$(DIR_BUILD)/../../include\n" >> $CONFFILE
153 printf "ARCH=$ARCH\n" >> $CONFFILE
154 printf "DEFS=$DEFS\n" >> $CONFFILE
155 printf "STG_LIBS=" >> $CONFFILE
158 printf "$lib " >> $CONFFILE
160 printf "\n" >> $CONFFILE
161 printf "LIB_THREAD=$LIB_THREAD\n" >> $CONFFILE
162 printf "CXXFLAGS=$CXXFLAGS\n" >> $CONFFILE
163 printf "CFLAGS=$CFLAGS\n" >> $CONFFILE
164 printf "LDFLAGS=$LDFLAGS\n" >> $CONFFILE
165 printf "PREFIX=$PREFIX\n" >> $CONFFILE
166 printf "BIN_MODE=$BIN_MODE\n" >> $CONFFILE
167 printf "DATA_MODE=$DATA_MODE\n" >> $CONFFILE
168 printf "DIR_MODE=$DIR_MODE\n" >> $CONFFILE
169 printf "OWNER=$OWNER\n" >> $CONFFILE