Browse code

- support for intel icc - fixed even more warnings

Andrei Pelinescu-Onciul authored on 02/03/2002 00:23:13
Showing 3 changed files
... ...
@@ -8,7 +8,7 @@
8 8
 VERSION = 0
9 9
 PATCHLEVEL = 8
10 10
 SUBLEVEL = 7
11
-EXTRAVERSION = -3-suncc
11
+EXTRAVERSION = -4-icc
12 12
 
13 13
 RELEASE=$(VERSION).$(PATCHLEVEL).$(SUBLEVEL)$(EXTRAVERSION)
14 14
 OS = $(shell uname -s)
... ...
@@ -141,12 +141,25 @@ ifneq (, $(findstring Sun, $(CC_LONGVER)))
141 141
 	MKDEP=$(CC) -xM1 $(DEFS)
142 142
 endif
143 143
 
144
+ifneq (, $(findstring Intel(R) C++ Compiler, $(CC_LONGVER)))
145
+	# very nice: gcc compatible
146
+	CC_NAME=icc
147
+	CC_FULLVER=$(shell echo "$(CC_LONGVER)"|head -1| \
148
+					sed -e 's/.*Version \([0-9]\.[0-9]\.[0-9]*\).*/\1/g' )
149
+	CC_SHORTVER=$(shell echo "$(CC_FULLVER)" | cut -d. -f1,2 )
150
+	CC_VER=$(CC) $(CC_FULLVER)
151
+	MKDEP=$(CC) -MM $(DEFS)
152
+endif
153
+
154
+
144 155
 ifeq (,$(CC_NAME))
145 156
 #not found
146 157
 	CC_NAME=$(CC)
147 158
 	CC_SHORTVER=unknown
148 159
 	CC_VER=unknown
149 160
 	MKDEP=gcc -MM $(DEFS)
161
+$(warning	Unknown compiler $(CC)\; supported compilers: \
162
+			gcc, sun cc, intel icc )
150 163
 endif
151 164
 
152 165
 
... ...
@@ -181,8 +194,17 @@ endif			# CC_SHORTVER, 2.9x
181 194
 endif			# CC_SHORTVER, 3.0
182 195
 
183 196
 else		# CC_NAME, gcc
197
+ifeq		($(CC_NAME), icc)
198
+			CFLAGS=-O3  -ipo -ipo_obj -unroll  $(PROFILE) \
199
+					 -tpp6 -xK  #-openmp  #optimize for PIII 
200
+				# -prefetch doesn't seem to work
201
+				#( ty to inline acroos files, unroll loops,prefetch,
202
+				# optimize for PIII, use PIII instructions & vect.,
203
+				# mutlithread loops)
204
+else
184 205
 				#other compilers
185 206
 $(error 			Unsupported compiler ($(CC):$(CC_NAME)), try gcc)
207
+endif		#CC_NAME, icc
186 208
 endif		#CC_NAME, gcc
187 209
 endif	#ARCH, i386
188 210
 
... ...
@@ -236,6 +258,10 @@ ifeq	($(CC_NAME), gcc)
236 258
 	#gcc and maybe others
237 259
 	LDFLAGS+=-Wl,-O2 -Wl,-E $(PROFILE) 
238 260
 endif
261
+ifeq	($(CC_NAME), icc)
262
+	#gcc and maybe others
263
+	LDFLAGS+=-Wl,-O2 -Wl,-E $(PROFILE) 
264
+endif
239 265
 ifeq	($(CC_NAME), suncc)
240 266
 	LDFLAGS+=-xO5 $(PROFILE)
241 267
 endif
... ...
@@ -247,6 +273,10 @@ ifeq	($(CC_NAME), gcc)
247 273
 		CFLAGS=-g -Wcast-align -Winline $(PROFILE)
248 274
 		LDFLAGS+=-g -Wl,-E $(PROFILE)
249 275
 endif
276
+ifeq	($(CC_NAME), icc)
277
+		CFLAGS=-g  $(PROFILE)
278
+		LDFLAGS+=-g -Wl,-E $(PROFILE)
279
+endif
250 280
 ifeq	($(CC_NAME), suncc)
251 281
 		CFLAGS= -g $(PROFILE)
252 282
 		LDFLAGS+=-g $(PROFILE)
... ...
@@ -260,6 +290,10 @@ ifeq	($(CC_NAME), gcc)
260 290
 MOD_CFLAGS=-fPIC -DPIC $(CFLAGS)
261 291
 MOD_LDFLAGS=-shared $(LDFLAGS)
262 292
 endif
293
+ifeq	($(CC_NAME), icc)
294
+MOD_CFLAGS=-Kpic $(CFLAGS)
295
+MOD_LDFLAGS=-shared $(LDFLAGS)
296
+endif
263 297
 ifeq	($(CC_NAME), suncc)
264 298
 MOD_CFLAGS=-Kpic  $(CFLAGS)
265 299
 MOD_LDFLAGS=-G $(LDFLAGS)
... ...
@@ -26,9 +26,12 @@ int udp_sock;
26 26
 int probe_max_receive_buffer( int udp_sock )
27 27
 {
28 28
 	int optval, optvallen;
29
-	int ioptval, ioptvallen;
30
-	int foptval, foptvallen;
31
-	int voptval, voptvallen;
29
+	int ioptval;
30
+	unsigned int ioptvallen;
31
+	int foptval;
32
+	unsigned int foptvallen;
33
+	int voptval;
34
+	unsigned int voptvallen;
32 35
 	int i;
33 36
 	int phase=0;
34 37
 
... ...
@@ -158,7 +161,7 @@ int udp_rcv_loop()
158 161
 #endif
159 162
 
160 163
 	struct sockaddr_in* from;
161
-	int fromlen;
164
+	unsigned int fromlen;
162 165
 
163 166
 
164 167
 	from=(struct sockaddr_in*) malloc(sizeof(struct sockaddr_in));
... ...
@@ -23,7 +23,7 @@
23 23
 	}while(0)
24 24
 
25 25
 #define trim_r( _mystr ) \
26
-	do{	static _c; \
26
+	do{	static char _c; \
27 27
 		while( ((_mystr).len) && ((_c=(_mystr).s[(_mystr).len-1]))==0 || _c=='\r' || _c=='\n') \
28 28
 			(_mystr).len--; \
29 29
 	}while(0)