Freeradius/Oracle compilation

Alexandre Chapellon alexandre.chapellon at mana.pf
Wed Dec 15 02:01:26 CET 2010


Hello I didn't have even a comment about this.
Is there something stupid in the proposed patch?

regards.

Le samedi 11 décembre 2010 à 18:43 -1000, alexandre.chapellon at mana.pf a
écrit :

> Unless I missunderstood the compil process it seems to me that todays source tree is stuck to Oracle 10g. Indeed the configure.in file for the rlm_sql_oracle module has a library name harcoded: libnnz10.
> If you run Oracle instantclient 11g (I guess it's the same with a full installation of Oracle 11g) the library is named libnnz11. As a result, oracle linking test wiil always fail even with a correct --with-oracle-lib-dir set.
> To be able to compile with both version of Oracle (10g and 11g)
> I suggest a new option can be set that would define the version during ./configure.
> If it sounds ok for everyone and can be tested by more people (I only tested it on Debian with instantclient_11.1), here is "works for me" patch that introduce the --with-oracle-version switch.
> 
> --- freeradius-server-2.1.10.orig/src/modules/rlm_sql/drivers/rlm_sql_oracle/configure.in	2010-09-28 11:03:56.000000000 +0000
> +++ freeradius-server-2.1.10/src/modules/rlm_sql/drivers/rlm_sql_oracle/configure.in	2010-12-12 03:58:02.000000000 +0000
> @@ -22,6 +22,23 @@
>  	dnl # Check for command line options
>  	dnl ############################################################
>  
> +	dnl extra argument: --with-oracle-version=VER
> +	oracle_version=
> +	AC_ARG_WITH(oracle-version,
> +		[AS_HELP_STRING([--with-oracle-version=VER],
> +			[Version of Oracle to search for. Should be 10 for Oracle 10g and 11 for 11g])],
> +		[case "$withval" in
> +                        11)
> +                            oracle_version="$withval"
> +                            ;;
> +                        10)
> +                            oracle_version="$withval"
> +                            ;;
> +                        *)
> +                           AC_MSG_ERROR(Need oracle-version)
> +                            ;;
> +                esac])
> +
>  	dnl extra argument: --with-oracle-include-dir=DIR
>  	oracle_include_dir=
>  	AC_ARG_WITH(oracle-include-dir,
> @@ -86,7 +103,12 @@
>  		if test "x$oracle_lib_dir" != "x" ; then
>  			ORACLE_LIBDIR_SWITCH="-L${oracle_lib_dir} "
>  		fi
> -		LIBS="$old_LIBS $ORACLE_LIBDIR_SWITCH -lclntsh -lnnz10"
> +                if test "x$oracle_version" = "x" ; then
> +                        AC_MSG_RESULT(no)
> +                        AC_MSG_WARN([oracle version not found.  Use --with-oracle-version={10|11}.])
> +                        fail="$fail Oracle version"
> +                else 
> +		LIBS="$old_LIBS $ORACLE_LIBDIR_SWITCH -lclntsh -lnnz${oracle_version}"
>  		AC_TRY_LINK([#include <oci.h>
>  	
>  				static OCIEnv           *p_env;
> @@ -109,12 +131,13 @@
>  				          (void (*)(dvoid *, dvoid *)) 0 );
>  
>  			],
> -			ORACLE_LIBS="$ORACLE_LIBDIR_SWITCH -lclntsh -lnnz10",
> +			ORACLE_LIBS="$ORACLE_LIBDIR_SWITCH -lclntsh -lnnz${oracle_version}",
>  			ORACLE_LIBS=
>  		)
>  
>  		LIBS="$old_LIBS"
>  		CFLAGS="$old_CFLAGS"
> +                fi
>  	fi
>  
> 
> @@ -129,7 +152,7 @@
>  
>  		if test "x$ORACLE_LIBS" = "x"; then
>  			AC_MSG_WARN([oracle libraries not found.  Use --with-oracle-lib-dir=<path>.])
> -			fail="$fail libclntsh libnnz10"
> +			fail="$fail libclntsh libnnz${oracle_version}"
>  		else
>  			sql_oracle_ldflags="${sql_oracle_ldflags} $ORACLE_LIBS"
>  			AC_MSG_RESULT(yes)
> 
> 
> As you can see the patch modify the configure.in file autogen.sh must be used after patching.
> 
> P.S The patch do not include version of Oracle prior to 10 because the instantclient archive is not available anymore on the Oracle website.
> -
> List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html


-- 
Follow us on: twitter https://www.twitter.com/manainternet
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freeradius.org/pipermail/freeradius-users/attachments/20101214/ff5f6a43/attachment.html>


More information about the Freeradius-Users mailing list