Environment variable, Linux fixes

svn path=/trunk/boinc/; revision=461
This commit is contained in:
Eric Heien 2002-10-04 20:26:23 +00:00
parent 6d53f16c4d
commit 2970a82cde
4 changed files with 44 additions and 42 deletions

View File

@ -10,63 +10,58 @@ INSTALL_DIR = /usr/local/boinc
ENV_MSG_1 = "The environment variable "
ENV_MSG_2 = " does not seem to be set. "
ENV_MSG_3 = "Please be sure to set all environment variables before compiling. "
ifndef BOINC_DOWNLOAD_DIR
ifndef BOINC_PROJECTS_DIR
BOINC_WARN_ENV = 1
BOINC_DOWNLOAD_DIR_MSG = $(ENV_MSG_1)"BOINC_DOWNLOAD_DIR"$(ENV_MSG_2)
BOINC_PROJECTS_DIR_MSG = $(ENV_MSG_1)"BOINC_PROJECTS_DIR"$(ENV_MSG_2)
endif
ifndef BOINC_UPLOAD_DIR
ifndef BOINC_HOSTS_DIR
BOINC_WARN_ENV = 1
BOINC_UPLOAD_DIR_MSG = $(ENV_MSG_1)"BOINC_UPLOAD_DIR"$(ENV_MSG_2)
BOINC_HOSTS_DIR_MSG = $(ENV_MSG_1)"BOINC_HOSTS_DIR"$(ENV_MSG_2)
endif
ifndef BOINC_PLATFORM
ifndef BOINC_USER_NAME
BOINC_WARN_ENV = 1
BOINC_PLATFORM_MSG = $(ENV_MSG_1)"BOINC_PLATFORM"$(ENV_MSG_2)
BOINC_USER_NAME_MSG = $(ENV_MSG_1)"BOINC_USER_NAME"$(ENV_MSG_2)
endif
ifndef BOINC_EMAIL
ifndef BOINC_SRC_DIR
BOINC_WARN_ENV = 1
BOINC_EMAIL_MSG = $(ENV_MSG_1)"BOINC_EMAIL"$(ENV_MSG_2)
BOINC_SRC_DIR_MSG = $(ENV_MSG_1)"BOINC_SRC_DIR"$(ENV_MSG_2)
endif
ifndef BOINC_CGI_DIR
BOINC_WARN_ENV = 1
BOINC_CGI_DIR_MSG = $(ENV_MSG_1)"BOINC_CGI_DIR"$(ENV_MSG_2)
endif
ifndef BOINC_CGI_URL
BOINC_WARN_ENV = 1
BOINC_CGI_URL_MSG = $(ENV_MSG_1)"BOINC_CGI_URL"$(ENV_MSG_2)
endif
ifndef BOINC_HTML_DIR
BOINC_WARN_ENV = 1
BOINC_HTML_DIR_MSG = $(ENV_MSG_1)"BOINC_HTML_DIR"$(ENV_MSG_2)
endif
ifndef BOINC_HTML_URL
BOINC_WARN_ENV = 1
BOINC_HTML_URL_MSG = $(ENV_MSG_1)"BOINC_HTML_URL"$(ENV_MSG_2)
endif
ifndef BOINC_KEY_DIR
BOINC_WARN_ENV = 1
BOINC_KEY_DIR_MSG = $(ENV_MSG_1)"BOINC_KEY_DIR"$(ENV_MSG_2)
endif
ifndef BOINC_SHMEM_KEY
ifndef BOINC_PLATFORM
BOINC_WARN_ENV = 1
BOINC_SHMEM_KEY_MSG = $(ENV_MSG_1)"BOINC_SHMEM_KEY"$(ENV_MSG_2)
endif
ifndef BOINC_DB_NAME
BOINC_WARN_ENV = 1
BOINC_DB_NAME_MSG = $(ENV_MSG_1)"BOINC_DB_NAME"$(ENV_MSG_2)
endif
ifndef BOINC_USER
BOINC_WARN_ENV = 1
BOINC_USER_MSG = $(ENV_MSG_1)"BOINC_USER"$(ENV_MSG_2)
endif
ifndef BOINC_UPLOAD_URL
BOINC_WARN_ENV = 1
BOINC_UPLOAD_URL_MSG = $(ENV_MSG_1)"BOINC_UPLOAD_URL"$(ENV_MSG_2)
endif
ifndef BOINC_DOWNLOAD_URL
BOINC_WARN_ENV = 1
BOINC_DOWNLOAD_URL_MSG = $(ENV_MSG_1)"BOINC_DOWNLOAD_URL"$(ENV_MSG_2)
endif
ifndef BOINC_MASTER_URL
BOINC_WARN_ENV = 1
BOINC_MASTER_URL_MSG = $(ENV_MSG_1)"BOINC_MASTER_URL"$(ENV_MSG_2)
BOINC_PLATFORM_KEY_MSG = $(ENV_MSG_1)"BOINC_PLATFORM_KEY"$(ENV_MSG_2)
endif
ifdef BOINC_WARN_ENV
ENV_MESSAGES = "****************************************" \
$(BOINC_DOWNLOAD_DIR_MSG) \
$(BOINC_UPLOAD_URL_MSG) \
$(BOINC_PLATFORM_MSG) \
$(BOINC_EMAIL_MSG) \
$(BOINC_HOSTS_DIR_MSG) \
$(BOINC_PROJECTS_DIR_MSG) \
$(BOINC_USER_NAME_MSG) \
$(BOINC_SRC_DIR_MSG) \
$(BOINC_CGI_DIR_MSG) \
$(BOINC_CGI_URL_MSG) \
$(BOINC_HTML_DIR_MSG) \
$(BOINC_HTML_URL_MSG) \
$(BOINC_KEY_DIR_MSG) \
$(BOINC_SHMEM_KEY_MSG) \
$(BOINC_DB_NAME_MSG) \
$(BOINC_USER_MSG) \
$(BOINC_UPLOAD_URL_MSG) \
$(BOINC_DOWNLOAD_URL_MSG) \
$(BOINC_MASTER_URL_MSG) \
$(BOINC_PLATFORM_MSG) \
$(ENV_MSG_3) \
"****************************************"
EXIT_IF_NEEDED = @exit 1;

View File

@ -6,11 +6,13 @@ VPATH = @srcdir@
VERSION = 1
MYSQL_DIR = /usr/local/mysql/include
MYSQL_DIR2 = /usr/local/mysql/include/mysql
CFLAGS = -g -Wall @DEFS@ \
-DHOSTTYPE=\"@host@\" \
-DVERSION=$(VERSION) \
-I $(MYSQL_DIR) \
-I $(MYSQL_DIR2) \
-pedantic
CC = @CC@ $(CFLAGS)

View File

@ -43,7 +43,7 @@ void die(char* p) {
exit(1);
}
main(int argc, char** argv) {
int main(int argc, char** argv) {
R_RANDOM_STRUCT randomStruct;
R_RSA_PUBLIC_KEY public_key;
R_RSA_PRIVATE_KEY private_key;
@ -118,4 +118,6 @@ main(int argc, char** argv) {
} else {
printf("unrecognized command\n");
}
return 0;
}

View File

@ -4,12 +4,13 @@
#include <unistd.h>
#include <strings.h>
#include <string.h>
#include "synch.h"
#define KEY 0xdeadbeef
main(int argc, char** argv) {
int main(int argc, char** argv) {
if (!strcmp(argv[1], "-c")) {
create_semaphore(KEY);
} else if (!strcmp(argv[1], "-d")) {
@ -19,4 +20,6 @@ main(int argc, char** argv) {
sleep(10);
unlock_semaphore(KEY);
}
return 0;
}