From: Maxim Mamontov Date: Sat, 20 Jun 2015 09:32:23 +0000 (+0300) Subject: Merge branch 'stg-2.409' into stg-2.409-radius X-Git-Url: https://git.stg.codes/stg.git/commitdiff_plain/70f8adff2c970496bdc45717cad49ddec0405ae7?hp=-c Merge branch 'stg-2.409' into stg-2.409-radius --- 70f8adff2c970496bdc45717cad49ddec0405ae7 diff --combined projects/rlm_stg/Makefile index 1280bd91,05c43d95..548232a8 --- a/projects/rlm_stg/Makefile +++ b/projects/rlm_stg/Makefile @@@ -13,27 -13,24 +13,26 @@@ SRCS = ./rlm_stg.c ./stg_client.cpp STGLIBS = crypto \ - common + common \ + sgcp STGLIBS_INCS = $(addprefix -I ../../stglibs/,$(addsuffix .lib/include,$(STGLIBS))) STGLIBS_LIBS = $(addprefix -L ../../stglibs/,$(addsuffix .lib,$(STGLIBS))) - LIBS += $(addprefix -lstg,$(STGLIBS)) $(LIB_THREAD) + LIBS += $(addprefix -lstg,$(STGLIBS)) $(LIB_THREAD) $(LIBICONV) ifeq ($(OS),linux) LIBS += -ldl else LIBS += -lintl \ - -lc \ - -liconv + -lc endif SEARCH_DIRS = -I ../../include OBJS = $(notdir $(patsubst %.cpp, %.o, $(patsubst %.c, %.o, $(SRCS)))) +CFLAGS += -fPIC $(DEFS) $(STGLIBS_INCS) $(SEARCH_DIRS) CXXFLAGS += -fPIC $(DEFS) $(STGLIBS_INCS) $(SEARCH_DIRS) CFLAGS += $(DEFS) $(STGLIBS_INCS) $(SEARCH_DIRS) LDFLAGS += -shared -Wl,-rpath,$(PREFIX)/usr/lib/stg -Wl,-E $(STGLIBS_LIBS) diff --combined projects/rlm_stg/build index e9be4ed0,179d5261..4894491a --- a/projects/rlm_stg/build +++ b/projects/rlm_stg/build @@@ -61,13 -61,14 +61,14 @@@ printf "############################### printf " Building rlm_stg for $sys $release\n" printf "#############################################################################\n" -STG_LIBS="crypto.lib common.lib" +STG_LIBS="crypto.lib common.lib sgcp.lib" if [ "$OS" = "linux" ] then DEFS="$DEFS -DLINUX" LIB_THREAD=-lpthread else + LIBICONV="-liconv" if [ "$OS" = "bsd" ] then DEFS="$DEFS -DFREE_BSD" @@@ -137,6 -138,18 +138,18 @@@ els fi rm -f fake + printf "Checking for iconv 2nd argument... " + printf "#include \nint main(){ const char** src = 0; iconv(0, src, 0, 0, 0); }\n" > build_check.c + $CC $CFLAGS $LDFLAGS -Werror build_check.c $LIBICONV -o fake > /dev/null 2> /dev/null + if [ $? != 0 ] + then + printf "non-const\n" + else + DEFS="$DEFS -DCONST_ICONV" + printf "const\n" + fi + rm -f fake + printf "OS=$OS\n" > $CONFFILE printf "STG_TIME=yes\n" >> $CONFFILE printf "DEBUG=$DEBUG\n" >> $CONFFILE @@@ -156,6 -169,7 +169,7 @@@ printf "CXXFLAGS=$CXXFLAGS\n" >> $CONFF printf "CFLAGS=$CFLAGS\n" >> $CONFFILE printf "LDFLAGS=$LDFLAGS\n" >> $CONFFILE printf "LIB_THREAD=$LIB_THREAD\n" >> $CONFFILE + printf "LIBICONV=$LIBICONV\n" >> $CONFFILE printf "PREFIX=$PREFIX\n" >> $CONFFILE printf "BIN_MODE=$BIN_MODE\n" >> $CONFFILE printf "DATA_MODE=$DATA_MODE\n" >> $CONFFILE diff --combined stglibs/common.lib/Makefile index 33f29440,1f662c25..932e2709 --- a/stglibs/common.lib/Makefile +++ b/stglibs/common.lib/Makefile @@@ -7,14 -7,10 +7,12 @@@ include ../../Makefile.con LIB_NAME = stgcommon SRCS = common.cpp \ - strptime.cpp + strptime.cpp \ + blockio.cpp -INCS = common.h +INCS = common.h \ + blockio.h - ifneq ($(OS),linux) - LIBS += -liconv - endif + LIBS += $(LIBICONV) include ../Makefile.in