Commit 8210ef96 authored by chenhaowen's avatar chenhaowen

add: compile option of dll

parent 23350d10
#CC:=gcc #CC:=gcc
CFLAGS+= -Wall -DDEBUG -DVERSION=\"1.6-0\" CFLAGS+= -Wall -fPIC -DDEBUG -DVERSION=\"1.6-0\"
objects=gdut-drcom.o config.o auth.o objects= config.o auth.o
all: gdut-drcom all: gdut-drcom
@echo gdut-drcom @echo gdut-drcom
...@@ -21,11 +21,17 @@ endif ...@@ -21,11 +21,17 @@ endif
ifeq ($(LANG),) ifeq ($(LANG),)
LIBS+= -lws2_32 LIBS+= -lws2_32
DLLNAME=gdut-drcom.dll
else
DLLNAME=gdut-drcom.so
endif endif
gdut-drcom: $(objects) gdut-drcom: $(objects) gdut-drcom.o
$(CC) *.o -o gdut-drcom $(CFLAGS) $(LIBS) $(CC) *.o -o gdut-drcom $(CFLAGS) $(LIBS)
dll: $(objects)
$(CC) -shared $(objects) -o $(DLLNAME) $(CFLAGS) $(LIBS)
gdut-drcom.o: gdut-drcom.c gdut-drcom.o: gdut-drcom.c
$(CC) $(CFLAGS) -c $< $(CC) $(CFLAGS) -c $<
...@@ -35,12 +41,12 @@ auth.o: auth.c config.h ...@@ -35,12 +41,12 @@ auth.o: auth.c config.h
$(CC) $(CFLAGS) -c $< $(CC) $(CFLAGS) -c $<
md5.o md4.o sha1.o: md5.o md4.o sha1.o:
$(CC) -c crypt/*.c $(CC) -c crypt/*.c $(CFLAGS)
.PHONY : clean .PHONY : clean
clean: clean:
ifeq ($(LANG),) ifeq ($(LANG),)
del gdut-drcom.exe *.o del gdut-drcom.exe *.o *.dll
else else
$(RM) gdut-drcom *.o $(RM) gdut-drcom *.o *.so
endif endif
...@@ -21,6 +21,24 @@ static int parse_line(char *buf, int size); ...@@ -21,6 +21,24 @@ static int parse_line(char *buf, int size);
static void strstrip(char *s, char *chars); static void strstrip(char *s, char *chars);
/* locale functions */ /* locale functions */
void set_remote_ip(char* ip, int len)
{
memcpy(drcom_config.remote_ip, ip, len);
printf("set remote_ip = %s\n", drcom_config.remote_ip);
}
void set_keep_alive1_flag(char* flag, int len)
{
sscanf(flag, "%02hhx", &drcom_config.keep_alive1_flag);
printf("set keep_alive1_flag = %02hhx\n", drcom_config.keep_alive1_flag);
}
void set_enable_crypt(int enable)
{
drcom_config.enable_crypt = enable;
printf("set enable_crypt = %d\n", enable);
}
int parse_config(char *conf_file_name) int parse_config(char *conf_file_name)
{ {
// char conf_file_name[256] = "/etc/gdut-drcom.conf"; // char conf_file_name[256] = "/etc/gdut-drcom.conf";
......
...@@ -17,5 +17,8 @@ struct config_s { ...@@ -17,5 +17,8 @@ struct config_s {
extern struct config_s drcom_config; extern struct config_s drcom_config;
int parse_config(char * conf_file_name); int parse_config(char * conf_file_name);
void set_remote_ip(char *ip, int len);
void set_keep_alive1_flag(char *flag, int len);
void set_enable_crypt(int enable);
#endif //__CONFIG_H__ #endif //__CONFIG_H__
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment