[Opensrf-commits] r1349 - in trunk: . bin examples src src/libopensrf

svn at svn.open-ils.org svn at svn.open-ils.org
Mon Jun 30 15:46:12 EDT 2008


Author: dbs
Date: 2008-06-30 15:46:08 -0400 (Mon, 30 Jun 2008)
New Revision: 1349

Modified:
   trunk/Makefile.am
   trunk/bin/osrf_config.in
   trunk/bin/osrf_ctl.sh
   trunk/configure.ac
   trunk/examples/opensrf.xml.example
   trunk/examples/opensrf_core.xml.example
   trunk/examples/srfsh.xml.example
   trunk/src/Makefile.am
   trunk/src/libopensrf/Makefile.am
Log:
Patch from Kevin Beswick (kbeswick00 at gmail.com) to address various problems with the autotools:
  * src/libopensrf/Makefile.am:
    * Fix typo for -I (includes) vs. -L (linking libraries) compile option
  * src/Makefile.am:
    * Propagate NDEBUG compile flag to all other makefiles
    * Create target directories
    * Set directories in example config files to match configured options
  * configure.ac:
    * Set default prefix to /opensrf/ instead of /openils/
  * bin/osrf_config.in:
    * Add --localstatedir option for osrf_config
    * Correct output value for --apxs
  * bin/osrf_ctl.sh
    * Set default PID dir to localstatedir rather than sysconfdir
  * Makefile.am:
    * Propagate NDEBUG compile flag to all other makefiles
    * Remove explicit rpath option, automake will figure that out for us (supposedly)
  * examples/opensrf_core.xml.example, examples/opensrf.xml.example, examples/srfsh.xml.example:
    * Set directories in example config files to match configured options



Modified: trunk/Makefile.am
===================================================================
--- trunk/Makefile.am	2008-06-25 18:50:00 UTC (rev 1348)
+++ trunk/Makefile.am	2008-06-30 19:46:08 UTC (rev 1349)
@@ -12,6 +12,10 @@
 # GNU General Public License for more details.
 
 
+if !DEBUG
+MAYBE_DEBUG = -DNDEBUG
+endif
+
 export PREFIX                   = @prefix@
 export TMP                      = @TMP@
 export LIBXML2_HEADERS          = @LIBXML2_HEADERS@
@@ -19,9 +23,10 @@
 export ETCDIR                   = @sysconfdir@
 export APXS2                    = @APXS2@
 export APACHE2_HEADERS          = @APACHE2_HEADERS@
-export DEF_CFLAGS		= -D_LARGEFILE64_SOURCE -pipe -g -Wall -O2 -fPIC -I at abs_top_builddir@/include/ -I$(LIBXML2_HEADERS) -I$(APACHE2_HEADERS) -I$(APR_HEADERS) @INCLUDES@
-export DEF_LDFLAGS		= -Wl, -rpath=$(LIBDIR) -L$(TMPDIR) @LIBDIRS@
+export DEF_CFLAGS		= -D_LARGEFILE64_SOURCE $(MAYBE_DEBUG) -pipe -g -Wall -O2 -fPIC -I at abs_top_builddir@/include/ -I$(LIBXML2_HEADERS) -I$(APACHE2_HEADERS) -I$(APR_HEADERS) @INCLUDES@
+export DEF_LDFLAGS		= -L$(TMPDIR) @LIBDIRS@
 export DEF_LDLIBS		= -lobjson -lopensrf
+export VAR			= @localstatedir@
 export PID			= @localstatedir@/run/opensrf
 export SOCK			= @localstatedir@/lock/opensrf
 export LOG			= @localstatedir@/log/opensrf

Modified: trunk/bin/osrf_config.in
===================================================================
--- trunk/bin/osrf_config.in	2008-06-25 18:50:00 UTC (rev 1348)
+++ trunk/bin/osrf_config.in	2008-06-30 19:46:08 UTC (rev 1349)
@@ -105,11 +105,14 @@
      --sysconfdir)
 		echo @sysconfdir@;
 		;;
+     --localstatedir)
+		echo @localstatedir@;
+		;;
      --tmpdir)
 		echo @TMP@;
 		;;
      --apxs)
-		echo @APXS@;
+		echo @APXS2@;
 		;;
      --includedir)
 		echo @includedir@;

Modified: trunk/bin/osrf_ctl.sh
===================================================================
--- trunk/bin/osrf_ctl.sh	2008-06-25 18:50:00 UTC (rev 1348)
+++ trunk/bin/osrf_ctl.sh	2008-06-30 19:46:08 UTC (rev 1349)
@@ -9,8 +9,8 @@
 # but WITHOUT ANY WARRANTY; without even the implied warranty of
 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 # GNU General Public License for more details.
+ 
 
-
 OPT_ACTION=""
 OPT_CONFIG=""
 OPT_PID_DIR=""
@@ -94,7 +94,7 @@
 	echo "Please specify the location of the opensrf_core.xml file using the -c flag";
 	exit 1;
 fi;
-[ -z "$OPT_PID_DIR" ] && OPT_PID_DIR=`$OSRF_CONFIG --sysconfdir`/run;
+[ -z "$OPT_PID_DIR" ] && OPT_PID_DIR=`$OSRF_CONFIG --localstatedir`/run;
 [ -z "$OPT_ACTION" ] && usage;
 
 PID_ROUTER="$OPT_PID_DIR/router.pid";

Modified: trunk/configure.ac
===================================================================
--- trunk/configure.ac	2008-06-25 18:50:00 UTC (rev 1348)
+++ trunk/configure.ac	2008-06-30 19:46:08 UTC (rev 1349)
@@ -24,7 +24,7 @@
 AM_INIT_AUTOMAKE([OpenSRF], [trunk])
 AC_REVISION($Revision: 0.1 $)
 AC_CONFIG_SRCDIR([configure.ac])
-AC_PREFIX_DEFAULT([/openils/])
+AC_PREFIX_DEFAULT([/opensrf/])
 
 
 AC_SUBST(prefix)

Modified: trunk/examples/opensrf.xml.example
===================================================================
--- trunk/examples/opensrf.xml.example	2008-06-25 18:50:00 UTC (rev 1348)
+++ trunk/examples/opensrf.xml.example	2008-06-30 19:46:08 UTC (rev 1349)
@@ -22,16 +22,16 @@
     <dirs>
 
       <!-- opensrf log files go in this directory -->
-      <log>/path/to/log</log>
+      <log>LOCALSTATEDIR/log</log>
 
       <!-- opensrf unix domaind socket files go here -->
-      <sock>/path/to/sock</sock>
+      <sock>LOCALSTATEDIR/lock</sock>
 
       <!-- opensrf pids go here -->
-      <pid>/path/to/pid</pid>
+      <pid>LOCALSTATEDIR/run</pid>
 
       <!-- global config directory -->
-      <conf>/path/to/conf</conf>
+      <conf>SYSCONFDIR</conf>
     </dirs>
 
     <!-- prefork, simple. prefork is suggested -->

Modified: trunk/examples/opensrf_core.xml.example
===================================================================
--- trunk/examples/opensrf_core.xml.example	2008-06-25 18:50:00 UTC (rev 1348)
+++ trunk/examples/opensrf_core.xml.example	2008-06-30 19:46:08 UTC (rev 1349)
@@ -27,7 +27,7 @@
     <port>5222</port>
 
     <!-- log to a local file -->
-    <logfile>/openils/var/log/osrfsys.log</logfile>
+    <logfile>LOCALSTATEDIR/log/osrfsys.log</logfile>
 
     <!-- Log to syslog. You can use this same layout for 
         defining the logging of all services in this file -->
@@ -41,7 +41,7 @@
     <loglevel>3</loglevel>
 
     <!-- config file for the services -->
-    <settings_config>/openils/conf/opensrf.xml</settings_config>
+    <settings_config>SYSCONFDIR/opensrf.xml</settings_config>
 
   </opensrf>
 
@@ -57,7 +57,7 @@
     <secret>secret</secret>
     <listen_address>10.0.0.3</listen_address>
     <loglevel>3</loglevel>
-    <logfile>/openils/var/log/osrfsys.log</logfile>
+    <logfile>LOCALSTATEDIR/log/osrfsys.log</logfile>
   </chopchop>
 
   <!-- The section between <gateway>...</gateway> is a standard OpenSRF C stack config file -->
@@ -88,7 +88,7 @@
     <username>mylogin</username>
     <passwd>mypassword</passwd>
     <port>5222</port>
-    <logfile>/openils/var/log/gateway.log</logfile>
+    <logfile>LOCALSTATEDIR/log/gateway.log</logfile>
     <loglevel>3</loglevel>
 
   </gateway>
@@ -128,7 +128,7 @@
         <max_reconnect_attempts>5</max_reconnect_attempts>
   
         </transport>
-      <logfile>/openils/var/log/router.log</logfile>
+      <logfile>LOCALSTATEDIR/log/router.log</logfile>
       <loglevel>2</loglevel>
   
     </router>

Modified: trunk/examples/srfsh.xml.example
===================================================================
--- trunk/examples/srfsh.xml.example	2008-06-25 18:50:00 UTC (rev 1348)
+++ trunk/examples/srfsh.xml.example	2008-06-30 19:46:08 UTC (rev 1349)
@@ -6,6 +6,6 @@
   <username>myusername</username>
   <passwd>mypassword</passwd>
   <port>5222</port>
-  <logfile>/path/to/log/srfsh.log</logfile>
+  <logfile>LOCALSTATEDIR/log/srfsh.log</logfile>
   <loglevel>4</loglevel>
 </srfsh>

Modified: trunk/src/Makefile.am
===================================================================
--- trunk/src/Makefile.am	2008-06-25 18:50:00 UTC (rev 1348)
+++ trunk/src/Makefile.am	2008-06-30 19:46:08 UTC (rev 1349)
@@ -23,13 +23,11 @@
 export INCLUDEDIR= @includedir@
 export OSRF_JAVA_DEPSDIR = @OSRF_JAVA_DEPSDIR@
 
+
+
 AM_LDFLAGS = $(DEF_LDFLAGS)
 AM_CFLAGS = $(DEF_CFLAGS)
 
-if DEBUG
-AM_CFLAGS += -DNDEBUG
-endif
-
 if BUILDJSON
 LDADD = -lobjson
 BJSON=1
@@ -46,6 +44,10 @@
 SUBDIRS = libopensrf c-apps router srfsh jserver gateway $(MAYBE_PY) $(MAYBE_JA)
 
 install-data-local:
+	mkdir -p $(VAR)
+	mkdir -p $(PID)
+	mkdir -p $(LOG)
+	mkdir -p $(SOCK)
 	mkdir -p $(JSDIR)
 	mkdir -p $(PERLDIR)
 	mkdir -p $(ETCDIR)
@@ -53,6 +55,12 @@
 	mv $(BINDIR)/opensrf $(BINDIR)/opensrf-c
 	cp ../bin/osrf_config $(BINDIR)
 	cp ../bin/osrf_ctl.sh $(BINDIR)
+	sed -i 's|LOCALSTATEDIR|$(VAR)|g' '../examples/opensrf.xml.example'
+	sed -i 's|SYSCONFDIR|$(ETCDIR)|g' '../examples/opensrf.xml.example'
+	sed -i 's|LOCALSTATEDIR|$(VAR)|g' '../examples/opensrf_core.xml.example'
+	sed -i 's|SYSCONFDIR|$(ETCDIR)|g' '../examples/opensrf_core.xml.example'
+	sed -i 's|LOCALSTATEDIR|$(VAR)|g' '../examples/srfsh.xml.example'
+	sed -i 's|SYSCONFDIR|$(ETCDIR)|g' '../examples/srfsh.xml.example'
 	cp ../examples/opensrf.xml.example $(ETCDIR)
 	cp ../examples/opensrf_core.xml.example $(ETCDIR)
 	cp ../examples/srfsh.xml.example $(ETCDIR)

Modified: trunk/src/libopensrf/Makefile.am
===================================================================
--- trunk/src/libopensrf/Makefile.am	2008-06-25 18:50:00 UTC (rev 1348)
+++ trunk/src/libopensrf/Makefile.am	2008-06-30 19:46:08 UTC (rev 1349)
@@ -12,7 +12,7 @@
 # GNU General Public License for more details.
 
 
-AM_CFLAGS = $(DEF_CFLAGS) -DASSUME_STATELESS  -DOSRF_STRICT_PARAMS -rdynamic -fno-strict-aliasing -I./.libs/ -DOSRF_JSON_ENABLE_XML_UTILS
+AM_CFLAGS = $(DEF_CFLAGS) -DASSUME_STATELESS  -DOSRF_STRICT_PARAMS -rdynamic -fno-strict-aliasing -L./.libs/ -DOSRF_JSON_ENABLE_XML_UTILS
 AM_LDFLAGS = $(DEF_LDFLAGS)
 LDADD = -lxml2 -ldl -lmemcache -lopensrf -lobjson
 



More information about the opensrf-commits mailing list