Passing make flags to a dependency

Clement Laforet sheep.killer at cultdeadsheep.org
Mon Feb 7 02:46:16 PST 2005


On Sun, Feb 06, 2005 at 12:59:29PM -0800, Michael C. Shultz wrote:
> On Sunday 06 February 2005 12:05 pm, you wrote:
> > Thanks Mike,
> >
> > On Sun, Feb 06, 2005 at 11:01:07AM -0800, Michael C. Shultz wrote:
> > > This is going to be a can of worms for you to automate, here are a
> > > few reasons why:
> > >
> > > What if apache2 is all ready installed without SSL turned on?
> > > What if the user wants other features besides SSL?
> > >
> > > Suggestion:  Test for a library that will only exist if apache2 has
> > > been installed with WITH_SSL_MODULES=yes and if that library is
> > > missing then have your port refuse to build with a message that
> > > apache2 must be built with WITH_SSL_MODULES=yes.
> >
> > This is a good point.  I could change the scope of this dependency to
> > be "SSL would be a good idea".   Going on that, is there a way that I
> > could specify that SSL be turned on if apache2 does get built by my
> > port, else give a warning that it's a Good Idea and/or bug out?
> >
> > -m
> 
> Here are a few ideas:
> 
> in your ports/{catagory}/{portname}/Makefile
> 
> post-configure:
> 	if test -e ${PREFIX}/lib/{library of apache SSL file}
> 	then
> 		cd ${PORTSDIR}/www/apache2;make clean;make WITH_SSL_MODULES=yes	\ 
> install clean
> 	fi
> 
> Or if you do it in configure.ac
> 
> If the test for apache2's library fails you do the following to run a 
> command:
> 
> if test "x$target_os" ="FreeBSD"; then
> AC_CONFIG_COMMANDS_PRE(cd ${PORTSDIR}/www/apache2;make clean;make \ 
> WITH_SSL_MODULES=yes  install clean)
> else
>  ### display a message about adding apache##
> fi

These solutions violates ports concept. Since mod_ssl is *NOT* 
required to make application run, any dirty hack can't be allowed.

to warn users:
just add at the end of the Makefile. (and remove '.include 
<bsd.port.mk>')

.include <bsd.port.pre.mk>

.if exists(${LOCALBASE}/libexec/apache2/mod_ssl.so)
pre-everything::
	@${ECHO_MSG} "${PORTNAME} should be accessed in HTTPS, please"
	@${ECHO_MSG} "consider using apache2 with mod_ssl."
.endif

.include <bsd.port.post.mk>

Of course, limitations are:
- message will be printed if apache2 is not installed before
- you can't detect static mod_ssl.

clem


More information about the freebsd-ports mailing list