|
@@ -42,6 +42,7 @@
|
|
|
# 2005-06-26 numeric OSREL & HAVE_KQUEUE added to the *BSD (andrei)
|
|
|
# 2005-07-04 HAVE_DEVPOLL added to solaris (andrei)
|
|
|
# 2005-07-06 gcc 4.0 optimizations support (andrei)
|
|
|
+# 2005-07-25 better solaris arch detection (andrei)
|
|
|
|
|
|
|
|
|
# check if already included/exported
|
|
@@ -62,14 +63,29 @@ EXTRAVERSION = -dev14-tcp
|
|
|
|
|
|
RELEASE=$(VERSION).$(PATCHLEVEL).$(SUBLEVEL)$(EXTRAVERSION)
|
|
|
OS = $(shell uname -s | sed -e s/SunOS/solaris/ | tr "[A-Z]" "[a-z]")
|
|
|
-ARCH = $(shell uname -m |sed -e s/i.86/i386/ -e s/sun4u/sparc64/ \
|
|
|
- -e s/armv4l/arm/ -e "s/Power Macintosh/ppc/" -e "s/cobalt/mips2/" \
|
|
|
+
|
|
|
+ifeq ($(OS),solaris)
|
|
|
+ GETARCH=uname -p
|
|
|
+else
|
|
|
+ GETARCH=uname -m
|
|
|
+endif
|
|
|
+
|
|
|
+ARCH := $(shell $(GETARCH) |sed -e s/i.86/i386/ -e s/sun4u/sparc64/ \
|
|
|
+ -e s/armv4l/arm/ -e "s/Power Macintosh/ppc/" \
|
|
|
+ -e "s/cobalt/mips2/" \
|
|
|
-e s/amd64/x86_64/ )
|
|
|
+# fix sparc -> sparc64
|
|
|
+ifeq ($(ARCH),sparc)
|
|
|
+ ifeq ($(shell uname -m),sun4u)
|
|
|
+ ARCH := sparc64
|
|
|
+ endif
|
|
|
+endif
|
|
|
+
|
|
|
OSREL = $(shell uname -r)
|
|
|
# numerical version (good for comparisons: A.B.C => A*1000000+B*1000+C)
|
|
|
OSREL_N= $(shell echo $(OSREL) | sed -e 's/^[^0-9]*//' \
|
|
|
-e 's/^\([0-9][0-9]*\(\.[0-9][0-9]*\)*\).*$$/\1/g' | \
|
|
|
- (IFS=. read A B C ; R=0; \
|
|
|
+ (IFS=. read A B C D; R=0; \
|
|
|
[ -n "$$A" ] && R=`expr $$R \* 1000 + $$A` && \
|
|
|
[ -n "$$B" ] && R=`expr $$R \* 1000 + $$B` && \
|
|
|
[ -n "$$C" ] && R=`expr $$R \* 1000 + $$C`; echo $$R ) )
|
|
@@ -357,7 +373,7 @@ endif
|
|
|
# platform dependent settings
|
|
|
|
|
|
# find ld & as name (gnu or solaris)
|
|
|
-ifeq ($(ARCH), sparc64)
|
|
|
+ifeq ($(OS), solaris)
|
|
|
ifeq ($(CC_NAME), gcc)
|
|
|
LDGCC=$(shell $(CC) -v 2>&1 | grep with-ld| \
|
|
|
sed -e 's/.*--with-ld=\([^ ][^ ]*\).*/\1/' )
|
|
@@ -902,20 +918,14 @@ CFLAGS+= $(CC_EXTRA_OPTS)
|
|
|
|
|
|
# setting LDFLAGS
|
|
|
ifeq ($(CC_NAME), gcc)
|
|
|
-ifeq ($(ARCH), sparc64)
|
|
|
-ifeq ($(LDTYPE), solaris)
|
|
|
- # solaris ld
|
|
|
- LDFLAGS+=-O2 $(PROFILE)
|
|
|
- MOD_LDFLAGS=-G $(LDFLAGS)
|
|
|
-else
|
|
|
- #gcc and maybe others, on solaris, with gnu ld
|
|
|
- LDFLAGS+=-Wl,-O2 -Wl,-E $(PROFILE)
|
|
|
- MOD_LDFLAGS=-shared $(LDFLAGS)
|
|
|
-endif
|
|
|
-else
|
|
|
- #gcc and maybe others
|
|
|
- LDFLAGS+=-Wl,-O2 -Wl,-E $(PROFILE)
|
|
|
- MOD_LDFLAGS=-shared $(LDFLAGS)
|
|
|
+ifeq ($(LDTYPE), solaris)
|
|
|
+ # solaris ld
|
|
|
+ LDFLAGS+=-O2 $(PROFILE)
|
|
|
+ MOD_LDFLAGS=-G $(LDFLAGS)
|
|
|
+else
|
|
|
+ #gcc and maybe others, => gnu ld
|
|
|
+ LDFLAGS+=-Wl,-O2 -Wl,-E $(PROFILE)
|
|
|
+ MOD_LDFLAGS=-shared $(LDFLAGS)
|
|
|
endif
|
|
|
endif
|
|
|
ifeq ($(CC_NAME), icc)
|