5 # $Date: 2010/04/14 08:58:52 $
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" ]
56 if [ "$OS" = "unknown" ]
58 printf "#############################################################################\n"
59 printf "# Sorry, but rscriptd currently supported by Linux, FreeBSD 4.x, 5.x, 6.x #\n"
60 printf "#############################################################################\n"
64 printf "#############################################################################\n"
65 printf " Building rscriptd for $sys $release\n"
66 printf "#############################################################################\n"
75 if [ "$OS" = "linux" ]
82 DEFS="$DEFS -DFREE_BSD"
85 DEFS="$DEFS -DFREE_BSD5"
105 printf "Checking CC... "
106 $CC --version > /dev/null 2> /dev/null
110 printf "$CC not found\n"
114 printf "Checking CXX... "
115 $CXX --version > /dev/null 2> /dev/null
119 printf "$CXX not found\n"
124 printf "Checking endianess... "
125 printf "int main() { int probe = 0x00000001; return *(char *)&probe; }\n" > build_check.c
126 $CC $CFLAGS $LDFLAGS build_check.c -o fake > /dev/null 2> /dev/null
130 printf "Endianess checking failed\n"
137 CXXFLAGS="$CXXFLAGS -DARCH_LE"
138 CFLAGS="$CFLAGS -DARCH_LE"
139 printf "Little Endian\n"
142 CXXFLAGS="$CXXFLAGS -DARCH_BE"
143 CFLAGS="$CFLAGS -DARCH_BE"
144 printf "Big Endian\n"
150 printf "OS=$OS\n" > $CONFFILE
151 printf "STG_TIME=yes\n" >> $CONFFILE
152 printf "DEBUG=$DEBUG\n" >> $CONFFILE
153 printf "DIR_BUILD=$BUILD_DIR\n" >> $CONFFILE
154 printf "DIR_LIB=\$(DIR_BUILD)/../../lib\n" >> $CONFFILE
155 printf "DIR_LIBSRC=\$(DIR_BUILD)/../../stglibs\n" >> $CONFFILE
156 printf "DIR_INCLUDE=\$(DIR_BUILD)/../../include\n" >> $CONFFILE
157 printf "ARCH=$ARCH\n" >> $CONFFILE
158 printf "DEFS=$DEFS\n" >> $CONFFILE
159 printf "STG_LIBS=" >> $CONFFILE
162 printf "$lib " >> $CONFFILE
164 printf "\n" >> $CONFFILE
165 printf "LIB_THREAD=$LIB_THREAD\n" >> $CONFFILE
166 printf "CXXFLAGS=$CXXFLAGS\n" >> $CONFFILE
167 printf "CFLAGS=$CFLAGS\n" >> $CONFFILE
168 printf "LDFLAGS=$LDFLAGS\n" >> $CONFFILE
169 printf "PREFIX=$PREFIX\n" >> $CONFFILE
170 printf "BIN_MODE=$BIN_MODE\n" >> $CONFFILE
171 printf "DATA_MODE=$DATA_MODE\n" >> $CONFFILE
172 printf "DIR_MODE=$DIR_MODE\n" >> $CONFFILE
173 printf "OWNER=$OWNER\n" >> $CONFFILE