5 # $Date: 2010/04/14 08:58:44 $
6 ######################################################
10 release=`uname -r | cut -b1`
12 CONFFILE="../../Makefile.conf"
22 MAKEOPTS="$MAKEOPTS -j1"
23 CXXFLAGS="$CXXFLAGS -ggdb3 -W -Wall -Wextra"
30 CXXFLAGS="$CXXFLAGS -I/usr/local/include"
31 LDFLAGS="$LDFLAGS -L/usr/local/lib"
33 if [ "$sys" = "Linux" ]
40 if [ "$sys" = "FreeBSD" ]
54 if [ "$OS" = "unknown" ]
56 printf "#############################################################################\n"
57 printf "# Sorry, but rlm_stg currently supported by Linux, FreeBSD 4.x, 5.x, 6.x #\n"
58 printf "#############################################################################\n"
62 printf "#############################################################################\n"
63 printf " Building rlm_stg for $sys $release\n"
64 printf "#############################################################################\n"
66 STG_LIBS="crypto.lib common.lib"
68 if [ "$OS" = "linux" ]
75 DEFS="$DEFS -DFREE_BSD"
77 DEFS="$DEFS -DFREE_BSD5"
85 CXXFLAGS="$CXXFLAGS -DHAVE_CLOSEFROM"
98 printf "Checking CC... "
99 $CC --version > /dev/null 2> /dev/null
103 printf "$CC not found\n"
107 printf "Checking CXX... "
108 $CXX --version > /dev/null 2> /dev/null
112 printf "$CXX not found\n"
117 printf "Checking endianess... "
118 printf "int main() { int probe = 0x00000001; return *(char *)&probe; }\n" > build_check.c
119 $CC $CFLAGS $LDFLAGS build_check.c -o fake > /dev/null 2> /dev/null
123 printf "Endianess checking failed\n"
130 CXXFLAGS="$CXXFLAGS -DARCH_LE"
131 CFLAGS="$CFLAGS -DARCH_LE"
132 printf "Little Endian\n"
135 CXXFLAGS="$CXXFLAGS -DARCH_BE"
136 CFLAGS="$CFLAGS -DARCH_BE"
137 printf "Big Endian\n"
142 printf "OS=$OS\n" > $CONFFILE
143 printf "STG_TIME=yes\n" >> $CONFFILE
144 printf "DEBUG=$DEBUG\n" >> $CONFFILE
145 printf "DIR_BUILD=$BUILD_DIR\n" >> $CONFFILE
146 printf "DIR_LIB=\$(DIR_BUILD)/../../lib\n" >> $CONFFILE
147 printf "DIR_LIBSRC=\$(DIR_BUILD)/../../stglibs\n" >> $CONFFILE
148 printf "DIR_INCLUDE=\$(DIR_BUILD)/../../include\n" >> $CONFFILE
149 printf "ARCH=$ARCH\n" >> $CONFFILE
150 printf "DEFS=$DEFS\n" >> $CONFFILE
151 printf "STG_LIBS=" >> $CONFFILE
154 printf "$lib " >> $CONFFILE
156 printf "\n" >> $CONFFILE
157 printf "CXXFLAGS=$CXXFLAGS\n" >> $CONFFILE
158 printf "CFLAGS=$CFLAGS\n" >> $CONFFILE
159 printf "LDFLAGS=$LDFLAGS\n" >> $CONFFILE
160 printf "LIB_THREAD=$LIB_THREAD\n" >> $CONFFILE
161 printf "PREFIX=$PREFIX\n" >> $CONFFILE
162 printf "BIN_MODE=$BIN_MODE\n" >> $CONFFILE
163 printf "DATA_MODE=$DATA_MODE\n" >> $CONFFILE
164 printf "DIR_MODE=$DIR_MODE\n" >> $CONFFILE
165 printf "OWNER=$OWNER\n" >> $CONFFILE