[dia] Bug #391541 - make the C++ compiler optional



commit 915d9c80dc9f1e642c44f10fd15705148399d027
Author: Hans Breuer <hans breuer org>
Date:   Fri Jul 31 18:27:04 2009 +0200

    Bug #391541 - make the C++ compiler optional
    
    AC_PROG_CXX does behave a bit strange, it is setting CXX=g++ as "last resort"
    but that does not solve the missing g++ issue. Use some implmetation
    details given at
    http://www.delorie.com/gnu/docs/autoconf/autoconf_65.html

 bindings/Makefile.am     |    2 ++
 configure.in             |   11 +++++++++++
 plug-ins/wmf/Makefile.am |    3 +++
 3 files changed, 16 insertions(+), 0 deletions(-)
---
diff --git a/bindings/Makefile.am b/bindings/Makefile.am
index 16bfdeb..162c75a 100644
--- a/bindings/Makefile.am
+++ b/bindings/Makefile.am
@@ -1,6 +1,8 @@
 ## Process this file with automake to produce Makefile.in
 
+if HAVE_CPLUSPLUS
 libpython_bindings = _dia.la
+endif
 
 ## without SWIG we wont have/build this
 ## but to avoid bit-rotting we build the rest
diff --git a/configure.in b/configure.in
index 7d13eb1..ffef85a 100644
--- a/configure.in
+++ b/configure.in
@@ -211,6 +211,16 @@ AC_SUBST(PNG_LIBS)
 
 LIBS="${old_LIBS} ${PNG_LIBS}"
 
+dnl AC_PROG_CXX does behave a bit strange, it is setting CXX=g++ as "last resort"
+dnl but that does not solve the missing g++ issue. Make C++ optional:
+cxx_ok=yes
+if test "$CXX" = "g++"; then
+  if test "$GXX" != "yes"; then
+    cxx_ok=no
+  fi
+fi
+AM_CONDITIONAL(HAVE_CPLUSPLUS, test "$cxx_ok" = yes)
+
 dnl check for libEMF to provide Windows Metafile plug-in on Linux
 AC_ARG_ENABLE([libemf],
 	AS_HELP_STRING([--enable-libemf], [enable plugin for windows metafile support]),
@@ -665,6 +675,7 @@ echo "
 Configuration:
 	Source code location:	${srcdir}
 	Compiler:		${CC}
+	can C++:		${cxx_ok}
 
 	Gnome support:				 ${have_gnome}
 	Python support:				 ${with_python}
diff --git a/plug-ins/wmf/Makefile.am b/plug-ins/wmf/Makefile.am
index f52c6b3..cb4f682 100644
--- a/plug-ins/wmf/Makefile.am
+++ b/plug-ins/wmf/Makefile.am
@@ -4,7 +4,10 @@ if !WITH_LIBEMF
 plugin_sources += wmf_gdi.cpp wmf_gdi.h
 endif
 
+# Can't do without C++
+if HAVE_CPLUSPLUS
 pkglib_LTLIBRARIES = libwmf_filter.la
+endif
 
 libwmf_filter_la_SOURCES = $(plugin_sources)
 libwmf_filter_la_LDFLAGS = -export-dynamic -module -avoid-version 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]