0005-Fix-C-support.patch 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. From bdccec4c374a93480a7fd303d15e20810a5d5b7e Mon Sep 17 00:00:00 2001
  2. From: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
  3. Date: Sat, 25 Oct 2014 21:22:40 +0200
  4. Subject: [PATCH 5/5] Fix C++ support
  5. Autoreconf fails with the following message:
  6. tests/log4c/Makefile.am: error: C++ source seen but 'CXX' is undefined
  7. So this commit adds the AC_PROG_CXX macro to configure.in, and ensures
  8. that the C++ test is only built if a C++ compiler is available.
  9. Submitted upstream: https://github.com/rcmadruga/log4c-localtime/pull/1
  10. Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
  11. ---
  12. configure.in | 3 +++
  13. tests/log4c/Makefile.am | 6 +++++-
  14. 2 files changed, 8 insertions(+), 1 deletion(-)
  15. diff --git a/configure.in b/configure.in
  16. index 769b204..ce75800 100644
  17. --- a/configure.in
  18. +++ b/configure.in
  19. @@ -38,6 +38,7 @@ AC_DEFINE(_GNU_SOURCE,1,"POSIXandGNU extensions")
  20. #.
  21. AC_PROG_YACC
  22. AC_PROG_CC
  23. +AC_PROG_CXX
  24. AC_PROG_CPP
  25. AM_PROG_LEX
  26. AC_PROG_AWK
  27. @@ -47,6 +48,8 @@ AC_PROG_MAKE_SET
  28. AC_PROG_RANLIB
  29. AC_PROG_LIBTOOL
  30. +AM_CONDITIONAL([USE_CXX], [test "$ac_cv_prog_CXX" != "no"])
  31. +
  32. # platform idioms
  33. case "$host" in
  34. *-hp-hpux*)
  35. diff --git a/tests/log4c/Makefile.am b/tests/log4c/Makefile.am
  36. index f647f27..b1b4ed6 100644
  37. --- a/tests/log4c/Makefile.am
  38. +++ b/tests/log4c/Makefile.am
  39. @@ -3,7 +3,11 @@ INCLUDES = \
  40. -DSRCDIR="\"$(srcdir)\""
  41. noinst_PROGRAMS = test_category test_rc bench bench_fwrite \
  42. - test_stream2 test_layout_r cpp_compile_test
  43. + test_stream2 test_layout_r
  44. +
  45. +if USE_CXX
  46. +noinst_PROGRAMS += cpp_compile_test
  47. +endif
  48. if WITH_ROLLINGFILE
  49. noinst_PROGRAMS += test_rollingfile_appender test_rollingfile_appender_mt
  50. --
  51. 2.0.0