The JSAPI is now a full C++ interface. Convert the polkit
to JavaScript interface module to C++ compilation in order to
support newer versions of spidermonkey.

Signed-off-by: Jeremy Linton <jeremy.lin...@arm.com>
---
 configure.ac                                                       | 3 +++
 src/polkitbackend/Makefile.am                                      | 7 ++++++-
 .../{polkitbackendjsauthority.c => polkitbackendjsauthority.cpp}   | 0
 test/polkitbackend/Makefile.am                                     | 3 +++
 4 files changed, 12 insertions(+), 1 deletion(-)
 rename src/polkitbackend/{polkitbackendjsauthority.c => 
polkitbackendjsauthority.cpp} (100%)

diff --git a/configure.ac b/configure.ac
index 97d4222..18c1f4e 100644
--- a/configure.ac
+++ b/configure.ac
@@ -30,6 +30,8 @@ AC_PROG_MAKE_SET
 AC_PROG_LN_S
 AC_SYS_LARGEFILE
 AM_PROG_CC_C_O
+AC_PROG_CXX
+AX_CXX_COMPILE_STDCXX_11()
 
 # Taken from dbus
 AC_ARG_ENABLE(ansi,             [  --enable-ansi           enable -ansi 
-pedantic gcc flags],enable_ansi=$enableval,enable_ansi=no)
@@ -142,6 +144,7 @@ AS_IF([test x${with_mozjs} != xauto], [
   ])
 ])
 AC_SUBST(LIBJS_CFLAGS)
+AC_SUBST(LIBJS_CXXFLAGS)
 AC_SUBST(LIBJS_LIBS)
 
 EXPAT_LIB=""
diff --git a/src/polkitbackend/Makefile.am b/src/polkitbackend/Makefile.am
index a80ca36..5655d17 100644
--- a/src/polkitbackend/Makefile.am
+++ b/src/polkitbackend/Makefile.am
@@ -32,7 +32,7 @@ libpolkit_backend_1_la_SOURCES =                              
                        \
        polkitbackendprivate.h                                                  
        \
        polkitbackendauthority.h                polkitbackendauthority.c        
        \
        polkitbackendinteractiveauthority.h     
polkitbackendinteractiveauthority.c     \
-       polkitbackendjsauthority.h              polkitbackendjsauthority.c      
        \
+       polkitbackendjsauthority.h              polkitbackendjsauthority.cpp    
        \
        polkitbackendactionpool.h               polkitbackendactionpool.c       
        \
        polkitbackendactionlookup.h             polkitbackendactionlookup.c     
        \
         $(NULL)
@@ -53,6 +53,8 @@ libpolkit_backend_1_la_CFLAGS =                               
                \
        $(LIBJS_CFLAGS)                                                 \
         $(NULL)
 
+libpolkit_backend_1_la_CXXFLAGS = $(libpolkit_backend_1_la_CFLAGS) -fpermissive
+
 libpolkit_backend_1_la_LIBADD =                                        \
         $(GLIB_LIBS)                                                   \
        $(LIBSYSTEMD_LIBS)                                              \
@@ -73,6 +75,9 @@ polkitd_SOURCES =                                             
        \
                                        polkitd.c                       \
        $(NULL)
 
+# force C++ link via dummy C++ file, (see GNU automake manual section 8.3.5)
+nodist_EXTRA_polkitd_SOURCES = dummy-force-cpp-link.cxx
+
 polkitd_CFLAGS =                                                       \
        -DPOLKIT_BACKEND_I_KNOW_API_IS_SUBJECT_TO_CHANGE                \
        -DG_LOG_DOMAIN=\"polkitd-1\"                                    \
diff --git a/src/polkitbackend/polkitbackendjsauthority.c 
b/src/polkitbackend/polkitbackendjsauthority.cpp
similarity index 100%
rename from src/polkitbackend/polkitbackendjsauthority.c
rename to src/polkitbackend/polkitbackendjsauthority.cpp
diff --git a/test/polkitbackend/Makefile.am b/test/polkitbackend/Makefile.am
index 8859c1f..53bfb2a 100644
--- a/test/polkitbackend/Makefile.am
+++ b/test/polkitbackend/Makefile.am
@@ -35,6 +35,9 @@ TEST_PROGS =
 
 TEST_PROGS += polkitbackendjsauthoritytest
 polkitbackendjsauthoritytest_SOURCES = test-polkitbackendjsauthority.c
+# force C++ link via dummy C++ file, (see GNU automake manual section 8.3.5)
+nodist_EXTRA_polkitbackendjsauthoritytest_SOURCES = dummy-force-cpp-link.cxx
+
 
 # 
----------------------------------------------------------------------------------------------------
 
-- 
2.9.2

_______________________________________________
polkit-devel mailing list
polkit-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/polkit-devel

Reply via email to