From d2faf448b81f89c904ff2ad1f27487f81cb89a5d Mon Sep 17 00:00:00 2001 From: Andy Williams Date: Sat, 28 Feb 2015 16:04:16 +0000 Subject: [PATCH] rework configure.ac, remove attribute and quicklaunch tests are they are not used. Patch from Vincent Torri --- configure.ac | 149 +++++++++++++++++++++++++++----------------- m4/efl_attribute.m4 | 56 ----------------- 2 files changed, 93 insertions(+), 112 deletions(-) delete mode 100644 m4/efl_attribute.m4 diff --git a/configure.ac b/configure.ac index d3792d2..64668e0 100644 --- a/configure.ac +++ b/configure.ac @@ -5,71 +5,41 @@ AC_PREREQ([2.65]) AC_CONFIG_SRCDIR([configure.ac]) AC_CONFIG_HEADERS([config.h]) -AC_CANONICAL_BUILD -AC_CANONICAL_HOST - AM_INIT_AUTOMAKE([1.10 dist-bzip2 -Wall color-tests]) m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])]) -AM_PROG_AR -# this will speed up libtool checks -LT_PREREQ([2.2]) -LT_INIT([win32-dll pic-only]) -EFL_INIT -AC_PROG_CC -AM_PROG_CC_C_O -EFL_ATTRIBUTE_UNUSED -ELM_QUICKLAUNCH -EFL_COMPILER_FLAG([-Wall]) -EFL_COMPILER_FLAG([-W]) - -# Checks for header files. -EFL_CHECK_PATH_MAX - -# Check for EFL -PKG_CHECK_MODULES([EFL], -[ - eina >= 1.8.0 - evas >= 1.8.0 - ecore >= 1.8.0 - edje >= 1.8.0 - eo >= 1.8.0 - elementary >= 1.8.0 - eio >= 1.8.0 -]) +### Additional options to configure # Check for tests and coverage AC_ARG_WITH([tests], - [AC_HELP_STRING([--with-tests=none|regular|coverage], + [AS_HELP_STRING([--with-tests=none|regular|coverage], [choose testing method: regular, coverage or none. - @<:@default=none@:>@])], + @<:@default=auto@:>@])], [build_tests=${withval}], [build_tests=auto]) +# clang support +AC_ARG_ENABLE([libclang], + [AS_HELP_STRING([--disable-libclang], [Disable use of libclang. @<:@default=enable@:>@])], + [ + if test "x${enableval}" = "xyes" ; then + want_clang="yes" + else + want_clang="no" + fi + ], + [want_clang="yes"]) -HAVE_LIBCLANG=0 -AC_ARG_ENABLE(libclang, - [ --disable-libclang Disable use of libclang.],,) +### Checks for programs -build_clang="no" -if test "$enable_libclang" != "no"; then - AC_CHECK_HEADERS("clang-c/Index.h") - if test "$ac_cv_header_clang_c_Index_h" = "yes"; then - AC_CHECK_LIB(clang, clang_Cursor_getArgument) - if test "$ac_cv_lib_clang_clang_Cursor_getArgument" = "yes"; then - HAVE_LIBCLANG=1; - MORE_LIBS="$MORE_LIBS -lclang" - build_clang="yes" - fi - fi - if test "$HAVE_LIBCLANG" = "0"; then - AC_MSG_WARN([Could not find a usable libclang. Please install libclang to enable syntax highlighting features.]) - fi -fi +LT_PREREQ([2.2]) +LT_INIT([win32-dll pic-only]) +EFL_INIT -AC_SUBST(HAVE_LIBCLANG) +AM_GNU_GETTEXT_VERSION([0.17]) +AM_GNU_GETTEXT([external]) # if cross compiling, disable NLS support. # It's not worth the trouble, at least for now. @@ -77,11 +47,28 @@ if test "x$cross_compiling" = xyes; then enable_nls=no fi -EFL_TESTS([${build_tests}]) +m4_ifdef([AM_PROG_AR], [AM_PROG_AR]) + +AC_PROG_CC + +PKG_PROG_PKG_CONFIG -# doxygen program for documentation building EFL_CHECK_DOXYGEN([build_doc="yes"], [build_doc="no"]) + +### Checks for libraries + +PKG_CHECK_MODULES([EFL], +[ + eina >= 1.8.0 + evas >= 1.8.0 + ecore >= 1.8.0 + edje >= 1.8.0 + eo >= 1.8.0 + elementary >= 1.8.0 + eio >= 1.8.0 +]) + # Check edje_cc EFL_WITH_BIN([edje], [edje-cc], [edje_cc]) EFL_WITH_BIN([eolian], [eolian-gen], [eolian_gen]) @@ -93,11 +80,59 @@ AM_CONDITIONAL([HAVE_EOLIAN_GEN], [true]) DEPS_EOLIAN_FLAGS=`${PKG_CONFIG} --variable=eolian_flags eo evas efl elementary` AC_SUBST([DEPS_EOLIAN_FLAGS]) -# Checks for library functions. + +### Checks for header files + + +### Checks for types + + +### Checks for structures + + +### Checks for compiler characteristics + +AM_PROG_CC_C_O + +EFL_CHECK_PATH_MAX +EFL_COMPILER_FLAG([-Wall]) +EFL_COMPILER_FLAG([-Wextra]) + + +### Checks for linker characteristics + + +### Checks for library functions + AC_CHECK_FUNCS([setlocale]) -AM_GNU_GETTEXT_VERSION([0.17]) -AM_GNU_GETTEXT([external]) +# this will speed up libtool checks + + +# Checks for header files. + +have_clang="no" +if test "${want_clang}" = "yes"; then + AC_CHECK_HEADERS([clang-c/Index.h], [have_clang="yes"], [have_clang="no"]) +fi + +EFL_TESTS([${build_tests}]) + +# Checks for library functions. + +if test "${have_clang}" = "yes"; then + AC_CHECK_LIB([clang], [clang_Cursor_getArgument], + [ + AC_DEFINE([HAVE_LIBCLANG], [1], [Set to 1 if clang is found]) + EFL_LIBS="${EFL_LIBS} -lclang" + ], + [have_clang="no"]) +fi + +if test "${have_clang}" = "no"; then + AC_MSG_WARN([Could not find a usable libclang. Please install libclang to enable syntax highlighting features.]) +fi + AC_CONFIG_FILES([ Makefile @@ -136,9 +171,11 @@ echo "$PACKAGE_NAME $PACKAGE_VERSION" echo "------------------------------------------------------------------------" echo echo "Compilation..............: make (or gmake)" +echo " CPPFLAGS...............: $CPPFLAGS" echo " CFLAGS.................: $CFLAGS" +echo " LDFLAGS................: $LDFLAGS" echo " edje_cc................: ${edje_cc}" -echo " highlighting (libclang): ${build_clang}" +echo " highlighting (libclang): ${have_clang}" echo echo "eolian_gen...............: ${eolian_gen}" echo diff --git a/m4/efl_attribute.m4 b/m4/efl_attribute.m4 deleted file mode 100644 index 78bff15..0000000 --- a/m4/efl_attribute.m4 +++ /dev/null @@ -1,56 +0,0 @@ -dnl Copyright (C) 2011 Vincent Torri -dnl That code is public domain and can be freely used or copied. - -dnl Macros for checking if the compiler supports some __attribute__ uses - -dnl Usage: EFL_ATTRIBUTE_UNUSED -dnl call AC_DEFINE for __UNUSED__ if __attribute__((unused)) is available - -AC_DEFUN([EFL_ATTRIBUTE_UNUSED], -[ -AC_MSG_CHECKING([for __attribute__ ((unused))]) -AC_COMPILE_IFELSE( - [AC_LANG_PROGRAM( - [[ -void foo(int x __attribute__ ((unused))) {} - ]], - [[ - ]])], - [have_attribute_unused="yes"], - [have_attribute_unused="no"]) -AC_MSG_RESULT([${have_attribute_unused}]) - -if test "x${have_attribute_unused}" = "xyes" ; then - AC_DEFINE([__UNUSED__], [__attribute__ ((unused))], [Macro declaring a function argument to be unused.]) -else - AC_DEFINE([__UNUSED__], [], [__attribute__ ((unused)) is not supported.]) -fi -]) - -dnl Usage: EFL_ATTRIBUTE_VECTOR -dnl call AC_DEFINE for HAVE_GCC_ATTRIBUTE_VECTOR if __attribute__((vector)) is available - -AC_DEFUN([EFL_ATTRIBUTE_VECTOR], -[ -AC_MSG_CHECKING([for __attribute__ ((vector))]) -AC_COMPILE_IFELSE( - [AC_LANG_PROGRAM( - [[ -typedef int v4si __attribute__ ((vector_size (16))); - ]], - [[ -if (sizeof(v4si) == 16) - return 0; -else - return -1; - ]])], - [have_attribute_vector="yes"], - [have_attribute_vector="no"]) -AC_MSG_RESULT([${have_attribute_vector}]) - -if test "x${have_attribute_vector}" = "xyes" ; then - AC_DEFINE([HAVE_GCC_ATTRIBUTE_VECTOR], [1], [Define to 1 if your compiler supports __attribute__ ((vector)).]) -fi -]) - -dnl End of efl_attribute.m4