./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)
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"
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
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