5 # $Date: 2010/04/14 08:58:52 $
6 ######################################################
10 release=`uname -r | cut -b1`
12 CONFFILE="../../Makefile.conf"
28 CXXFLAGS="$CXXFLAGS -ggdb3 -W -Wall"
36 CXXFLAGS="$CXXFLAGS -I/usr/local/include"
37 LDFLAGS="$LDFLAGS -L/usr/local/lib"
39 if [ "$sys" = "Linux" ]
46 if [ "$sys" = "FreeBSD" ]
60 if [ "$OS" = "unknown" ]
62 echo "#############################################################################"
63 echo "# Sorry, but rscriptd currently supported by Linux, FreeBSD 4.x, 5.x, 6.x #"
64 echo "#############################################################################"
68 echo "#############################################################################"
69 echo " Building rscriptd for $sys $release"
70 echo "#############################################################################"
79 if [ "$OS" = "linux" ]
86 DEFS="$DEFS -DFREE_BSD"
89 DEFS="$DEFS -DFREE_BSD5"
109 echo -n "Checking CC... "
110 $CC --version > /dev/null 2> /dev/null
118 echo -n "Checking CXX... "
119 $CXX --version > /dev/null 2> /dev/null
123 echo "$CXX not found"
128 echo -n "Checking endianess... "
129 echo "int main() { int probe = 0x00000001; return *(char *)&probe; }" > build_check.c
130 $CC $CFLAGS $LDFLAGS build_check.c -o fake > /dev/null 2> /dev/null
134 echo "Endianess checking failed"
141 CXXFLAGS="$CXXFLAGS -DARCH_LE"
142 CFLAGS="$CFLAGS -DARCH_LE"
146 CXXFLAGS="$CXXFLAGS -DARCH_BE"
147 CFLAGS="$CFLAGS -DARCH_BE"
154 echo "OS=$OS" > $CONFFILE
155 echo "STG_TIME=yes" >> $CONFFILE
156 echo "DEBUG=$DEBUG" >> $CONFFILE
157 echo "DIR_BUILD=$BUILD_DIR" >> $CONFFILE
158 echo "DIR_LIB=\$(DIR_BUILD)/../../lib" >> $CONFFILE
159 echo "DIR_LIBSRC=\$(DIR_BUILD)/../../stglibs" >> $CONFFILE
160 echo "DIR_INCLUDE=\$(DIR_BUILD)/../../include" >> $CONFFILE
161 echo "ARCH=$ARCH" >> $CONFFILE
162 echo "DEFS=$DEFS" >> $CONFFILE
163 echo -n "STG_LIBS=" >> $CONFFILE
166 echo -n "$lib " >> $CONFFILE
169 echo "LIB_THREAD=$LIB_THREAD" >> $CONFFILE
170 echo "CXXFLAGS=$CXXFLAGS" >> $CONFFILE
171 echo "CFLAGS=$CFLAGS" >> $CONFFILE
172 echo "LDFLAGS=$LDFLAGS" >> $CONFFILE
173 echo "PREFIX=$PREFIX" >> $CONFFILE
174 echo "BIN_MODE=$BIN_MODE" >> $CONFFILE
175 echo "DATA_MODE=$DATA_MODE" >> $CONFFILE
176 echo "DIR_MODE=$DIR_MODE" >> $CONFFILE
177 echo "OWNER=$OWNER" >> $CONFFILE