httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Rasmus Lerdorf <ras...@lerdorf.on.ca>
Subject Trying to grok .module files
Date Thu, 23 Oct 1997 00:01:06 GMT
Ok, since  there is only 1 example of a .module configuation file, I
figured I would try to grok that.  Grabbing a completely fresh CVS tree as
of right now and commenting out mod_auth and commenting in mod_auth_db
gives me:

7:09pm asf-admin:~/apachen/src> ./Configure
Using config file: Configuration
Creating Makefile
 + configured for Solaris 251 platform
 + setting C compiler to gcc
 + Adding selected modules
    o db_auth_module uses ConfigStart/End:
 + using -ldb for mod_auth_db
 + doing sanity check on compiler and options
ld: fatal: library -ldb: not found
ld: fatal: File processing errors.  No output written to dummy
make: *** [dummy] Error 1
** A test compilation with your Makefile configuration
** failed. This is most likely because your C compiler
** is not ANSI. Apache requires an ANSI C Compiler, such
** as gcc. The above error message from your compiler
** will also provide a clue.
 Aborting!

It obviously shouldn't be doing a -ldb on Solaris.  So, we need to clear
that default on that platform (and many others, I bet), so I suggest this
patch:

diff -c -r1.161 Configure
*** Configure   1997/10/21 06:41:07     1.161
--- Configure   1997/10/22 23:13:33
***************
*** 367,372 ****
--- 367,373 ----
        SOLVER=`echo $PLAT | sed 's/^.*solaris2.//'`
        OS="Solaris $SOLVER"
        CFLAGS="$CFLAGS -DSOLARIS2=$SOLVER"
+       DB_LIB=""
        LIBS="$LIBS -lsocket -lnsl"
        case "$SOLVER" in
            2[56789]*)


I am also having some problems with the fact that the sanity check which
runs ./helpers/TestCompile is running out of the helpers/ directory and
not from the src directory.  That means that when I set up my LIBS line in
mod_php3.module I have to add something like:

  -L../modules/extra -Lmodules/extra -lphp3

The first one ensures the sanity check fails, and the second is for the
actual link.  I think the sanity check and the actual link should run out
of the same dir or else relative paths to stuff installed in the modules
directories are all bogus.

To that end, I propose the following patch:

Index: TestCompile
===================================================================
RCS file: /export/home/cvs/apachen/src/helpers/TestCompile,v
retrieving revision 1.7
diff -c -r1.7 TestCompile
*** TestCompile 1997/10/15 20:32:02     1.7
--- TestCompile 1997/10/22 23:47:50
***************
*** 102,111 ****
  LDFLAGS=\$(LDFLAGS1) \$(EXTRA_LDFLAGS)
  
  dummy:
!       \$(CC) \$(CFLAGS) \$(INCLUDES) \$(LDFLAGS) dummy.c -o dummy $TLIB
\$(LIBS)
  
  testfunc:
!       \$(CC) \$(CFLAGS) \$(INCLUDES) \$(LDFLAGS) testfunc.c -o testfunc
\$(LIBS)
  EOF
  
  # Now run that Makefile
--- 102,111 ----
  LDFLAGS=\$(LDFLAGS1) \$(EXTRA_LDFLAGS)
  
  dummy:
!       cd ..;\$(CC) \$(CFLAGS) \$(INCLUDES) \$(LDFLAGS) helpers/dummy.c
-o helpers/dummy $TLIB \$(LIBS)
  
  testfunc:
!       cd ..;\$(CC) \$(CFLAGS) \$(INCLUDES) \$(LDFLAGS)
helpers/testfunc.c -o helpers/testfunc \$(LIBS)
  EOF
  
  # Now run that Makefile


Ok, I am not done yet.  For my own particular needs, I need to be able to
override the setting of WANTHSREGEX.  Due to the order of things in the
Configure script, this is not currently possible to do in a .module file.
The fix is simple.  Put the WANTHSREGEX rule check after the .module files
have been read to give the .module files a chance to alter the setting.
I propose the following patch for this:

Index: Configure
===================================================================
RCS file: /export/home/cvs/apachen/src/Configure,v
retrieving revision 1.161
diff -c -r1.161 Configure
*** Configure   1997/10/21 06:41:07     1.161
--- Configure   1997/10/22 23:56:47
***************
*** 666,679 ****
        ;;
  esac
  
- #
- # Now HS's POSIX regex implementation if needed/wanted
- #
- if [ "$RULE_WANTHSREGEX" = "yes" ]; then
-     REGLIB="regex/libregex.a"
-     SUBDIRS="$SUBDIRS regex"
-     INCLUDES_AUTODEPTH="$INCLUDES_AUTODEPTH regex"
- fi
  
  #
  # Now SOCKS4.
--- 667,672 ----
***************
*** 864,869 ****
--- 857,871 ----
        print "  NULL"
        print "};"
      }'
+ 
+ #
+ # Now HS's POSIX regex implementation if needed/wanted
+ #
+ if [ "$RULE_WANTHSREGEX" = "yes" ]; then
+     REGLIB="regex/libregex.a"
+     SUBDIRS="$SUBDIRS regex"
+     INCLUDES_AUTODEPTH="$INCLUDES_AUTODEPTH regex"
+ fi
  
  # figure out which module dir require use to autocreate a Makefile.
  # for these dirs we must not list the object files from the AddModule


So, if you are keeping score at home, this message has 2 proposed patches
to Configure and 1 to helpers/TestCompile.  All 3 are related to making
the .module feature useful to someone like me trying to build a seamless
module installation procedure for a massive module.

-Rasmus


Mime
View raw message