I am running AIX 5.2 with Apache 1.3 and would like to get auth_ldap
working. I have OpenLDAP and OpenSSL compiled and installed. Also,
after some serious hacking with Makefiles, I have auth_ldap compiling.
However, I cannot get auth_ldap to link either with ld or directly with
apxs.
Okay, first, I try to link after using cc to compile. To compile, I use
the following Makefile. Note, I had to hack the Makefile to even get
this far. The configure script did not produce a Makefile that did much
for me:
../configure --with-apxs=/opt/freeware/apache/bin/apxs \
--with-libs=/usr/local/lib \
--includedir=/opt/freeware/apache/include \
--with-sdk-headers=/usr/local/include \
--with-sdk-libs=/usr/local/lib \
--with-shared-cache
Okay, the important parts of the Makefile:
LIBS=-lldap -llber
CPPFLAGS=-I/usr/local/include
APACHEINCLUDE=/opt/freeware/apache/include
LDAPINCLUDE=/usr/local/include
OBJS=auth_ldap.o auth_ldap_config.o auth_ldap_cache.o
auth_ldap_cache_mgr.o
SRC=auth_ldap.c auth_ldap_config.c auth_ldap_cache.c
auth_ldap_cache_mgr.c
CFLAGS=`$(APXS) -q CFLAGS` $(FRONTPAGE) $(SSL) $(SHARED_CACHE)
$(OPENLDAP) -I$(APACHEINCLUDE) -I$(LDAPINCLUDE)
auth_ldap.so: $(OBJS) $(AIX_EXP)
# @echo $(LD_SHLIB) $(LDFLAGS_SHLIB) -o $@ $(OBJS) $(LIBS)
# @$(LD_SHLIB) $(LDFLAGS_SHLIB) -o $@ $(OBJS) $(LIBS)
$(APXS) -c -Wl,-bexpall -Wc,-I/usr/local/include -Wc,-I./ -o
auth_ldap.so $(OBJS)
..c.o:
@$(MYCC) -c -o $@ $(CFLAGS) $(CFLAGS_SHLIB) -I$(INCLUDEDIR)
$(CPPFLAGS) $<
This at least compiles the code. However, a link fails:
ld -H512 -T512 -bhalt:4 -bM:SRE -e _nostart
-bI:/opt/freeware/apache/libexec/httpd.exp -lc -o auth_lda
p.so auth_ldap.o auth_ldap_config.o auth_ldap_cache.o
auth_ldap_cache_mgr.o -bexpall
ld: 0711-327 WARNING: Entry point not found: _nostart
ld: 0711-317 ERROR: Undefined symbol: .ldap_url_parse
ld: 0711-317 ERROR: Undefined symbol: .ldap_free_urldesc
ld: 0711-317 ERROR: Undefined symbol: .ldap_compare_s
ld: 0711-317 ERROR: Undefined symbol: .ldap_search_ext_s
ld: 0711-317 ERROR: Undefined symbol: .ldap_err2string
ld: 0711-317 ERROR: Undefined symbol: .ldap_first_entry
ld: 0711-317 ERROR: Undefined symbol: .ldap_get_dn
ld: 0711-317 ERROR: Undefined symbol: .ldap_msgfree
ld: 0711-317 ERROR: Undefined symbol: .ldap_memfree
ld: 0711-317 ERROR: Undefined symbol: .ldap_count_entries
ld: 0711-317 ERROR: Undefined symbol: .ldap_simple_bind_s
ld: 0711-317 ERROR: Undefined symbol: .ldap_unbind_s
ld: 0711-317 ERROR: Undefined symbol: .ldap_init
ld: 0711-317 ERROR: Undefined symbol: .ldap_set_option
ld: 0711-317 ERROR: Undefined symbol: .ldap_start_tls_s
ld: 0711-345 Use the -bloadmap or -bnoquiet option to obtain more
information.
If I try to run ld in the Makefile (without doing it via apxs as I did
via a change under auth_ldap.so

I get an error about not having a
symbol table auth_ldap.exp or something. After reading up, I found that
the AIX linker wants a previously created symbol table ready for use.
This isn't included with auth_ldap. Linking with apxs as a front-end
seems to somewhat, but then I get the above set of errors.
So, I try compiling and linking with apxs as a front-end and I can't
even get past the compiling stage:
# apxs -c -Wl,-bexpall -Wc,-I/usr/local/include -Wc,-I./ auth_ldap.c
auth_...
....
c -DAIX=51 -DUSE_PTHREAD_SERIALIZED_ACCEPT -U__STR__
-DAIX_BIND_PROCESSOR -DMOD_SSL=208108 -DUSE_HSREGEX
-DEAPI -DUSE_EXPAT -I../lib/expat-lite -fpic -DSHARED_MODULE
-I/opt/freeware/apache/include
-I/usr/local/include -I./ -c auth_ldap_cache_mgr.c
1506-507 (W) No licenses available. Contact your program supplier to
add additional users. Compilation
will proceed shortly.
cc -DAIX=51 -DUSE_PTHREAD_SERIALIZED_ACCEPT -U__STR__
-DAIX_BIND_PROCESSOR -DMOD_SSL=208108 -DUSE_HSREGEX
-DEAPI -DUSE_EXPAT -I../lib/expat-lite -fpic -DSHARED_MODULE
-I/opt/freeware/apache/include
-I/usr/local/include -I./ -c auth_ldap_config.c
1506-507 (W) No licenses available. Contact your program supplier to
add additional users. Compilation
will proceed shortly.
"auth_ldap_config.c", line 73.10: 1506-045 (S) Undeclared identifier
LDAP_URL_ERR_NOTLDAP.
"auth_ldap_config.c", line 73.10: 1506-051 (S) Case expression must be
a valid integral constant.
"auth_ldap_config.c", line 75.10: 1506-045 (S) Undeclared identifier
LDAP_URL_ERR_NODN.
"auth_ldap_config.c", line 75.10: 1506-051 (S) Case expression must be
a valid integral constant.
apxs:Break: Command failed with rc=1
....
So I'm unsure what is going on. I'm not familiar with the AIX
linker, so I'm at a loss.
Any ideas?