configure.ac: check for Oracle libs is broken
The check reported as “checking for Oracle OCI libraries in $oracle_lib_dir...” sets
oci_ldflags="-L$oracle_lib_dir -lclntsh"
LDFLAGS="$LDFLAGS $oci_ldflags"
which on my machine produces gcc -o conftest <-W flags> -I<oracle include> -L<oracle lib> -lclntsh conftest.c -lpthread
. Note that -lclntsh
precedes conftest.c
and thus the check inevitably fails with
/usr/bin/ld: /tmp/cc12Szfy.o: in function `main':
conftest.c:(.text.startup+0x23): undefined reference to `OCIEnvCreate'
/usr/bin/ld: conftest.c:(.text.startup+0x39): undefined reference to `OCIHandleFree'
collect2: error: ld returned 1 exit status
I am not sure if this is the proper way but this can be easily fixed by moving the -lcntsh
to LIBS
, i.e.
oci_ldflags="-L$oracle_lib_dir"
LIBS="-lclntsh"
LDFLAGS="$LDFLAGS $oci_ldflags"
Comments (6)
-
repo owner -
repo owner - changed status to closed
-
reporter Well, that's exactly how I did it and my issue is that it doesn't set it correctly. Compare the first code block showing the actual code of configure (packaged in the tar with 3.2.2 release or generated using the bootstrap script from this repo) with the last one with my quick fix which enabled me to build the thing at all.
-
reporter It seems that I can’t submit pull requests anymore but the fix is the matter of adding that extra LIBS line in ax_lib_oracle_oci.m4 as done here (or disabling this check altogether as you’ve suggested).
-
reporter - changed status to open
-
repo owner - changed status to closed
Fixed by updating ax_lib_oracle_oci.m4
- Log in to comment
Use
/configure --with-oci-include=/opt/oci/include --with-oci-lib=/opt/oci/lib
instead. This should set LIBS as expected. The built-inax_lib_oracle_oci.m4
module can be buggy on modern systems and should be removed or fixed.