--- server/Makefile.orig 2010-10-02 16:21:01 UTC +++ server/Makefile @@ -26,6 +26,7 @@ MANMODE ?= 644 MANDIRMODE ?= 755 INSTALL ?= install +PKGCONFIGDIR ?= $(INSTALLROOT)/lib/pkgconfig LINK_FLAGS ?= -Wl,-E EXTRAOBJS = @@ -57,18 +58,18 @@ PKG_INCLUDE = `$(PKG_CONFIG) --cflags glib-2.0 gthread-2.0` PKG_LIB = `$(PKG_CONFIG) --libs glib-2.0 gmodule-2.0 gthread-2.0` -GLIB12_INCLUDE = `glib-config --cflags` -GLIB12_LIB = `glib-config --libs glib gmodule` +GLIB12_INCLUDE = `$(GLIB_CONFIG) --cflags` +GLIB12_LIB = `$(GLIB_CONFIG) --libs glib gmodule` -FLAGS = -O2 $(PKG_INCLUDE) +FLAGS = $(PKG_INCLUDE) ifeq ($(glib12),1) - FLAGS = -O2 $(GLIB12_INCLUDE) + FLAGS = $(GLIB12_INCLUDE) endif ifeq ($(glib12),yes) - FLAGS = -O2 $(GLIB12_INCLUDE) + FLAGS = $(GLIB12_INCLUDE) endif -FLAGS += $(GTOP_INCLUDE) $(PTHREAD_INC) -I.. -I$(SHARED_PATH) -DGKRELLM_SERVER +FLAGS += $(GTOP_INCLUDE) $(PTHREAD_INC) -I.. -I$(SHARED_PATH) -I$(LOCALBASE)/include -DGKRELLM_SERVER LIBS = $(PKG_LIB) ifeq ($(glib12),1) @@ -115,20 +116,31 @@ all: gkrellmd -gkrellmd: $(OBJS) $(EXTRAOBJS) +gkrellmd: gkrellmd.pc $(OBJS) $(EXTRAOBJS) $(CC) $(OBJS) $(EXTRAOBJS) -o gkrellmd \ $(LDFLAGS) $(LIBS) $(LINK_FLAGS) -static: $(OBJS) $(EXTRAOBJS) +static: gkrellmd.pc $(OBJS) $(EXTRAOBJS) $(CC) $(OBJS) $(EXTRAOBJS) -o gkrellmd.static -static \ $(LDFLAGS) $(LIBS) $(LINK_FLAGS) +gkrellmd.pc: Makefile + echo "prefix=$(INSTALLROOT)" > gkrellmd.pc + echo "Name: GKrellMd" >> gkrellmd.pc + echo "Description: Extensible GLIB system monitoring application server" >> gkrellmd.pc + echo "Version: $(VERSION)" >> gkrellmd.pc + echo "Requires: glib-2.0" >> gkrellmd.pc + echo "Cflags: -I$(INCLUDEDIR)" >> gkrellmd.pc + freebsd2: $(MAKE) EXTRAOBJS= SYS_LIBS="-lkvm -lmd" gkrellmd -freebsd3 freebsd: +freebsd3 freebsd4: $(MAKE) EXTRAOBJS= SYS_LIBS="-lkvm -ldevstat -lmd" gkrellmd +freebsd5 freebsd6 freebsd7 freebsd8 freebsd: + $(MAKE) EXTRAOBJS= SYS_LIBS="-ldevstat -lmd" gkrellmd + # Darwin target for systems that still have libkvm darwin: $(MAKE) STRIP= HAVE_GETADDRINFO=1 \ @@ -176,27 +188,32 @@ SYS_LIBS="-lws2_32 -lwtsapi32 -lpdh -lnetapi32 -liphlpapi -lintl" \ gkrellmd -install: install_bin install_inc install_man +install: install_bin install_inc install_man install_gkrellmd.pc install_bin: - $(INSTALL) -d -m $(INSTALLDIRMODE) $(SINSTALLDIR) - $(INSTALL) -c $(STRIP) -m $(BINMODE) $(PACKAGE_D)$(BINEXT) $(SINSTALLDIR)/$(PACKAGE_D)$(BINEXT) + $(INSTALL) -d -m $(INSTALLDIRMODE) $(DESTDIR)$(SINSTALLDIR) + $(INSTALL) -c $(STRIP) -m $(BINMODE) $(PACKAGE_D)$(BINEXT) $(DESTDIR)$(SINSTALLDIR)/$(PACKAGE_D)$(BINEXT) install_inc: - $(INSTALL) -d -m $(INCLUDEDIRMODE) $(INCLUDEDIR)/gkrellm2 - $(INSTALL) -c -m $(INCLUDEMODE) $(GKRELLMD_INCLUDES) $(INCLUDEDIR)/gkrellm2 + $(INSTALL) -d -m $(INCLUDEDIRMODE) $(DESTDIR)$(INCLUDEDIR)/gkrellm2 + $(INSTALL) -c -m $(INCLUDEMODE) $(GKRELLMD_INCLUDES) $(DESTDIR)$(INCLUDEDIR)/gkrellm2 install_man: - $(INSTALL) -d -m $(MANDIRMODE) $(SMANDIR) - $(INSTALL) -c -m $(MANMODE) ../gkrellmd.1 $(SMANDIR)/$(PACKAGE_D).1 + $(INSTALL) -d -m $(MANDIRMODE) $(DESTDIR)$(SMANDIR) + $(INSTALL) -c -m $(MANMODE) ../gkrellmd.1 $(DESTDIR)$(SMANDIR)/$(PACKAGE_D).8 install_cfg: - $(INSTALL) -d -m $(CFGDIRMODE) $(CFGDIR) - $(INSTALL) -c -m $(CFGMODE) gkrellmd.conf $(CFGDIR)/gkrellmd.conf + $(INSTALL) -d -m $(CFGDIRMODE) $(DESTDIR)$(CFGDIR) + $(INSTALL) -c -m $(CFGMODE) gkrellmd.conf $(DESTDIR)$(CFGDIR)/gkrellmd.conf + +install_gkrellmd.pc: + $(INSTALL) -d $(DESTDIR)$(PKGCONFIGDIR) + $(INSTALL) -c -m $(INCLUDEMODE) gkrellmd.pc $(DESTDIR)$(PKGCONFIGDIR) uninstall: rm -f $(SINSTALLDIR)/$(PACKAGE_D) rm -f $(SMANDIR)/$(PACKAGE_D).1 + rm -f $(PKGCONFIGDIR)/gkrellmd.pc install_darwin install_darwin9 install_macosx: $(MAKE) install STRIP= @@ -227,6 +244,7 @@ clean: $(RM) *.o *~ *.bak configure.h configure.log gkrellmd gkrellmd.exe \ libgkrellmd.a core + $(RM) gkrellmd.pc SYSDEPS = ../src/sysdeps/bsd-common.c ../src/sysdeps/bsd-net-open.c \ ../src/sysdeps/darwin.c \