From: Maxim Mamontov Date: Mon, 16 Mar 2015 20:06:04 +0000 (+0200) Subject: Fixed installation on BSD-systems. X-Git-Tag: 2.409~190 X-Git-Url: https://git.stg.codes/stg.git/commitdiff_plain/7e0f07b593a81c4f1bf0101cdc66968ae40462fb?ds=sidebyside Fixed installation on BSD-systems. --- diff --git a/projects/rlm_stg/Makefile b/projects/rlm_stg/Makefile index 3d410483..15d973d8 100644 --- a/projects/rlm_stg/Makefile +++ b/projects/rlm_stg/Makefile @@ -13,8 +13,8 @@ SRCS = ./rlm_stg.c \ ./stg_client.cpp STGLIBS = crypto \ - common - + common + STGLIBS_INCS = $(addprefix -I ../../stglibs/,$(addsuffix .lib/include,$(STGLIBS))) STGLIBS_LIBS = $(addprefix -L ../../stglibs/,$(addsuffix .lib,$(STGLIBS))) @@ -22,10 +22,12 @@ LIBS += $(addprefix -lstg,$(STGLIBS)) $(LIB_THREAD) ifeq ($(OS),linux) LIBS += -ldl +D_FLAG = -D else LIBS += -lintl \ -lc \ - -liconv + -liconv +D_FLAG = -d endif SEARCH_DIRS = -I ../../include @@ -59,16 +61,16 @@ install: install-bin install-bin: ifeq ($(DEBUG), yes) ifeq ($(OS), linux) - install -D -m $(BIN_MODE) -o $(OWNER) $(PROG) $(PREFIX)/usr/lib/freeradius/$(PROG) + install $(D_FLAG) -m $(BIN_MODE) -o $(OWNER) $(PROG) $(PREFIX)/usr/lib/freeradius/$(PROG) else - install -D -m $(BIN_MODE) -o $(OWNER) $(PROG) $(PREFIX)/usr/lib/$(PROG) + install $(D_FLAG) -m $(BIN_MODE) -o $(OWNER) $(PROG) $(PREFIX)/usr/lib/$(PROG) endif else - install -D -m $(BIN_MODE) -o $(OWNER) -s $(PROG) $(PREFIX)/usr/lib/freeradius/$(PROG) + install $(D_FLAG) -m $(BIN_MODE) -o $(OWNER) -s $(PROG) $(PREFIX)/usr/lib/freeradius/$(PROG) ifeq ($(OS), linux) - install -D -m $(BIN_MODE) -o $(OWNER) -s $(PROG) $(PREFIX)/usr/lib/freeradius/$(PROG) + install $(D_FLAG) -m $(BIN_MODE) -o $(OWNER) -s $(PROG) $(PREFIX)/usr/lib/freeradius/$(PROG) else - install -D -m $(BIN_MODE) -o $(OWNER) -s $(PROG) $(PREFIX)/usr/lib/$(PROG) + install $(D_FLAG) -m $(BIN_MODE) -o $(OWNER) -s $(PROG) $(PREFIX)/usr/lib/$(PROG) endif endif $(MAKE) -C $(DIR_LIBSRC) install diff --git a/projects/rscriptd/Makefile b/projects/rscriptd/Makefile index 4c960db7..cd357bbe 100644 --- a/projects/rscriptd/Makefile +++ b/projects/rscriptd/Makefile @@ -23,6 +23,9 @@ LIBS += $(addprefix -lstg,$(STGLIBS)) $(LIB_THREAD) ifneq ($(OS),linux) LIBS += -liconv +D_FLAG = -D +else +D_FLAG = -d endif SEARCH_DIRS = -I ../../include @@ -62,9 +65,9 @@ install: install-bin install-data install-bin: ifeq ($(DEBUG), yes) - install -D -m $(BIN_MODE) -o $(OWNER) $(PROG) $(PREFIX)/usr/sbin/$(PROG) + install $(D_FLAG) -m $(BIN_MODE) -o $(OWNER) $(PROG) $(PREFIX)/usr/sbin/$(PROG) else - install -D -m $(BIN_MODE) -o $(OWNER) -s $(PROG) $(PREFIX)/usr/sbin/$(PROG) + install $(D_FLAG) -m $(BIN_MODE) -o $(OWNER) -s $(PROG) $(PREFIX)/usr/sbin/$(PROG) endif $(MAKE) -C $(DIR_LIBSRC) install @@ -73,11 +76,11 @@ install-data: mkdir -m $(DIR_MODE) -p $(PREFIX)/etc/rscriptd install -m $(DATA_MODE) -o $(OWNER) ./rscriptd.conf $(PREFIX)/etc/rscriptd/rscriptd.conf ifeq ($(OS), linux) - install -D -m $(BIN_MODE) -o $(OWNER) ../stargazer/inst/linux/etc/stargazer/OnConnect $(PREFIX)/etc/rscriptd/ - install -D -m $(BIN_MODE) -o $(OWNER) ../stargazer/inst/linux/etc/stargazer/OnDisconnect $(PREFIX)/etc/rscriptd/ + install $(D_FLAG) -m $(BIN_MODE) -o $(OWNER) ../stargazer/inst/linux/etc/stargazer/OnConnect $(PREFIX)/etc/rscriptd/ + install $(D_FLAG) -m $(BIN_MODE) -o $(OWNER) ../stargazer/inst/linux/etc/stargazer/OnDisconnect $(PREFIX)/etc/rscriptd/ else - install -D -m $(BIN_MODE) -o $(OWNER) ../stargazer/inst/freebsd/etc/stargazer/OnConnect $(PREFIX)/etc/rscriptd/ - install -D -m $(BIN_MODE) -o $(OWNER) ../stargazer/inst/freebsd/etc/stargazer/OnDisconnect $(PREFIX)/etc/rscriptd/ + install $(D_FLAG) -m $(BIN_MODE) -o $(OWNER) ../stargazer/inst/freebsd/etc/stargazer/OnConnect $(PREFIX)/etc/rscriptd/ + install $(D_FLAG) -m $(BIN_MODE) -o $(OWNER) ../stargazer/inst/freebsd/etc/stargazer/OnDisconnect $(PREFIX)/etc/rscriptd/ endif uninstall: uninstall-bin uninstall-data diff --git a/projects/sgauth/Makefile b/projects/sgauth/Makefile index ef649119..3c538966 100644 --- a/projects/sgauth/Makefile +++ b/projects/sgauth/Makefile @@ -23,7 +23,10 @@ LIBS += $(addprefix -lstg,$(STGLIBS)) $(LIB_THREAD) ifneq ($(OS),linux) LIBS += -lintl \ -lc \ - -liconv + -liconv +D_FLAG = -D +else +D_FLAG = -d endif SEARCH_DIRS = -I ../../include @@ -59,9 +62,9 @@ install: install-bin install-data install-bin: ifeq ($(DEBUG), yes) - install -D -m $(BIN_MODE) -o $(OWNER) $(PROG) $(PREFIX)/usr/sbin/$(PROG) + install $(D_FLAG) -m $(BIN_MODE) -o $(OWNER) $(PROG) $(PREFIX)/usr/sbin/$(PROG) else - install -D -m $(BIN_MODE) -o $(OWNER) -s $(PROG) $(PREFIX)/usr/sbin/$(PROG) + install $(D_FLAG) -m $(BIN_MODE) -o $(OWNER) -s $(PROG) $(PREFIX)/usr/sbin/$(PROG) endif $(MAKE) -C $(DIR_LIBSRC) install diff --git a/projects/sgauthstress/Makefile b/projects/sgauthstress/Makefile index f88e59c6..3cc73a97 100644 --- a/projects/sgauthstress/Makefile +++ b/projects/sgauthstress/Makefile @@ -9,8 +9,8 @@ SRCS = main.cpp \ proto.cpp STGLIBS = dotconfpp \ - crypto \ - common + crypto \ + common STGLIBS_INCS = $(addprefix -I ../../stglibs/,$(addsuffix .lib/include,$(STGLIBS))) STGLIBS_LIBS = $(addprefix -L ../../stglibs/,$(addsuffix .lib,$(STGLIBS))) @@ -19,10 +19,12 @@ LIBS += $(addprefix -lstg,$(STGLIBS)) $(LIB_THREAD) ifeq ($(OS),linux) LIBS += -ldl +D_FLAG = -D else LIBS += -lintl \ -lc \ - -liconv + -liconv +D_FLAG = -d endif SEARCH_DIRS = -I ../../include diff --git a/projects/sgconf/Makefile b/projects/sgconf/Makefile index 09699122..be513439 100644 --- a/projects/sgconf/Makefile +++ b/projects/sgconf/Makefile @@ -11,7 +11,7 @@ SRCS = ./main.cpp \ STGLIBS = conffiles \ srvconf \ - crypto \ + crypto \ common STGLIBS_INCS = $(addprefix -I ../../stglibs/,$(addsuffix .lib/include,$(STGLIBS))) @@ -22,7 +22,10 @@ LIBS += $(addprefix -lstg,$(STGLIBS)) -lexpat $(LIB_THREAD) ifeq ($(OS),linux) else LIBS += -lc \ - -liconv + -liconv +D_FLAG = -D +else +D_FLAG = -d endif SEARCH_DIRS = -I ../../include @@ -71,9 +74,9 @@ install: install-bin install-bin: ifeq ($(DEBUG), yes) - install -D -m $(BIN_MODE) -o $(OWNER) $(PROG) $(PREFIX)/usr/bin/$(PROG) + install $(D_FLAG) -m $(BIN_MODE) -o $(OWNER) $(PROG) $(PREFIX)/usr/bin/$(PROG) else - install -D -m $(BIN_MODE) -o $(OWNER) -s $(PROG) $(PREFIX)/usr/bin/$(PROG) + install $(D_FLAG) -m $(BIN_MODE) -o $(OWNER) -s $(PROG) $(PREFIX)/usr/bin/$(PROG) endif $(MAKE) -C $(DIR_LIBSRC) install diff --git a/projects/sgconf_xml/Makefile b/projects/sgconf_xml/Makefile index b953bb52..ab53b752 100644 --- a/projects/sgconf_xml/Makefile +++ b/projects/sgconf_xml/Makefile @@ -22,7 +22,10 @@ LIBS += $(addprefix -lstg,$(STGLIBS)) -lexpat $(LIB_THREAD) ifeq ($(OS),linux) else LIBS += -lc \ - -liconv + -liconv +D_FLAG = -D +else +D_FLAG = -d endif SEARCH_DIRS = -I ../../include @@ -67,9 +70,9 @@ install: install-bin install-data install-bin: ifeq ($(DEBUG), yes) - install -D -m $(BIN_MODE) -o $(OWNER) $(PROG) $(PREFIX)/usr/bin/$(PROG) + install $(D_FLAG) -m $(BIN_MODE) -o $(OWNER) $(PROG) $(PREFIX)/usr/bin/$(PROG) else - install -D -m $(BIN_MODE) -o $(OWNER) -s $(PROG) $(PREFIX)/usr/bin/$(PROG) + install $(D_FLAG) -m $(BIN_MODE) -o $(OWNER) -s $(PROG) $(PREFIX)/usr/bin/$(PROG) endif $(MAKE) -C $(DIR_LIBSRC) install diff --git a/projects/sgconv/Makefile b/projects/sgconv/Makefile index ceea22b7..fae92f7b 100644 --- a/projects/sgconv/Makefile +++ b/projects/sgconv/Makefile @@ -10,9 +10,9 @@ SRCS = ./main.cpp \ ./settings_impl.cpp STGLIBS = dotconfpp \ - conffiles \ - logger \ - crypto \ + conffiles \ + logger \ + crypto \ common STGLIBS_INCS = $(addprefix -I ../../stglibs/,$(addsuffix .lib/include,$(STGLIBS))) @@ -22,8 +22,10 @@ LIBS += $(addprefix -lstg,$(STGLIBS)) $(LIB_THREAD) ifeq ($(OS),linux) LIBS += -ldl +D_FLAG = -D else LIBS += -lc -liconv +D_FLAG = -d endif SEARCH_DIRS = -I ../../include @@ -45,7 +47,7 @@ all: libs plugins $(PROG) ../../Makefile.conf libs: $(MAKE) -C $(DIR_LIBSRC) -plugins: libs +plugins: libs $(MAKE) -C $(DIR_PLUGINS) $(PROG): $(OBJS) @@ -67,9 +69,9 @@ install: install-bin install-bin: ifeq ($(DEBUG), yes) - install -D -m $(BIN_MODE) -o $(OWNER) $(PROG) $(PREFIX)/usr/bin/$(PROG) + install $(D_FLAG) -m $(BIN_MODE) -o $(OWNER) $(PROG) $(PREFIX)/usr/bin/$(PROG) else - install -D -m $(BIN_MODE) -o $(OWNER) -s $(PROG) $(PREFIX)/usr/bin/$(PROG) + install $(D_FLAG) -m $(BIN_MODE) -o $(OWNER) -s $(PROG) $(PREFIX)/usr/bin/$(PROG) endif $(MAKE) -C $(DIR_PLUGINS) install diff --git a/projects/stargazer/Makefile b/projects/stargazer/Makefile index e210dc2f..640fb0e1 100644 --- a/projects/stargazer/Makefile +++ b/projects/stargazer/Makefile @@ -37,8 +37,10 @@ LIBS += $(addprefix -lstg,$(STGLIBS)) $(LIB_THREAD) ifeq ($(OS),linux) LIBS += -ldl +D_FLAG = -D else LIBS += -lc -liconv +D_FLAG = -d endif SEARCH_DIRS = -I ../../include @@ -83,9 +85,9 @@ install: install-bin install-data install-bin: $(PROG) ifeq ($(DEBUG), yes) - install -D -m $(BIN_MODE) -o $(OWNER) $(PROG) $(PREFIX)/usr/sbin/$(PROG) + install $(D_FLAG) -m $(BIN_MODE) -o $(OWNER) $(PROG) $(PREFIX)/usr/sbin/$(PROG) else - install -D -m $(BIN_MODE) -o $(OWNER) -s $(PROG) $(PREFIX)/usr/sbin/$(PROG) + install $(D_FLAG) -m $(BIN_MODE) -o $(OWNER) -s $(PROG) $(PREFIX)/usr/sbin/$(PROG) endif $(MAKE) -C $(DIR_INCLUDE) install $(MAKE) -C $(DIR_LIBSRC) install