summaryrefslogtreecommitdiff
path: root/sysutils/gkrellm/files/top.Makefile.inc
blob: d8661b93ab8dd5fea366e268bef3b782c4c85b13 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
VERSION=	2.1.25

# Path options
PREFIX?=	/usr/local
X11BASE?=	/nonexistent
INSTALLROOT?=	$(DESTDIR)$(PREFIX)
INSTALLDIR?=	$(INSTALLROOT)/bin
INCLUDEDIR?=	$(INSTALLROOT)/include
LOCALEDIR?=	$(INSTALLROOT)/share/locale
PKGCONFIGDIR?=	$(INSTALLROOT)/lib/pkgconfig
MANDIR?=	$(INSTALLROOT)/man/man1
SMANDIR?=	$(INSTALLROOT)/man/man1
SINSTALLDIR?=	$(INSTALLROOT)/bin

# Ownership and mode options
DATAMODE?=	0644
BINMODE?=	0755
BINOWNER?=	root
BINGROUP?=	root

# Tools paths
MSGFMT?=	msgfmt
MSGFMT_OPT?=	-f -v 
INSTALL?=	install
PKG_CONFIG?=	pkg-config
STRIP?=		-s

# Helpers
INSTALL_DIR=	$(INSTALL) -d
INSTALL_DATA=	$(INSTALL) -c -m $(DATAMODE)
INSTALL_BIN=	$(INSTALL) -c -m $(BINMODE) -o $(BINOWNER) -g $(BINGROUP)

# Compilation options
ENABLE_NLS?=	yes
DEBUG?=		no
PROFILE?=	no
NEED_MD5?=	yes
MD5_LIBS?=
GKRELLM_CFLAGS?=
GTOP?=

# Vanilla GKrellM compatibility
ifeq ($(enable_nls),1)
ENABLE_NLS=	yes
endif
ifeq ($(enable_nls),yes)
ENABLE_NLS=	yes
endif
ifeq ($(debug),1)
DEBUG=		yes
endif
ifeq ($(debug),yes)
DEBUG=		yes
endif
ifeq ($(profile),1)
PROFILE=	yes
endif
ifeq ($(profile),yes)
PROFILE=	yes
endif

ifeq ($(GTOP),)
# OS-specific overrides
SUPPORTED_OSES=	Linux NetBSD FreeBSD OpenBSD Darwin Solaris

REALOPSYS=	$(shell uname -s)
OPSYS=		$(if $(findstring $(REALOPSYS),$(SUPPORTED_OSES)),$(REALOPSYS),Linux)
OSREV=		$(shell uname -r)

# Isn't this ugly?

ifeq ($(OPSYS),NetBSD)
SYS_LIBS=	-lkvm
BINGROUP=	kmem
NEED_MD5=	no
MD5_LIBS=
else
 ifeq ($(OPSYS),OpenBSD)
SYS_LIBS=	-lkvm -pthread
BINGROUP=	kmem
 else
  ifeq ($(OPSYS),FreeBSD)
BINGROUP=	kmem
NEED_MD5=	no
MD5_LIBS=	-lmd
   ifeq ($(filter 2.%,$(OSREV)),)
SYS_LIBS=	-lkvm -ldevstat
   else
SYS_LIBS=	-lkvm
   endif
  else
   ifeq ($(OPSYS),Darwin)
SYS_LIBS=	-lkvm -framework IOKit
LINK_FLAGS+=	-prebind -Wl,-bind_at_load -framework CoreFoundation -lX11
GTK_CONFIG=	gtk-config
STRIP=
NEED_MD5=	no
MD5_LIBS=	-lmd5
    ifeq ($(MODULE),src)
LINK_FLAGS+=	-lX11
    endif
   else
    ifeq ($(OPSYS),Solaris)
MSGFMT_OPT=	-v 
CC?=		gcc
GKRELLM_CFLAGS=	-Wno-implicit-int
SYS_LIBS=	-lkstat -lkvm -ldevinfo
     ifeq ($(OSREV),5.8)
LINK_FLAGS=
SYS_LIBS+=	-lsocket -lintl
      ifeq ($(MODULE),src)
SYS_LIBS+=	-lresolv -lX11
      else # Well, we don't really care about po
SYS_LIBS+=	-lnsl
GKRELLM_CFLAGS=	-DSOLARIS_8
      endif
     else
      ifeq ($(MODULE),src)
SYS_LIBS+=	-lresolv
      else
SYS_LIBS+=	-lsocket -lnsl
      endif
     endif
    endif
   endif
  endif
 endif
endif
else	# GTOP
LINK_FLAGS=
MD5_LIBS=
 ifeq ($(GTOP), gnome-gtop)
SYS_LIBS=	`gnome-config --libs libgtop`
GKRELLM_CFLAGS=	`gnome-config --cflags libgtop`
 else
  ifeq ($(GTOP), gtop)
SYS_LIBS=	`libgtop-config --libs`
GKRELLM_CFLAGS=	`libgtop-config --cflags`
  else	# gtop1.0 by default
GTOP_PREFIX?=	/usr
GKRELLM_CFLAGS=	-I$(GTOP_PREFIX)/include
SYS_LIBS=	-L$(GTOP_PREFIX)/lib -lgtop -lgtop_common -lgtop_sysdeps
   ifeq ($(MODULE),src)
SYS_LIBS+=	-lXau
   endif
  endif
 endif
endif

CFLAGS+=	$(GKRELLM_CFLAGS)