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 50
 VERSION = 0
51 51
 PATCHLEVEL = 8
52 52
 SUBLEVEL =   99
53
-EXTRAVERSION = -dev25
53
+EXTRAVERSION = -dev26
54 54
 
55 55
 RELEASE=$(VERSION).$(PATCHLEVEL).$(SUBLEVEL)$(EXTRAVERSION)
56 56
 OS = $(shell uname -s | sed -e s/SunOS/solaris/ | tr "[A-Z]" "[a-z]")
... ...
@@ -173,8 +174,9 @@ ifneq (,$(findstring gcc, $(CC_LONGVER)))
173 173
 	#transform gcc version into 2.9x or 3.0
174 174
 	CC_SHORTVER=$(shell echo "$(CC_VER)" | cut -d" " -f 2| \
175 175
 				 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/')
176
+				 sed -e 's/2\.9.*/2.9x/' -e 's/3\.[0-3]\..*/3.0/' -e \
177
+				 	's/3\.[0-3]/3.0/' -e 's/3\.[4-9]\..*/3.4/' -e \
178
+					's/3\.[4-9]/3.4/' )
178 179
 endif
179 180
 
180 181
 ifneq (, $(findstring Sun, $(CC_LONGVER)))
... ...
@@ -430,14 +432,20 @@ ifeq	($(ARCH), i386)
430 430
 ifeq		($(CC_NAME), gcc)
431 431
 				#common stuff
432 432
 				CFLAGS=-g -O9 -funroll-loops  -Wcast-align $(PROFILE) \
433
-					-Wall   \
434
-			#if gcc 3.0
433
+					-Wall  
434
+			#if gcc 3.4+
435
+ifeq			($(CC_SHORTVER), 3.4)
436
+					CPU ?= athlon
437
+					CFLAGS+=-minline-all-stringops -malign-double \
438
+							-falign-loops \
439
+							-mtune=$(CPU) 
440
+else
441
+			#if gcc 3.0+
435 442
 ifeq			($(CC_SHORTVER), 3.0)
436 443
 					CPU ?= athlon
437 444
 					CFLAGS+=-minline-all-stringops -malign-double \
438 445
 							-falign-loops \
439
-							-mcpu=$(CPU) \
440
-							#-mcpu=athlon
446
+							-mcpu=$(CPU) 
441 447
 else
442 448
 ifeq			($(CC_SHORTVER), 2.9x) #older gcc version (2.9[1-5])
443 449
 $(warning 			Old gcc detected ($(CC_SHORTVER)), use  gcc >= 3.1 \
... ...
@@ -452,6 +460,7 @@ $(warning			You are using an old and unsupported gcc \
452 452
 
453 453
 endif			# CC_SHORTVER, 2.9x
454 454
 endif			# CC_SHORTVER, 3.0
455
+endif			# CC_SHORTVER, 3.4
455 456
 
456 457
 else		# CC_NAME, gcc
457 458
 ifeq		($(CC_NAME), icc)
... ...
@@ -474,12 +483,18 @@ ifeq	($(ARCH), x86_64)
474 474
 ifeq		($(CC_NAME), gcc)
475 475
 				#common stuff
476 476
 				CFLAGS=-g -O9 -funroll-loops  -Wcast-align $(PROFILE) \
477
-					-Wall   \
477
+					-Wall 
478
+			#if gcc 3.4
479
+ifeq			($(CC_SHORTVER), 3.4)
480
+					CPU ?= athlon64
481
+					CFLAGS+=-minline-all-stringops \
482
+							-falign-loops 
483
+else
478 484
 			#if gcc 3.0
479 485
 ifeq			($(CC_SHORTVER), 3.0)
480 486
 					CPU ?= athlon64
481 487
 					CFLAGS+=-minline-all-stringops \
482
-							-falign-loops \
488
+							-falign-loops 
483 489
 							#-mcpu=$(CPU) \ # not working on all x86_64 gccs
484 490
 							#-mcpu=athlon
485 491
 else
... ...
@@ -496,6 +511,7 @@ $(warning			You are using an old and unsupported gcc \
496 496
 
497 497
 endif			# CC_SHORTVER, 2.9x
498 498
 endif			# CC_SHORTVER, 3.0
499
+endif			# CC_SHORTVER, 3.4
499 500
 
500 501
 else		# CC_NAME, gcc
501 502
 ifeq		($(CC_NAME), icc)
... ...
@@ -521,6 +537,12 @@ ifeq		($(CC_NAME), gcc)
521 521
 					-Wall\
522 522
 					#-Wcast-align \
523 523
 					#-Wmissing-prototypes 
524
+				#if gcc 3.4
525
+ifeq			($(CC_SHORTVER), 3.4)
526
+					CPU ?= ultrasparc
527
+					#use 32bit for now
528
+					CFLAGS+= -mcpu=ultrasparc -mtune=$(CPU)
529
+else
524 530
 				#if gcc 3.0
525 531
 ifeq			($(CC_SHORTVER), 3.0)
526 532
 					CPU ?= ultrasparc
... ...
@@ -557,6 +579,7 @@ endif
557 557
 	
558 558
 endif			#CC_SHORTVER, 2.9x
559 559
 endif			#CC_SHORTVER, 3.0
560
+endif			#CC_SHORTVER, 3.4
560 561
 
561 562
 else		#CC_NAME, gcc
562 563
 ifeq		($(CC_NAME), suncc)
... ...
@@ -576,7 +599,11 @@ ifeq	($(ARCH), arm)
576 576
 ifeq		($(CC_NAME), gcc)
577 577
 				#common stuff
578 578
 				CFLAGS=-O9 -funroll-loops  -Wcast-align $(PROFILE) \
579
-					-Wall   \
579
+					-Wall   
580
+			#if gcc 3.4+
581
+ifeq			($(CC_SHORTVER), 3.4)
582
+					CFLAGS+= -mcpu=strongarm1100
583
+else
580 584
 			#if gcc 3.0
581 585
 ifeq			($(CC_SHORTVER), 3.0)
582 586
 					CFLAGS+= -mcpu=strongarm1100
... ...
@@ -594,6 +621,7 @@ $(warning			You are using an old and unsupported gcc \
594 594
 	
595 595
 endif			# CC_SHORTVER, 2.9x
596 596
 endif			# CC_SHORTVER, 3.0
597
+endif			# CC_SHORTVER, 3.4
597 598
 	
598 599
 else		# CC_NAME, gcc
599 600
 				#other compilers
... ...
@@ -607,7 +635,11 @@ ifeq	($(ARCH), mips)
607 607
 ifeq		($(CC_NAME), gcc)
608 608
 				#common stuff
609 609
 				CFLAGS=-O9 -funroll-loops  -Wcast-align $(PROFILE) \
610
-					-Wall   \
610
+					-Wall 
611
+			#if gcc 3.4+
612
+ifeq			($(CC_SHORTVER), 3.4)
613
+					CFLAGS+= -mcpu=r3000
614
+else
611 615
 			#if gcc 3.0
612 616
 ifeq			($(CC_SHORTVER), 3.0)
613 617
 					CFLAGS+= -mcpu=r3000
... ...
@@ -625,6 +657,7 @@ $(warning			You are using an old and unsupported gcc \
625 625
 	
626 626
 endif			# CC_SHORTVER, 2.9x
627 627
 endif			# CC_SHORTVER, 3.0
628
+endif			# CC_SHORTVER, 3.4
628 629
 	
629 630
 else		# CC_NAME, gcc
630 631
 				#other compilers
... ...
@@ -638,7 +671,11 @@ ifeq	($(ARCH), mips2)
638 638
 ifeq		($(CC_NAME), gcc)
639 639
 				#common stuff
640 640
 				CFLAGS= -mips2 -O9 -funroll-loops $(PROFILE) \
641
-					-Wall   \
641
+					-Wall 
642
+			#if gcc 3.4+
643
+ifeq			($(CC_SHORTVER), 3.4)
644
+					CFLAGS+=
645
+else
642 646
 			#if gcc 3.0
643 647
 ifeq			($(CC_SHORTVER), 3.0)
644 648
 					CFLAGS+=
... ...
@@ -654,6 +691,7 @@ $(warning			You are using an old and unsupported gcc \
654 654
 	
655 655
 endif			# CC_SHORTVER, 2.9x
656 656
 endif			# CC_SHORTVER, 3.0
657
+endif			# CC_SHORTVER, 3.4
657 658
 	
658 659
 else		# CC_NAME, gcc
659 660
 				#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"