Building Apache with many modules > Examine the configuration
Previous Page Contents Next Page
OOP-Reserch home page

Mail to Me

Examine the configuration

Any questions and comments are welcome to me.

'./configure' command is very powerfull and in most case, it will achieve all the required tasks. But there may be the case where we have to give it enough information to work fine. So, it is safe to examine the 'Makefile' which was generated by './configure' before preceeding the next step(actual compiling).

Now let's see about how './configure' works. We can think that it takes the following steps:

  1. Obtaining some information from the environment variables. Such environment variables are: In normal situation, setting these values is not required. Without these variables given explicitly, './configure' can guess the appropriate values according to the environment(such as the OS).
  2. Parses the options given, such as '--prefix=/usr/local'.
  3. Based on the information retrieved in the procedures above, it generates 'Configuration.apaci' file. It resides in (source_path)/src directory.
  4. Based on 'Configuration.apaci' file generated in the previouse procedure, it generates 'Makefile.config', which also resides in (source_path)/src directory. This file must include all the required information to compile the source, so if some values are missing in 'Configuration.apaci', './configure' guess them.
  5. Based 'Makefile.config', it generates many 'Makefile' in the source tree.

Taking the procedures above into account, we can think that checking the values in 'Makefile.config' will be enough to decide whether we can compile the source successfully. Now let's examine '(source_directory)/src/Makefile.config'. On my Solaris2.7(x86), it looks like this:


##
##  Inherited Makefile options from Configure script
##  (Begin of automatically generated section)
##
SRCDIR=.
EXTRA_CFLAGS=`$(SRCDIR)/apaci`
EXTRA_LDFLAGS=
EXTRA_LIBS=
EXTRA_INCLUDES=
EXTRA_DEPS=
OSDIR=$(SRCDIR)/os/unix
INCDIR=$(SRCDIR)/include
INCLUDES0=-I$(OSDIR) -I$(INCDIR)
SHELL=/bin/sh
OS=Solaris 270
CC=gcc
CPP=gcc -E
TARGET=httpd
OPTIM=
CFLAGS_SHLIB= -DSHARED_MODULE
LD_SHLIB=ld
LDFLAGS_SHLIB=-G
LDFLAGS_SHLIB_EXPORT=
LDFLAGS_MOD_SHLIB=-G
LD_SHCORE_DEF=
LD_SHCORE_LIBS=
SHARED_CORE_EP=lib$(TARGET).ep
SHCORE_IMPLIB=
CFLAGS1= -DSOLARIS2=270 -DUSE_EXPAT -I$(SRCDIR)/lib/expat-lite -fPIC -DSHARED_CORE
INCLUDES1=
LIBS_SHLIB=
LDFLAGS1=
MFLAGS_STATIC=--no-print-directory
REGLIB=
EXPATLIB=lib/expat-lite/libexpat.a
RANLIB=ranlib
LIBS1=  -lsocket -lnsl -ldl
##
##  (End of automatically generated section)
##

Note that the above content is good enough for my Solaris.
In case of some Solaris OS, the following values may not be set to he appropriate value: As for CFLAGS1, be sure that '-fPIC' is included.(I'm not sure, but GCC on Solaris requires this option for DSO.)
If it is true for you, you can set them by setting the environment variables in the previous shell script as follows:

#!/bin/sh

echo "Configuring Apache..."
cd apache_1.3.12

# Setting Environment variables.
# Note that the lines below is for Born shell.
# For other Unix shell, modify them.
CFLAGS=-fPIC
export CFLAGS
LD_SHLIB=ld
export LD_SHLIB
LDFLAGS_SHLIB=-G
export LDFLAGS_SHLIB

# Run the 'configure'.
./configure \
    --prefix=/export/home/jun/apache_test/test_build \
    --enable-rule=SHARED_CORE \
    --enable-shared=max

cd ..
echo "Done!"

The required values may differ on the environment(OS and C compiler) you use, so please consult (source_directory)/INSTALL for details. Edit the shell script and examine the result(Makefile.config) until you get the desired one.

Java and all Java-based trademarks and logos are trademarks or registered of Sun Microsystems, Inc. in the United States and other countries.


Previous Page Contents Next Page
OOP-Reserch home page

Mail to Me


ALL CONTENTS COPYRIGHT 2000 , Jun Inamori. All rights reserved.
Any questions and comments are welcome to Jun Inamori .