]> git.stg.codes - stg.git/commitdiff
Merge branch 'stg-2.409' into stg-2.409-radius
authorMaxim Mamontov <faust.madf@gmail.com>
Sat, 20 Jun 2015 09:32:23 +0000 (12:32 +0300)
committerMaxim Mamontov <faust.madf@gmail.com>
Sat, 20 Jun 2015 09:32:23 +0000 (12:32 +0300)
1  2 
projects/rlm_stg/Makefile
projects/rlm_stg/build
stglibs/common.lib/Makefile

index 1280bd9134e809d3c5f5e061811f3f8fae7e1f73,05c43d95135b559866886ac904108ce3fc074cfc..548232a8a9b7a88f3748667d3c3c66580aea6d50
@@@ -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 e9be4ed0f86562b891a840d4996618f966d8a434,179d526188d9aef6e1370ca024d04d01063a27e9..4894491a84c1800e1e44074a65bec4abbca1fd3a
@@@ -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 <iconv.h>\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
index 33f29440463ef847f362e1fa703980d43ea2e9ba,1f662c25c3357985ec83d49a11fbb5129b7a4539..932e270948b62d3b78fed5186e6889e53dd304b2
@@@ -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