How to tell Autoconf "require symbol A or B" from LIB? -


i'm trying configure postgres 9.5.4 openssl 1.1.0. configure dying because can't find ssl_library_init in openssl 1.1.0. openssl 1.1.0 provides openssl_init_ssl instead of ssl_library_init. autoconf needs check either ssl_library_init or openssl_init_ssl.

postgres uses following test:

ac_check_lib(ssl, ssl_library_init, [], [ac_msg_error([library 'ssl' required openssl])]) 

how modify [rule?] either ssl_library_init or openssl_init_ssl?


naively, changed configure.in following, did not work. best can tell, changes ignored (even after running autoreconf):

ac_check_lib(ssl, ssl_library_init|openssl_init_ssl, [], [ac_msg_error([library 'ssl' required openssl])]) 

here postgrs configure command:

$ ./configure --with-openssl --with-includes=/usr/local/ssl/include --with-libraries=/usr/local/ssl/lib 

here relevant entry config.log:

configure:8732: gcc -o conftest -wall -wmissing-prototypes -wpointer-arith -wdeclaration-after-statement -wendif-labels -wmissing-format-attribute -wformat-security -fno-strict-aliasing -fwrapv -wno-unused-command-line-argument -i/usr/local/ssl/include -l/usr/local/ssl/lib   -i/usr/local/ssl/include   -l/usr/local/ssl/lib conftest.c -lssl  -lcrypto -lz -lreadline -lm  >&5 undefined symbols architecture x86_64:   "_ssl_library_init", referenced from:       _main in conftest-c0c2a1.o ld: symbol(s) not found architecture x86_64 clang: error: linker command failed exit code 1 (use -v see invocation) configure:8732: $? = 1 configure: failed program was: | /* confdefs.h */ | #define package_name "postgresql" | #define package_tarname "postgresql" | #define package_version "9.5.4" | #define package_string "postgresql 9.5.4" | #define package_bugreport "pgsql-bugs(at)postgresql(dot)org" | #define package_url "" | #define pg_majorversion "9.5" | #define pg_version "9.5.4" | #define use_integer_datetimes 1 | #define def_pgport 5432 | #define def_pgport_str "5432" | #define blcksz 8192 | #define relseg_size 131072 | #define xlog_blcksz 8192 | #define xlog_seg_size (16 * 1024 * 1024) | #define enable_thread_safety 1 | #define pg_krb_srvnam "postgres" | #define use_openssl 1 | #define have_libm 1 | #define have_libreadline 1 | #define have_libz 1 | #define have_spinlocks 1 | #define have_atomics 1 | #define have_libcrypto 1 | /* end confdefs.h.  */ |  | /* override gcc internal prototype avoid error. |    use char because int might match return type of gcc |    builtin , argument prototype still apply.  */ | #ifdef __cplusplus | extern "c" | #endif | char ssl_library_init (); | int | main () | { | return ssl_library_init (); |   ; |   return 0; | } configure:8741: result: no configure:8751: error: library 'ssl' required openssl 

something should work out you:

accept_ssl_lib="no" ac_check_lib(ssl, openssl_init_ssl, [accept_ssl_lib="yes"]) ac_check_lib(ssl, ssl_library_init, [accept_ssl_lib="yes"]) as_if([test "x$accept_ssl_lib" = xno], [ac_msg_error([library 'ssl' required openssl])]) 

you may need variable tell init function call, set ssl, unless there's macro magic in header file fix right value.


Comments