* Small C test program. It does not do anything yet, but it's already a good thing to know whether all public headers can be #included from C code.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83
diff --git a/.gitignore b/.gitignore
index 9f8a15b..a052639 100644
--- a/.gitignore
+++ b/.gitignore
@@ -17,6 +17,7 @@ stamp-h1
*.la
demo/FTGLDemo
demo/FTGLMFontDemo
+test/CTest
test/FTGLTest
docs/doc-stamp
docs/html
diff --git a/configure.ac b/configure.ac
index 8cbef81..63c5eb3 100644
--- a/configure.ac
+++ b/configure.ac
@@ -27,6 +27,7 @@ AC_PROG_INSTALL
dnl These don't mix with C++
dnl AC_C_CONST
dnl AC_C_INLINE
+AM_PROG_CC_C_O
# Checks for header files.
AC_HEADER_STDC
diff --git a/test/CTest.c b/test/CTest.c
new file mode 100644
index 0000000..b22c7dd
--- /dev/null
+++ b/test/CTest.c
@@ -0,0 +1,20 @@
+/* Small C bindings test program */
+
+#include <ftgl.h>
+
+int main(int argc, char *argv[])
+{
+ FTGLfont *f;
+
+ if(argc < 2)
+ return 1;
+
+ f = ftglCreateBitmapFont(argv[1]);
+ if(f == NULL)
+ return 2;
+
+ ftglDestroyFont(f);
+
+ return 0;
+}
+
diff --git a/test/Makefile.am b/test/Makefile.am
index 7796bb7..a3e62d7 100644
--- a/test/Makefile.am
+++ b/test/Makefile.am
@@ -1,7 +1,7 @@
if HAVE_CPPUNIT
if HAVE_GLUT
-noinst_PROGRAMS = FTGLTest
+noinst_PROGRAMS = CTest FTGLTest
endif
endif
@@ -46,6 +46,19 @@ FTGLTest_CXXFLAGS = $(FT2_CFLAGS) $(GL_CFLAGS)
FTGLTest_LDFLAGS = $(FT2_LIBS) $(GLUT_LIBS) -lcppunit
FTGLTest_LDADD = ../src/libftgl.la
+CTest_SOURCES = \
+ CTest.c \
+ $(NULL)
+CTest_CPPFLAGS = \
+ -I$(top_srcdir)/include \
+ -I$(top_srcdir)/src \
+ -I$(top_srcdir)/src/FTGlyph \
+ -I$(top_srcdir)/src/FTFont \
+ -I$(top_srcdir)/src/FTLayout
+CTest_CFLAGS = $(FT2_CFLAGS) $(GL_CFLAGS)
+CTest_LDFLAGS = $(FT2_LIBS) $(GLUT_LIBS)
+CTest_LDADD = ../src/libftgl.la
+
DEACTIVATED = \
FTFont-Test.cpp \
FTGlyphContainer-Test.cpp \