Permalink
Browse files

build libbrowserid as a shared library

  • Loading branch information...
1 parent 382873b commit b8af1e85d43fb56ce1e97b3d2b9d6a3ba7e97af3 @lhoward lhoward committed Feb 5, 2013
Showing with 50 additions and 22 deletions.
  1. +5 −1 Makefile.am
  2. +5 −4 README.md
  3. +2 −0 acinclude.m4
  4. +19 −7 configure.ac
  5. +1 −1 contrib/sample/Makefile
  6. +12 −2 libbrowserid/Makefile.am
  7. +3 −1 libbrowserid/tests/Makefile
  8. +3 −6 mech_browserid/Makefile.am
View
@@ -1,4 +1,8 @@
AUTOMAKE_OPTIONS = foreign
ACLOCAL_AMFLAGS = -I m4
-SUBDIRS = libbrowserid mech_browserid
+SUBDIRS = libbrowserid
+if GSSBID_ENABLE_ACCEPTOR
+else
+SUBDIRS += mech_browserid
+endif
EXTRA_DIST = mech_browserid.spec
View
@@ -13,10 +13,11 @@ More information on BrowserID is available at the URL
The BrowserID GSS mechanism is split into two parts: libbrowserid, which is a
(more or less) general-purpose library for generating and verifying BrowserID
assertions; and mech\_browserid, which is the actual GSS mechanism (based on
-the Moonshot code). (The libbrowserid API is not yet stable enough to make it
-into a shared library; this will be possible when the GSS mechanism only uses
-its public interfaces. However, if you are interested in using it in a non-GSS
-application, see contrib/sample.)
+the Moonshot code).
+
+If you would just like to build libbrowserid, then execute configure with the
+--disable-gss-mechanism flag. This will remove Kerberos as a dependency. Sample
+code for using it in a non-GSS application can be found in contrib/sample.
Information on the BrowserID GSS protocol can be found in the document
gss-browserid.md, however essentially the protocol is the same as for web-based
View
@@ -47,6 +47,7 @@ AC_MSG_RESULT([yes])
done
if test x_$found_krb5 != x_yes; then
AC_MSG_RESULT($found_krb5)
+if test x_$build_mech != x_no; then
AC_MSG_ERROR([
----------------------------------------------------------------------
Cannot find GSS-API/Kerberos libraries.
@@ -55,6 +56,7 @@ if test x_$found_krb5 != x_yes; then
--with-krb5=(dir).
----------------------------------------------------------------------
])
+fi
else
printf "Kerberos found in $krb5dir\n";
AC_SUBST(KRB5_CFLAGS)
View
@@ -1,5 +1,5 @@
AC_PREREQ([2.61])
-AC_INIT([mech_browserid], [0.1], [lukeh@padl.com])
+AC_INIT([mech_browserid], [1.0], [lukeh@padl.com])
AC_CONFIG_MACRO_DIR([m4])
AC_CONFIG_AUX_DIR([build-aux])
@@ -35,6 +35,19 @@ dnl TARGET_CFLAGS="-Wall -pedantic -pthread"
dnl TARGET_LDFLAGS=""
dnl esac
+build_mech=yes
+AC_ARG_ENABLE(gss-mechanism,
+ [ --enable-gss-mechanism whether to build GSS BrowserID mechanism: yes/no; default yes ],
+ [ if test "x$enableval" = "xyes" -o "x$enableval" = "xno" ; then
+ build_mech=$enableval
+ else
+ echo "--enable-gss-mechanism argument must be yes or no"
+ exit -1
+ fi
+ ])
+
+AM_CONDITIONAL(GSSBID_BUILD_MECH, test "xbuild_mech" != "xno")
+
acceptor=yes
AC_ARG_ENABLE(acceptor,
[ --enable-acceptor whether to enable acceptor codepaths: yes/no; default yes ],
@@ -47,7 +60,6 @@ AC_ARG_ENABLE(acceptor,
])
if test "x$acceptor" = "xyes" ; then
- echo "acceptor enabled"
TARGET_CFLAGS="$TARGET_CFLAGS -DGSSBID_ENABLE_ACCEPTOR"
fi
AM_CONDITIONAL(GSSBID_ENABLE_ACCEPTOR, test "x$acceptor" != "xno")
@@ -57,10 +69,6 @@ AC_SUBST(TARGET_LDFLAGS)
AX_CHECK_WINDOWS
AX_CHECK_MACOSX
AX_CHECK_KRB5
-AX_CHECK_CURL
-AX_CHECK_JANSSON
-AX_CHECK_OPENSSL
-AM_CONDITIONAL(OPENSSL, test "x$found_openssl" = "xyes")
AX_CHECK_OPENSAML
AM_CONDITIONAL(OPENSAML, test "x$found_opensaml" = "xyes")
AX_CHECK_SHIBRESOLVER
@@ -69,7 +77,11 @@ if test x$found_shibresolver = xyes; then
AX_CHECK_SHIBSP
fi
AM_CONDITIONAL(SHIBSP, test "x$found_shibsp" = "xyes")
+AX_CHECK_CURL
+AX_CHECK_JANSSON
+AX_CHECK_OPENSSL
+AM_CONDITIONAL(OPENSSL, test "x$found_openssl" = "xyes")
AC_CONFIG_FILES([Makefile libbrowserid/Makefile mech_browserid/Makefile
- mech_browserid.spec])
+ mech_browserid.spec])
AC_OUTPUT
View
@@ -1,6 +1,6 @@
CFLAGS=-I../.. -I../../libbrowserid
LDFLAGS=-L/usr/local/lib -L../../libbrowserid/.libs
-LIBS=-lbrowserid -framework WebKit -framework Foundation -framework AppKit -ljansson -lcrypto -lcurl
+LIBS=-lbrowserid
all: bidget bidverify
View
@@ -1,9 +1,14 @@
AUTOMAKE_OPTIONS = foreign
+EXTRA_DIST = libbrowserid.exports
+
bin_PROGRAMS = bidtool
+libbrowserid_la_EXPORTS = libbrowserid.exports
+
libbrowserid_la_CFLAGS = -Werror -Wall -Wunused-parameter
libbrowserid_la_CXXFLAGS = -Werror -Wall -Wunused-parameter
+libbrowserid_la_DEPENDENCIES = $(libbrowserid_la_EXPORTS)
libbrowserid_la_CPPFLAGS = -DBUILD_GSSBID_LIB -I$(top_srcdir) -I$(top_srcdir)/libbrowserid
libbrowserid_la_SOURCES = \
@@ -31,13 +36,18 @@ libbrowserid_la_SOURCES = \
bid_x509.c \
vers.c
+libbrowserid_la_LIBADD = @JANSSON_LIBS@ @CURL_LIBS@ @OPENSSL_LIBS@
+libbrowserid_la_LDFLAGS = -export-symbols $(libbrowserid_la_EXPORTS) -no-undefined \
+ @JANSSON_LDFLAGS@ @CURL_LDFLAGS@ @OPENSSL_LDFLAGS@ @TARGET_LDFLAGS@
+
if TARGET_MACOSX
+libbrowserid_la_LDFLAGS += -framework WebKit -framework AppKit
libbrowserid_la_SOURCES += bid_json.m bid_webkit.m
else
libbrowserid_la_SOURCES += bid_stubs.c
endif
-noinst_LTLIBRARIES = libbrowserid.la
+lib_LTLIBRARIES = libbrowserid.la
BUILT_SOURCES = vers.c
@@ -48,4 +58,4 @@ clean-generic:
$(RM) vers.c
bidtool_SOURCES = bidtool.c
-bidtool_LDADD = $(noinst_LTLIBRARIES) @JANSSON_LDFLAGS@ @CURL_LDFLAGS@ @OPENSSL_LDFLAGS@ @TARGET_LDFLAGS@ @JANSSON_LIBS@ @CURL_LIBS@ @OPENSSL_LIBS@
+bidtool_LDADD = $(lib_LTLIBRARIES)
@@ -1,6 +1,8 @@
LIBS=-L/usr/local/lib -ljansson -lcurl
-all: bid_sig bid_vfy bid_doc bid_acq bid_b64 bid_acq.so bid_acq_ldr bid_fct
+# most of these tests will require libbrowserid to be built as a static library
+
+all: bid_acq
bid_sig: bid_sig.c ../libbrowserid.la
clang -I../.. -I.. -g -Wall -o bid_sig bid_sig.c -lcrypto -L../.libs -lbrowserid $(LIBS)
@@ -29,21 +29,18 @@ mech_browserid_la_DEPENDENCIES = $(GSSBID_EXPORTS) $(top_builddir)/libbrowserid/
mech_browserid_la_CPPFLAGS = -DBUILD_GSSBID_LIB -DSYSCONFDIR=\"${sysconfdir}\" -DDATAROOTDIR=\"${datarootdir}\" -I$(top_srcdir)/libbrowserid
mech_browserid_la_CFLAGS += \
- @KRB5_CFLAGS@ @TARGET_CFLAGS@ @JANSSON_CFLAGS@ @OPENSSL_CFLAGS@
+ @KRB5_CFLAGS@ @TARGET_CFLAGS@ @JANSSON_CFLAGS@
mech_browserid_la_CXXFLAGS += \
@KRB5_CFLAGS@ @OPENSAML_CXXFLAGS@ @SHIBRESOLVER_CXXFLAGS@ @SHIBSP_CXXFLAGS@ @TARGET_CFLAGS@
mech_browserid_la_LDFLAGS = -avoid-version -module \
-export-symbols $(GSSBID_EXPORTS) -no-undefined \
- @KRB5_LDFLAGS@ @JANSSON_LDFLAGS@ @CURL_LDFLAGS@ @OPENSSL_LDFLAGS@ @TARGET_LDFLAGS@
+ @KRB5_LDFLAGS@ @JANSSON_LDFLAGS@ @TARGET_LDFLAGS@
if TARGET_WINDOWS
mech_browserid_la_LDFLAGS += -debug
endif
mech_browserid_la_LIBADD = @KRB5_LIBS@ ../libbrowserid/libbrowserid.la \
- @OPENSAML_LIBS@ @SHIBRESOLVER_LIBS@ @SHIBSP_LIBS@ @JANSSON_LIBS@ @CURL_LIBS@ @OPENSSL_LIBS@
-if TARGET_MACOSX
-mech_browserid_la_LDFLAGS += -framework WebKit -framework AppKit -Wl,-sectcreate,__TEXT,__info_plist,Info.plist
-endif
+ @OPENSAML_LIBS@ @SHIBRESOLVER_LIBS@ @SHIBSP_LIBS@ @JANSSON_LIBS@
mech_browserid_la_SOURCES = \
acquire_cred.c \

0 comments on commit b8af1e8

Please sign in to comment.