[strongSwan-dev] sql options build implications

Tobias Brunner tobias at strongswan.org
Fri Aug 19 17:17:27 CEST 2011


Hi Riaan,

> I am currently updating the FreeBSD port of strongswan. There are a
> number of options I want to add to the port that I have
> tested/checked. The problem I am having is that --enable-attr-sql and
> --enable-sql requires (at least I think so) access to an SQL backend.
> However the options list [1] in a FreeBSD port is one dimensional and
> cannot handle inter dependencies.
 >
> The crux of my query is:
> ====================
> Can I have --enable-attr-sql and --enable-sql without a DB backend
> (--enable-sqlite or --enable-mysql). Will it configure, compile, and
> run with the default config?

That is no problem.  The user has to configure an URI for the DB anyway 
before the SQL plugins can be used.  So charon will just log a failure 
to initialize the sql and attr-sql plugins, if no DB backends are found 
(or no URI is configured yet).

> Further advice needed, considering the above:
> =====================================
> What would you consider the best choice for setting the sql related
> options in the FreeBSD port.
>
> 1. Enable --enable-attr-sql and --enable-sql per default and give the
> user the option to use sqlite and mysql.  What are the implications of
> compiling sql and attr-sql (the default case) and not having an sql db
> access method like sqlite or mysql.  I like this idea because then I
> only bother the user with choices which require external dependencies.
> The list would look like:
>     [  ] enable mysql
>     [  ] enable sqlite
> 2. Provide a list of all the options, such as
>     [  ] enable sql
>     [  ] enable attr-sql
>     [  ] enable mysql
>     [  ] enable sqlite
> and hope the user makes the right choices.
> 2a. Present the list above and try to catch incompatible combinations
> early in the port building process. That is what I am currently
> trying, but I having a hard time with the syntax of Makefile logic.

I think the first option will work fine.  But couldn't you also do 
something like

   OPTIONS=    MYSQL "Enable MySQL" Off \
               SQLITE "Enable SQLite" Off

   .if defined(WITH_MYSQL) || defined(WITH_SQLITE)
   CONFIGURE_ARGS+=    --enable-sql --enable-attr-sql
   .endif

So that the two SQL plugins are only enabled, if at least one of the 
database backends is enabled.

Regards,
Tobias




More information about the Dev mailing list