On Tue, Dec 13, 2011 at 1:31 PM, Vincent Torri <[email protected]> wrote:
> On Tue, Dec 13, 2011 at 4:21 PM, Gustavo Sverzut Barbieri
> <[email protected]> wrote:
>> On Tue, Dec 13, 2011 at 12:54 PM, Vincent Torri <[email protected]>
>> wrote:
>>> On Tue, Dec 13, 2011 at 3:44 PM, Gustavo Sverzut Barbieri
>>> <[email protected]> wrote:
>>>> On Tue, Dec 13, 2011 at 12:35 PM, Vincent Torri <[email protected]>
>>>> wrote:
>>>>> On Tue, Dec 13, 2011 at 2:28 PM, Gustavo Sverzut Barbieri
>>>>> <[email protected]> wrote:
>>>>>>>
>>>>>>> I would actually like you to answer that question: why moving to cmake
>>>>>>> if the autotools are already doing the job correctly ?
>>>>>>
>>>>>> Doing it correctly may not be enough.
>>>>>
>>>>> you didn't answer to that question. you just give vague comparison. So
>>>>> what's no enough ?
>>>>
>>>> 1. it is utterly complicated for what it does, m4 macros are a hell,
>>>> the shell commands to be portable must be restricted from gnu-isms and
>>>> likely we fail at that from time to time.
>>>
>>> it's a hell for you, maybe. I've tried to twek cmake files, and i
>>> didn't undrestand how to do what i wanted. It's a matter of learning a
>>> langage.
>>
>> We'll stay and help, it's not a drop and run thing. Don't worry.
>>
>> And as for learning the language. I do know, both actually. Some of
>> the helper m4 files were written by me, like the optional plugin used
>> by e17.
>>
>> I can guarantee you, I just came to like cmake after I tried it. And
>> even being autofoo person since 1998 I find my way easier on cmake
>> than autofoo.
>>
>>
>>>> 2. it does not generate native build systems, which is not a problem
>>>> for the way we handle win32/mac ports at the moment, but it may not be
>>>> sufficient in the future.
>>>
>>> for win32, i've already replied.
>>
>> Yes, for the current solution. But is that the final solution?
>> Wouldn't it be better to integrate more natively with win32 apis if
>> there was manpower to help fix the VS bugs?
>
> fixing bugs ? well, it's mainly about asm : the syntax is different
> (intel vs AT&T). If you want to support both syntaxes....
>
> and yes, there's also some of the c99 features used in the efl and not
> supported by vc++. Feel free to fix them. I prefer cross compiling,
> nowadays
>
>>>
>>> again, it's a matter of learning a "langage".
>>
>> compare adding an option at autoconf and cmake:
>>
>> cmake:
>> OPTION(NAME "Some documentation for help" INIT_VAL)
>>
>> autoconf:
>> AC_ARG_ENABLE(NAME,
>> AC_HELP_STRING([--enable-NAME], [Some documentation for help
>> @<:@default=detect@:>@]),
>> [NAME=$enableval],
>> [NAME=INIT_VAL]
>> )
>>
>> seems very close, right? but if someone drops [] it will work, except
>> in some cases that requires quotes, etc. It's tricky.
>
> I forgot to say : is there a --help option with cmake ?
>
>>
>> Needless to say there is no such thing as variable types in autoconf,
>> that prevents people to create nice GUI for it, for cmake people have
>> at least an ncurses and qt! You can have it to present checkboxes or
>> even file dialogs to choose paths.
>>
>> If you want to choose cache for variables, painful with autoconf...
>> then we don't do it and we actually remove config.cache!
>>
>> Take a look at:
>> http://svn.webkit.org/repository/webkit/trunk/CMakeLists.txt # our
>> configure.ac
>> http://svn.webkit.org/repository/webkit/trunk/Source/cmake/ # our m4/
>>
>> As webkit is a complex software with different ports (different
>> features, versions...), each port keeps options in separate:
>> http://svn.webkit.org/repository/webkit/trunk/Source/cmake/OptionsCommon.cmake
>> http://svn.webkit.org/repository/webkit/trunk/Source/cmake/OptionsEfl.cmake
>> http://svn.webkit.org/repository/webkit/trunk/Source/cmake/OptionsWinCE.cmake
>> http://svn.webkit.org/repository/webkit/trunk/Source/cmake/OptionsBlackBerry.cmake
>>
>
> nice try : i won't look at those files...
How about looking at a patch? I've converted Embryo to CMake to make a
case, find attached file.
Supposedly it does the same as configure.ac and others, unless I've
missed some thing. Of course I could not test with evil, but the rule
is there.
See how simple it is, it's readable. And this is not accounting any
helper files such as our efl_*.m4, in real world we should move
common bits to it. Also notice that some automatically created defines
we use from autofoo changed names, then I'm doing the remap on the
cmake, but it could be changed in the source code.
--
Gustavo Sverzut Barbieri
http://profusion.mobi embedded systems
--------------------------------------
MSN: [email protected]
Skype: gsbarbieri
Mobile: +55 (19) 9225-2202
Index: src/lib/CMakeLists.txt
===================================================================
--- src/lib/CMakeLists.txt (revision 0)
+++ src/lib/CMakeLists.txt (revision 0)
@@ -0,0 +1,30 @@
+LIST(APPEND LIBEMBRYO_SOURCES
+ embryo_amx.c
+ embryo_args.c
+ embryo_float.c
+ embryo_main.c
+ embryo_rand.c
+ embryo_str.c
+ embryo_time.c
+ )
+
+LIST(APPEND LIBEMBRYO_LIBS ${EINA_LIBRARIES} ${EVIL_LIBRARIES})
+
+IF(SHARED_LIBS)
+ ADD_LIBRARY(so_embryo SHARED ${LIBEMBRYO_SOURCES})
+ TARGET_LINK_LIBRARIES(so_embryo ${LIBEMBRYO_LIBS})
+ SET_TARGET_PROPERTIES(so_embryo PROPERTIES
+ VERSION ${EMBRYO_VERSION} SOVERSION ${EMBRYO_VERSION_MAJOR})
+ SET_TARGET_PROPERTIES(so_embryo PROPERTIES OUTPUT_NAME "embryo")
+ INSTALL(TARGETS so_embryo DESTINATION lib)
+ENDIF(SHARED_LIBS)
+
+IF(STATIC_LIBS)
+ ADD_LIBRARY(st_embryo ${LIBEMBRYO_SOURCES})
+ TARGET_LINK_LIBRARIES(st_embryo ${LIBEMBRYO_LIBS})
+ SET_TARGET_PROPERTIES(st_embryo PROPERTIES OUTPUT_NAME "embryo")
+ INSTALL(TARGETS st_embryo DESTINATION lib)
+ENDIF(STATIC_LIBS)
+
+INSTALL(FILES Embryo.h
+ DESTINATION include/${CMAKE_PROJECT_NAME}-${EMBRYO_VERSION_MAJOR})
Index: src/bin/CMakeLists.txt
===================================================================
--- src/bin/CMakeLists.txt (revision 0)
+++ src/bin/CMakeLists.txt (revision 0)
@@ -0,0 +1,22 @@
+LIST(APPEND EMBRYO_CC_SOURCES
+ embryo_cc_prefix.c
+ embryo_cc_sc1.c
+ embryo_cc_sc2.c
+ embryo_cc_sc3.c
+ embryo_cc_sc4.c
+ embryo_cc_sc5.c
+ embryo_cc_sc6.c
+ embryo_cc_sc7.c
+ embryo_cc_scexpand.c
+ embryo_cc_sclist.c
+ embryo_cc_scvars.c
+ )
+
+ADD_EXECUTABLE(embryo_cc ${EMBRYO_CC_SOURCES})
+IF(SHARED_LIBS)
+ TARGET_LINK_LIBRARIES(embryo_cc so_embryo)
+ELSE(SHARED_LIBS)
+ TARGET_LINK_LIBRARIES(embryo_cc st_embryo)
+ENDIF(SHARED_LIBS)
+
+INSTALL(TARGETS embryo_cc DESTINATION bin)
Index: cmakeconfig.h.in
===================================================================
--- cmakeconfig.h.in (revision 0)
+++ cmakeconfig.h.in (revision 0)
@@ -0,0 +1,22 @@
+#define PACKAGE "@CMAKE_PROJECT_NAME@"
+#define VERSION "@EMBRYO_VERSION_WITH_REV@"
+#define VMAJ @EMBRYO_VERSION_MAJOR@
+#define VMIN @EMBRYO_VERSION_MINOR@
+#define VMIC @EMBRYO_VERSION_MICRO@
+#define VREV @EMBRYO_VERSION_REV@
+
+#cmakedefine HAVE___ATTRIBUTE__
+#ifdef HAVE___ATTRIBUTE__
+#define __UNUSED__ __attribute__((unused))
+#else
+#define __UNUSED__
+#endif
+
+#cmakedefine HAVE_PATH_MAX
+#ifndef HAVE_PATH_MAX
+#define PATH_MAX 4096
+#endif
+
+#cmakedefine HAVE_ALLOCA_H
+#cmakedefine HAVE_GETTIMEOFDAY
+#cmakedefine HAVE_EVIL
Index: CMakeLists.txt
===================================================================
--- CMakeLists.txt (revision 0)
+++ CMakeLists.txt (revision 0)
@@ -0,0 +1,137 @@
+CMAKE_MINIMUM_REQUIRED(VERSION 2.8)
+PROJECT(embryo C)
+
+IF (NOT CMAKE_BUILD_TYPE AND NOT CMAKE_C_FLAGS AND NOT CMAKE_CXX_FLAGS)
+ SET(CMAKE_BUILD_TYPE Release)
+ENDIF ()
+
+OPTION(SHARED_LIBS "Enable build of shared libraries" ON)
+OPTION(STATIC_LIBS "Enable build of static libraries" ON)
+
+FIND_PACKAGE(Subversion)
+IF(Subversion_FOUND)
+ SET(SVN_REPO_PATH "$ENV{SVN_REPO_PATH}")
+ IF(NOT SVN_REPO_PATH)
+ MESSAGE(STATUS "Assuming \$SVN_REPO_PATH=${PROJECT_SOURCE_DIR}")
+ SET(SVN_REPO_PATH "${PROJECT_SOURCE_DIR}")
+ ENDIF(NOT SVN_REPO_PATH)
+ Subversion_WC_INFO(${SVN_REPO_PATH} SVN)
+ SET(EMBRYO_VERSION_REV "${SVN_WC_REVISION}")
+ELSE(Subversion_FOUND)
+ MESSAGE(STATUS "No SVN found. Assume release tarball.")
+ SET(EMBRYO_VERSION_REV "")
+ENDIF(Subversion_FOUND)
+
+SET(EMBRYO_VERSION_MAJOR 1)
+SET(EMBRYO_VERSION_MINOR 1)
+SET(EMBRYO_VERSION_MICRO 99)
+SET(EMBRYO_VERSION ${EMBRYO_VERSION_MAJOR}.${EMBRYO_VERSION_MINOR}.${EMBRYO_VERSION_MICRO})
+
+IF(EMBRYO_VERSION_REV)
+SET(EMBRYO_VERSION_WITH_REV ${EMBRYO_VERSION}.${EMBRYO_VERSION_REV})
+ELSE(EMBRYO_VERSION_REV)
+SET(EMBRYO_VERSION_WITH_REV ${EMBRYO_VERSION})
+ENDIF(EMBRYO_VERSION_REV)
+
+INCLUDE_DIRECTORIES("${PROJECT_BINARY_DIR}")
+INCLUDE_DIRECTORIES("${PROJECT_SOURCE_DIR}/src/lib")
+
+INCLUDE(FindPkgConfig)
+
+PKG_CHECK_MODULES(EINA REQUIRED eina>=1.1.0)
+
+INCLUDE_DIRECTORIES(${EINA_INCLUDE_DIRS})
+
+PKG_CHECK_MODULES(EVIL evil>=1.0.0)
+IF(EVIL_FOUND)
+ INCLUDE_DIRECTORIES(${EVIL_INCLUDE_DIRS})
+ SET(requirement_embryo evil)
+ SET(HAVE_EVIL 1)
+ENDIF(EVIL_FOUND)
+
+# likely put this into an FindCompilerAttribute.cmake:
+INCLUDE(CheckCSourceCompiles)
+SET(HAVE___ATTRIBUTE__)
+CHECK_C_SOURCE_COMPILES(
+"void foo (int bar __attribute__((unused)) ) { }
+static void baz (void) __attribute__((unused));
+static void baz (void) { }
+int main(){}
+" HAVE___ATTRIBUTE__)
+
+INCLUDE(CheckIncludeFiles)
+CHECK_INCLUDE_FILES(alloca.h HAVE_ALLOCA_H)
+
+INCLUDE(CheckSymbolExists)
+CHECK_SYMBOL_EXISTS(PATH_MAX "limits.h" HAVE_PATH_MAX)
+
+INCLUDE(CheckFunctionExists)
+CHECK_FUNCTION_EXISTS(gettimeofday HAVE_GETTIMEOFDAY)
+
+
+ADD_DEFINITIONS(-DPACKAGE_BIN_DIR="${CMAKE_INSTALL_PREFIX}/bin"
+ -DPACKAGE_DATA_DIR="${CMAKE_INSTALL_PREFIX}/share/${CMAKE_PROJECT_NAME}"
+ -DPACKAGE_LIB_DIR="${CMAKE_INSTALL_PREFIX}/lib")
+
+
+# these shouldn't be needed if it's a native cmake, just change .pc.in:
+SET(prefix "${CMAKE_INSTALL_PREFIX}")
+SET(exec_prefix "\${prefix}")
+SET(libdir "\${exec_prefix}/lib")
+SET(includedir "\${prefix}/include")
+SET(datarootdir "\${prefix}/share")
+SET(datadir "\${datarootdir}")
+SET(embryoincludedir "\${datarootdir}/include")
+SET(PACKAGE "${CMAKE_PROJECT_NAME}")
+SET(VERSION "${EMBRYO_VERSION_WITH_REV}")
+SET(VMAJ "${EMBRYO_VERSION_MAJOR}")
+SET(pkgconfig_requires_private "Requires.private")
+CONFIGURE_FILE("${PROJECT_SOURCE_DIR}/embryo.pc.in"
+ "${PROJECT_BINARY_DIR}/embryo.pc"
+ @ONLY)
+INSTALL(FILES "${PROJECT_BINARY_DIR}/embryo.pc"
+ DESTINATION lib/pkgconfig)
+
+CONFIGURE_FILE("${PROJECT_SOURCE_DIR}/cmakeconfig.h.in"
+ "${PROJECT_BINARY_DIR}/config.h")
+ADD_DEFINITIONS(-DHAVE_CONFIG_H)
+
+ADD_SUBDIRECTORY("src/lib")
+
+OPTION(BUILD_EMBRYO_CC "Build embryo_cc compiler" ON)
+IF(BUILD_EMBRYO_CC)
+ ADD_SUBDIRECTORY("src/bin")
+ENDIF(BUILD_EMBRYO_CC)
+
+INSTALL(FILES "${PROJECT_SOURCE_DIR}/include/default.inc"
+ DESTINATION "share/${CMAKE_PROJECT_NAME}/include")
+
+FIND_PACKAGE(Doxygen)
+IF(DOXYGEN_FOUND)
+ # these SET should go when it is changed to native cmake
+ SET(srcdir ${PROJECT_SOURCE_DIR}/doc)
+ SET(top_srcdir ${PROJECT_SOURCE_DIR})
+ CONFIGURE_FILE("${PROJECT_SOURCE_DIR}/doc/Doxyfile.in"
+ "${PROJECT_BINARY_DIR}/doc/Doxyfile"
+ @ONLY)
+ CONFIGURE_FILE("${PROJECT_SOURCE_DIR}/doc/embryo.dox.in"
+ "${PROJECT_BINARY_DIR}/doc/embryo.dox"
+ @ONLY)
+ UNSET(srcdir)
+ UNSET(top_srcdir)
+ ADD_CUSTOM_TARGET(doc
+ ${DOXYGEN_EXECUTABLE} ${CMAKE_CURRENT_BINARY_DIR}/doc/Doxyfile
+ WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/doc
+ COMMENT "Generating API documentation with Doxygen"
+ VERBATIM)
+ MESSAGE("Doxygen found, type 'make doc'")
+ENDIF(DOXYGEN_FOUND)
+
+INCLUDE(InstallRequiredSystemLibraries)
+SET(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/COPYING")
+SET(CPACK_PACKAGE_DESCRIPTION_FILE "${CMAKE_CURRENT_SOURCE_DIR}/README")
+SET(CPACK_PACKAGE_DESCRIPTION_SUMMARY "Embryo scripting language and VM")
+SET(CPACK_PACKAGE_VERSION_MAJOR "${EMBRYO_VERSION_MAJOR}")
+SET(CPACK_PACKAGE_VERSION_MINOR "${EMBRYO_VERSION_MINOR}")
+SET(CPACK_PACKAGE_VERSION_PATCH "${EMBRYO_VERSION_MICRO}")
+INCLUDE(CPack)
------------------------------------------------------------------------------
Systems Optimization Self Assessment
Improve efficiency and utilization of IT resources. Drive out cost and
improve service delivery. Take 5 minutes to use this Systems Optimization
Self Assessment. http://www.accelacomm.com/jaw/sdnl/114/51450054/
_______________________________________________
enlightenment-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/enlightenment-devel