[Devel] openser on Solaris

Wolfgang Hottgenroth woho at hottis.de
Thu Jul 27 13:45:13 CEST 2006


Hi,



I had some problems to compile openser 1.1.0 on Solaris.

1.) Solaris sed does not support -i (edit in place). This happens in the
Makefile when installing openserctl. I've changed the Makefile.
2.) Solaris has no IPTOS_MINCOST. There is already a cpp logic in cfg.y
which should disable this on Solaris, but this logic seems to be buggy:

#if !defined(__OS_solaris) || !defined(__OS_netbsd)
                            } else if (strcasecmp($3,"IPTOS_MINCOST")) {
                                tos=IPTOS_MINCOST;
#endif

Certainly #if !defined(__OS_solaris) && !defined(__OS_netbsd) or #if
!(defined(__OS_solaris) || defined(__OS_netbsd)) (de Morgane's rule?)
was meant. Otherwise IPTOS_MINCOST is only remove if the OS is both
Solaris and NetBSD ;-)
If changed cfg.y.

Additionally I've changed Makefule.rules and Makefile.sources to make
C++ modules possible.

I've attached an unifed patch.



Cheers,
Wolfgang



-------------- next part --------------
diff -rNup openser-1.1.0-notls.orig/Makefile openser-1.1.0-notls.patched/Makefile
--- openser-1.1.0-notls.orig/Makefile	2006-07-10 17:57:20.000000000 +0000
+++ openser-1.1.0-notls.patched/Makefile	2006-07-27 11:16:00.467484000 +0000
@@ -55,7 +55,7 @@ endif
 override exclude_modules+= CVS $(skip_modules)
 
 #always include this modules
-include_modules?=
+include_modules?= ctdclt
 
 # first 2 lines are excluded because of the experimental or incomplete
 # status of the modules
@@ -392,10 +392,10 @@ install-cfg: $(cfg-prefix)/$(cfg-dir)
 install-bin: $(bin-prefix)/$(bin-dir) utils
 		$(INSTALL-TOUCH) $(bin-prefix)/$(bin-dir)/$(NAME) 
 		$(INSTALL-BIN) $(NAME) $(bin-prefix)/$(bin-dir)
-		sed -e "s#/usr/local/sbin#$(bin-target)#g" \
-			< scripts/openserctl > /tmp/openserctl
-		sed -i -e "s#/usr/local/lib/openser#$(lib-target)#g" /tmp/openserctl
-		sed -i -e "s#/usr/local/etc/openser#$(cfg-target)#g" /tmp/openserctl
+		cat scripts/openserctl | \
+		sed -e "s#/usr/local/sbin#$(bin-target)#g" | \
+		sed -e "s#/usr/local/lib/openser#$(lib-target)#g" | \
+		sed -e "s#/usr/local/etc/openser#$(cfg-target)#g"  >/tmp/openserctl
 		$(INSTALL-TOUCH) $(bin-prefix)/$(bin-dir)/openserctl
 		$(INSTALL-BIN) /tmp/openserctl $(bin-prefix)/$(bin-dir)
 		rm -fr /tmp/openserctl
diff -rNup openser-1.1.0-notls.orig/Makefile.rules openser-1.1.0-notls.patched/Makefile.rules
--- openser-1.1.0-notls.orig/Makefile.rules	2006-04-07 14:55:40.000000000 +0000
+++ openser-1.1.0-notls.patched/Makefile.rules	2006-07-26 14:53:18.511105000 +0000
@@ -16,11 +16,19 @@
 	@echo "Compiling $<"
 	$(Q)$(CC) $(CFLAGS) $(DEFS) -c $< -o $@
 
+%.o:%.C  $(ALLDEP)
+	@echo "Compiling (C++) $<"
+	$(Q)$(CXX) $(CFLAGS) $(DEFS) -c $< -o $@
+
 %.d: %.c $(ALLDEP)
 	@set -e; $(MKDEP) $(DEFS) $< \
-	|  sed 's#\(\($*D)\)\?$(*F)\)\.o[ :]*#$*.o $@ : #g' > $@; \
+ 	|  sed 's#\(\($*D)\)\?$(*F)\)\.o[ :]*#$*.o $@ : #g' > $@; \
 	[ -s $@ ] || rm -f $@
 
+%.d: %.C $(ALLDEP)
+	@set -e; $(MKDEP) $(DEFS) $< \
+	|  sed 's#\(\($*D)\)\?$(*F)\)\.o[ :]*#$*.o $@ : #g' > $@; \
+	[ -s $@ ] || rm -f $@
 
 # normal rules
 $(NAME): $(objs) $(ALLDEP)
diff -rNup openser-1.1.0-notls.orig/Makefile.sources openser-1.1.0-notls.patched/Makefile.sources
--- openser-1.1.0-notls.orig/Makefile.sources	2005-06-13 16:47:25.000000000 +0000
+++ openser-1.1.0-notls.patched/Makefile.sources	2006-07-26 14:53:18.521103000 +0000
@@ -17,9 +17,12 @@ sources=$(filter-out $(auto_gen), $(wild
 ifneq ($(TLS),)
 	sources+= $(wildcard tls/*.c)
 endif
+sources_cxx=$(wildcard *.C)
 objs=$(sources:.c=.o)
+objs+=$(sources_cxx:.C=.o)
 extra_objs=
 depends=$(sources:.c=.d)
+depends+=$(sources_cxx:.C=.d)
 modules=
 static_modules=
 static_modules_path=
diff -rNup openser-1.1.0-notls.orig/cfg.y openser-1.1.0-notls.patched/cfg.y
--- openser-1.1.0-notls.orig/cfg.y	2006-07-10 13:37:02.000000000 +0000
+++ openser-1.1.0-notls.patched/cfg.y	2006-07-27 11:11:16.897484000 +0000
@@ -854,7 +854,7 @@ assign_stm:	DEBUG EQUAL NUMBER { debug=$
 								tos=IPTOS_THROUGHPUT;
 							} else if (strcasecmp($3,"IPTOS_RELIABILITY")) {
 								tos=IPTOS_RELIABILITY;
-#if !defined(__OS_solaris) || !defined(__OS_netbsd)
+#if !defined(__OS_solaris) && !defined(__OS_netbsd)
 							} else if (strcasecmp($3,"IPTOS_MINCOST")) {
 								tos=IPTOS_MINCOST;
 #endif
@@ -862,7 +862,7 @@ assign_stm:	DEBUG EQUAL NUMBER { debug=$
 								yyerror("invalid tos value - allowed: "
 									"IPTOS_LOWDELAY,IPTOS_THROUGHPUT,"
 									"IPTOS_RELIABILITY,IPTOS_LOWCOST"
-#if !defined(__OS_solaris) || !defined(__OS_netbsd)
+#if !defined(__OS_solaris) && !defined(__OS_netbsd)
 									",IPTOS_MINCOST\n");
 #else
 									"\n");


More information about the Devel mailing list