5 # $Date: 2010/05/09 12:39:01 $
6 ######################################################
8 # Installation path prefix
12 # Binaries access bits
16 # Data files access bits
24 # Binaries and data files owner
30 release=`uname -r | cut -b1`
32 CONFFILE="../../Makefile.conf"
33 VAR_DIR="./inst/var/stargazer"
34 MIN_XMLRPCC_VERSION="1.06.27"
35 XMLRPC_FEATURES="c++2 abyss-server"
41 MAKEOPTS="$MAKEOPTS -j1"
42 CFLAGS="$CFLAGS -ggdb3 -W -Wall"
43 CXXFLAGS="$CXXFLAGS -ggdb3 -W -Wall"
50 CFLAGS="$CFLAGS -I/usr/local/include"
51 CXXFLAGS="$CXXFLAGS -I/usr/local/include"
52 LDFLAGS="$LDFLAGS -L/usr/local/lib"
54 if [ "$sys" = "Linux" ]
58 ETC_DIR="./inst/linux/etc/stargazer"
62 if [ "$sys" = "FreeBSD" ]
71 ETC_DIR="./inst/freebsd/etc/stargazer"
75 if [ "$sys" = "Darwin" ]
78 ETC_DIR="./inst/freebsd/etc/stargazer"
82 if [ "$OS" = "unknown" ]
84 printf "#############################################################################\n"
85 printf "# Sorry, but stargazer currently supported by Linux, FreeBSD 4.x, 5.x, 6.x #\n"
86 printf "#############################################################################\n"
90 printf "#############################################################################\n"
91 printf " Building STG 2.4 for $sys $release\n"
92 printf "#############################################################################\n"
105 if [ "$OS" = "linux" ]
111 DEFS="$DEFS -DFREE_BSD"
113 if [ "$OS" = "bsd7" ]
115 DEFS="$DEFS -DFREE_BSD5"
117 if [ "$OS" == "darwin" ]
119 DEFS="$DEFS -DDARWIN"
135 printf "Checking CC... "
136 $CC --version > /dev/null 2> /dev/null
140 printf "$CC not found\n"
144 printf "Checking CXX... "
145 $CXX --version > /dev/null 2> /dev/null
149 printf "$CXX not found\n"
154 printf "Checking endianess... "
155 printf "int main() { int probe = 0x00000001; return *(char *)&probe; }\n" > build_check.c
156 $CC $CFLAGS $LDFLAGS build_check.c -o fake
160 printf "Endianess checking failed\n"
167 CXXFLAGS="$CXXFLAGS -DARCH_LE"
168 CFLAGS="$CFLAGS -DARCH_LE"
169 printf "Little Endian\n"
172 CXXFLAGS="$CXXFLAGS -DARCH_BE"
173 CFLAGS="$CFLAGS -DARCH_BE"
174 printf "Big Endian\n"
179 printf "Checking for -lexpat... "
180 printf "#include <expat.h>\nint main() { return 0; }\n" > build_check.c
181 $CXX $CXXFLAGS $LDFLAGS build_check.c -lexpat -o fake > /dev/null 2> /dev/null
192 printf "Checking for -lfbclient... "
193 printf "int main() { return 0; }\n" > build_check.c
194 $CXX $CXXFLAGS $LDFLAGS build_check.c -lfbclient $LIB_THREAD -o fake > /dev/null 2> /dev/null
207 if [ "$CHECK_EXPAT" != "yes" ]
209 printf -- "-lexpat not found!\n"
213 if [ "$CHECK_FBCLIENT" = "yes" ]
219 printf "OS=$OS\n" > $CONFFILE
220 printf "STG_TIME=yes\n" >> $CONFFILE
221 printf "DEBUG=$DEBUG\n" >> $CONFFILE
222 printf "DIR_BUILD=$BUILD_DIR\n" >> $CONFFILE
223 printf "DIR_LIB=\$(DIR_BUILD)/../../lib\n" >> $CONFFILE
224 printf "DIR_LIBSRC=\$(DIR_BUILD)/../../stglibs\n" >> $CONFFILE
225 printf "DIR_INCLUDE=\$(DIR_BUILD)/../../include\n" >> $CONFFILE
226 printf "DIR_MOD=\$(DIR_BUILD)/modules\n" >> $CONFFILE
227 printf "DIR_PLUGINS=\$(DIR_BUILD)/plugins\n" >> $CONFFILE
228 printf "ARCH=$ARCH\n" >> $CONFFILE
229 printf "CHECK_EXPAT=$CHECK_EXPAT\n" >> $CONFFILE
230 printf "CHECK_FBCLIENT=$CHECK_FBCLIENT\n" >> $CONFFILE
231 printf "CHECK_MYSQLCLIENT=$CHECK_MYSQLCLIENT\n" >> $CONFFILE
232 printf "CHECK_PQ=$CHECK_PQ\n" >> $CONFFILE
233 printf "CHECK_XMLRPC=$CHECK_XMLRPC\n" >> $CONFFILE
234 printf "CHECK_PCAP=$CHECK_PCAP\n" >> $CONFFILE
235 printf "CHECK_NFNETLINK=$CHECK_NFNETLINK\n" >> $CONFFILE
236 printf "CHECK_NFQ=$CHECK_NFQ\n" >> $CONFFILE
237 printf "DEFS=$DEFS\n" >> $CONFFILE
238 printf "NFQ_LIBS=$NFQ_LIBS\n" >> $CONFFILE
239 printf "STG_LIBS=" >> $CONFFILE
242 printf "$lib " >> $CONFFILE
244 printf "\n" >> $CONFFILE
245 printf "PLUGINS=" >> $CONFFILE
246 for plugin in $PLUGINS
248 printf "$plugin " >> $CONFFILE
250 printf "\n" >> $CONFFILE
251 printf "CXXFLAGS=$CXXFLAGS\n" >> $CONFFILE
252 printf "CFLAGS=$CFLAGS\n" >> $CONFFILE
253 printf "LDFLAGS=$LDFLAGS\n" >> $CONFFILE
254 printf "LIB_THREAD=$LIB_THREAD\n" >> $CONFFILE
255 printf "PREFIX=$PREFIX\n" >> $CONFFILE
256 printf "BIN_MODE=$BIN_MODE\n" >> $CONFFILE
257 printf "DATA_MODE=$DATA_MODE\n" >> $CONFFILE
258 printf "DIR_MODE=$DIR_MODE\n" >> $CONFFILE
259 printf "OWNER=$OWNER\n" >> $CONFFILE
260 printf "VAR_DIR=$VAR_DIR\n" >> $CONFFILE
261 printf "ETC_DIR=$ETC_DIR\n" >> $CONFFILE
265 if [ "$1" != "debug" ]
269 printf "\n\n\nDebug build. Type $MAKE explicitly\n"