summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOwen Taylor <otaylor@redhat.com>2001-11-27 00:27:51 +0000
committerOwen Taylor <otaylor@src.gnome.org>2001-11-27 00:27:51 +0000
commite369baa4f65aaceb31d8aeaf322e5d1fe0869311 (patch)
tree0a08e010ece11fde215e77e18f2f0d3082a8c4df
parent8eb8470fde676c147a76e406e1fb2c66a00d016b (diff)
downloadpango-e369baa4f65aaceb31d8aeaf322e5d1fe0869311.tar.gz
Add a test program that includes all headers in a C++ program. (#52606)
Mon Nov 26 19:24:21 2001 Owen Taylor <otaylor@redhat.com> * configure.in tests/Makefile.am tests/cxx-test.C: Add a test program that includes all headers in a C++ program. (#52606)
-rw-r--r--ChangeLog6
-rw-r--r--ChangeLog.pre-1-06
-rw-r--r--ChangeLog.pre-1-106
-rw-r--r--ChangeLog.pre-1-26
-rw-r--r--ChangeLog.pre-1-46
-rw-r--r--ChangeLog.pre-1-66
-rw-r--r--ChangeLog.pre-1-86
-rw-r--r--configure.in69
-rw-r--r--tests/Makefile.am43
-rw-r--r--tests/cxx-test.C29
10 files changed, 152 insertions, 31 deletions
diff --git a/ChangeLog b/ChangeLog
index 95b62de8..2800c802 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+Mon Nov 26 19:24:21 2001 Owen Taylor <otaylor@redhat.com>
+
+ * configure.in tests/Makefile.am tests/cxx-test.C: Add
+ a test program that includes all headers in a C++ program.
+ (#52606)
+
2001-11-26 Alex Larsson <alexl@redhat.com>
* pango/pangoxft-font.c (pango_xft_font_get_coverage):
diff --git a/ChangeLog.pre-1-0 b/ChangeLog.pre-1-0
index 95b62de8..2800c802 100644
--- a/ChangeLog.pre-1-0
+++ b/ChangeLog.pre-1-0
@@ -1,3 +1,9 @@
+Mon Nov 26 19:24:21 2001 Owen Taylor <otaylor@redhat.com>
+
+ * configure.in tests/Makefile.am tests/cxx-test.C: Add
+ a test program that includes all headers in a C++ program.
+ (#52606)
+
2001-11-26 Alex Larsson <alexl@redhat.com>
* pango/pangoxft-font.c (pango_xft_font_get_coverage):
diff --git a/ChangeLog.pre-1-10 b/ChangeLog.pre-1-10
index 95b62de8..2800c802 100644
--- a/ChangeLog.pre-1-10
+++ b/ChangeLog.pre-1-10
@@ -1,3 +1,9 @@
+Mon Nov 26 19:24:21 2001 Owen Taylor <otaylor@redhat.com>
+
+ * configure.in tests/Makefile.am tests/cxx-test.C: Add
+ a test program that includes all headers in a C++ program.
+ (#52606)
+
2001-11-26 Alex Larsson <alexl@redhat.com>
* pango/pangoxft-font.c (pango_xft_font_get_coverage):
diff --git a/ChangeLog.pre-1-2 b/ChangeLog.pre-1-2
index 95b62de8..2800c802 100644
--- a/ChangeLog.pre-1-2
+++ b/ChangeLog.pre-1-2
@@ -1,3 +1,9 @@
+Mon Nov 26 19:24:21 2001 Owen Taylor <otaylor@redhat.com>
+
+ * configure.in tests/Makefile.am tests/cxx-test.C: Add
+ a test program that includes all headers in a C++ program.
+ (#52606)
+
2001-11-26 Alex Larsson <alexl@redhat.com>
* pango/pangoxft-font.c (pango_xft_font_get_coverage):
diff --git a/ChangeLog.pre-1-4 b/ChangeLog.pre-1-4
index 95b62de8..2800c802 100644
--- a/ChangeLog.pre-1-4
+++ b/ChangeLog.pre-1-4
@@ -1,3 +1,9 @@
+Mon Nov 26 19:24:21 2001 Owen Taylor <otaylor@redhat.com>
+
+ * configure.in tests/Makefile.am tests/cxx-test.C: Add
+ a test program that includes all headers in a C++ program.
+ (#52606)
+
2001-11-26 Alex Larsson <alexl@redhat.com>
* pango/pangoxft-font.c (pango_xft_font_get_coverage):
diff --git a/ChangeLog.pre-1-6 b/ChangeLog.pre-1-6
index 95b62de8..2800c802 100644
--- a/ChangeLog.pre-1-6
+++ b/ChangeLog.pre-1-6
@@ -1,3 +1,9 @@
+Mon Nov 26 19:24:21 2001 Owen Taylor <otaylor@redhat.com>
+
+ * configure.in tests/Makefile.am tests/cxx-test.C: Add
+ a test program that includes all headers in a C++ program.
+ (#52606)
+
2001-11-26 Alex Larsson <alexl@redhat.com>
* pango/pangoxft-font.c (pango_xft_font_get_coverage):
diff --git a/ChangeLog.pre-1-8 b/ChangeLog.pre-1-8
index 95b62de8..2800c802 100644
--- a/ChangeLog.pre-1-8
+++ b/ChangeLog.pre-1-8
@@ -1,3 +1,9 @@
+Mon Nov 26 19:24:21 2001 Owen Taylor <otaylor@redhat.com>
+
+ * configure.in tests/Makefile.am tests/cxx-test.C: Add
+ a test program that includes all headers in a C++ program.
+ (#52606)
+
2001-11-26 Alex Larsson <alexl@redhat.com>
* pango/pangoxft-font.c (pango_xft_font_get_coverage):
diff --git a/configure.in b/configure.in
index 2c2e828b..f5fc53fb 100644
--- a/configure.in
+++ b/configure.in
@@ -13,11 +13,23 @@ AM_INIT_AUTOMAKE(pango, $PANGO_MAJOR_VERSION.$PANGO_MINOR_VERSION)
AM_CONFIG_HEADER(config.h)
AC_PROG_CC
+
+dnl
+dnl Check for a working C++ compiler, but do not bail out, if none is found.
+dnl We use this for an automated test for C++ header correctness.
+dnl
+AC_CHECK_PROGS(CXX, $CCC c++ g++ gcc CC cxx cc++ cl, gcc)
+AC_LANG_SAVE
+AC_LANG_CPLUSPLUS
+AC_TRY_COMPILE(,[class a { int b; } c;], ,CXX=)
+AM_CONDITIONAL(HAVE_CXX, test "$CXX" != "")
+AC_LANG_RESTORE
+
AC_LIBTOOL_WIN32_DLL
AM_PROG_LIBTOOL
AM_PROG_LEX
AC_PROG_YACC
-
+
AC_MSG_CHECKING([for some Win32 platform])
case "$host" in
*-*-mingw*|*-*-cygwin*)
@@ -337,36 +349,35 @@ AC_CHECK_FUNCS(flockfile)
AC_ARG_WITH(qt, [ --with-qt=DIR Location where Qt is installed],,with_qt=yes)
QTDIR=
-AC_MSG_CHECKING(For Qt location)
+if test "$CXX" != "" ; then
+ AC_MSG_CHECKING(For Qt location)
-if test "x$with_qt" = xyes ; then
-# Search for Qt in a common location. The ls -r is an attempt to find the newest
- dirs=`cd /usr/lib && ls -d -r qt*`
- for dir in $dirs ; do
- case $dir in
- qt2*|qt-2*)
- if test -x /usr/lib/$dir/bin/moc ; then
- QTDIR=/usr/lib/$dir
- break
- fi
- ;;
- esac
- done
-
-else
- if test "x$with_qt" != xno ; then
- if test -x $with_qt/bin/moc ; then
- QTDIR=$with_qt
- fi
- fi
-fi
+ if test "x$with_qt" = xyes ; then
+ # Search for Qt in a common location. The ls -r is an attempt to find the newest
+ dirs=`cd /usr/lib && ls -d -r qt*`
+ for dir in $dirs ; do
+ case $dir in
+ qt2*|qt-2*)
+ if test -x /usr/lib/$dir/bin/moc ; then
+ QTDIR=/usr/lib/$dir
+ break
+ fi
+ ;;
+ esac
+ done
+ else
+ if test "x$with_qt" != xno ; then
+ if test -x $with_qt/bin/moc ; then
+ QTDIR=$with_qt
+ fi
+ fi
+ fi
-if test "x$QTDIR" = x ; then
- AC_MSG_RESULT(none)
-else
- AC_MSG_RESULT($QTDIR)
-
- AC_PROG_CXX
+ if test "x$QTDIR" = x ; then
+ AC_MSG_RESULT(none)
+ else
+ AC_MSG_RESULT($QTDIR)
+ fi
fi
AM_CONDITIONAL(BUILD_QT_TEST, test "x$QTDIR" != x)
diff --git a/tests/Makefile.am b/tests/Makefile.am
index 16bca8a8..aabc7afc 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -1,12 +1,44 @@
## Process this file with automake to create Makefile.in.
-INCLUDES = -I$(top_srcdir) $(GLIB_CFLAGS)
+if HAVE_XFT
+X_DEFINES=-DHAVE_X
+else
+X_DEFINES=
+endif
+
+if HAVE_XFT
+XFT_DEFINES=-DHAVE_XFT
+else
+XFT_DEFINES=
+endif
+
+if HAVE_FREETYPE
+FT2_DEFINES=-DHAVE_FREETYPE
+else
+FT2_DEFINES=
+endif
+
+if HAVE_WIN32
+WIN32_DEFINES=-DHAVE_WIN32
+else
+WIN32_DEFINES=
+endif
+
+INCLUDES = \
+ -I$(top_srcdir) \
+ $(GLIB_CFLAGS) \
+ $(X_CFLAGS) \
+ $(FREETYPE_CFLAGS) \
+ $(X_DEFINES) \
+ $(XFT_DEFINES) \
+ $(FT2_DEFINES) \
+ $(WIN32_DEFINES)
TESTS=runtests.sh
noinst_PROGRAMS = gen-all-unicode dump-boundaries
-check_PROGRAMS = testboundaries
+check_PROGRAMS = testboundaries $(CXX_TEST)
gen_all_unicode_SOURCES = gen-all-unicode.c
@@ -20,6 +52,13 @@ testboundaries_LDADD = ../pango/libpango.la
dump_boundaries_LDADD = ../pango/libpango.la
+if HAVE_CXX
+CXX_TEST = cxx-test
+cxx_test_SOURCES = cxx-test.C
+else
+CXX_TEST =
+endif
+
EXTRA_DIST = \
all-unicode.txt \
boundaries.utf8 \
diff --git a/tests/cxx-test.C b/tests/cxx-test.C
new file mode 100644
index 00000000..7142152b
--- /dev/null
+++ b/tests/cxx-test.C
@@ -0,0 +1,29 @@
+/* This test makes sure that all Pango headers can be included
+ * and compiled in a C++ program.
+ */
+#define PANGO_ENABLE_ENGINE
+#define PANGO_ENABLE_BACKEND
+
+#include <pango/pango.h>
+
+#ifdef HAVE_X
+#include <pango/pangox.h>
+#endif
+
+#ifdef HAVE_XFT
+#include <pango/pangoxft.h>
+#endif
+
+#ifdef HAVE_FREETYPE
+#include <pango/pangoft2.h>
+#endif
+
+#ifdef HAVE_WIN32
+#include <pango/pangowin32.h>
+#endif
+
+int
+main ()
+{
+ return 0;
+}