Compile Mod Security 2.5.9 on Solaris 10

Hi,
I am using Apache 2.0.63 which came installed with Solaris 10 (SPARC)

Some problems here when I tried to do a make. My options for configure was:
CC=/usr/sfw/bin/gcc CXX=/usr/sfw/bin/g++ ./configure --with-apxs=/usr/apache2/bin/apxs  --with-apr=
error was:
  :
  :
# make
/var/apache2/build/libtool --silent --mode=compile /opt/SUNWspro/bin/cc -prefer-pic -xO3 -xarch=v8 -xspace -W0,-Lt -W2,-Rcond_elim -Xa -xildoff -xO4 -DSSL_EXPERIMENTAL -DSSL_ENGINE  -DSOLARIS2=10 -D_POSIX_PTHREAD_SEMANTICS -D_REENTRANT -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64  -I/usr/apache2/include  -I/usr/apache2/include   -I/usr/apache2/include -I/usr/sfw/include -O2 -g -Wall -I/usr/apache2/include -I/usr/local/include -I/usr/local/include/libxml2  -c -o mod_security2.lo mod_security2.c && touch mod_security2.slo
/var/apache2/build/libtool: line 1279: /opt/SUNWspro/bin/cc: No such file or directory
apxs:Error: Command failed with rc=65536
.
*** Error code 1
The following command caused the error:
src=""; \
for f in mod_security2 apache2_config apache2_io apache2_util  re re_operators re_actions re_tfns re_variables  msc_logging msc_xml msc_multipart modsecurity msc_parsers msc_util msc_pcre  persist_dbm msc_reqbody pdf_protect msc_geo acmp msc_lua msc_release; do \
        src="$src $f.c"; \
done; \
rm -f msc_test msc_test.o msc_test.lo msc_test.slo; \
build/apxs-wrapper -c -I/usr/apache2/include    -I/usr/local/include -I/usr/local/include/libxml2   -L/usr/local/lib -R/usr/local/lib -lpcre -L/usr/local/lib -R/usr/local/lib -lxml2 -lz -lpthread -liconv -lm -lsocket -lnsl  -Wc,-O2 -Wc,-g -Wc,-Wall  $src
make: Fatal error: Command failed for target `mod_security2.la'

Open in new window

LVL 1
QLJAsked:
Who is Participating?
 
Brian UtterbackConnect With a Mentor Principle Software EngineerCommented:
If it worked, then there is no implications. The "-Wall" flag simply tells gcc to not print any warnings and be
more quiet. So, it doesn't effect the resulting object file, just the compilation noise. If you didn't see any
worisome warnings that got you upset, then everything is fine.
0
 
QLJAuthor Commented:
i made a mistake as I pointed to the wrong path for gcc. Once corrected, I got a new set of error msgs
:
:
cc: unrecognized option `-Xa'
cc: unrecognized option `-KPIC'
cc: language O4 not recognized
cc: msc_lua.c: linker input file unused because linking not done
/var/apache2/build/libtool --silent --mode=compile /opt/SUNWspro/bin/cc -prefer-pic -xO3 -xarch=v8 -xspace -W0,-Lt -W2,-Rcond_elim -Xa -xildoff -xO4 -DSSL_EXPERIMENTAL -DSSL_ENGINE  -DSOLARIS2=10 -D_POSIX_PTHREAD_SEMANTICS -D_REENTRANT -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64  -I/usr/apache2/include  -I/usr/apache2/include   -I/usr/apache2/include -I/usr/sfw/include -O2 -g -Wall -I/usr/apache2/include -I/usr/local/include -I/usr/local/include/libxml2  -c -o msc_release.lo msc_release.c && touch msc_release.slo
cc: unrecognized option `-Xa'
cc: unrecognized option `-KPIC'
cc: language O4 not recognized
cc: msc_release.c: linker input file unused because linking not done
/var/apache2/build/libtool --silent --mode=link /opt/SUNWspro/bin/cc -o mod_security2.la -R/usr/local/lib -R/usr/local/lib  -L/usr/local/lib -L/usr/local/lib -lpcre -lxml2 -lz -lpthread -liconv -lm -lsocket -lnsl -rpath /usr/apache2/libexec -module -avoid-version    msc_release.lo msc_lua.lo acmp.lo msc_geo.lo pdf_protect.lo msc_reqbody.lo persist_dbm.lo msc_pcre.lo msc_util.lo msc_parsers.lo modsecurity.lo msc_multipart.lo msc_xml.lo msc_logging.lo re_variables.lo re_tfns.lo re_actions.lo re_operators.lo re.lo apache2_util.lo apache2_io.lo apache2_config.lo mod_security2.lo
ld: fatal: file .libs/msc_release.o: open failed: No such file or directory
apxs:Error: Command failed with rc=65536
.
*** Error code 1
The following command caused the error:
src=""; \
for f in mod_security2 apache2_config apache2_io apache2_util  re re_operators re_actions re_tfns re_variables  msc_logging msc_xml msc_multipart modsecurity msc_parsers msc_util msc_pcre  persist_dbm msc_reqbody pdf_protect msc_geo acmp msc_lua msc_release; do \
        src="$src $f.c"; \
done; \
rm -f msc_test msc_test.o msc_test.lo msc_test.slo; \
build/apxs-wrapper -c -I/usr/apache2/include    -I/usr/local/include -I/usr/local/include/libxml2   -L/usr/local/lib -R/usr/local/lib -lpcre -L/usr/local/lib -R/usr/local/lib -lxml2 -lz -lpthread -liconv -lm -lsocket -lnsl  -Wc,-O2 -Wc,-g -Wc,-Wall  $src
make: Fatal error: Command failed for target `mod_security2.la'

Open in new window

0
 
Brian UtterbackPrinciple Software EngineerCommented:
Well, the problem is your first statement. You need to compile the apache mods in the same manner
used by the apache executable. That is the whole reason for having libtool, after, to get the options and
choices to match.  So, you cannot use gcc to compile the mod, you need to use Sun Studio.

You can get it for free. There are several links on Sun's website. Here is one:
http://developers.sun.com/sunstudio/downloads/
0
Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

 
QLJAuthor Commented:
I am having major problems getting sun studio to run. Is there a way i can run sunstudio's compiler at cmd line?

Appreciate all guidance.. am a newbie with sunstudio.
0
 
Brian UtterbackPrinciple Software EngineerCommented:
Actually, your last question confuses me, because the only way I ever run sunstudio compilers is from
the command line. So, yes, of course, you can run it from the command line. Just set your path appropriately and then type "cc".  You may be having problems with your path, because you may have more than on "cc" on your path.
0
 
QLJAuthor Commented:
hi blu, evidently, i have never used sunstudio before. ;)

1) I can't seem to find the CC with SunStudio (default path?)
2) sample command to use to compile at the command line.
0
 
Brian UtterbackPrinciple Software EngineerCommented:
Usually, the Sun Studio compilers install in /opt, in SUNWspro. So, the full path to the c compiler would be /opt/SUNWspro/bin/cc and for the C++ compiler, /opt/SUNWspro/bin/CC.
The simplest command to compile a c program would be

/opt/SUNWspro/bin/cc   -o main main.c
0
 
QLJAuthor Commented:
I hate to say this, but it doesn't seem to be working right - for the SunStudio method of running /opt/SUNWspro/bin/cc   -o modsecurity modsecurity.c

By the way, the documentation in modsecurity website did  say to compile using ./configure
http://www.modsecurity.org/documentation/modsecurity-apache/2.5.9/modsecurity2-apache-reference.html#installation

Is there a reason or anyway to troubleshoot why I cant get it to work on mine?
0
 
Brian UtterbackPrinciple Software EngineerCommented:
I didn't say not to compile with configure, I just said to use the Sun Studio compiler. just add /opt/SUNWspro/bin to
the beginning of your path before you call configure, and otherwise proceed as you would normally.
0
 
QLJAuthor Commented:
Whoops.. totally misinterpreted..
well, i tried adding /opt/SUNWspro/bin to path. I now have a different error set:

# make
/var/apache2/build/libtool --silent --mode=compile /opt/SUNWspro/bin/cc -prefer-pic -xO3 -xarch=v8 -xspace -W0,-Lt -W2,-Rcond_elim -Xa -xildoff -xO4 -DSSL_EXPERIMENTAL -DSSL_ENGINE  -DSOLARIS2=10 -D_POSIX_PTHREAD_SEMANTICS -D_REENTRANT -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64  -I/usr/apache2/include  -I/usr/apache2/include   -I/usr/apache2/include -I/usr/sfw/include -O2 -g -Wall -I/usr/apache2/include -I/usr/local/include -I/usr/local/include/libxml2  -c -o mod_security2.lo mod_security2.c && touch mod_security2.slo
cc: illegal option -Wall
apxs:Error: Command failed with rc=65536
0
 
QLJAuthor Commented:
ok, i solved it... just went into the Makefile and deleted all -Wall

Problem is, would there be any implications if i do that?rything looks ok so far...
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.