Browse code

- mips v1 support introduces (really brain dead processors, no hardware locking support -> we have to use sysv)

Andrei Pelinescu-Onciul authored on 08/11/2003 18:27:10
Showing 1 changed files
... ...
@@ -29,6 +29,7 @@
29 29
 #  2003-09-25  added -pthread into LIBS when compiling on FreeBSD/alpha
30 30
 #              and other FreeBSD arches for which no fast locking assembly
31 31
 #              code exists (sobomax)
32
+#  2003-11-08  mips1 support introduced (andrei)
32 33
 
33 34
 
34 35
 # check if already included/exported
... ...
@@ -240,16 +241,16 @@ endif
240 241
 # -DUSE_POSIX_SEM
241 242
 #		uses posix semaphores for locking (faster than sys v)
242 243
 # -DBUSY_WAIT
243
-#		uses busy waiting on the lock
244
+#		uses busy waiting on the lock (FAST_LOCK)
244 245
 # -DADAPTIVE_WAIT
245 246
 #		try busy waiting for a while and if the lock is still held go to
246
-#		force reschedule
247
+#		force reschedule (FAST_LOCK)
247 248
 # -DADAPTIVE_WAIT_LOOPS=number
248 249
 #		number of loops we busy wait, after "number" loops have elapsed we 
249
-#		force a reschedule
250
+#		force a reschedule (FAST_LOCK)
250 251
 # -DNOSMP
251 252
 #		don't use smp compliant locking (faster but won't work on SMP machines)
252
-#		(not yet enabled)
253
+#		(not yet enabled) (FAST_LOCK)
253 254
 # -DNO_PINGTEL_TAG_HACK
254 255
 #		if enabled, To-header-field will be less liberal and will not accept
255 256
 #		'tag=' (tag parameter with equal sign and without value); it is called
... ...
@@ -273,7 +274,6 @@ DEFS+= $(extra_defs) \
273 274
 	 -DCFG_DIR='"$(cfg-target)"'\
274 275
 	 -DPKG_MALLOC \
275 276
 	 -DSHM_MEM  -DSHM_MMAP \
276
-	 -DADAPTIVE_WAIT -DADAPTIVE_WAIT_LOOPS=1024 \
277 277
 	 -DDNS_IP_HACK \
278 278
 	 -DUSE_IPV6 \
279 279
 	 -DUSE_TCP \
... ...
@@ -386,8 +386,13 @@ ifeq ($(ARCH), ppc)
386 386
 	use_fast_lock=yes
387 387
 endif
388 388
 
389
+ifeq ($(ARCH), mips)
390
+# mips1 arch. (e.g. R3000) - no hardware locking support
391
+	use_fast_lock=no
392
+endif
393
+
389 394
 ifeq ($(use_fast_lock), yes)
390
-	DEFS+= -DFAST_LOCK
395
+	DEFS+= -DFAST_LOCK -DADAPTIVE_WAIT -DADAPTIVE_WAIT_LOOPS=1024 
391 396
 	found_lock_method=yes
392 397
 endif
393 398
 
... ...
@@ -519,15 +524,46 @@ else
519 524
 				#really old version
520 525
 $(warning			You are using an old and unsupported gcc \
521 526
 					 version ($(CC_SHORTVER)), compile at your own risk!)
522
-
527
+	
523 528
 endif			# CC_SHORTVER, 2.9x
524 529
 endif			# CC_SHORTVER, 3.0
530
+	
531
+else		# CC_NAME, gcc
532
+				#other compilers
533
+$(error 			Unsupported compiler ($(CC):$(CC_NAME)), try gcc)
534
+endif		#CC_NAME, gcc
535
+endif	#ARCH, arm 
525 536
 
537
+	#if  mips (R3000)
538
+ifeq	($(ARCH), mips)
539
+		# if gcc 
540
+ifeq		($(CC_NAME), gcc)
541
+				#common stuff
542
+				CFLAGS=-O9 -funroll-loops  -Wcast-align $(PROFILE) \
543
+					-Wall   \
544
+			#if gcc 3.0
545
+ifeq			($(CC_SHORTVER), 3.0)
546
+					CFLAGS+= -mcpu=r3000
547
+							#-mcpu=athlon
548
+else
549
+ifeq			($(CC_SHORTVER), 2.9x) #older gcc version (2.9[1-5])
550
+$(warning 			Old gcc detected ($(CC_SHORTVER)), use  gcc 3.0.x \
551
+					for better results)
552
+					
553
+					CFLAGS+=-mcpu=r3000
554
+else
555
+				#really old version
556
+$(warning			You are using an old and unsupported gcc \
557
+					 version ($(CC_SHORTVER)), compile at your own risk!)
558
+	
559
+endif			# CC_SHORTVER, 2.9x
560
+endif			# CC_SHORTVER, 3.0
561
+	
526 562
 else		# CC_NAME, gcc
527 563
 				#other compilers
528 564
 $(error 			Unsupported compiler ($(CC):$(CC_NAME)), try gcc)
529 565
 endif		#CC_NAME, gcc
530
-endif	#ARCH, i386
566
+endif	#ARCH, mips
531 567
 
532 568
 
533 569
 CFLAGS+= $(CC_EXTRA_OPTS)