title: Add c++ support in a autotools project?
body: <p>I am now writing  an app that need using c++ in my c code.My problem is i can't compile through the c++ code.</p>
  
  <p>i have two source folders,cpp (contains only a c source file ) and src (contains only a c++ source file ). </p>
  
  <p>my configure.in is just like this,very simple</p>
  
  <pre><code>AC_PREREQ([2.68])
  AC_INIT([tste], [1.0], [ee@b.com])
  AC_PROG_CXX
  AC_PROG_CC
  AC_CANONICAL_SYSTEM
  AM_INIT_AUTOMAKE()
  AC_CONFIG_FILES([Makefile cpp/Makefile src/Makefile] )
  AC_OUTPUT
  </code></pre>
  
  <p>./Makefile.am:</p>
  
  <pre><code>SUBDIRS= src cpp
  </code></pre>
  
  <p>./cpp/Makefile.am:</p>
  
  <pre><code>bin_PROGRAMS=main
  main_SOURCES=main.c
  </code></pre>
  
  <p>./src/Makefile.am:</p>
  
  <pre><code>bin_PROGRAMS=test
  test_SOURCES=testcpp.cpp
  </code></pre>
  
  <p>When i using make to compile my project , the error occurs:</p>
  
  <pre><code>Making all in src
  make[1]: Entering directory `/home/hujin/Desktop/test/src'
  make[1]: Nothing to be done for `all'.
  make[1]: Leaving directory `/home/hujin/Desktop/test/src'
  Making all in cpp
  make[1]: Entering directory `/home/hujin/Desktop/test/cpp'
  make[1]: *** No rule to make target `main.o', needed by `main'.  Stop.
  make[1]: Leaving directory `/home/hujin/Desktop/test/cpp'
  make: *** [all-recursive] Error 1
  </code></pre>