# HG changeset patch # User Mike Becker # Date 1381750588 -7200 # Node ID 6b15a094d9964777b551f61e3b141f897e0a429e # Parent 95b77e842db3cbf8c992388236e9f2ebf75aab56 minor fixes in snprintf and build system diff -r 95b77e842db3 -r 6b15a094d996 .hgignore --- a/.hgignore Mon Sep 09 12:15:54 2013 +0200 +++ b/.hgignore Mon Oct 14 13:36:28 2013 +0200 @@ -2,3 +2,9 @@ relre:^build/.*$ relre:^config.mk$ relre:DS_Store +\.orig\..*$ +\.orig$ +\.chg\..*$ +\.rej$ +\.conflict\~$ +^nbproject/.*$ diff -r 95b77e842db3 -r 6b15a094d996 config.mk --- a/config.mk Mon Sep 09 12:15:54 2013 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,15 +0,0 @@ -# -# config.mk generated by configure -# - -INSTALL_DIR = /export/home/olaf/Projekte/webserver/work -HOST = sunfire - - -include $(BUILD_ROOT)/make/suncc.mk -include $(BUILD_ROOT)/make/solaris.mk - -CFLAGS += -I/usr/include/libxml2 -I/usr/sfw/include -LDFLAGS += -R/usr/sfw/lib -L/usr/sfw/lib -lxml2 -lpthread -lz -lm -lssl -lcrypto -lsocket -lnsl -ldl - - diff -r 95b77e842db3 -r 6b15a094d996 configure --- a/configure Mon Sep 09 12:15:54 2013 +0200 +++ b/configure Mon Oct 14 13:36:28 2013 +0200 @@ -54,18 +54,22 @@ # platform if [ $OS = SunOS ]; then -CCONF=suncc.mk -PLATFORM=solaris.mk + CCONF=suncc.mk + PLATFORM=solaris.mk fi if [ $OS = Linux ]; then -CCONF=gcc.mk -PLATFORM=linux.mk + if `type clang > /dev/null`; then + CCONF=clang.mk + else + CCONF=gcc.mk + fi + PLATFORM=linux.mk fi if [ $OS = Darwin ]; then -CCONF=clang.mk -PLATFORM=osx.mk + CCONF=clang.mk + PLATFORM=osx.mk fi echo " diff -r 95b77e842db3 -r 6b15a094d996 make/clang.mk --- a/make/clang.mk Mon Sep 09 12:15:54 2013 +0200 +++ b/make/clang.mk Mon Oct 14 13:36:28 2013 +0200 @@ -27,9 +27,11 @@ # CFLAGS = -g +LDFLAGS = -Wl,-R,'$$ORIGIN/../lib' -CC = cc -CXX = c++ -LD = cc +CC = clang +CXX = clang +LD = clang -SHLIB_FLAGS = -shared +SHLIB_CFLAGS = -fPIC +SHLIB_LDFLAGS = -shared diff -r 95b77e842db3 -r 6b15a094d996 src/server/safs/service.c --- a/src/server/safs/service.c Mon Sep 09 12:15:54 2013 +0200 +++ b/src/server/safs/service.c Mon Oct 14 13:36:28 2013 +0200 @@ -86,7 +86,7 @@ // add content-length header char contentLength[32]; - int len = snprintf(contentLength, 32, "%lld", s->st_size); + int len = snprintf(contentLength, 32, "%jd", s->st_size); pblock_kvinsert(pb_key_content_length, contentLength, len, rq->srvhdrs); diff -r 95b77e842db3 -r 6b15a094d996 src/server/util/Makefile --- a/src/server/util/Makefile Mon Sep 09 12:15:54 2013 +0200 +++ b/src/server/util/Makefile Mon Oct 14 13:36:28 2013 +0200 @@ -27,6 +27,7 @@ # UTIL_CFLAGS = + $(UTIL_OBJPRE)%.o: util/%.c $(CC) -o $@ -c $(UTIL_CFLAGS) $(CFLAGS) $< diff -r 95b77e842db3 -r 6b15a094d996 src/server/webdav/webdav.c --- a/src/server/webdav/webdav.c Mon Sep 09 12:15:54 2013 +0200 +++ b/src/server/webdav/webdav.c Mon Oct 14 13:36:28 2013 +0200 @@ -590,7 +590,7 @@ if(!S_ISDIR(st.st_mode)) { prop.name = "getcontentlength"; char buf[32]; - size_t n = snprintf(buf, 32, "%lld", st.st_size); + size_t n = snprintf(buf, 32, "%jd", st.st_size); dav_propfind_add_str_prop(rq, &prop, buf, n); } @@ -618,7 +618,7 @@ } } else if(!strcmp(s, "getcontentlength") && !S_ISDIR(st.st_mode)) { char buf[32]; - size_t n = snprintf(buf, 32, "%lld", st.st_size); + size_t n = snprintf(buf, 32, "%jd", st.st_size); dav_propfind_add_str_prop(rq, prop, buf, n); } else if(!strcmp(s, "getlastmodified")) { sstr_t s = date_format_http(st.st_mtime, rq->sn->pool);