cedric pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=b50813f6e5025a84d0bb6d7b9e7d0cdfb0bf71f9

commit b50813f6e5025a84d0bb6d7b9e7d0cdfb0bf71f9
Author: Jean Guyomarc'h <[email protected]>
Date:   Wed Aug 27 22:30:08 2014 +0200

    autotools: provide BSD-echo compatibility (fix c++ bindings)
    
    Summary: The '-e' option does not exist in BSD-echo, nevertheless it 
behaves by default like the "echo -e" of the GNU-echo.
    
    Reviewers: raster, cedric
    
    Subscribers: cedric
    
    Differential Revision: https://phab.enlightenment.org/D1376
    
    Signed-off-by: Cedric BAIL <[email protected]>
---
 configure.ac                    | 10 ++++++++++
 m4/efl.m4                       | 15 ++++-----------
 src/Makefile_Ecore_Audio_Cxx.am |  6 +++---
 src/Makefile_Ecore_Cxx.am       |  6 +++---
 src/Makefile_Edje_Cxx.am        |  6 +++---
 src/Makefile_Efl_Cxx.am         |  6 +++---
 src/Makefile_Evas_Cxx.am        |  6 +++---
 7 files changed, 29 insertions(+), 26 deletions(-)

diff --git a/configure.ac b/configure.ac
index efbefc2..9573bd8 100644
--- a/configure.ac
+++ b/configure.ac
@@ -271,6 +271,16 @@ fi
 
 AM_CONDITIONAL([HAVE_PO], [test "x${have_po}" = "xyes"])
 
+### echo compatibility
+
+## the BSD echo does not have the -e option (it is the default behaviour)
+echo_e=
+if test "`echo -e x`" = "x"; then
+   echo_e=-e
+fi
+AC_SUBST([ECHO_E], [${echo_e}])
+
+
 ### compilers
 
 AC_PROG_MKDIR_P
diff --git a/m4/efl.m4 b/m4/efl.m4
index f4ec126..aa6de2a 100644
--- a/m4/efl.m4
+++ b/m4/efl.m4
@@ -58,17 +58,10 @@ case "$TERM" in
 esac
 
 if test "${want_color}" = "yes"; then
-   if test `echo -e x` = x; then
-      echoopt=-e
-   else
-      echoopt=
-   fi
-
-   COLOR_YES=`echo $echoopt "\033@<:@1;32m"`
-   COLOR_NO=`echo $echoopt "\033@<:@1;31m"`
-   COLOR_OTHER=`echo $echoopt "\033@<:@1;36m"`
-   COLOR_RESET=`echo $echoopt "\033@<:@0m"`
-
+   COLOR_YES=`echo $echo_e "\033@<:@1;32m"`
+   COLOR_NO=`echo $echo_e "\033@<:@1;31m"`
+   COLOR_OTHER=`echo $echo_e "\033@<:@1;36m"`
+   COLOR_RESET=`echo $echo_e "\033@<:@0m"`
 else
    COLOR_YES=""
    COLOR_NO=""
diff --git a/src/Makefile_Ecore_Audio_Cxx.am b/src/Makefile_Ecore_Audio_Cxx.am
index 30552ba..498bcbf 100644
--- a/src/Makefile_Ecore_Audio_Cxx.am
+++ b/src/Makefile_Ecore_Audio_Cxx.am
@@ -13,10 +13,10 @@ lib/ecore_audio/ecore_audio_out_pulse.eo.hh \
 lib/ecore_audio/ecore_audio_in_tone.eo.hh
 
 lib/ecore_audio/Ecore_Audio.hh: $(generated_ecore_audio_cxx_bindings)
-       @echo -e "#ifndef EFL_CXX_ECORE_AUDIO_HH\n#define 
EFL_CXX_ECORE_AUDIO_HH\n" > $(top_builddir)/src/lib/ecore_audio/Ecore_Audio.hh
-       @echo -e "#ifdef EFL_BETA_API_SUPPORT" >> 
$(top_builddir)/src/lib/ecore_audio/Ecore_Audio.hh
+       @echo @ECHO_E@ "#ifndef EFL_CXX_ECORE_AUDIO_HH\n#define 
EFL_CXX_ECORE_AUDIO_HH\n" > $(top_builddir)/src/lib/ecore_audio/Ecore_Audio.hh
+       @echo @ECHO_E@ "#ifdef EFL_BETA_API_SUPPORT" >> 
$(top_builddir)/src/lib/ecore_audio/Ecore_Audio.hh
        @for i in $(generated_ecore_audio_cxx_bindings); do echo "#include 
<$$(basename $$i)>" >> $(top_builddir)/src/lib/ecore_audio/Ecore_Audio.hh; done
-       @echo -e "#endif\n\n#endif\n" >> 
$(top_builddir)/src/lib/ecore_audio/Ecore_Audio.hh
+       @echo @ECHO_E@ "#endif\n\n#endif\n" >> 
$(top_builddir)/src/lib/ecore_audio/Ecore_Audio.hh
 
 generated_ecore_audio_cxx_all = \
        $(generated_ecore_audio_cxx_bindings) \
diff --git a/src/Makefile_Ecore_Cxx.am b/src/Makefile_Ecore_Cxx.am
index 3db71db..d81651a 100644
--- a/src/Makefile_Ecore_Cxx.am
+++ b/src/Makefile_Ecore_Cxx.am
@@ -15,10 +15,10 @@ lib/ecore/ecore_animator.eo.hh \
 lib/ecore/ecore_parent.eo.hh
 
 lib/ecore/Ecore.eo.hh: $(generated_ecore_cxx_bindings)
-       @echo -e "#ifndef EFL_CXX_ECORE_HH\n#define EFL_CXX_ECORE_HH\n" > 
$(top_builddir)/src/lib/ecore/Ecore.eo.hh
-       @echo -e "#ifdef EFL_BETA_API_SUPPORT" >> 
$(top_builddir)/src/lib/ecore/Ecore.eo.hh
+       @echo @ECHO_E@ "#ifndef EFL_CXX_ECORE_HH\n#define EFL_CXX_ECORE_HH\n" > 
$(top_builddir)/src/lib/ecore/Ecore.eo.hh
+       @echo @ECHO_E@ "#ifdef EFL_BETA_API_SUPPORT" >> 
$(top_builddir)/src/lib/ecore/Ecore.eo.hh
        @for i in $(generated_ecore_cxx_bindings); do echo "#include 
<$$(basename $$i)>" >> $(top_builddir)/src/lib/ecore/Ecore.eo.hh; done
-       @echo -e "#endif\n\n#endif\n" >> 
$(top_builddir)/src/lib/ecore/Ecore.eo.hh
+       @echo @ECHO_E@ "#endif\n\n#endif\n" >> 
$(top_builddir)/src/lib/ecore/Ecore.eo.hh
 
 generated_ecore_cxx_all = \
        $(generated_ecore_cxx_bindings) \
diff --git a/src/Makefile_Edje_Cxx.am b/src/Makefile_Edje_Cxx.am
index b3f6625..8d6b068 100644
--- a/src/Makefile_Edje_Cxx.am
+++ b/src/Makefile_Edje_Cxx.am
@@ -8,10 +8,10 @@ lib/edje/edje_object.eo.hh \
 lib/edje/edje_edit.eo.hh
 
 lib/edje/Edje.hh: $(generated_edje_cxx_bindings)
-       @echo -e "#ifndef EFL_CXX_EDJE_HH\n#define EFL_CXX_EDJE_HH\n" > 
$(top_builddir)/src/lib/edje/Edje.hh
-       @echo -e "#ifdef EFL_BETA_API_SUPPORT" >> 
$(top_builddir)/src/lib/edje/Edje.hh
+       @echo @ECHO_E@ "#ifndef EFL_CXX_EDJE_HH\n#define EFL_CXX_EDJE_HH\n" > 
$(top_builddir)/src/lib/edje/Edje.hh
+       @echo @ECHO_E@ "#ifdef EFL_BETA_API_SUPPORT" >> 
$(top_builddir)/src/lib/edje/Edje.hh
        @for i in $(generated_edje_cxx_bindings); do echo "#include 
<$$(basename $$i)>" >> $(top_builddir)/src/lib/edje/Edje.hh; done
-       @echo -e "#endif\n\n#endif\n" >> $(top_builddir)/src/lib/edje/Edje.hh
+       @echo @ECHO_E@ "#endif\n\n#endif\n" >> 
$(top_builddir)/src/lib/edje/Edje.hh
 
 generated_edje_cxx_all = \
        $(generated_edje_cxx_bindings) \
diff --git a/src/Makefile_Efl_Cxx.am b/src/Makefile_Efl_Cxx.am
index f752bda..1ddd25d 100644
--- a/src/Makefile_Efl_Cxx.am
+++ b/src/Makefile_Efl_Cxx.am
@@ -11,10 +11,10 @@ generated_efl_cxx_bindings = \
                  lib/efl/interfaces/efl_text_properties.eo.hh
 
 lib/efl/Efl.hh: $(generated_efl_cxx_bindings)
-       @echo -e "#ifndef EFL_CXX_EDJE_HH\n#define EFL_CXX_EDJE_HH\n" > 
$(top_builddir)/src/lib/efl/Efl.hh
-       @echo -e "#ifdef EFL_BETA_API_SUPPORT" >> 
$(top_builddir)/src/lib/efl/Efl.hh
+       @echo @ECHO_E@ "#ifndef EFL_CXX_EDJE_HH\n#define EFL_CXX_EDJE_HH\n" > 
$(top_builddir)/src/lib/efl/Efl.hh
+       @echo @ECHO_E@ "#ifdef EFL_BETA_API_SUPPORT" >> 
$(top_builddir)/src/lib/efl/Efl.hh
        @for i in $(generated_efl_cxx_bindings); do echo "#include <$$(basename 
$$i)>" >> $(top_builddir)/src/lib/efl/Efl.hh; done
-       @echo -e "#endif\n\n#endif\n" >> $(top_builddir)/src/lib/efl/Efl.hh
+       @echo @ECHO_E@ "#endif\n\n#endif\n" >> 
$(top_builddir)/src/lib/efl/Efl.hh
 
 generated_efl_cxx_all = \
        $(generated_efl_cxx_bindings) \
diff --git a/src/Makefile_Evas_Cxx.am b/src/Makefile_Evas_Cxx.am
index 45155c1..957ae73 100644
--- a/src/Makefile_Evas_Cxx.am
+++ b/src/Makefile_Evas_Cxx.am
@@ -28,10 +28,10 @@ lib/evas/canvas/evas_zoomable_interface.eo.hh \
 lib/evas/canvas/evas_box.eo.hh
 
 lib/evas/Evas.hh: $(generated_evas_canvas_cxx_bindings)
-       @echo -e "#ifndef EFL_CXX_EVAS_HH\n#define EFL_CXX_EVAS_HH\n" > 
$(top_builddir)/src/lib/evas/Evas.hh
-       @echo -e "#ifdef EFL_BETA_API_SUPPORT" >> 
$(top_builddir)/src/lib/evas/Evas.hh
+       @echo @ECHO_E@ "#ifndef EFL_CXX_EVAS_HH\n#define EFL_CXX_EVAS_HH\n" > 
$(top_builddir)/src/lib/evas/Evas.hh
+       @echo @ECHO_E@ "#ifdef EFL_BETA_API_SUPPORT" >> 
$(top_builddir)/src/lib/evas/Evas.hh
        @for i in $(generated_evas_canvas_cxx_bindings); do echo "#include 
<canvas/$$(basename $$i)>" >> $(top_builddir)/src/lib/evas/Evas.hh; done
-       @echo -e "#endif\n\n#endif\n" >> $(top_builddir)/src/lib/evas/Evas.hh
+       @echo @ECHO_E@ "#endif\n\n#endif\n" >> 
$(top_builddir)/src/lib/evas/Evas.hh
 
 CLEANFILES += \
 $(generated_evas_canvas_cxx_bindings) \

-- 


Reply via email to