PDA

View Full Version : Apache 2 compiling error



decryption
2nd May 2004, 02:32 PM
I'm trying to compile Apache 2 on my Mac OS X system, and I get the following error running "make" after I've run "./configure"




/Users/decryption/httpd-2.0.49/srclib/pcre/.libs/libpcre.al(pcreposix.lo) definition of _regcomp in section (__TEXT,__text)
/usr/lib/libpthread.dylib(regcomp.So) definition of _regcomp
ld: warning multiple definitions of symbol _regexec
/Users/decryption/httpd-2.0.49/srclib/pcre/.libs/libpcre.al(pcreposix.lo) definition of _regexec in section (__TEXT,__text)
/usr/lib/libpthread.dylib(regexec.So) definition of _regexec
ld: warning multiple definitions of symbol _regfree
/Users/decryption/httpd-2.0.49/srclib/pcre/.libs/libpcre.al(pcreposix.lo) definition of _regfree in section (__TEXT,__text)
/usr/lib/libpthread.dylib(regfree.So) definition of _regfree


I have no idea what's going on, can someone help?

DVD Plaza
3rd May 2004, 01:24 PM
What options did you specify for ./configure?

decryption
3rd May 2004, 01:27 PM
./configure --enable-mods-shared=ALL

DVD Plaza
3rd May 2004, 05:40 PM
This is my configuration (not fully optimised yet - my PHP and MySQL configurations are tightly tuned but I haven't as yet for Apache):

./configure \
--prefix=/usr/local/apache \
--disable-status \
--disable-asis \
--disable-cgi \
--disable-negotiation \
--disable-imap \
--disable-actions \
--disable-userdir \
--disable-cgid \
--enable-expires \
--enable-headers \
--enable-static-support \
--enable-http \
--enable-info \
--enable-module=php4

For optimum compiled code I set the following variables for gcc:

CC=gcc \
CXX=gcc \
CFLAGS="-O3 -fno-omit-frame-pointer" \
CXXFLAGS="-O3 -fno-omit-frame-pointer -felide-constructors -fno-exceptions -fno-rtti"

decryption
3rd May 2004, 06:18 PM
Thanks DVD Plaza, I'll try those settings.
Do you know why that error was happening in the first place?

DVD Plaza
3rd May 2004, 06:50 PM
I'm guessing either compiler compatibility (in which case the gcc variables I listed will fix you up) or one of the modules you included (you included everything) is not compatible with OSX?

DVD Plaza
3rd May 2004, 06:53 PM
Could also be a third option - could be a conflict with Apple's Apache setup (you'll note my configuration specifically steers clear of Apple's setup so that any OSX updates don't cause havoc)...

Gothikon
4th May 2004, 07:50 AM
I can't remember where I found it but you can get apache 2 as an installable package, no compiling, no messing around, double click, bam there it is, also added a pref pane to turn it on and off, you might want to google for it rather than jump through all these hopes, unless it's more of an exercise in using the command line.

decryption
4th May 2004, 09:14 AM
Originally posted by Gothikon@May 4 2004, 07:50 AM
I can't remember where I found it but you can get apache 2 as an installable package, no compiling, no messing around, double click, bam there it is, also added a pref pane to turn it on and off, you might want to google for it rather than jump through all these hopes, unless it's more of an exercise in using the command line.
Yeah, I found it here: http://www.serverlogistics.com/apache2.php
They also have a PHP and a SQL package that's easy to install too :)

DVD Plaza
4th May 2004, 09:38 AM
Originally posted by Gothikon@May 4 2004, 07:50 AM
I can't remember where I found it but you can get apache 2 as an installable package, no compiling, no messing around, double click, bam there it is, also added a pref pane to turn it on and off, you might want to google for it rather than jump through all these hopes, unless it's more of an exercise in using the command line.
Whats hard about compiling it yourself? Once you've sussed out precisely how you want it setup you simply do the same thing each time, maybe 20 seconds work and a few minutes waiting (for compiling & installing).

There's major reasons why you do it yourself. For one you upgrade to the latest fixes (including security fixes) as soon as they're available, not just when someone else decides (eg Apple/Server Logistics). You compile in only strictly what you require (performance and security advantage). You compile in the latest of not only the product in question, but any associated libraries (eg if you simply grab a pre-compiled PHP for instance good luck with it - it is a gamble what version of the MySQL libraries are compiled into it, and there's little chance it will be for the same version of MySQL you have installed - for stability/performance reasons PHP should always be compiled against the MySQL installed on your system). You can obviously make your own changes/fixes to the source code before compiling. You can tailor the entire setup, including where it runs from (extremely important as you don't want it overlapping Apple at all - otherwise the second an Apple update does any updating to their Apache setup it will damage yours). The compiled code is tuned to your precise setup - eg the exact versions and setup of all the squillions of libraries in your BSD core that the product in question relies on. etc.

For general home use there's nothing wrong with what's already installed by Apple, so for anything you'd do it yourself - grabbing a pre-compiled source is simply changing the vendor you are relying on, nothing more. Personally in that case I'd rather rely on Apple.