Passing make flags to a dependency
Michael C. Shultz
reso3w83 at verizon.net
Sun Feb 6 13:03:33 PST 2005
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
How to test for libraries in configure.ac is going to require some
research on your part, the advantage to doing it here is then your
port is linux/other UNIX's friendly and you keep the FreeBSD Makefile
simple.
NOTE: These scripts are off of the top of my head and are guaranteed not
to work, they are meant only to show you how to approach the problem.
-Mike
More information about the freebsd-ports
mailing list