Browse code

- openbsd 3.4 support

Andrei Pelinescu-Onciul authored on 26/11/2003 11:43:53
Showing 1 changed files
... ...
@@ -30,6 +30,7 @@
30 30
 #              and other FreeBSD arches for which no fast locking assembly
31 31
 #              code exists (sobomax)
32 32
 #  2003-11-08  mips1 support introduced (andrei)
33
+#  2003-11-24  openbsd 3.4 (elf) fixes (andrei)
33 34
 
34 35
 
35 36
 # check if already included/exported
... ...
@@ -50,6 +51,7 @@ RELEASE=$(VERSION).$(PATCHLEVEL).$(SUBLEVEL)$(EXTRAVERSION)
50 51
 OS = $(shell uname -s | sed -e s/SunOS/solaris/ | tr "[A-Z]" "[a-z]")
51 52
 ARCH = $(shell uname -m |sed -e s/i.86/i386/ -e s/sun4u/sparc64/  \
52 53
 			-e s/armv4l/arm/)
54
+OSREL = $(shell uname -r)
53 55
 
54 56
 # TLS support
55 57
 TLS ?= 
... ...
@@ -703,7 +705,7 @@ ifeq ($(OS), freebsd)
703 705
 endif
704 706
 
705 707
 ifeq ($(OS), openbsd)
706
-	DEFS+=-DHAVE_SOCKADDR_SA_LEN -DDLSYM_PREFIX='"_"' -DHAVE_GETHOSTBYNAME2 \
708
+	DEFS+=-DHAVE_SOCKADDR_SA_LEN  -DHAVE_GETHOSTBYNAME2 \
707 709
 		-DHAVE_UNION_SEMUN -DHAVE_MSGHDR_MSG_CONTROL
708 710
 	ifneq ($(found_lock_method), yes)
709 711
 		DEFS+= -DUSE_PTHREAD_MUTEX  # try pthread sems
... ...
@@ -713,8 +715,14 @@ ifeq ($(OS), openbsd)
713 715
 	YACC=yacc
714 716
 	# no sched_yield on openbsd unless linking with c_r (not recommended)
715 717
 	LIBS= -lfl 
716
-	LDFLAGS=        # openbsd ld doesn't like -O2 or -E
718
+	OPENBSD_IS_AOUT= $(shell echo "$(OSREL)" | \
719
+				sed -e 's/^3\.[0-3][^0-9]*$$/yes/' |sed -e 's/^[0-2]\..*/yes/')
720
+	
721
+ifeq ($(OPENBSD_IS_AOUT), yes)
722
+		DEFS+=-DDLSYM_PREFIX='"_"'
723
+		LDFLAGS=        # openbsd ld doesn't like -O2 or -E
717 724
 endif
725
+endif   # if opensd
718 726
 	
719 727
 ifeq ($(OS), netbsd)
720 728
 	DEFS+=-DHAVE_SOCKADDR_SA_LEN -DHAVE_GETHOSTBYNAME2 \