Browse code

- gcc 3.4 makefile support - openbsd 3.2 daemonize.c compile fixes

Andrei Pelinescu-Onciul authored on 14/12/2004 18:39:22
Showing 2 changed files
... ...
@@ -34,6 +34,7 @@
34 34
 #  2004-07-27  darwin (mac os x) port  (andrei)
35 35
 #  2004-09-12  mips2 & cobalt support introduced (andrei)
36 36
 #  2004-09-28  x86_64 support introduced (andrei)
37
+#  2004-12-14  gcc-3.4 special case added (andrei)
37 38
 
38 39
 
39 40
 # check if already included/exported
... ...
@@ -50,7 +51,7 @@ MAIN_NAME=ser
50 51
 VERSION = 0
51 52
 PATCHLEVEL = 8
52 53
 SUBLEVEL =   99
53
-EXTRAVERSION = -dev25
54
+EXTRAVERSION = -dev26
54 55
 
55 56
 RELEASE=$(VERSION).$(PATCHLEVEL).$(SUBLEVEL)$(EXTRAVERSION)
56 57
 OS = $(shell uname -s | sed -e s/SunOS/solaris/ | tr "[A-Z]" "[a-z]")
... ...
@@ -173,8 +174,9 @@ ifneq (,$(findstring gcc, $(CC_LONGVER)))
173 174
 	#transform gcc version into 2.9x or 3.0
174 175
 	CC_SHORTVER=$(shell echo "$(CC_VER)" | cut -d" " -f 2| \
175 176
 				 sed -e 's/[^0-9]*-\(.*\)/\1/'| \
176
-				 sed -e 's/2\.9.*/2.9x/' -e 's/3\..\..*/3.0/' -e \
177
-				 	's/3\../3.0/')
177
+				 sed -e 's/2\.9.*/2.9x/' -e 's/3\.[0-3]\..*/3.0/' -e \
178
+				 	's/3\.[0-3]/3.0/' -e 's/3\.[4-9]\..*/3.4/' -e \
179
+					's/3\.[4-9]/3.4/' )
178 180
 endif
179 181
 
180 182
 ifneq (, $(findstring Sun, $(CC_LONGVER)))
... ...
@@ -430,14 +432,20 @@ ifeq	($(ARCH), i386)
430 432
 ifeq		($(CC_NAME), gcc)
431 433
 				#common stuff
432 434
 				CFLAGS=-g -O9 -funroll-loops  -Wcast-align $(PROFILE) \
433
-					-Wall   \
434
-			#if gcc 3.0
435
+					-Wall  
436
+			#if gcc 3.4+
437
+ifeq			($(CC_SHORTVER), 3.4)
438
+					CPU ?= athlon
439
+					CFLAGS+=-minline-all-stringops -malign-double \
440
+							-falign-loops \
441
+							-mtune=$(CPU) 
442
+else
443
+			#if gcc 3.0+
435 444
 ifeq			($(CC_SHORTVER), 3.0)
436 445
 					CPU ?= athlon
437 446
 					CFLAGS+=-minline-all-stringops -malign-double \
438 447
 							-falign-loops \
439
-							-mcpu=$(CPU) \
440
-							#-mcpu=athlon
448
+							-mcpu=$(CPU) 
441 449
 else
442 450
 ifeq			($(CC_SHORTVER), 2.9x) #older gcc version (2.9[1-5])
443 451
 $(warning 			Old gcc detected ($(CC_SHORTVER)), use  gcc >= 3.1 \
... ...
@@ -452,6 +460,7 @@ $(warning			You are using an old and unsupported gcc \
452 460
 
453 461
 endif			# CC_SHORTVER, 2.9x
454 462
 endif			# CC_SHORTVER, 3.0
463
+endif			# CC_SHORTVER, 3.4
455 464
 
456 465
 else		# CC_NAME, gcc
457 466
 ifeq		($(CC_NAME), icc)
... ...
@@ -474,12 +483,18 @@ ifeq	($(ARCH), x86_64)
474 483
 ifeq		($(CC_NAME), gcc)
475 484
 				#common stuff
476 485
 				CFLAGS=-g -O9 -funroll-loops  -Wcast-align $(PROFILE) \
477
-					-Wall   \
486
+					-Wall 
487
+			#if gcc 3.4
488
+ifeq			($(CC_SHORTVER), 3.4)
489
+					CPU ?= athlon64
490
+					CFLAGS+=-minline-all-stringops \
491
+							-falign-loops 
492
+else
478 493
 			#if gcc 3.0
479 494
 ifeq			($(CC_SHORTVER), 3.0)
480 495
 					CPU ?= athlon64
481 496
 					CFLAGS+=-minline-all-stringops \
482
-							-falign-loops \
497
+							-falign-loops 
483 498
 							#-mcpu=$(CPU) \ # not working on all x86_64 gccs
484 499
 							#-mcpu=athlon
485 500
 else
... ...
@@ -496,6 +511,7 @@ $(warning			You are using an old and unsupported gcc \
496 511
 
497 512
 endif			# CC_SHORTVER, 2.9x
498 513
 endif			# CC_SHORTVER, 3.0
514
+endif			# CC_SHORTVER, 3.4
499 515
 
500 516
 else		# CC_NAME, gcc
501 517
 ifeq		($(CC_NAME), icc)
... ...
@@ -521,6 +537,12 @@ ifeq		($(CC_NAME), gcc)
521 537
 					-Wall\
522 538
 					#-Wcast-align \
523 539
 					#-Wmissing-prototypes 
540
+				#if gcc 3.4
541
+ifeq			($(CC_SHORTVER), 3.4)
542
+					CPU ?= ultrasparc
543
+					#use 32bit for now
544
+					CFLAGS+= -mcpu=ultrasparc -mtune=$(CPU)
545
+else
524 546
 				#if gcc 3.0
525 547
 ifeq			($(CC_SHORTVER), 3.0)
526 548
 					CPU ?= ultrasparc
... ...
@@ -557,6 +579,7 @@ endif
557 579
 	
558 580
 endif			#CC_SHORTVER, 2.9x
559 581
 endif			#CC_SHORTVER, 3.0
582
+endif			#CC_SHORTVER, 3.4
560 583
 
561 584
 else		#CC_NAME, gcc
562 585
 ifeq		($(CC_NAME), suncc)
... ...
@@ -576,7 +599,11 @@ ifeq	($(ARCH), arm)
576 599
 ifeq		($(CC_NAME), gcc)
577 600
 				#common stuff
578 601
 				CFLAGS=-O9 -funroll-loops  -Wcast-align $(PROFILE) \
579
-					-Wall   \
602
+					-Wall   
603
+			#if gcc 3.4+
604
+ifeq			($(CC_SHORTVER), 3.4)
605
+					CFLAGS+= -mcpu=strongarm1100
606
+else
580 607
 			#if gcc 3.0
581 608
 ifeq			($(CC_SHORTVER), 3.0)
582 609
 					CFLAGS+= -mcpu=strongarm1100
... ...
@@ -594,6 +621,7 @@ $(warning			You are using an old and unsupported gcc \
594 621
 	
595 622
 endif			# CC_SHORTVER, 2.9x
596 623
 endif			# CC_SHORTVER, 3.0
624
+endif			# CC_SHORTVER, 3.4
597 625
 	
598 626
 else		# CC_NAME, gcc
599 627
 				#other compilers
... ...
@@ -607,7 +635,11 @@ ifeq	($(ARCH), mips)
607 635
 ifeq		($(CC_NAME), gcc)
608 636
 				#common stuff
609 637
 				CFLAGS=-O9 -funroll-loops  -Wcast-align $(PROFILE) \
610
-					-Wall   \
638
+					-Wall 
639
+			#if gcc 3.4+
640
+ifeq			($(CC_SHORTVER), 3.4)
641
+					CFLAGS+= -mcpu=r3000
642
+else
611 643
 			#if gcc 3.0
612 644
 ifeq			($(CC_SHORTVER), 3.0)
613 645
 					CFLAGS+= -mcpu=r3000
... ...
@@ -625,6 +657,7 @@ $(warning			You are using an old and unsupported gcc \
625 657
 	
626 658
 endif			# CC_SHORTVER, 2.9x
627 659
 endif			# CC_SHORTVER, 3.0
660
+endif			# CC_SHORTVER, 3.4
628 661
 	
629 662
 else		# CC_NAME, gcc
630 663
 				#other compilers
... ...
@@ -638,7 +671,11 @@ ifeq	($(ARCH), mips2)
638 671
 ifeq		($(CC_NAME), gcc)
639 672
 				#common stuff
640 673
 				CFLAGS= -mips2 -O9 -funroll-loops $(PROFILE) \
641
-					-Wall   \
674
+					-Wall 
675
+			#if gcc 3.4+
676
+ifeq			($(CC_SHORTVER), 3.4)
677
+					CFLAGS+=
678
+else
642 679
 			#if gcc 3.0
643 680
 ifeq			($(CC_SHORTVER), 3.0)
644 681
 					CFLAGS+=
... ...
@@ -654,6 +691,7 @@ $(warning			You are using an old and unsupported gcc \
654 691
 	
655 692
 endif			# CC_SHORTVER, 2.9x
656 693
 endif			# CC_SHORTVER, 3.0
694
+endif			# CC_SHORTVER, 3.4
657 695
 	
658 696
 else		# CC_NAME, gcc
659 697
 				#other compilers
... ...
@@ -34,24 +34,25 @@
34 34
  *  2004-05-03  applied pgid patch from janakj
35 35
  */
36 36
 
37
-#define _XOPEN_SOURCE   /* needed on linux for the  getpgid prototype */
38
-#define _XOPEN_SOURCE_EXTENDED /* same as above */
39
-#define __EXTENSIONS__ /* needed on solaris: if XOPEN_SOURCE is defined
40
-                          struct timeval defintion from <sys/time.h> won't
41
-                          be included => workarround define _EXTENSIONS_
42
-                           -andrei */
43 37
 
44 38
 #include <sys/types.h>
45
-#include <unistd.h>
46 39
 #include <signal.h>
47 40
 #include <syslog.h>
48 41
 #include <errno.h>
49 42
 #include <string.h>
50 43
 #include <stdio.h>
51 44
 #include <stdlib.h>
52
-#include <sys/time.h>      /* setrlimit */
53 45
 #include <sys/resource.h> /* setrlimit */
54 46
 
47
+#define _XOPEN_SOURCE   /* needed on linux for the  getpgid prototype */
48
+#define _XOPEN_SOURCE_EXTENDED /* same as above */
49
+#define __EXTENSIONS__ /* needed on solaris: if XOPEN_SOURCE is defined
50
+                          struct timeval defintion from <sys/time.h> won't
51
+                          be included => workarround define _EXTENSIONS_
52
+                           -andrei */
53
+#include <unistd.h>
54
+#include <sys/time.h>    
55
+
55 56
 #include "daemonize.h"
56 57
 #include "globals.h"
57 58
 #include "dprint.h"