You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@httpd.apache.org by Aaron Bannert <aa...@clove.org> on 2001/09/28 05:18:17 UTC

[PATCH] allow statically linked support tools (htpasswd, etc)

This patch adds some new configure parameters:

--enable-static-htpasswd
--enable-static-htdigest
--enable-static-logresolve
--enable-static-rotatelogs
--enable-static-ab

This allows the given executable to be statically linked with the apache/apr
libs. This was necessary to allow these executables to be relocatable
after build-time (for example when they were distributed in binary form).

Since these parameters generate variables that are specific to the
support/ directory, I've created a new config.m4 script in that directory.
(To apply, apply the patch and copy the config.m4 script into support/)

I've tested this patch on the following platforms:
Linux 2.4.3 (gcc 2.96 from RH7.1) i386
Solaris 8 (7/01) (gcc 2.95.2) i86pc
FreeBSD 5.0-CURRENT (gcc 2.95.3) i386

-aaron

config.m4 also inlined for public reviewal (following the diff):


Index: support/Makefile.in
===================================================================
RCS file: /home/cvspublic/httpd-2.0/support/Makefile.in,v
retrieving revision 1.23
diff -u -r1.23 Makefile.in
--- support/Makefile.in	2001/09/13 22:19:13	1.23
+++ support/Makefile.in	2001/09/28 02:07:34
@@ -23,23 +23,23 @@
 
 htpasswd_OBJECTS = htpasswd.lo
 htpasswd: $(htpasswd_OBJECTS)
-	$(LINK) $(htpasswd_OBJECTS) $(PROGRAM_LDADD)
+	$(LINK) $(htpasswd_LTFLAGS) $(htpasswd_OBJECTS) $(PROGRAM_LDADD)
 
 htdigest_OBJECTS = htdigest.lo
 htdigest: $(htdigest_OBJECTS)
-	$(LINK) $(htdigest_OBJECTS) $(PROGRAM_LDADD)
+	$(LINK) $(htdigest_LTFLAGS) $(htdigest_OBJECTS) $(PROGRAM_LDADD)
 
 rotatelogs_OBJECTS = rotatelogs.lo
 rotatelogs: $(rotatelogs_OBJECTS)
-	$(LINK) $(rotatelogs_OBJECTS) $(PROGRAM_LDADD)
+	$(LINK) $(rotatelogs_LTFLAGS) $(rotatelogs_OBJECTS) $(PROGRAM_LDADD)
 
 logresolve_OBJECTS = logresolve.lo
 logresolve: $(logresolve_OBJECTS)
-	$(LINK) $(logresolve_OBJECTS) $(PROGRAM_LDADD)
+	$(LINK) $(logresolve_LTFLAGS) $(logresolve_OBJECTS) $(PROGRAM_LDADD)
 
 ab_OBJECTS = ab.lo
 ab: $(ab_OBJECTS)
-	$(LINK) $(ab_OBJECTS) $(PROGRAM_LDADD)
+	$(LINK) $(ab_LTFLAGS) $(ab_OBJECTS) $(PROGRAM_LDADD)
 
 suexec_OBJECTS = suexec.lo
 suexec: $(suexec_OBJECTS)
Index: configure.in
===================================================================
RCS file: /home/cvspublic/httpd-2.0/configure.in,v
retrieving revision 1.182
diff -u -r1.182 configure.in
--- configure.in	2001/09/25 15:58:52	1.182
+++ configure.in	2001/09/28 02:07:35
@@ -257,6 +257,8 @@
   APR_ADDTO(CPPFLAGS, -DAP_DEBUG)
 ])dnl
 
+sinclude(support/config.m4)
+
 APACHE_ENABLE_LAYOUT
 prefix="$orig_prefix"
 APACHE_ENABLE_MODULES





---------------------- support/config.m4

htpasswd_LTFLAGS=""
htdigest_LTFLAGS=""
rotatelogs_LTFLAGS=""
logresolve_LTFLAGS=""
ab_LTFLAGS=""

dnl XXX Should we change the foo_LTFLAGS="-static" settings below
dnl to something like APR_ADDTO? -aaron

AC_ARG_ENABLE(static-htpasswd,[  --enable-static-htpasswd  Build a statically linked version of htpasswd],[
if test "$enableval" = "yes" ; then
  htpasswd_LTFLAGS="-static"
fi
])
APACHE_SUBST(htpasswd_LTFLAGS)

AC_ARG_ENABLE(static-htdigest,[  --enable-static-htdigest  Build a statically linked version of htdigest],[
if test "$enableval" = "yes" ; then
  htdigest_LTFLAGS="-static"
fi
])
APACHE_SUBST(htdigest_LTFLAGS)

AC_ARG_ENABLE(static-rotatelogs,[  --enable-static-rotatelogs  Build a statically linked version of rotatelogs],[
if test "$enableval" = "yes" ; then
  rotatelogs_LTFLAGS="-static"
fi
])
APACHE_SUBST(rotatelogs_LTFLAGS)

AC_ARG_ENABLE(static-logresolve,[  --enable-static-logresolve  Build a statically linked version of logresolve],[
if test "$enableval" = "yes" ; then
  logresolve_LTFLAGS="-static"
fi
])
APACHE_SUBST(logresolve_LTFLAGS)

AC_ARG_ENABLE(static-ab,[  --enable-static-ab      Build a statically linked version of ab],[
if test "$enableval" = "yes" ; then
  ab_LTFLAGS="-static"
fi
])
APACHE_SUBST(ab_LTFLAGS)


Re: [PATCH] allow statically linked support tools (htpasswd, etc)

Posted by Ryan Bloom <rb...@covalent.net>.
On Thursday 27 September 2001 08:18 pm, Aaron Bannert wrote:
> This patch adds some new configure parameters:
>
> --enable-static-htpasswd
> --enable-static-htdigest
> --enable-static-logresolve
> --enable-static-rotatelogs
> --enable-static-ab
>
> This allows the given executable to be statically linked with the
> apache/apr libs. This was necessary to allow these executables to be
> relocatable after build-time (for example when they were distributed in
> binary form).
>
> Since these parameters generate variables that are specific to the
> support/ directory, I've created a new config.m4 script in that directory.
> (To apply, apply the patch and copy the config.m4 script into support/)
>
> I've tested this patch on the following platforms:
> Linux 2.4.3 (gcc 2.96 from RH7.1) i386
> Solaris 8 (7/01) (gcc 2.95.2) i86pc
> FreeBSD 5.0-CURRENT (gcc 2.95.3) i386
>
> -aaron
>
> config.m4 also inlined for public reviewal (following the diff):

Committed, minus the configure.in section.

Ryan

______________________________________________________________
Ryan Bloom				rbb@apache.org
Covalent Technologies			rbb@covalent.net
--------------------------------------------------------------

Re: [PATCH] allow statically linked support tools (htpasswd, etc)

Posted by Ryan Bloom <rb...@covalent.net>.
On Thursday 27 September 2001 08:46 pm, Ryan Bloom wrote:
> > This allows the given executable to be statically linked with the
> > apache/apr libs. This was necessary to allow these executables to be
> > relocatable after build-time (for example when they were distributed in
> > binary form).
> >
> > Since these parameters generate variables that are specific to the
> > support/ directory, I've created a new config.m4 script in that
> > directory. (To apply, apply the patch and copy the config.m4 script into
> > support/)
> >
> > I've tested this patch on the following platforms:
> > Linux 2.4.3 (gcc 2.96 from RH7.1) i386
> > Solaris 8 (7/01) (gcc 2.95.2) i86pc
> > FreeBSD 5.0-CURRENT (gcc 2.95.3) i386
> > Index: configure.in
> > ===================================================================
> > RCS file: /home/cvspublic/httpd-2.0/configure.in,v
> > retrieving revision 1.182
> > diff -u -r1.182 configure.in
> > --- configure.in	2001/09/25 15:58:52	1.182
> > +++ configure.in	2001/09/28 02:07:35
> > @@ -257,6 +257,8 @@
> >    APR_ADDTO(CPPFLAGS, -DAP_DEBUG)
> >  ])dnl
> >
> > +sinclude(support/config.m4)
> > +
> >  APACHE_ENABLE_LAYOUT
> >  prefix="$orig_prefix"
> >  APACHE_ENABLE_MODULES
>
> In general, very good.  I'll be applying soon (like 15 minutes), but this
> is unnecessary.  The buildconf script does a find on the entire directory
> tree to find all config.m4 files, so we don't have to sinclude them.

That's unclear.  The configure.in patch is the part that is unnecessary.

Ryan
______________________________________________________________
Ryan Bloom				rbb@apache.org
Covalent Technologies			rbb@covalent.net
--------------------------------------------------------------

Re: [PATCH] allow statically linked support tools (htpasswd, etc)

Posted by Ryan Bloom <rb...@covalent.net>.
>
> This allows the given executable to be statically linked with the
> apache/apr libs. This was necessary to allow these executables to be
> relocatable after build-time (for example when they were distributed in
> binary form).
>
> Since these parameters generate variables that are specific to the
> support/ directory, I've created a new config.m4 script in that directory.
> (To apply, apply the patch and copy the config.m4 script into support/)
>
> I've tested this patch on the following platforms:
> Linux 2.4.3 (gcc 2.96 from RH7.1) i386
> Solaris 8 (7/01) (gcc 2.95.2) i86pc
> FreeBSD 5.0-CURRENT (gcc 2.95.3) i386
> Index: configure.in
> ===================================================================
> RCS file: /home/cvspublic/httpd-2.0/configure.in,v
> retrieving revision 1.182
> diff -u -r1.182 configure.in
> --- configure.in	2001/09/25 15:58:52	1.182
> +++ configure.in	2001/09/28 02:07:35
> @@ -257,6 +257,8 @@
>    APR_ADDTO(CPPFLAGS, -DAP_DEBUG)
>  ])dnl
>
> +sinclude(support/config.m4)
> +
>  APACHE_ENABLE_LAYOUT
>  prefix="$orig_prefix"
>  APACHE_ENABLE_MODULES

In general, very good.  I'll be applying soon (like 15 minutes), but this
is unnecessary.  The buildconf script does a find on the entire directory
tree to find all config.m4 files, so we don't have to sinclude them.

Ryan

______________________________________________________________
Ryan Bloom				rbb@apache.org
Covalent Technologies			rbb@covalent.net
--------------------------------------------------------------