I'm having a hard time compiling Apache 2.4.2 in Solaris 10 in a x86 machine (64bits)
I installed all the required programs without problems, but when configuring (or doing make) with apache it explode.
I don't know if the problem is the env vairables. I don't know which one is failing -if this was the case-.
Here is a mini script (ran it with: source script) to illustrate what I'm doing (Notice that I install everything in /opt using the prefix flag):
#!/bin/sh
#Set ENV variables
export LDFLAGS=" -L/usr/sfw/lib -R/usr/sfw/lib -L/usr/X/lib -R/usr/X/lib -L/usr/X11/lib -R/usr/X11/lib -L/usr/ccs/lib -R/usr/ccs/lib "
export PATH=/usr/ccs/bin/amd64/usr/ccs/bin:/usr/sbin:/usr/bin:/usr/sfw/bin:/usr/sfw/sbin
export LD_LIBRARY_PATH=/usr/lib:/usr/sfw/lib
export LD_LIBRARY_PATH_64=/usr/lib/64:/usr/sfw/lib/64
export CFLAGS=-m64 -O3
export CPP_FLAGS=-m64 -O3
export CC=cc
#Install OPENSSL
cd /opt/build_src/source_apache_openssl/openssl-1.0.1c
./config --prefix=/opt/openssl-1.0.1c thread shared solaris64-gcc -m32
gmake clean
gmake
gmake install
#Install ARP
cd /opt/build_src/source_apache_openssl/apr-1.4.6
./configure --prefix=/opt/apr-1.4.6 --with-gnu-ld --enable-threads
gmake clean
gmake
gmake install
#Install ARP-UTIL
cd /opt/build_src/source_apache_openssl/apr-util-1.4.1
./configure --prefix=/opt/apr-util-1.4.1 --with-openssl=/opt/openssl-1.0.1c --with-apr=/opt/apr-1.4.6 --with-crypto --enable-threads
gmake clean
gmake
gmake install
#Instalamos Apache
cd /opt/build_src/source_apache_openssl/httpd-2.4.2 ---- IT FAILS!!!
Please, note the env variables. are they OK???
Here is what I get as an error, when configuring (./configure ... ) Apache: .... checking build system type... i386-pc-solaris2.10 checking host system type... i386-pc-solaris2.10 checking target system type... i386-pc-solaris2.10
Configuring Apache Portable Runtime library ...
checking for APR... yes
setting CPP to "gcc -E"
adding "-g" to CFLAGS
adding "-O2" to CFLAGS
setting CPPFLAGS to " -DSOLARIS2=10 -D_POSIX_PTHREAD_SEMANTICS -D_REENTRANT - D_LARGEFILE64_SOURCE"
Configuring Apache Portable Runtime Utility library...
checking for APR-util... yes
adding "-L/opt/openssl-1.0.1c/lib" to LDFLAGS
checking for gcc... cc
checking whether the C compiler works... no (!!!!!)
configure: error: in `/opt/build_src/source_apache_openssl/httpd-2.4.2': (!!!!!)
configure: error: C compiler cannot create executables (!!!!!)
See `config.log' for more details
The config.log doesn't say anything relevant -at last for me-, it just list the env variables setted -hundreds!-.
Nevertheless, if i do 'gmake' with that error I get:
Undefined first referenced
symbol in file
BIO_set_callback ab.o
BIO_set_callback_arg ab.o
BIO_get_callback_arg ab.o
SSL_CTX_set_info_callback ab.o
ld: fatal: symbol referencing errors. No output written to ab
collect2: ld returned 1 exit status
gmake[2]: *** [ab] Error 1
gmake[2]: Leaving directory `/opt/build_src/source_apache_openssl/httpd-2.4.2/support'
gmake[1]: *** [all-recursive] Error 1
gmake[1]: Leaving directory `/opt/build_src/source_apache_openssl/httpd-2.4.2/support'
gmake: *** [all-recursive] Error 1
EDIT: After following the suggestion of twalberg, I compiled it with GCC and NOT with cc, but now I'm getting this error doing the gmake:
...
ld: fatal: file ab.o: wrong ELF class: ELFCLASS32
ld: fatal: file processing errors. No output written to ab
-----other times I get-----
ld: fatal: file /opt/pcre-8.30/lib/libpcre.so: wrong ELF class: ELFCLASS32
ld: fatal: file processing errors. No output written to httpd
NOTE: I installed prce with (and without) the path to PATH=/usr/sfw/lib/64
collect2: ld returned 1 exit status
gmake[2]: *** [ab] Error 1
gmake[2]: Leaving directory `/opt/build_src/source_apache_openssl/httpd-2.4.2/support'
gmake[1]: *** [all-recursive] Error 1
gmake[1]: Leaving directory `/opt/build_src/source_apache_openssl/httpd-2.4.2/support'
gmake: *** [all-recursive] Error 1