Browse Source

- solaris fixes: - renamed struct meminfo to mem_info due to name conflicts, fixed sc $$(atempts+1) (thanks go to Josip Gracin)
- proper ISA ARCH detection on solaris (uname -p)
- cosmetics: io_wait log log msg. removed

Andrei Pelinescu-Onciul 20 years ago
parent
commit
473f6f2ee8
9 changed files with 37 additions and 30 deletions
  1. 28 18
      Makefile.defs
  2. 1 1
      fifo_server.c
  3. 0 4
      io_wait.c
  4. 1 1
      mem/f_malloc.c
  5. 1 1
      mem/f_malloc.h
  6. 2 1
      mem/meminfo.h
  7. 1 1
      mem/q_malloc.c
  8. 1 1
      mem/q_malloc.h
  9. 2 2
      scripts/sc

+ 28 - 18
Makefile.defs

@@ -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)

+ 1 - 1
fifo_server.c

@@ -876,7 +876,7 @@ static int ps_fifo_cmd(FILE *stream, char *response_file )
 
 static int meminfo_fifo_cmd( FILE *stream, char *response_file )
 {
-	struct meminfo mi;
+	struct mem_info mi;
 	
 	if (response_file==0 || *response_file==0 ) { 
 		LOG(L_ERR, "ERROR: meminfo_fifo_cmd: null file\n");

+ 0 - 4
io_wait.c

@@ -511,11 +511,7 @@ int init_io_wait(io_wait_h* h, int max_fd, enum poll_types poll_method)
 			LOG(L_INFO, "init_io_wait: using %s as the io watch method"
 					" (auto detected)\n", poll_method_str[poll_method]);
 		}
-	}else{
-			LOG(L_INFO, "init_io_wait: using %s io watch method (forced)\n",
-					poll_method_str[poll_method]);
 	}
-
 	
 	h->poll_method=poll_method;
 	

+ 1 - 1
mem/f_malloc.c

@@ -549,7 +549,7 @@ void fm_status(struct fm_block* qm)
 
 /* fills a malloc info structure with info about the block
  * if a parameter is not supported, it will be filled with 0 */
-void fm_info(struct fm_block* qm, struct meminfo* info)
+void fm_info(struct fm_block* qm, struct mem_info* info)
 {
 	int r;
 	long total_frags;

+ 1 - 1
mem/f_malloc.h

@@ -137,7 +137,7 @@ void*  fm_realloc(struct fm_block*, void* p, unsigned long size);
 #endif
 
 void  fm_status(struct fm_block*);
-void  fm_info(struct fm_block*, struct meminfo*);
+void  fm_info(struct fm_block*, struct mem_info*);
 
 
 #endif

+ 2 - 1
mem/meminfo.h

@@ -29,12 +29,13 @@
  * History:
  * --------
  *  2005-03-02  created (andrei)
+ *  2005-07-25  renamed meminfo to mem_info due to name conflict on solaris
  */
 
 #ifndef meminfo_h
 #define meminfo_h
 
-struct meminfo{
+struct mem_info{
 	unsigned long total_size;
 	unsigned long free;
 	unsigned long used;

+ 1 - 1
mem/q_malloc.c

@@ -687,7 +687,7 @@ void qm_status(struct qm_block* qm)
 
 /* fills a malloc info structure with info about the block
  * if a parameter is not supported, it will be filled with 0 */
-void qm_info(struct qm_block* qm, struct meminfo* info)
+void qm_info(struct qm_block* qm, struct mem_info* info)
 {
 	int r;
 	long total_frags;

+ 1 - 1
mem/q_malloc.h

@@ -148,7 +148,7 @@ void* qm_realloc(struct qm_block*, void* p, unsigned long size);
 #endif
 
 void  qm_status(struct qm_block*);
-void  qm_info(struct qm_block*, struct meminfo*);
+void  qm_info(struct qm_block*, struct mem_info*);
 
 
 #endif

+ 2 - 2
scripts/sc

@@ -911,7 +911,7 @@ case $1 in
 			exit 1
 		fi
 		chmod a+w $path
-		trap "rm $path;  clear; echo sc monitor ^C-ed; exit 1" 2
+		trap "rm $path;  clear; echo 'sc monitor ^C-ed'; exit 1" 2
 		attempt=0
 		if [ "$2" = "" ]; then
 		    loops=-1;
@@ -920,7 +920,7 @@ case $1 in
 		fi
 		clear
 		while [ $loops -ne $attempt ] ; do
-			attempt=$(($attempt + 1))
+			attempt=`expr $attempt + 1`
 			#clear
 			tput cup 0 0
 			print_stats $name $path $attempt