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.
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@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
Alexandre Chapellon wrote:
Hello I didn't have even a comment about this. Is there something stupid in the proposed patch?
I've been busy. Off of the top of my head: - requiring a new option to configure isn't friendly. - the whole *point* of configure is to have the computer "just figure it out" - leave the old code there, it works for many people - add *new* code, which is run only if the old code doesn't find the libraries - don't force the user to choose an oracle version. - you can write a "for" loop which loops over the different versions, and stops when the check is successful
It works here, is indeed smarter and lighter. Hope it's ok. --- /tmp/configure.in.orig 2010-12-14 23:24:40.019101002 -1000 +++ /tmp/configure.in 2010-12-14 23:18:25.875101003 -1000 @@ -86,32 +86,37 @@ if test "x$oracle_lib_dir" != "x" ; then ORACLE_LIBDIR_SWITCH="-L${oracle_lib_dir} " fi - LIBS="$old_LIBS $ORACLE_LIBDIR_SWITCH -lclntsh -lnnz10" - AC_TRY_LINK([#include <oci.h> - - static OCIEnv *p_env; - static OCIError *p_err; - static OCISvcCtx *p_svc; - static OCIStmt *p_sql; - static OCIDefine *p_dfn = (OCIDefine *) 0; - static OCIBind *p_bnd = (OCIBind *) 0; - ], - [ - int p_bvi; - char p_sli[20]; - int rc; - char errbuf[100]; - int errcode; - - rc = OCIInitialize((ub4) OCI_DEFAULT, (dvoid *)0, /* Initialize OCI */ - (dvoid * (*)(dvoid *, size_t)) 0, - (dvoid * (*)(dvoid *, dvoid *, size_t))0, - (void (*)(dvoid *, dvoid *)) 0 ); - - ], - ORACLE_LIBS="$ORACLE_LIBDIR_SWITCH -lclntsh -lnnz10", - ORACLE_LIBS= - ) + for oracle_version in 10 11 9 ""; do + LIBS="$old_LIBS $ORACLE_LIBDIR_SWITCH -lclntsh -lnnz${oracle_version}" + AC_TRY_LINK([#include <oci.h> + + static OCIEnv *p_env; + static OCIError *p_err; + static OCISvcCtx *p_svc; + static OCIStmt *p_sql; + static OCIDefine *p_dfn = (OCIDefine *) 0; + static OCIBind *p_bnd = (OCIBind *) 0; + ], + [ + int p_bvi; + char p_sli[20]; + int rc; + char errbuf[100]; + int errcode; + + rc = OCIInitialize((ub4) OCI_DEFAULT, (dvoid *)0, /* Initialize OCI */ + (dvoid * (*)(dvoid *, size_t)) 0, + (dvoid * (*)(dvoid *, dvoid *, size_t))0, + (void (*)(dvoid *, dvoid *)) 0 ); + + ], + ORACLE_LIBS="$ORACLE_LIBDIR_SWITCH -lclntsh -lnnz${oracle_version}", + ORACLE_LIBS= + ) + if test "x$ORACLE_LIBS" != "x"; then + break + fi + done LIBS="$old_LIBS" CFLAGS="$old_CFLAGS" @@ -129,7 +134,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) ---- Message original----
Date: Wed, 15 Dec 2010 07:54:38 +0100 From: freeradius-users-bounces+alexandre.chapellon=mana.pf@lists.freeradius.org (on behalf of Alan DeKok <aland@deployingradius.com>) Subject: Re: Freeradius/Oracle compilation To: FreeRadius users mailing list <freeradius-users@lists.freeradius.org>
Alexandre Chapellon wrote:
Hello I didn't have even a comment about this. Is there something stupid in the proposed patch?
I've been busy. Off of the top of my head:
- requiring a new option to configure isn't friendly.
- the whole *point* of configure is to have the computer "just figure it out"
- leave the old code there, it works for many people
- add *new* code, which is run only if the old code doesn't find the libraries
- don't force the user to choose an oracle version.
- you can write a "for" loop which loops over the different versions, and stops when the check is successful - List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html
Alan when you have enough time, may you take a look at it? And if ok merge it in trunk? regards. Le mardi 14 décembre 2010 à 23:30 -1000, alexandre.chapellon@mana.pf a écrit :
It works here, is indeed smarter and lighter. Hope it's ok.
--- /tmp/configure.in.orig 2010-12-14 23:24:40.019101002 -1000 +++ /tmp/configure.in 2010-12-14 23:18:25.875101003 -1000 @@ -86,32 +86,37 @@ if test "x$oracle_lib_dir" != "x" ; then ORACLE_LIBDIR_SWITCH="-L${oracle_lib_dir} " fi - LIBS="$old_LIBS $ORACLE_LIBDIR_SWITCH -lclntsh -lnnz10" - AC_TRY_LINK([#include <oci.h> - - static OCIEnv *p_env; - static OCIError *p_err; - static OCISvcCtx *p_svc; - static OCIStmt *p_sql; - static OCIDefine *p_dfn = (OCIDefine *) 0; - static OCIBind *p_bnd = (OCIBind *) 0; - ], - [ - int p_bvi; - char p_sli[20]; - int rc; - char errbuf[100]; - int errcode; - - rc = OCIInitialize((ub4) OCI_DEFAULT, (dvoid *)0, /* Initialize OCI */ - (dvoid * (*)(dvoid *, size_t)) 0, - (dvoid * (*)(dvoid *, dvoid *, size_t))0, - (void (*)(dvoid *, dvoid *)) 0 ); - - ], - ORACLE_LIBS="$ORACLE_LIBDIR_SWITCH -lclntsh -lnnz10", - ORACLE_LIBS= - ) + for oracle_version in 10 11 9 ""; do + LIBS="$old_LIBS $ORACLE_LIBDIR_SWITCH -lclntsh -lnnz${oracle_version}" + AC_TRY_LINK([#include <oci.h> + + static OCIEnv *p_env; + static OCIError *p_err; + static OCISvcCtx *p_svc; + static OCIStmt *p_sql; + static OCIDefine *p_dfn = (OCIDefine *) 0; + static OCIBind *p_bnd = (OCIBind *) 0; + ], + [ + int p_bvi; + char p_sli[20]; + int rc; + char errbuf[100]; + int errcode; + + rc = OCIInitialize((ub4) OCI_DEFAULT, (dvoid *)0, /* Initialize OCI */ + (dvoid * (*)(dvoid *, size_t)) 0, + (dvoid * (*)(dvoid *, dvoid *, size_t))0, + (void (*)(dvoid *, dvoid *)) 0 ); + + ], + ORACLE_LIBS="$ORACLE_LIBDIR_SWITCH -lclntsh -lnnz${oracle_version}", + ORACLE_LIBS= + ) + if test "x$ORACLE_LIBS" != "x"; then + break + fi + done
LIBS="$old_LIBS" CFLAGS="$old_CFLAGS" @@ -129,7 +134,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)
Date: Wed, 15 Dec 2010 07:54:38 +0100 From: freeradius-users-bounces+alexandre.chapellon=mana.pf@lists.freeradius.org (on behalf of Alan DeKok <aland@deployingradius.com>) Subject: Re: Freeradius/Oracle compilation To: FreeRadius users mailing list <freeradius-users@lists.freeradius.org>
Alexandre Chapellon wrote:
Hello I didn't have even a comment about this. Is there something stupid in the proposed patch?
I've been busy. Off of the top of my head:
- requiring a new option to configure isn't friendly.
- the whole *point* of configure is to have the computer "just figure it out"
- leave the old code there, it works for many people
- add *new* code, which is run only if the old code doesn't find the libraries
- don't force the user to choose an oracle version.
- you can write a "for" loop which loops over the different versions, and stops when the check is successful - List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html
---- Message original---- - List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html
-- Follow us on: twitter https://www.twitter.com/manainternet
participants (3)
-
Alan DeKok -
Alexandre Chapellon -
alexandre.chapellon@mana.pf