From: Maxim Mamontov Date: Mon, 11 May 2015 17:41:04 +0000 (+0300) Subject: Fixed iconv linkage. X-Git-Tag: 2.409~183 X-Git-Url: https://git.stg.codes/stg.git/commitdiff_plain/e1999cff4c8d39584a6723cf0ff2ffec9425c4da?ds=sidebyside Fixed iconv linkage. --- diff --git a/projects/libs/build b/projects/libs/build index 9b23d546..9ea852a0 100755 --- a/projects/libs/build +++ b/projects/libs/build @@ -95,6 +95,7 @@ if [ "$OS" = "linux" ] then DEFS="$DEFS -DLINUX" else + LIBICONV="-liconv" if [ "$OS" = "bsd" ] then DEFS="$DEFS -DFREE_BSD" @@ -106,6 +107,7 @@ else if [ "$OS" == "darwin" ] then DEFS="$DEFS -DDARWIN" + LIBICONV="" fi fi fi @@ -180,7 +182,7 @@ 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 -$CXX $CXXFLAGS $LDFLAGS -Werror build_check.c -o fake > /dev/null 2> /dev/null +$CXX $CXXFLAGS $LDFLAGS -Werror build_check.c $LIBICONV -o fake > /dev/null 2> /dev/null if [ $? != 0 ] then printf "non-const\n" @@ -273,6 +275,7 @@ printf "CXX=$CXX\n" >> $CONFFILE printf "CXXFLAGS=$CXXFLAGS\n" >> $CONFFILE printf "CFLAGS=$CFLAGS\n" >> $CONFFILE printf "LDFLAGS=$LDFLAGS\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 --git a/projects/rlm_stg/Makefile b/projects/rlm_stg/Makefile index efc1bcaa..05c43d95 100644 --- a/projects/rlm_stg/Makefile +++ b/projects/rlm_stg/Makefile @@ -18,14 +18,13 @@ STGLIBS = crypto \ 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 diff --git a/projects/rlm_stg/build b/projects/rlm_stg/build index f78a9e1f..ded3a070 100755 --- a/projects/rlm_stg/build +++ b/projects/rlm_stg/build @@ -68,6 +68,7 @@ then DEFS="$DEFS -DLINUX" LIB_THREAD=-lpthread else + LIBICONV="-liconv" if [ "$OS" = "bsd" ] then DEFS="$DEFS -DFREE_BSD" @@ -139,7 +140,7 @@ 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 -$CXX $CXXFLAGS $LDFLAGS -Werror build_check.c -o fake > /dev/null 2> /dev/null +$CXX $CXXFLAGS $LDFLAGS -Werror build_check.c $LIBICONV -o fake > /dev/null 2> /dev/null if [ $? != 0 ] then printf "non-const\n" @@ -168,6 +169,7 @@ printf "CXXFLAGS=$CXXFLAGS\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 diff --git a/projects/rscriptd/Makefile b/projects/rscriptd/Makefile index 516894b6..98b2f5e4 100644 --- a/projects/rscriptd/Makefile +++ b/projects/rscriptd/Makefile @@ -19,12 +19,7 @@ STGLIBS = scriptexecuter \ STGLIBS_INCS = $(addprefix -I ../../stglibs/,$(addsuffix .lib/include,$(STGLIBS))) STGLIBS_LIBS = $(addprefix -L ../../stglibs/,$(addsuffix .lib,$(STGLIBS))) -LIBS += $(addprefix -lstg,$(STGLIBS)) $(LIB_THREAD) - -ifeq ($(OS),linux) -else -LIBS += -liconv -endif +LIBS += $(addprefix -lstg,$(STGLIBS)) $(LIB_THREAD) $(LIBICONV) SEARCH_DIRS = -I ../../include diff --git a/projects/rscriptd/build b/projects/rscriptd/build index f01f50cb..65f634bd 100755 --- a/projects/rscriptd/build +++ b/projects/rscriptd/build @@ -81,6 +81,7 @@ then DEFS="$DEFS -DLINUX" LIB_THREAD=-lpthread else + LIBICONV="-liconv" if [ "$OS" = "bsd" ] then DEFS="$DEFS -DFREE_BSD" @@ -94,6 +95,7 @@ else then DEFS="$DEFS -DDARWIN" LIB_THREAD=-lpthread + LIBICONV="" else LIB_THREAD=-lc_r fi @@ -157,7 +159,7 @@ 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 -$CXX $CXXFLAGS $LDFLAGS -Werror build_check.c -o fake > /dev/null 2> /dev/null +$CXX $CXXFLAGS $LDFLAGS -Werror build_check.c $LIBICONV -o fake > /dev/null 2> /dev/null if [ $? != 0 ] then printf "non-const\n" @@ -190,6 +192,7 @@ printf "CXX=$CXX\n" >> $CONFFILE printf "CXXFLAGS=$CXXFLAGS\n" >> $CONFFILE printf "CFLAGS=$CFLAGS\n" >> $CONFFILE printf "LDFLAGS=$LDFLAGS\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 --git a/projects/sgauth/Makefile b/projects/sgauth/Makefile index c6c733f0..d6c844e0 100644 --- a/projects/sgauth/Makefile +++ b/projects/sgauth/Makefile @@ -18,13 +18,12 @@ STGLIBS = conffiles \ 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) else LIBS += -lintl \ - -lc \ - -liconv + -lc endif SEARCH_DIRS = -I ../../include diff --git a/projects/sgauth/build b/projects/sgauth/build index 4f8048cc..81edf8d4 100755 --- a/projects/sgauth/build +++ b/projects/sgauth/build @@ -83,6 +83,7 @@ then DEFS="$DEFS -DLINUX" LIB_THREAD=-lpthread else + LIBICONV="-liconv" if [ "$OS" = "bsd" ] then DEFS="$DEFS -DFREE_BSD" @@ -96,6 +97,7 @@ else then DEFS="$DEFS -DDARWIN" LIB_THREAD=-lpthread + LIBICONV="" else LIB_THREAD=-lc_r fi @@ -159,7 +161,7 @@ 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 -$CXX $CXXFLAGS $LDFLAGS -Werror build_check.c -o fake > /dev/null 2> /dev/null +$CXX $CXXFLAGS $LDFLAGS -Werror build_check.c $LIBICONV -o fake > /dev/null 2> /dev/null if [ $? != 0 ] then printf "non-const\n" @@ -192,6 +194,7 @@ printf "CXX=$CXX\n" >> $CONFFILE printf "CXXFLAGS=$CXXFLAGS\n" >> $CONFFILE printf "CFLAGS=$CFLAGS\n" >> $CONFFILE printf "LDFLAGS=$LDFLAGS\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 --git a/projects/sgauthstress/Makefile b/projects/sgauthstress/Makefile index 4884b213..74c09b62 100644 --- a/projects/sgauthstress/Makefile +++ b/projects/sgauthstress/Makefile @@ -15,14 +15,13 @@ STGLIBS = dotconfpp \ 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 diff --git a/projects/sgauthstress/build b/projects/sgauthstress/build index 92be70d9..4ea506e8 100755 --- a/projects/sgauthstress/build +++ b/projects/sgauthstress/build @@ -86,6 +86,7 @@ then DEFS="$DEFS -DLINUX" LIB_THREAD=-lpthread else + LIBICONV="-liconv" if [ "$OS" = "bsd" ] then DEFS="$DEFS -DFREE_BSD" @@ -157,7 +158,7 @@ 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 -$CXX $CXXFLAGS $LDFLAGS -Werror build_check.c -o fake > /dev/null 2> /dev/null +$CXX $CXXFLAGS $LDFLAGS -Werror build_check.c $LIBICONV -o fake > /dev/null 2> /dev/null if [ $? != 0 ] then printf "non-const\n" @@ -359,6 +360,7 @@ printf "CXX=$CXX\n" >> $CONFFILE printf "CXXFLAGS=$CXXFLAGS\n" >> $CONFFILE printf "CFLAGS=$CFLAGS\n" >> $CONFFILE printf "LDFLAGS=$LDFLAGS\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 --git a/projects/sgconf/Makefile b/projects/sgconf/Makefile index 3541a058..795c2522 100644 --- a/projects/sgconf/Makefile +++ b/projects/sgconf/Makefile @@ -17,12 +17,11 @@ STGLIBS = conffiles \ STGLIBS_INCS = $(addprefix -I ../../stglibs/,$(addsuffix .lib/include,$(STGLIBS))) STGLIBS_LIBS = $(addprefix -L ../../stglibs/,$(addsuffix .lib,$(STGLIBS))) -LIBS += $(addprefix -lstg,$(STGLIBS)) -lexpat $(LIB_THREAD) +LIBS += $(addprefix -lstg,$(STGLIBS)) -lexpat $(LIB_THREAD) $(LIBICONV) ifeq ($(OS),linux) else -LIBS += -lc \ - -liconv +LIBS += -lc endif SEARCH_DIRS = -I ../../include diff --git a/projects/sgconf/build b/projects/sgconf/build index 2d6fc859..44130698 100755 --- a/projects/sgconf/build +++ b/projects/sgconf/build @@ -80,6 +80,7 @@ then DEFS="$DEFS -DLINUX" LIB_THREAD=-lpthread else + LIBICONV="-liconv" if [ "$OS" = "bsd" ] then DEFS="$DEFS -DFREE_BSD" @@ -93,6 +94,7 @@ else then DEFS="$DEFS -DDARWIN" LIB_THREAD=-lpthread + LIBICONV="" else LIB_THREAD=-lc_r fi @@ -169,7 +171,7 @@ 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 -$CXX $CXXFLAGS $LDFLAGS -Werror build_check.c -o fake > /dev/null 2> /dev/null +$CXX $CXXFLAGS $LDFLAGS -Werror build_check.c $LIBICONV -o fake > /dev/null 2> /dev/null if [ $? != 0 ] then printf "non-const\n" @@ -209,6 +211,7 @@ printf "CXX=$CXX\n" >> $CONFFILE printf "CXXFLAGS=$CXXFLAGS\n" >> $CONFFILE printf "CFLAGS=$CFLAGS\n" >> $CONFFILE printf "LDFLAGS=$LDFLAGS\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 --git a/projects/sgconf_xml/Makefile b/projects/sgconf_xml/Makefile index bfb7b214..a7058b89 100644 --- a/projects/sgconf_xml/Makefile +++ b/projects/sgconf_xml/Makefile @@ -17,12 +17,11 @@ STGLIBS = conffiles \ STGLIBS_INCS = $(addprefix -I ../../stglibs/,$(addsuffix .lib/include,$(STGLIBS))) STGLIBS_LIBS = $(addprefix -L ../../stglibs/,$(addsuffix .lib,$(STGLIBS))) -LIBS += $(addprefix -lstg,$(STGLIBS)) -lexpat $(LIB_THREAD) +LIBS += $(addprefix -lstg,$(STGLIBS)) -lexpat $(LIB_THREAD) $(LIBICONV) ifeq ($(OS),linux) else -LIBS += -lc \ - -liconv +LIBS += -lc endif SEARCH_DIRS = -I ../../include diff --git a/projects/sgconf_xml/build b/projects/sgconf_xml/build index 10de5f00..fc206740 100755 --- a/projects/sgconf_xml/build +++ b/projects/sgconf_xml/build @@ -79,6 +79,7 @@ then DEFS="$DEFS -DLINUX" LIB_THREAD=-lpthread else + LIBICONV="-liconv" if [ "$OS" = "bsd" ] then DEFS="$DEFS -DFREE_BSD" @@ -162,12 +163,12 @@ 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 -$CXX $CXXFLAGS $LDFLAGS -Werror build_check.c -o fake > /dev/null 2> /dev/null +$CXX $CXXFLAGS $LDFLAGS -Werror build_check.c $LIBICONV -o fake > /dev/null 2> /dev/null if [ $? != 0 ] then - DEFS="$DEFS -DCONST_ICONV" printf "non-const\n" else + DEFS="$DEFS -DCONST_ICONV" printf "const\n" fi rm -f fake @@ -202,6 +203,7 @@ printf "CXX=$CXX\n" >> $CONFFILE printf "CXXFLAGS=$CXXFLAGS\n" >> $CONFFILE printf "CFLAGS=$CFLAGS\n" >> $CONFFILE printf "LDFLAGS=$LDFLAGS\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 --git a/projects/sgconv/Makefile b/projects/sgconv/Makefile index ff6308ed..b463f175 100644 --- a/projects/sgconv/Makefile +++ b/projects/sgconv/Makefile @@ -18,12 +18,12 @@ STGLIBS = dotconfpp \ 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 += -lc -liconv +LIBS += -lc endif SEARCH_DIRS = -I ../../include diff --git a/projects/sgconv/build b/projects/sgconv/build index 2d6ce471..da83a527 100755 --- a/projects/sgconv/build +++ b/projects/sgconv/build @@ -85,6 +85,7 @@ then DEFS="$DEFS -DLINUX" LIB_THREAD=-lpthread else + LIBICONV="-liconv" if [ "$OS" = "bsd" ] then DEFS="$DEFS -DFREE_BSD" @@ -99,6 +100,7 @@ else then DEFS="$DEFS -DDARWIN" LIB_THREAD=-lpthread + LIBICONV="" else LIB_THREAD=-lc_r fi @@ -162,7 +164,7 @@ 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 -$CXX $CXXFLAGS $LDFLAGS -Werror build_check.c -o fake > /dev/null 2> /dev/null +$CXX $CXXFLAGS $LDFLAGS -Werror build_check.c $LIBICONV -o fake > /dev/null 2> /dev/null if [ $? != 0 ] then printf "non-const\n" @@ -363,6 +365,7 @@ printf "CXXFLAGS=$CXXFLAGS\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 diff --git a/projects/stargazer/Makefile b/projects/stargazer/Makefile index 0fbccd32..e127d4f8 100644 --- a/projects/stargazer/Makefile +++ b/projects/stargazer/Makefile @@ -33,12 +33,12 @@ STGLIBS = scriptexecuter \ 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 += -lc -liconv +LIBS += -lc endif SEARCH_DIRS = -I ../../include diff --git a/projects/stargazer/build b/projects/stargazer/build index 4bf38506..a77c2e09 100755 --- a/projects/stargazer/build +++ b/projects/stargazer/build @@ -117,6 +117,7 @@ then capture/ether_linux" LIB_THREAD=-lpthread else + LIBICONV="-liconv" if [ "$OS" = "bsd" ] then DEFS="$DEFS -DFREE_BSD" @@ -131,6 +132,7 @@ else then DEFS="$DEFS -DDARWIN" LIB_THREAD=-lpthread + LIBICONV="" else LIB_THREAD=-lc_r fi @@ -210,7 +212,7 @@ 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 -$CXX $CXXFLAGS $LDFLAGS -Werror build_check.c -o fake > /dev/null 2> /dev/null +$CXX $CXXFLAGS $LDFLAGS -Werror build_check.c $LIBICONV -o fake > /dev/null 2> /dev/null if [ $? != 0 ] then printf "non-const\n" @@ -542,6 +544,7 @@ printf "CXXFLAGS=$CXXFLAGS\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 diff --git a/projects/stargazer/plugins/configuration/rpcconfig/Makefile b/projects/stargazer/plugins/configuration/rpcconfig/Makefile index 732b0e11..c647f752 100644 --- a/projects/stargazer/plugins/configuration/rpcconfig/Makefile +++ b/projects/stargazer/plugins/configuration/rpcconfig/Makefile @@ -16,11 +16,8 @@ SRCS = ./rpcconfig.cpp \ ./messages_methods.cpp LIBS += $(XMLRPC_LDFLAGS) \ - $(LIB_THREAD) - -ifneq ($(OS),linux) -LIBS += -liconv -endif + $(LIB_THREAD) \ + $(LIBICONV) STGLIBS = common \ logger \ diff --git a/stglibs/common.lib/Makefile b/stglibs/common.lib/Makefile index 0ef14dea..1f662c25 100644 --- a/stglibs/common.lib/Makefile +++ b/stglibs/common.lib/Makefile @@ -11,8 +11,6 @@ SRCS = common.cpp \ INCS = common.h -ifneq ($(OS),linux) -LIBS += -liconv -endif +LIBS += $(LIBICONV) include ../Makefile.in