diff --git a/INSTALL b/INSTALL index 2cbf048fe8..3260af24f9 100644 --- a/INSTALL +++ b/INSTALL @@ -12,10 +12,11 @@ The installation procedure itself is broken into seven steps 6. Testing (optional but strongly recommended) 7. Final install (optional) -Please note that BOINC does not support make uninstall and probably will not do -so in the near future. Currently, BOINC is installed into the /usr/local/boinc/ -directory structure, so to uninstall, simply remove all files from this -location. +Please note that BOINC currently only supports the targets all clean install +uninstall tar and client_tar. Currently, BOINC is installed into the +/usr/local/boinc/ directory structure. To install BOINC into a different +directory structure, the macro INSTALL_DIR needs to be edited in all +Makefile.in files. ------------------------------------------------------------------------------- Downloading the Source @@ -39,6 +40,11 @@ In order for the BOINC server to run, Apache web server and mySQL database server must both be installed and shared memory must be enabled, with a shared memory segment size of at least 32 megabytes (more is reccomended). +It is highly reccomended that PHP be installed, as the test scripts and web +administration are written in PHP and will not be usable without PHP installed. + +Apache should be configured to allow POST + ------------------------------------------------------------------------------- Setting environment variables diff --git a/INSTALL_CLIENT b/INSTALL_CLIENT index a7b081c5c7..24aaa1bab1 100644 --- a/INSTALL_CLIENT +++ b/INSTALL_CLIENT @@ -9,10 +9,10 @@ The installation procedure itself is broken into four steps 3. Building 4. Running the BOINC client -Please note that BOINC does not support make uninstall and probably will not do -so in the near future. Currently, BOINC is installed into the /usr/local/boinc -directory structure, so to uninstall, simply remove all files from this -location. +Please note that BOINC currently only supports the targets all clean install +uninstall and tar. Currently, BOINC is installed into the /usr/local/boinc/ +directory structure. To install BOINC into a different directory structure, +the macro INSTALL_DIR needs to be edited in the client/Makefile.in file. ------------------------------------------------------------------------------- Downloading the Source diff --git a/Makefile.in b/Makefile.in index 75a79870b1..009985be5b 100644 --- a/Makefile.in +++ b/Makefile.in @@ -5,6 +5,8 @@ topsrcdir = @top_srcdir@ srcdir = @srcdir@ VPATH = @srcdir@ +INSTALL_DIR = /usr/local/boinc + # # The ../$(srcdir)/client/configure # only works when the original configure is relative path @@ -12,6 +14,7 @@ VPATH = @srcdir@ # This needs to be fixed # all: + echo $(APACHE_MSG) cd RSAEuro/source; ${MAKE}; cd ../..; \ cd db; ${MAKE}; cd ..; \ cd lib; ${MAKE}; cd ..; \ @@ -33,18 +36,26 @@ clean: cd tools; ${MAKE} clean; cd ..; install: all - -mkdir -p /usr/local/boinc; + -mkdir -p $(INSTALL_DIR); cd sched; ${MAKE} install; cd lib; ${MAKE} install; cd api; ${MAKE} install; cd apps; ${MAKE} install; cd client; ${MAKE} install; cd tools; ${MAKE} install; - cp -r test /usr/local/boinc; + $(CP) -r test /usr/local/boinc; + +uninstall: + cd sched; ${MAKE} uninstall; + cd lib; ${MAKE} uninstall; + cd api; ${MAKE} uninstall; + cd apps; ${MAKE} uninstall; + cd client; ${MAKE} uninstall; + cd tools; ${MAKE} uninstall; + $(RM) -r $(INSTALL_DIR)/tools; tar: clean tar cf boinc.tar * ; gzip boinc.tar client_tar: clean - tar cf boinc_client.tar client/* lib/* api/* RSAEuro/* INSTALL_CLIENT - gzip boinc_client.tar + cd client; ${MAKE} tar; diff --git a/aclocal.m4 b/aclocal.m4 new file mode 100644 index 0000000000..eb1b2d5390 --- /dev/null +++ b/aclocal.m4 @@ -0,0 +1,32 @@ +AC_DEFUN([AC_PROG_APACHE],[ +AC_REQUIRE([AC_EXEEXT])dnl +AC_PATH_PROG(APACHE, apache$EXEEXT, nocommand) +if test "$APACHE" = nocommand; then + AC_MSG_WARN([****************************************]) + AC_MSG_WARN([apache not found in $PATH]) + AC_MSG_WARN([The BOINC server may not function properly without apache installed.]) + AC_MSG_WARN([****************************************]) +fi +]) + +AC_DEFUN([AC_PROG_MYSQL],[ +AC_REQUIRE([AC_EXEEXT])dnl +AC_PATH_PROG(MYSQL, mysql$EXEEXT, nocommand) +if test "$MYSQL" = nocommand; then + AC_MSG_WARN([****************************************]) + AC_MSG_WARN([mysql not found in $PATH]) + AC_MSG_WARN([The BOINC server may not function properly without mysql installed.]) + AC_MSG_WARN([****************************************]) +fi +]) + +AC_DEFUN([AC_PROG_PHP],[ +AC_REQUIRE([AC_EXEEXT])dnl +AC_PATH_PROG(PHP, php$EXEEXT, nocommand) +if test "$PHP" = nocommand; then + AC_MSG_WARN([****************************************]) + AC_MSG_WARN([php not found in $PATH]) + AC_MSG_WARN([The test scripts and web utilities may not function properly without php installed.]) + AC_MSG_WARN([****************************************]) +fi +]) diff --git a/api/Makefile.in b/api/Makefile.in index b932277322..c895e87a7e 100644 --- a/api/Makefile.in +++ b/api/Makefile.in @@ -3,6 +3,8 @@ topsrcdir = @top_srcdir@ srcdir = @srcdir@ VPATH = @srcdir@ +INSTALL_DIR = /usr/local/boinc + VERSION = 1 CFLAGS = -g -Wall @DEFS@ \ @@ -36,9 +38,12 @@ api_test: $(TEST_OBJS) $(CC) $(TEST_OBJS) -o api_test install: all - -mkdir -p /usr/local/boinc/api - cp api_test /usr/local/boinc/api/api_test - cp api_app /usr/local/boinc/api/api_app + -mkdir -p $(INSTALL_DIR)/api + cp api_test $(INSTALL_DIR)/api/api_test + cp api_app $(INSTALL_DIR)/api/api_app + +uninstall: + $(RM) -r $(INSTALL_DIR)/api; clean: rm -f *.o $(PROGS) core dependencies diff --git a/api/api_test.C b/api/api_test.C index aa46e454ef..220f383a73 100644 --- a/api/api_test.C +++ b/api/api_test.C @@ -1,4 +1,25 @@ +/* The contents of this file are subject to the Mozilla Public License +Version 1.0 (the "License"); you may not use this file except in +compliance with the License. You may obtain a copy of the License at +http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" +basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +License for the specific language governing rights and limitations +under the License. + +The Original Code is The Original Code is the Berkeley Open Infrastructure +for Network Computing. + +The Initial Developer of the Original Code is the SETI@home project. +Portions created by the SETI@home project are Copyright (C) 2002 +University of California at Berkeley. All Rights Reserved. + +Contributor(s): See ACKNOWLEDGEMENTS. +*/ + #include + #include #include "api.h" diff --git a/apps/Makefile.in b/apps/Makefile.in index 12a70ab2af..907a6bfd39 100644 --- a/apps/Makefile.in +++ b/apps/Makefile.in @@ -3,6 +3,8 @@ topsrcdir = @top_srcdir@ srcdir = @srcdir@ VPATH = @srcdir@ +INSTALL_DIR = /usr/local/boinc + VERSION = 1 CFLAGS = -g -Wall @DEFS@ \ @@ -40,12 +42,15 @@ uc_slow: uc_slow.o $(CC) 1sec.o $(LIBS) -o 1sec install: all - -mkdir -p /usr/local/boinc/apps - cp upper_case /usr/local/boinc/apps/upper_case - cp concat /usr/local/boinc/apps/concat - cp uc_slow /usr/local/boinc/apps/uc_slow - cp concat_slow /usr/local/boinc/apps/concat_slow - cp 1sec /usr/local/boinc/apps/1sec + -mkdir -p $(INSTALL_DIR)/apps + cp upper_case $(INSTALL_DIR)/apps/upper_case + cp concat $(INSTALL_DIR)/apps/concat + cp uc_slow $(INSTALL_DIR)/apps/uc_slow + cp concat_slow $(INSTALL_DIR)/apps/concat_slow + cp 1sec $(INSTALL_DIR)/apps/1sec + +uninstall: + $(RM) -r $(INSTALL_DIR)/apps clean: rm -f *.o $(APPS) dependencies diff --git a/checkin_notes b/checkin_notes index ac02c422aa..15eca05ec7 100755 --- a/checkin_notes +++ b/checkin_notes @@ -1220,3 +1220,24 @@ Michael Gary 7/17/2002 test_stderr.php test_uc_slow.php test_suite.php (added) + +Michael Gary 7/18/2002 + - Configure now checks to make sure that apache, mysql, and php are + installed. If they are not installed, it prints out a warning and + continues configuration + - Added uninstall target, made Makefiles more compliant with GNU standards + INSTALL + INSTALL_CLIENT + aclocal.m4 (added) + configure + configure.in + Makefile.in + sched/ + Makefile.in + lib/ + Makefile.in + api/ + Makefile.in + client/ + Makefile.in + diff --git a/client/Makefile.in b/client/Makefile.in index b5030d6bb2..47cd7b3fbf 100644 --- a/client/Makefile.in +++ b/client/Makefile.in @@ -3,6 +3,8 @@ topsrcdir = @top_srcdir@ srcdir = @srcdir@ VPATH = @srcdir@ +INSTALL_DIR = /usr/local/boinc + VERSION = 1 CFLAGS = -g -Wall @DEFS@ \ @@ -66,6 +68,8 @@ TEST_FX_OBJS = \ file_names.o \ file_xfer.o +TAR_TARGETS = client/* lib/* api/* RSAEuro/* INSTALL_CLIENT + .C.o: $(CC) -c -o $*.o $< .c.o: @@ -84,17 +88,21 @@ test_file_xfer: test_file_xfer.o $(TEST_FX_OBJS) $(CC) test_file_xfer.o $(TEST_FX_OBJS) $(CLIBS) -o test_file_xfer tar: - tar cf boinc_client.tar *.C *.h Makefile.in + cd $(topsrcdir); tar cf boinc_client.tar $(TAR_TARGETS); \ + gzip boinc_client.tar; clean: rm -f *.o $(PROGS) core dependencies Makefile config.cache install: all - -mkdir -p /usr/local/boinc/client - cp test_net_xfer /usr/local/boinc/client/test_net_xfer - cp test_http /usr/local/boinc/client/test_http - cp test_file_xfer /usr/local/boinc/client/test_file_xfer - cp $(CLIENT_PROG) /usr/local/boinc/client/$(CLIENT_PROG) + -mkdir -p $(INSTALL_DIR)/client + cp test_net_xfer $(INSTALL_DIR)/client/test_net_xfer + cp test_http $(INSTALL_DIR)/client/test_http + cp test_file_xfer $(INSTALL_DIR)/client/test_file_xfer + cp $(CLIENT_PROG) $(INSTALL_DIR)/client/$(CLIENT_PROG) + +uninstall: + $(RM) -r $(INSTALL_DIR)/client dependencies: @srcdir@/*.C $(CC) -M @srcdir@/*.C > dependencies diff --git a/configure b/configure index 56903c4d90..831def204d 100755 --- a/configure +++ b/configure @@ -771,9 +771,238 @@ else SET_MAKE="MAKE=${MAKE-make}" fi +echo $ac_n "checking for Cygwin environment""... $ac_c" 1>&6 +echo "configure:776: checking for Cygwin environment" >&5 +if eval "test \"`echo '$''{'ac_cv_cygwin'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + ac_cv_cygwin=yes +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + ac_cv_cygwin=no +fi +rm -f conftest* +rm -f conftest* +fi + +echo "$ac_t""$ac_cv_cygwin" 1>&6 +CYGWIN= +test "$ac_cv_cygwin" = yes && CYGWIN=yes +echo $ac_n "checking for mingw32 environment""... $ac_c" 1>&6 +echo "configure:809: checking for mingw32 environment" >&5 +if eval "test \"`echo '$''{'ac_cv_mingw32'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + ac_cv_mingw32=yes +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + ac_cv_mingw32=no +fi +rm -f conftest* +rm -f conftest* +fi + +echo "$ac_t""$ac_cv_mingw32" 1>&6 +MINGW32= +test "$ac_cv_mingw32" = yes && MINGW32=yes + + +echo $ac_n "checking for executable suffix""... $ac_c" 1>&6 +echo "configure:840: checking for executable suffix" >&5 +if eval "test \"`echo '$''{'ac_cv_exeext'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test "$CYGWIN" = yes || test "$MINGW32" = yes; then + ac_cv_exeext=.exe +else + rm -f conftest* + echo 'int main () { return 0; }' > conftest.$ac_ext + ac_cv_exeext= + if { (eval echo configure:850: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then + for file in conftest.*; do + case $file in + *.c | *.o | *.obj) ;; + *) ac_cv_exeext=`echo $file | sed -e s/conftest//` ;; + esac + done + else + { echo "configure: error: installation or configuration problem: compiler cannot create executables." 1>&2; exit 1; } + fi + rm -f conftest* + test x"${ac_cv_exeext}" = x && ac_cv_exeext=no +fi +fi + +EXEEXT="" +test x"${ac_cv_exeext}" != xno && EXEEXT=${ac_cv_exeext} +echo "$ac_t""${ac_cv_exeext}" 1>&6 +ac_exeext=$EXEEXT + + +# Extract the first word of "apache$EXEEXT", so it can be a program name with args. +set dummy apache$EXEEXT; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:874: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_path_APACHE'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + case "$APACHE" in + /*) + ac_cv_path_APACHE="$APACHE" # Let the user override the test with a path. + ;; + ?:/*) + ac_cv_path_APACHE="$APACHE" # Let the user override the test with a dos path. + ;; + *) + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_dummy="$PATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + ac_cv_path_APACHE="$ac_dir/$ac_word" + break + fi + done + IFS="$ac_save_ifs" + test -z "$ac_cv_path_APACHE" && ac_cv_path_APACHE="nocommand" + ;; +esac +fi +APACHE="$ac_cv_path_APACHE" +if test -n "$APACHE"; then + echo "$ac_t""$APACHE" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + +if test "$APACHE" = nocommand; then + echo "configure: warning: ****************************************" 1>&2 + echo "configure: warning: apache not found in $PATH" 1>&2 + echo "configure: warning: The BOINC server may not function properly without apache installed." 1>&2 + echo "configure: warning: ****************************************" 1>&2 +fi + + +# Extract the first word of "mysql$EXEEXT", so it can be a program name with args. +set dummy mysql$EXEEXT; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:918: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_path_MYSQL'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + case "$MYSQL" in + /*) + ac_cv_path_MYSQL="$MYSQL" # Let the user override the test with a path. + ;; + ?:/*) + ac_cv_path_MYSQL="$MYSQL" # Let the user override the test with a dos path. + ;; + *) + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_dummy="$PATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + ac_cv_path_MYSQL="$ac_dir/$ac_word" + break + fi + done + IFS="$ac_save_ifs" + test -z "$ac_cv_path_MYSQL" && ac_cv_path_MYSQL="nocommand" + ;; +esac +fi +MYSQL="$ac_cv_path_MYSQL" +if test -n "$MYSQL"; then + echo "$ac_t""$MYSQL" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + +if test "$MYSQL" = nocommand; then + echo "configure: warning: ****************************************" 1>&2 + echo "configure: warning: mysql not found in $PATH" 1>&2 + echo "configure: warning: The BOINC server may not function properly without mysql installed." 1>&2 + echo "configure: warning: ****************************************" 1>&2 +fi + + +# Extract the first word of "php$EXEEXT", so it can be a program name with args. +set dummy php$EXEEXT; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:962: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_path_PHP'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + case "$PHP" in + /*) + ac_cv_path_PHP="$PHP" # Let the user override the test with a path. + ;; + ?:/*) + ac_cv_path_PHP="$PHP" # Let the user override the test with a dos path. + ;; + *) + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_dummy="$PATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + ac_cv_path_PHP="$ac_dir/$ac_word" + break + fi + done + IFS="$ac_save_ifs" + test -z "$ac_cv_path_PHP" && ac_cv_path_PHP="nocommand" + ;; +esac +fi +PHP="$ac_cv_path_PHP" +if test -n "$PHP"; then + echo "$ac_t""$PHP" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + +if test "$PHP" = nocommand; then + echo "configure: warning: ****************************************" 1>&2 + echo "configure: warning: php not found in $PATH" 1>&2 + echo "configure: warning: The test scripts and web utilities may not function properly without php installed." 1>&2 + echo "configure: warning: ****************************************" 1>&2 +fi + + +AC_ENV(BOINC_WASUP) echo $ac_n "checking for main in -lgen""... $ac_c" 1>&6 -echo "configure:777: checking for main in -lgen" >&5 +echo "configure:1006: checking for main in -lgen" >&5 ac_lib_var=`echo gen'_'main | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -781,14 +1010,14 @@ else ac_save_LIBS="$LIBS" LIBS="-lgen $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:1021: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -816,7 +1045,7 @@ else fi echo $ac_n "checking for main in -lm""... $ac_c" 1>&6 -echo "configure:820: checking for main in -lm" >&5 +echo "configure:1049: checking for main in -lm" >&5 ac_lib_var=`echo m'_'main | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -824,14 +1053,14 @@ else ac_save_LIBS="$LIBS" LIBS="-lm $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:1064: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -859,7 +1088,7 @@ else fi echo $ac_n "checking for main in -lnsl""... $ac_c" 1>&6 -echo "configure:863: checking for main in -lnsl" >&5 +echo "configure:1092: checking for main in -lnsl" >&5 ac_lib_var=`echo nsl'_'main | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -867,14 +1096,14 @@ else ac_save_LIBS="$LIBS" LIBS="-lnsl $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:1107: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -902,7 +1131,7 @@ else fi echo $ac_n "checking for main in -lsocket""... $ac_c" 1>&6 -echo "configure:906: checking for main in -lsocket" >&5 +echo "configure:1135: checking for main in -lsocket" >&5 ac_lib_var=`echo socket'_'main | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -910,14 +1139,14 @@ else ac_save_LIBS="$LIBS" LIBS="-lsocket $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:1150: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -945,7 +1174,7 @@ else fi echo $ac_n "checking for main in -lstdc""... $ac_c" 1>&6 -echo "configure:949: checking for main in -lstdc" >&5 +echo "configure:1178: checking for main in -lstdc" >&5 ac_lib_var=`echo stdc'_'main | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -953,14 +1182,14 @@ else ac_save_LIBS="$LIBS" LIBS="-lstdc $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:1193: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -988,7 +1217,7 @@ else fi echo $ac_n "checking for gzopen in -lz""... $ac_c" 1>&6 -echo "configure:992: checking for gzopen in -lz" >&5 +echo "configure:1221: checking for gzopen in -lz" >&5 ac_lib_var=`echo z'_'gzopen | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -996,7 +1225,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lz $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:1240: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -1040,12 +1269,12 @@ for ac_hdr in dirent.h sys/ndir.h sys/dir.h ndir.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr that defines DIR""... $ac_c" 1>&6 -echo "configure:1044: checking for $ac_hdr that defines DIR" >&5 +echo "configure:1273: checking for $ac_hdr that defines DIR" >&5 if eval "test \"`echo '$''{'ac_cv_header_dirent_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include <$ac_hdr> @@ -1053,7 +1282,7 @@ int main() { DIR *dirp = 0; ; return 0; } EOF -if { (eval echo configure:1057: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:1286: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* eval "ac_cv_header_dirent_$ac_safe=yes" else @@ -1078,7 +1307,7 @@ done # Two versions of opendir et al. are in -ldir and -lx on SCO Xenix. if test $ac_header_dirent = dirent.h; then echo $ac_n "checking for opendir in -ldir""... $ac_c" 1>&6 -echo "configure:1082: checking for opendir in -ldir" >&5 +echo "configure:1311: checking for opendir in -ldir" >&5 ac_lib_var=`echo dir'_'opendir | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -1086,7 +1315,7 @@ else ac_save_LIBS="$LIBS" LIBS="-ldir $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:1330: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -1119,7 +1348,7 @@ fi else echo $ac_n "checking for opendir in -lx""... $ac_c" 1>&6 -echo "configure:1123: checking for opendir in -lx" >&5 +echo "configure:1352: checking for opendir in -lx" >&5 ac_lib_var=`echo x'_'opendir | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -1127,7 +1356,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lx $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:1371: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -1161,7 +1390,7 @@ fi fi echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6 -echo "configure:1165: checking how to run the C preprocessor" >&5 +echo "configure:1394: checking how to run the C preprocessor" >&5 # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= @@ -1176,13 +1405,13 @@ else # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. cat > conftest.$ac_ext < Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1186: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:1415: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then : @@ -1193,13 +1422,13 @@ else rm -rf conftest* CPP="${CC-cc} -E -traditional-cpp" cat > conftest.$ac_ext < Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1203: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:1432: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then : @@ -1210,13 +1439,13 @@ else rm -rf conftest* CPP="${CC-cc} -nologo -E" cat > conftest.$ac_ext < Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1220: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:1449: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then : @@ -1241,12 +1470,12 @@ fi echo "$ac_t""$CPP" 1>&6 echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6 -echo "configure:1245: checking for ANSI C header files" >&5 +echo "configure:1474: checking for ANSI C header files" >&5 if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include @@ -1254,7 +1483,7 @@ else #include EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1258: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:1487: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -1271,7 +1500,7 @@ rm -f conftest* if test $ac_cv_header_stdc = yes; then # SunOS 4.x string.h does not declare mem*, contrary to ANSI. cat > conftest.$ac_ext < EOF @@ -1289,7 +1518,7 @@ fi if test $ac_cv_header_stdc = yes; then # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. cat > conftest.$ac_ext < EOF @@ -1310,7 +1539,7 @@ if test "$cross_compiling" = yes; then : else cat > conftest.$ac_ext < #define ISLOWER(c) ('a' <= (c) && (c) <= 'z') @@ -1321,7 +1550,7 @@ if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2); exit (0); } EOF -if { (eval echo configure:1325: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:1554: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then : else @@ -1345,12 +1574,12 @@ EOF fi echo $ac_n "checking for sys/wait.h that is POSIX.1 compatible""... $ac_c" 1>&6 -echo "configure:1349: checking for sys/wait.h that is POSIX.1 compatible" >&5 +echo "configure:1578: checking for sys/wait.h that is POSIX.1 compatible" >&5 if eval "test \"`echo '$''{'ac_cv_header_sys_wait_h'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include @@ -1366,7 +1595,7 @@ wait (&s); s = WIFEXITED (s) ? WEXITSTATUS (s) : 1; ; return 0; } EOF -if { (eval echo configure:1370: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:1599: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_header_sys_wait_h=yes else @@ -1390,17 +1619,17 @@ for ac_hdr in fcntl.h malloc.h strings.h sys/time.h unistd.h sys/systeminfo.h sy do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:1394: checking for $ac_hdr" >&5 +echo "configure:1623: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1404: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:1633: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -1430,17 +1659,17 @@ for ac_hdr in mysql/include/mysql_com.h mysql/mysql_com.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:1434: checking for $ac_hdr" >&5 +echo "configure:1663: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1444: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:1673: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -1468,12 +1697,12 @@ done echo $ac_n "checking for working const""... $ac_c" 1>&6 -echo "configure:1472: checking for working const" >&5 +echo "configure:1701: checking for working const" >&5 if eval "test \"`echo '$''{'ac_cv_c_const'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:1755: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_c_const=yes else @@ -1543,12 +1772,12 @@ EOF fi echo $ac_n "checking whether time.h and sys/time.h may both be included""... $ac_c" 1>&6 -echo "configure:1547: checking whether time.h and sys/time.h may both be included" >&5 +echo "configure:1776: checking whether time.h and sys/time.h may both be included" >&5 if eval "test \"`echo '$''{'ac_cv_header_time'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include @@ -1557,7 +1786,7 @@ int main() { struct tm *tp; ; return 0; } EOF -if { (eval echo configure:1561: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:1790: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_header_time=yes else @@ -1580,13 +1809,13 @@ fi if test $ac_cv_prog_gcc = yes; then echo $ac_n "checking whether ${CC-cc} needs -traditional""... $ac_c" 1>&6 -echo "configure:1584: checking whether ${CC-cc} needs -traditional" >&5 +echo "configure:1813: checking whether ${CC-cc} needs -traditional" >&5 if eval "test \"`echo '$''{'ac_cv_prog_gcc_traditional'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else ac_pattern="Autoconf.*'x'" cat > conftest.$ac_ext < Autoconf TIOCGETP @@ -1604,7 +1833,7 @@ rm -f conftest* if test $ac_cv_prog_gcc_traditional = no; then cat > conftest.$ac_ext < Autoconf TCGETA @@ -1626,12 +1855,12 @@ echo "$ac_t""$ac_cv_prog_gcc_traditional" 1>&6 fi echo $ac_n "checking for vprintf""... $ac_c" 1>&6 -echo "configure:1630: checking for vprintf" >&5 +echo "configure:1859: checking for vprintf" >&5 if eval "test \"`echo '$''{'ac_cv_func_vprintf'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:1887: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_vprintf=yes" else @@ -1678,12 +1907,12 @@ fi if test "$ac_cv_func_vprintf" != yes; then echo $ac_n "checking for _doprnt""... $ac_c" 1>&6 -echo "configure:1682: checking for _doprnt" >&5 +echo "configure:1911: checking for _doprnt" >&5 if eval "test \"`echo '$''{'ac_cv_func__doprnt'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:1939: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func__doprnt=yes" else @@ -1731,7 +1960,7 @@ fi fi echo $ac_n "checking for wait3 that fills in rusage""... $ac_c" 1>&6 -echo "configure:1735: checking for wait3 that fills in rusage" >&5 +echo "configure:1964: checking for wait3 that fills in rusage" >&5 if eval "test \"`echo '$''{'ac_cv_func_wait3_rusage'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1739,7 +1968,7 @@ else ac_cv_func_wait3_rusage=no else cat > conftest.$ac_ext < #include @@ -1770,7 +1999,7 @@ main() { } } EOF -if { (eval echo configure:1774: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:2003: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_func_wait3_rusage=yes else @@ -1795,12 +2024,12 @@ fi for ac_func in gethostname gettimeofday mkdir select socket strstr uname do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:1799: checking for $ac_func" >&5 +echo "configure:2028: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2056: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -1994,6 +2223,10 @@ s%@infodir@%$infodir%g s%@mandir@%$mandir%g s%@CC@%$CC%g s%@SET_MAKE@%$SET_MAKE%g +s%@EXEEXT@%$EXEEXT%g +s%@APACHE@%$APACHE%g +s%@MYSQL@%$MYSQL%g +s%@PHP@%$PHP%g s%@CPP@%$CPP%g CEOF diff --git a/configure.in b/configure.in index 65a6cf2c41..b76c18128d 100644 --- a/configure.in +++ b/configure.in @@ -4,6 +4,9 @@ AC_INIT(api/api_test.C) dnl Checks for programs. AC_PROG_CC AC_PROG_MAKE_SET +AC_PROG_APACHE +AC_PROG_MYSQL +AC_PROG_PHP dnl Checks for libraries. dnl Replace `main' with a function in -lgen: diff --git a/lib/Makefile.in b/lib/Makefile.in index 91559c04a7..807c343d7e 100644 --- a/lib/Makefile.in +++ b/lib/Makefile.in @@ -3,6 +3,8 @@ topsrcdir = @top_srcdir@ srcdir = @srcdir@ VPATH = @srcdir@ +INSTALL_DIR = $(INSTALL_DIR) + VERSION = 1 CFLAGS = -g @@ -52,11 +54,14 @@ clean: rm -f *.o $(PROGS) core dependencies install: all - -mkdir -p /usr/local/boinc/lib - cp md5_test /usr/local/boinc/lib/md5_test - cp shmem_test /usr/local/boinc/lib/shmem_test - cp synch_test /usr/local/boinc/lib/synch_test - #cp crypt_prog /usr/local/boinc/lib/crypt_prog + -mkdir -p $(INSTALL_DIR)/lib + cp md5_test $(INSTALL_DIR)/lib/md5_test + cp shmem_test $(INSTALL_DIR)/lib/shmem_test + cp synch_test $(INSTALL_DIR)/lib/synch_test + cp crypt_prog $(INSTALL_DIR)/lib/crypt_prog + +uninstall: + $(RM) -r $(INSTALL_DIR)/lib dependencies: @srcdir@/*.C $(CC) -M @srcdir@/*.C > dependencies diff --git a/sched/Makefile.in b/sched/Makefile.in index e75f243dea..e0995aca2f 100644 --- a/sched/Makefile.in +++ b/sched/Makefile.in @@ -3,6 +3,8 @@ topsrcdir = @top_srcdir@ srcdir = @srcdir@ VPATH = @srcdir@ +INSTALL_DIR = /usr/local/boinc + all: cgi CFLAGS = -g -Wall @DEFS@ \ @@ -117,11 +119,14 @@ clean: rm -f $(PROGS) *.o core dependencies config.cache install: $(PROGS) - -mkdir -p /usr/local/boinc/sched - cp fcgi /usr/local/boinc/sched/fcgi - cp cgi /usr/local/boinc/sched/cgi - cp feeder /usr/local/boinc/sched/feeder - cp show_shmem /usr/local/boinc/sched/show_shmem - rm -rR -f ~barry/ - cp cgi ../../../boinc_server/cgi/cgi - cp file_upload_handler ../../../boinc_server/cgi/file_upload_handler + -mkdir -p $(INSTALL_DIR)/cgi + -mkdir -p $(INSTALL_DIR)/sched + cp fcgi $(INSTALL_DIR)/cgi/fcgi + cp cgi $(INSTALL_DIR)/cgi/cgi + cp feeder $(INSTALL_DIR)/sched/feeder + cp show_shmem $(INSTALL_DIR)/sched/show_shmem + cp file_upload_handler $(INSTALL_DIR)/cgi/file_upload_handler + +uninstall: + $(RM) -r $(INSTALL_DIR)/cgi; + $(RM) -r $(INSTALL_DIR)/sched; diff --git a/sched/file_upload_handler.C b/sched/file_upload_handler.C index 257f2e4829..8032050622 100644 --- a/sched/file_upload_handler.C +++ b/sched/file_upload_handler.C @@ -125,11 +125,15 @@ int handle_request(FILE* in, R_RSA_PUBLIC_KEY& key) { while (fgets(buf, 256, in)) { if (match_tag(buf, "")) { retval = file_info.parse(in); - if (retval) return retval; + if (retval) { + fprintf(stderr, "file_upload_handler: FILE_INFO.parse\n"); + return retval; + } retval = verify_string( file_info.signed_xml, file_info.xml_signature, key, is_valid ); if (retval || !is_valid) { + fprintf(stderr, "invalid XML signature\n"); print_status(-1, "invalid XML signature"); return -1; } @@ -139,12 +143,14 @@ int handle_request(FILE* in, R_RSA_PUBLIC_KEY& key) { else if (parse_double(buf, "", nbytes)) continue; else if (match_tag(buf, "")) { if (nbytes == 0) { + fprintf(stderr, "nbytes missing\n"); print_status(-1, "nbytes missing"); return -1; } // enforce limits in signed XML if (nbytes > file_info.max_nbytes) { + fprintf(stderr, "nbytes too large\n"); sprintf(buf, "nbytes too large: %f > %f", nbytes, file_info.max_nbytes @@ -155,6 +161,9 @@ int handle_request(FILE* in, R_RSA_PUBLIC_KEY& key) { sprintf(path, "%s/%s", BOINC_UPLOAD_DIR, file_info.name); retval = copy_socket_to_file(in, path, offset, nbytes); + if(retval) { + fprintf(stderr, "file_upload_handler: copy_socket_to_file\n"); + } break; } } diff --git a/tools/Makefile.in b/tools/Makefile.in index 0ca5ee051e..0d743b43e8 100644 --- a/tools/Makefile.in +++ b/tools/Makefile.in @@ -3,6 +3,8 @@ topsrcdir = @top_srcdir@ srcdir = @srcdir@ VPATH = @srcdir@ +INSTALL_DIR = /usr/local/boinc + VERSION = 1 MYSQL_INC = /usr/local/mysql/include @@ -61,10 +63,13 @@ clean: rm -f *.o create_work add core country_select dependencies install: - -mkdir -p /usr/local/boinc/tools - cp create_work /usr/local/boinc/tools/create_work - cp add /usr/local/boinc/tools/add - cp country_select /usr/local/boinc/tools/country_select + -mkdir -p $(INSTALL_DIR)/tools + cp create_work $(INSTALL_DIR)/tools/create_work + cp add $(INSTALL_DIR)/tools/add + cp country_select $(INSTALL_DIR)/tools/country_select + +uninstall: + $(RM) -r $(INSTALL_DIR)/tools dependencies: @srcdir@/*.C $(CC) -M @srcdir@/*.C > dependencies