You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by gs...@locus.apache.org on 2000/12/07 12:37:10 UTC

cvs commit: httpd-2.0/build build2.mk buildexports.sh

gstein      00/12/07 03:37:09

  Modified:    include  http_main.h
               server   Makefile.in main.c
               build    build2.mk buildexports.sh
  Log:
  *) fix up buildexports.sh:
     - enable it to be run from any dir by passing a parameter for the
       location of srclib, and using its own location for determining where
       the AWK script is located
     - accept exports files on STDIN, and produce output on STDOUT
     - use "pwd" and cd back to it, rather than assuming ../../.. (which might
       not apply if we feed it other export files)
     - add USAGE reporting
  
  *) generate exports.c during normal build of "server" rather than during the
     buildconf stage. update invocation to match above changes
  
  *) revamp the ap_ugly_hack referencing in main.c: put it at the bottom of
     the file with the other, similar references, and style it similarly.
  
  *) remove the ap_ugly_hack declaration from http_main.h; it is internal to
     the "server" code
  
  Revision  Changes    Path
  1.17      +0 -4      httpd-2.0/include/http_main.h
  
  Index: http_main.h
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/include/http_main.h,v
  retrieving revision 1.16
  retrieving revision 1.17
  diff -u -u -r1.16 -r1.17
  --- http_main.h	2000/11/02 18:51:06	1.16
  +++ http_main.h	2000/12/07 11:37:01	1.17
  @@ -89,10 +89,6 @@
    *  effect the server based on command line options */
   extern AP_DECLARE_DATA apr_array_header_t *ap_server_config_defines;
   
  -#ifdef AP_USING_AUTOCONF
  -extern void *ap_ugly_hack;
  -#endif
  -
   #ifdef __cplusplus
   }
   #endif
  
  
  
  1.26      +5 -0      httpd-2.0/server/Makefile.in
  
  Index: Makefile.in
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/server/Makefile.in,v
  retrieving revision 1.25
  retrieving revision 1.26
  diff -u -u -r1.25 -r1.26
  --- Makefile.in	2000/12/05 02:45:49	1.25
  +++ Makefile.in	2000/12/07 11:37:04	1.26
  @@ -30,3 +30,8 @@
   
   util_uri.lo: uri_delims.h
   util.lo: test_char.h
  +
  +EXPORT_FILES = ../srclib/apr/apr.exports ../srclib/apr-util/aprutil.exports
  +
  +exports.c: $(EXPORT_FILES)
  +	(cat $(EXPORT_FILES) | ../build/buildexports.sh ../srclib) > $@
  
  
  
  1.76      +14 -8     httpd-2.0/server/main.c
  
  Index: main.c
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/server/main.c,v
  retrieving revision 1.75
  retrieving revision 1.76
  diff -u -u -r1.75 -r1.76
  --- main.c	2000/12/01 14:02:49	1.75
  +++ main.c	2000/12/07 11:37:04	1.76
  @@ -301,14 +301,6 @@
   
       apr_initialize();
   
  -#ifdef AP_USING_AUTOCONF
  -    /* This ugly little hack pulls any function referenced in exports.c into
  -     * the web server.  exports.c is generated by buildconf, and it
  -     * has all of the apr functions specified by httpd.exp.
  -     */
  -    ap_ugly_hack = (void *) apr_initialize;
  -#endif
  -
       process = create_process(argc, argv);
       pglobal = process->pool;
       pconf = process->pconf;
  @@ -456,3 +448,17 @@
   }
   #endif
   
  +#ifdef AP_USING_AUTOCONF
  +/* This ugly little hack pulls any function referenced in exports.c into
  + * the web server.  exports.c is generated during the build, and it
  + * has all of the APR functions specified by the apr/apr.exports and
  + * apr-util/aprutil.exports files.
  + */
  +const void *suck_in_APR(void);
  +const void *suck_in_APR(void)
  +{
  +    extern const void *ap_ugly_hack;
  +
  +    return ap_ugly_hack;
  +}
  +#endif
  
  
  
  1.23      +1 -4      httpd-2.0/build/build2.mk
  
  Index: build2.mk
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/build/build2.mk,v
  retrieving revision 1.22
  retrieving revision 1.23
  diff -u -u -r1.22 -r1.23
  --- build2.mk	2000/12/05 18:29:06	1.22
  +++ build2.mk	2000/12/07 11:37:07	1.23
  @@ -73,7 +73,7 @@
   
   PCRE_TARGETS = $(pcre_configure)
   
  -targets = .deps aclocal.m4 $(APACHE_TARGETS) $(APR_TARGETS) $(PCRE_TARGETS) export_lists
  +targets = .deps aclocal.m4 $(APACHE_TARGETS) $(APR_TARGETS) $(PCRE_TARGETS)
   
   cross_compile_warning = "warning: AC_TRY_RUN called without default to allow cross compiling"
   
  @@ -87,9 +87,6 @@
   aclocal.m4: acinclude.m4 srclib/apr/apr_common.m4 srclib/apr/hints.m4 $(libtool_m4)
   	@echo rebuilding $@
   	@cat acinclude.m4 $(libtool_m4) > $@
  -
  -export_lists: $(aprutil_configure) $(apr_configure)
  -	@build/buildexports.sh server/exports.c srclib/apr/apr.exports srclib/apr-util/aprutil.exports
   
   $(LT_TARGETS):
   	libtoolize $(AMFLAGS) --force
  
  
  
  1.9       +16 -16    httpd-2.0/build/buildexports.sh
  
  Index: buildexports.sh
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/build/buildexports.sh,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -u -r1.8 -r1.9
  --- buildexports.sh	2000/12/05 18:29:06	1.8
  +++ buildexports.sh	2000/12/07 11:37:08	1.9
  @@ -1,8 +1,11 @@
   #! /bin/sh
   
  -outfile=$1
  -exec >$outfile
  -shift
  +if test -z "$1"; then
  +    echo "USAGE: $0 SRCLIB-DIRECTORY"
  +    echo ""
  +    echo "for example: $0 ../srclib"
  +    exit 1
  +fi
   
   echo "/* This is an ugly hack that needs to be here, so that libtool will"
   echo " * link all of the APR functions into server regardless of whether"
  @@ -10,23 +13,20 @@
   echo " */"
   echo ""
   
  -for dir in srclib/apr/include srclib/apr-util/include
  +cur_dir="`pwd`"
  +for dir in $1/apr/include $1/apr-util/include
   do
       cd $dir
  -    for file in *.h
  -    do
  +    for file in *.h; do
           echo "#include \"$file\""
       done
  -    cd ../../../
  +    cd "$cur_dir"
   done
  -echo ""
  -
  -for file
  -do
  -    exec <$file
  -    awk -f build/buildexports.awk
  -done
   
  +echo ""
  +echo "const void *ap_ugly_hack;"
   echo ""
  -echo "void *ap_ugly_hack;"
  -exit 0
  +
  +# convert export files (on STDIN) into a series of declarations
  +my_dir="`dirname $0`"
  +awk -f "$my_dir/buildexports.awk"
  
  
  

Re: cvs commit: httpd-2.0/build build2.mk buildexports.sh

Posted by Greg Stein <gs...@lyra.org>.
On Thu, Dec 07, 2000 at 11:37:10AM -0000, gstein@locus.apache.org wrote:
> gstein      00/12/07 03:37:09
> 
>   Modified:    include  http_main.h
>                server   Makefile.in main.c
>                build    build2.mk buildexports.sh
>   Log:
>...
>   *) generate exports.c during normal build of "server" rather than during the
>      buildconf stage. update invocation to match above changes

I'd like to comment on why I did it as part of the build step, rather than
as part of the buildconf or configuration step:

  OtherBill just nuked apr_canonical_error from APR. But it was still
  sitting in my apr.exports. Therefore, exports.c contained a reference to
  the (now non-existent) function and the compilation barfed. By placing
  this into the build itself, and including a dependency on the *.exports
  files, I was able to tweak apr.exports to remove apr_canonical_error,
  exports.c was regenerated automatically, and then rebuilt. Contrast this
  with needing to run buildconf or configure to pick up the change.

I hope that makes sense...

(and yes: that AWK script from Brian made this process damn fast! woo!)

Cheers,
-g

-- 
Greg Stein, http://www.lyra.org/