Hello list,

Attached to this e-mail are several assorted  patches  needed  to
build pdns 3.1 on Solaris 10.

Features:
- goracle / oracle backend  ORACLE_HOME  and  ORACLE_SID  support
  (thanks to Mr. Tuomi);
- support for linking with the Solaris 10 bundled PostgreSQL 8.3,
  32- and 64-bit  (requires  building  on  Solaris  10  u8  at  a
  minimum);
- linking with $ORIGIN ld(1)  keyword,  enabling  relocation  and
  obviating the need for LD_LIBRARY_PATH hacks

The good news is that for the most part, pdns 3.1 needed  minimal
surgery to build on Solaris, a huge improvement.

In addition to pdns_recursor, we have attained full SMF  integra-
tion of pdns_server(1M) and the POWERDNS Oracle database with SMF
on Solaris 10 i86pc platform:

> svcs -xv powerdns
svc:/site/oracle:powerdns (PowerDNS Oracle database)
 State: online since Thu May 24 07:57:53 2012
   See: /var/svc/log/site-oracle:powerdns.log
Impact: None.

svc:/site/powerdns:server (PowerDNS authoritative name server)
 State: online since Thu May 24 07:57:38 2012
   See: man -M /opt/powerdns/share/man -s 1M pdns_server
   See: /var/svc/log/site-powerdns:server.log
Impact: None.

svc:/site/powerdns:recursor (PowerDNS recursive name server)
 State: online since Thu May 24 07:57:32 2012
   See: man -M /opt/powerdns/share/man -s 1M pdns_server
   See: /var/svc/log/site-powerdns:recursor.log
Impact: None.

Thanks to everyone who helped make pdns be a  better  product  on
Solaris.
                                          
--- configure.orig	Sun May  6 07:28:12 2012
+++ configure	Sun May  6 07:28:47 2012
@@ -18360,7 +18360,7 @@
 	case "$PGSQL_libdir" in
 	  /usr/lib ) PGSQL_lib="" ;;
 	  /usr/lib64 ) PGSQL_lib="" ;;
-	  /* ) PGSQL_lib="-L$PGSQL_libdir -Wl,-rpath,$PGSQL_libdir"
+	  /* ) PGSQL_lib="-L$PGSQL_libdir -Wl,-R${PGSQL_libdir}"
 	       LDFLAGS="$PGSQL_lib $LDFLAGS"
                ;;
 	  * )  as_fn_error "The PgSQL library directory ($PGSQL_libdir) must be an absolute path." "$LINENO" 5 ;;
--- ltmain.sh.orig	Mon Apr  2 16:23:47 2012
+++ ltmain.sh	Mon Apr  2 16:26:34 2012
@@ -4341,13 +4341,6 @@
 	  continue
 	  ;;
 	rpath | xrpath)
-	  # We need an absolute path.
-	  case $arg in
-	  [\\/]* | [A-Za-z]:[\\/]*) ;;
-	  *)
-	    func_fatal_error "only absolute run-paths are allowed"
-	    ;;
-	  esac
 	  if test "$prev" = rpath; then
 	    case "$rpath " in
 	    *" $arg "*) ;;
@@ -4646,13 +4639,6 @@
       -R*)
 	func_stripname '-R' '' "$arg"
 	dir=$func_stripname_result
-	# We need an absolute path.
-	case $dir in
-	[\\/]* | [A-Za-z]:[\\/]*) ;;
-	*)
-	  func_fatal_error "only absolute run-paths are allowed"
-	  ;;
-	esac
 	case "$xrpath " in
 	*" $dir "*) ;;
 	*) xrpath="$xrpath $dir" ;;
--- modules/goraclebackend/goraclebackend.cc	2012-05-02 22:26:17.132256970 +0300
+++ modules/goraclebackend/goraclebackend.cc	2012-05-02 23:09:05.908049852 +0300
@@ -15,12 +15,16 @@
 
 #include "soracle.hh"
 
-
 #include <sstream>
 
 gOracleBackend::gOracleBackend(const string &mode, const string &suffix)  : GSQLBackend(mode,suffix)
 {
   try {
+    // set some envionment variables
+    setenv("ORACLE_HOME", getArg("home").c_str(), 1);
+    setenv("ORACLE_SID", getArg("sid").c_str(), 1);
+    setenv("NLS_LANG", getArg("nls-lang").c_str(), 1);
+ 
     setDB(new SOracle(getArg("tnsname"),
         	     getArg("user"),
         	     getArg("password")));
@@ -41,10 +45,15 @@
   
   void declareArguments(const string &suffix="")
   {
+    declare(suffix,"home", "Oracle home path", "");
+    declare(suffix,"sid", "Oracle sid", "XE");
+    declare(suffix,"nls-lang", "Oracle language", "AMERICAN_AMERICA.AL32UTF8");
+
     declare(suffix,"tnsname","Generic Oracle backend TNSNAME to connect to","powerdns");
     declare(suffix,"user","Database backend user to connect as","powerdns");
     declare(suffix,"password","Pdns backend password to connect with","");
 
+    declare(suffix,"get-all-domains-query", "Get all domain","select id,name,master,last_check,type,notified_serial,account from domains");
     declare(suffix,"basic-query","Basic query","select content,ttl,prio,type,domain_id,name from records where type='%s' and name='%s'");
     declare(suffix,"id-query","Basic with ID query","select content,ttl,prio,type,domain_id,name from records where type='%s' and name='%s' and domain_id=%d");
     declare(suffix,"wildcard-query","Wildcard query","select content,ttl,prio,type,domain_id,name from records where type='%s' and name like '%s'");
--- modules/oraclebackend/oraclebackend.cc	2012-05-02 22:26:25.702147380 +0300
+++ modules/oraclebackend/oraclebackend.cc	2012-05-02 23:18:09.084068923 +0300
@@ -1809,6 +1809,11 @@
     sword err;
 
     try {
+      // set some envionment variables
+      setenv("ORACLE_HOME", arg()["oracle-home"].c_str(), 1);
+      setenv("ORACLE_SID", arg()["oracle-sid"].c_str(), 1);
+      setenv("NLS_LANG", arg()["oracle-nls-lang"].c_str(), 1);
+
       // Initialize and create the environment
       err = OCIEnvCreate(&oraenv, OCI_THREADED, NULL, NULL,
                          NULL, NULL, 0, NULL);
@@ -1910,6 +1915,10 @@
   }
 
   void declareArguments (const string & suffix = "") {
+    declare(suffix,"home", "Oracle home path", "");
+    declare(suffix,"sid", "Oracle sid", "XE");
+    declare(suffix,"nls-lang", "Oracle language", "AMERICAN_AMERICA.AL32UTF8");
+
     declare(suffix, "pool-database", "Database to connect to for the session pool", "powerdns");
     declare(suffix, "pool-username", "Username to connect as for the session pool", "powerdns");
     declare(suffix, "pool-password", "Password to connect with for the session pool", "");
--- pdns/Makefile.in.orig	Sun May  6 07:55:19 2012
+++ pdns/Makefile.in	Sun May  6 07:55:38 2012
@@ -651,7 +651,7 @@
 	$(am__append_5) $(am__append_7)
 
 #
-pdns_server_LDFLAGS = @moduleobjects@ @modulelibs@ @DYNLINKFLAGS@ @LIBDL@ @THREADFLAGS@  $(BOOST_SERIALIZATION_LDFLAGS)  -rdynamic
+pdns_server_LDFLAGS = @moduleobjects@ @modulelibs@ @DYNLINKFLAGS@ @LIBDL@ @THREADFLAGS@  $(BOOST_SERIALIZATION_LDFLAGS)
 pdns_server_LDADD = ext/polarssl-1.1.2/library/libpolarssl.a \
 	$(BOOST_SERIALIZATION_LIBS) $(LUA_LIBS) $(SQLITE3_LIBS) \
 	$(am__append_2) $(am__append_4) $(am__append_6)
--- pdns/ext/polarssl-1.1.2/library/Makefile.orig	Sun May  6 07:36:12 2012
+++ pdns/ext/polarssl-1.1.2/library/Makefile	Sun May  6 07:49:34 2012
@@ -47,9 +47,7 @@
 
 libpolarssl.a: $(OBJS)
 	echo "  AR    $@"
-	$(AR) r $@ $(OBJS)
-	echo "  RL    $@"
-	$(AR) s $@
+	$(AR) rs $@ $(OBJS)
 
 libpolarssl.so: libpolarssl.a
 	echo "  LD    $@"
_______________________________________________
Pdns-dev mailing list
[email protected]
http://mailman.powerdns.com/mailman/listinfo/pdns-dev

Reply via email to