[PATCH ocserv 5/5] Allow linking with system libopts if installed
Nikos Mavrogiannopoulos
n.mavrogiannopoulos at gmail.com
Tue Jul 23 06:47:01 EDT 2013
Hello Mike and thank you for the patches. I've not had time to check
them yet, so only a comment about this one. Unfortunately using the
system libopts may cause the programs not to work, since libopts
refuses to work if a different library version is present from the one
that was used to generate the files. So for such a patch to work, the
presence of autogen must be checked and the generation of the
intermediate files must be forced.
That's why I didn't bother with that and only used the included library version.
regards,
Nikos
On Sun, Jul 21, 2013 at 6:16 AM, Mike Miller <mtmiller at ieee.org> wrote:
> ---
> Makefile.am | 6 +++++-
> configure.ac | 2 --
> src/Makefile.am | 12 +++++++++---
> 3 files changed, 14 insertions(+), 6 deletions(-)
>
> diff --git a/Makefile.am b/Makefile.am
> index 6883823..6810efd 100644
> --- a/Makefile.am
> +++ b/Makefile.am
> @@ -1,6 +1,10 @@
> EXTRA_DIST = m4/lib-link.m4 LICENSE
>
> -SUBDIRS = gl libopts src doc tests
> +SUBDIRS = gl
> +if NEED_LIBOPTS
> +SUBDIRS += libopts
> +endif
> +SUBDIRS += src doc tests
>
> ACLOCAL_AMFLAGS = -I gl/m4 -I libopts/m4 -I m4
>
> diff --git a/configure.ac b/configure.ac
> index e8da5ec..344032e 100644
> --- a/configure.ac
> +++ b/configure.ac
> @@ -141,8 +141,6 @@ LIBS="$oldlibs"
>
> AM_CONDITIONAL(PCL, test "$pcl_enabled" = yes)
>
> -enable_local_libopts=yes
> -NEED_LIBOPTS_DIR=true
> LIBOPTS_CHECK([libopts])
>
> AC_CONFIG_FILES([
> diff --git a/src/Makefile.am b/src/Makefile.am
> index 0686613..4752d49 100644
> --- a/src/Makefile.am
> +++ b/src/Makefile.am
> @@ -1,7 +1,13 @@
> SUBDIRS =
>
> AM_CPPFLAGS = -I$(srcdir)/../gl/ -I$(builddir)/../gl/ \
> - -I$(srcdir)/ -I$(builddir)/../ -I$(srcdir)/../libopts
> + -I$(srcdir)/ -I$(builddir)/../ $(LIBOPTS_CFLAGS)
> +
> +if NEED_LIBOPTS
> +LIBOPTS = ../libopts/libopts.a
> +else
> +LIBOPTS = $(LIBOPTS_LDADD)
> +endif
>
> EXTRA_DIST = ccan/licenses/BSD-MIT version.def.in \
> ccan/licenses/CC0 ccan/licenses/LGPL-2.1
> @@ -26,7 +32,7 @@ ocserv_SOURCES = main.c main-auth.c worker-vpn.c worker-auth.c tlslib.c \
>
> ocserv_SOURCES += ocserv-args.def ocserv-args.c ocserv-args.h
>
> -ocserv_LDADD = ../gl/libgnu.a ../libopts/libopts.a
> +ocserv_LDADD = ../gl/libgnu.a $(LIBOPTS)
> ocserv_LDADD += $(LIBGNUTLS_LIBS) $(GDBM_LIBS) $(PAM_LIBS) $(LIBUTIL) \
> $(LIBSECCOMP) $(LIBWRAP) $(LIBCRYPT)
>
> @@ -43,7 +49,7 @@ ocserv-args.c ocserv-args.h: $(srcdir)/ocserv-args.def
>
> ocpasswd_SOURCES = ocpasswd.c ocpasswd-args.def ocpasswd-args.c ocpasswd-args.h
>
> -ocpasswd_LDADD = ../gl/libgnu.a ../libopts/libopts.a
> +ocpasswd_LDADD = ../gl/libgnu.a $(LIBOPTS)
> ocpasswd_LDADD += $(LIBGNUTLS_LIBS) $(LIBCRYPT)
>
> ocpasswd-args.c ocpasswd-args.h: $(srcdir)/ocpasswd-args.def
> --
> 1.8.3.2
>
> _______________________________________________
> openconnect-devel mailing list
> openconnect-devel at lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/openconnect-devel
More information about the openconnect-devel
mailing list