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 181
 endif			# CC_SHORTVER, 3.0
182 182
 
183 183
 else		# CC_NAME, gcc
184
+ifeq		($(CC_NAME), icc)
185
+			CFLAGS=-O3  -ipo -ipo_obj -unroll  $(PROFILE) \
186
+					 -tpp6 -xK  #-openmp  #optimize for PIII 
187
+				# -prefetch doesn't seem to work
188
+				#( ty to inline acroos files, unroll loops,prefetch,
189
+				# optimize for PIII, use PIII instructions & vect.,
190
+				# mutlithread loops)
191
+else
184 192
 				#other compilers
185 193
 $(error 			Unsupported compiler ($(CC):$(CC_NAME)), try gcc)
194
+endif		#CC_NAME, icc
186 195
 endif		#CC_NAME, gcc
187 196
 endif	#ARCH, i386
188 197
 
... ...
@@ -236,6 +258,10 @@ ifeq	($(CC_NAME), gcc)
236 236
 	#gcc and maybe others
237 237
 	LDFLAGS+=-Wl,-O2 -Wl,-E $(PROFILE) 
238 238
 endif
239
+ifeq	($(CC_NAME), icc)
240
+	#gcc and maybe others
241
+	LDFLAGS+=-Wl,-O2 -Wl,-E $(PROFILE) 
242
+endif
239 243
 ifeq	($(CC_NAME), suncc)
240 244
 	LDFLAGS+=-xO5 $(PROFILE)
241 245
 endif
... ...
@@ -247,6 +273,10 @@ ifeq	($(CC_NAME), gcc)
247 247
 		CFLAGS=-g -Wcast-align -Winline $(PROFILE)
248 248
 		LDFLAGS+=-g -Wl,-E $(PROFILE)
249 249
 endif
250
+ifeq	($(CC_NAME), icc)
251
+		CFLAGS=-g  $(PROFILE)
252
+		LDFLAGS+=-g -Wl,-E $(PROFILE)
253
+endif
250 254
 ifeq	($(CC_NAME), suncc)
251 255
 		CFLAGS= -g $(PROFILE)
252 256
 		LDFLAGS+=-g $(PROFILE)
... ...
@@ -260,6 +290,10 @@ ifeq	($(CC_NAME), gcc)
260 260
 MOD_CFLAGS=-fPIC -DPIC $(CFLAGS)
261 261
 MOD_LDFLAGS=-shared $(LDFLAGS)
262 262
 endif
263
+ifeq	($(CC_NAME), icc)
264
+MOD_CFLAGS=-Kpic $(CFLAGS)
265
+MOD_LDFLAGS=-shared $(LDFLAGS)
266
+endif
263 267
 ifeq	($(CC_NAME), suncc)
264 268
 MOD_CFLAGS=-Kpic  $(CFLAGS)
265 269
 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 158
 #endif
159 159
 
160 160
 	struct sockaddr_in* from;
161
-	int fromlen;
161
+	unsigned int fromlen;
162 162
 
163 163
 
164 164
 	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)