Forum OpenACS Q&A: Re: compiling nspostgres
Mac OS X, 10.3.2 (Panther)
AOLserver 4.0.1
PG 7.4.1
Tcl 8.4.5
nscache-1.5
nssha1-0.1
Home directories of postgres and aolserver respectively:
POSTGRES = /usr/local/pgsql
NSHOME = /usr/local/aolserver
make version: GNU Make version 3.79, Built for powerpc-apple-darwin7.0
I downloaded and untarred nspostgres-4.0beta1 into my /usr/local/aolserver/ directory.
I edited this line in the Makefile from this:
# MODLIBS = -L$(PGLIB) -lpq
to this:
MODLIBS = -L$(PGLIB) -lpq -lnsdb
(Per Russell Muetzelfeldt's suggestion above)
However, when I issue the command:
$ make POSTGRES=/usr/local/pgsql INST=/usr/local/aolserver ACS=1
I get the following error message:
gcc -pipe -DBIND_EMULATION -I/usr/local/pgsql/include -DFOR_ACS_USE -Os -Wall -Wconversion -Wno-implicit-int -fno-common -DMAC_OSX_TCL -DHAVE_CFBUNDLE -DUSE_VFORK -DTCL_DEFAULT_ENCODING=\"utf-8\" -I/usr/local/aolserver/include -I/usr/local/aolserver/include -DNO_CONST -DHAVE_UNISTD_H=1 -DHAVE_LIMITS_H=1 -DTCL_THREADS=1 -DUSE_THREAD_ALLOC=1 -D_REENTRANT=1 -D_THREAD_SAFE=1 -DHAVE_PTHREAD_ATTR_SETSTACKSIZE=1 -DHAVE_READDIR_R=1 -DTCL_WIDE_INT_TYPE=long\ long -DWORDS_BIGENDIAN=1 -DHAVE_GETCWD=1 -DHAVE_OPENDIR=1 -DHAVE_STRSTR=1 -DHAVE_STRTOL=1 -DHAVE_STRTOLL=1 -DHAVE_STRTOULL=1 -DHAVE_TMPNAM=1 -DHAVE_WAITPID=1 -DNO_VALUES_H=1 -DHAVE_UNISTD_H=1 -DHAVE_SYS_PARAM_H=1 -DUSE_TERMIOS=1 -DHAVE_SYS_TIME_H=1 -DTIME_WITH_SYS_TIME=1 -DHAVE_TM_ZONE=1 -DHAVE_GMTIME_R=1 -DHAVE_LOCALTIME_R=1 -DHAVE_TM_GMTOFF=1 -DHAVE_ST_BLKSIZE=1 -DSTDC_HEADERS=1 -DHAVE_SIGNED_CHAR=1 -DHAVE_PUTENV_THAT_COPIES=1 -DHAVE_LANGINFO=1 -DHAVE_SYS_IOCTL_H=1 -DHAVE_SYS_FILIO_H=1 -DHAVE_TIMEGM=1 -DHAVE_POLL=1 -DHAVE_DRAND48=1 -DHAVE_RANDOM=1 -DHAVE__NSGETENVIRON=1 -DUSE_DYLD=1 -DHAVE_CMMSG=1 -c -o nspostgres.o nspostgres.c
nspostgres.c: In function `Ns_PgTableList':
nspostgres.c:678: warning: passing arg 3 of `Tcl_DStringAppend' as signed due to prototype
nspostgres.c: In function `encode3':
nspostgres.c:748: warning: passing arg 1 of `enc_one' with different width due to prototype
nspostgres.c:749: warning: passing arg 1 of `enc_one' with different width due to prototype
nspostgres.c:750: warning: passing arg 1 of `enc_one' with different width due to prototype
nspostgres.c:751: warning: passing arg 1 of `enc_one' with different width due to prototype
nspostgres.c: In function `decode3':
nspostgres.c:771: warning: passing arg 1 of `get_one' with different width due to prototype
nspostgres.c:772: warning: passing arg 1 of `get_one' with different width due to prototype
nspostgres.c:773: warning: passing arg 1 of `get_one' with different width due to prototype
nspostgres.c:774: warning: passing arg 1 of `get_one' with different width due to prototype
nspostgres.c: In function `stream_actually_write':
nspostgres.c:863: warning: passing arg 3 of `write' as unsigned due to prototype
nspostgres.c: In function `blob_send_to_stream':
nspostgres.c:979: warning: `fd' might be used uninitialized in this function
nspostgres.c:981: warning: `conn' might be used uninitialized in this function
nspostgres.c: In function `parse_bind_variables':
nspostgres.c:1210: warning: unused variable `first_bind'
nspostgres.c: In function `PgBindCmd':
nspostgres.c:1326: warning: unused variable `value_frag_len'
/bin/rm -f nspostgres.so
cc -bundle -L/usr/local/aolserver/lib -o nspostgres.so nspostgres.o -L/usr/local/pgsql/lib -lpq -lnsdb -lnsthread -lnsd -L/usr/local/aolserver/lib -ltcl8.4 -lpthread -framework CoreFoundation
ld: Undefined symbols:
_SSL_pending
_BIO_free
_BIO_new_mem_buf
_DH_check
_DH_generate_parameters
_DH_size
_ERR_get_error
_ERR_reason_error_string
_EVP_PKEY_free
_PEM_read_DHparams
_PEM_read_PrivateKey
_PEM_read_X509
_PEM_read_bio_DHparams
_SSL_CTX_ctrl
_SSL_CTX_free
_SSL_CTX_load_verify_locations
_SSL_CTX_new
_SSL_CTX_set_tmp_dh_callback
_SSL_CTX_set_verify
_SSL_CTX_set_verify_depth
_SSL_connect
_SSL_free
_SSL_get_error
_SSL_get_ex_data
_SSL_get_peer_certificate
_SSL_library_init
_SSL_load_error_strings
_SSL_new
_SSL_read
_SSL_set_ex_data
_SSL_set_fd
_SSL_shutdown
_SSL_write
_TLSv1_method
_X509_NAME_get_text_by_NID
_X509_NAME_oneline
_X509_check_private_key
_X509_free
_X509_get_subject_name
make: *** [nspostgres.so] Error 1
It looks like it's trying to link against OpenSSL but can't find the correct libraries - I'm guessing you built your postgres with SSL support.
Try changing the modlibs line to
MODLIBSÂ = -L$(PGLIB) -lpq -lnsdb -lssl