You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by Mladen Turk <mt...@apache.org> on 2006/02/09 15:02:26 UTC

[PATCH] catalina.sh 'CATALINA_NATIVE'

Hi,

Any objections for committing this patch?
It sets LD_LIBRARY_PATH to include CATALINA_HOME/native
if CATALINA_HOME/native/libtcnative-1.so is present.



Index: C:/U/SVN/tomcat/container/tc5.5.x/catalina/src/bin/catalina.sh
===================================================================
--- C:/U/SVN/tomcat/container/tc5.5.x/catalina/src/bin/catalina.sh 
(revision 376293)
+++ C:/U/SVN/tomcat/container/tc5.5.x/catalina/src/bin/catalina.sh 
(working copy)
@@ -116,6 +116,18 @@
    fi
  fi

+if [ -z "$CATALINA_NATIVE" ] ; then
+  # Define the path for Tomcat Native APR.
+  CATALINA_NATIVE="$CATALINA_HOME"/native
+fi
+if [ -r "$CATALINA_NATIVE"/libtcnative-1.so ]; then
+  if [ -n "$LD_LIBRARY_PATH" ] ; then
+    LD_LIBRARY_PATH=$CATALINA_NATIVE:$LD_LIBRARY_PATH
+  else
+    LD_LIBRARY_PATH=$CATALINA_NATIVE
+  fi
+fi
+
  # Add on extra jar files to CLASSPATH
  if [ -n "$JSSE_HOME" ]; then
 
CLASSPATH="$CLASSPATH":"$JSSE_HOME"/lib/jcert.jar:"$JSSE_HOME"/lib/jnet.jar:"$JSSE_HOME"/lib/jsse.jar
@@ -153,6 +165,7 @@
  echo "Using CATALINA_BASE:   $CATALINA_BASE"
  echo "Using CATALINA_HOME:   $CATALINA_HOME"
  echo "Using CATALINA_TMPDIR: $CATALINA_TMPDIR"
+echo "Using CATALINA_NATIVE: $CATALINA_NATIVE"
  if [ "$1" = "debug" -o "$1" = "javac" ] ; then
    echo "Using JAVA_HOME:       $JAVA_HOME"
  else

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


Re: [PATCH] catalina.sh 'CATALINA_NATIVE'

Posted by Mladen Turk <mt...@apache.org>.
Tim Funk wrote:
> I see the point of the native dir.

Right, anything but bin is OK.


> lib/native/{platform}/ <!-- any needed .so, or dll files
> 

This makes sense too, even more then my proposed /native.
Although I doubt the (platform) would make sense, unless
we decide to ship the bins for all platforms.

Regards,
Mladen.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


Re: [PATCH] catalina.sh 'CATALINA_NATIVE'

Posted by Tim Funk <fu...@joedog.org>.
I see the point of the native dir. Once my sysadmin sees this (whose not much 
of a java guy) - he'd be confused in seeing a bin dir with jar, bat, sh, and 
so files in it. Maybe itstime to reorg the the bin package dir. Possibly 
something along the lines of:

bin/ <-- All the sh and bat files
lib/jar <-- all the jar files for the system classloader. The scripts can 
also be made smart enough to iterate throug this dir and append them instead 
of hardcoding.
lib/native/{platform}/ <!-- any needed .so, or dll files

Where platform can be some standard prefix based on OS and architecture. That 
way, if a binary is retrieved - the user knows immediately if the .so is not 
binary compatible.

Of course the above has many issues with respect to how to dyncamically pull 
in {platform} in the startup scripts. (Allowing a CATALINA_NATIVE would of 
course be nice as an override).

Personally - I'm indifferent to the whole thing because I'm swamped with my 
day job and don't have time to help with such a reorg. But I thought I'd 
throw it out as an idea.


-Tim


Remy Maucherat wrote:

> Mladen Turk wrote:
> 
>> Hi,
>>
>> Any objections for committing this patch?
>> It sets LD_LIBRARY_PATH to include CATALINA_HOME/native
>> if CATALINA_HOME/native/libtcnative-1.so is present.
> 
> 
> Why not using the "bin" folder ?
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


Re: [PATCH] catalina.sh 'CATALINA_NATIVE'

Posted by Remy Maucherat <re...@apache.org>.
Mladen Turk wrote:
> Hi,
> 
> Any objections for committing this patch?
> It sets LD_LIBRARY_PATH to include CATALINA_HOME/native
> if CATALINA_HOME/native/libtcnative-1.so is present.

Why not using the "bin" folder ?

Rémy

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org