This reverts commit 8ea93e95f4fd6f5ff004ba9b3e7132e5a673c8bf. --- README.markdown | 8 ++++---- matahari.spec | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/README.markdown b/README.markdown index 4040aef..114c548 100644 --- a/README.markdown +++ b/README.markdown @@ -11,7 +11,7 @@ Matahari has build dependencies on the following packages:
1. pcre-devel -2. glib2-devel (version 2.28 at least) +2. glib2-devel 3. qmf 4. qmf-devel 5. qpid-cpp-client @@ -21,10 +21,10 @@ Matahari has build dependencies on the following packages: 9. sigar 10. sigar-devel
-These packages may be available in your distribution. In Fedora 15, they can +These packages may be available in your distribution. In Fedora 14, they can be installed via the yum command.
-*Step 2* - Build Matahari +*Step 2* - Build Mataharhi
user% make user% cd linux.build @@ -43,7 +43,7 @@ On your Fedora box first:
yum install mingw32-matahari
- copy the /usr/share/matahari*/*iso to Windows machine (or burn iso). + copy the /usr/share/matahari*/*iso to Windows machine.( or burn iso ) load iso/cd; run setup
Please see: https://fedorahosted.org/matahari/ diff --git a/matahari.spec b/matahari.spec index ae31bad..49f9eca 100644 --- a/matahari.spec +++ b/matahari.spec @@ -30,7 +30,7 @@ BuildRequires: cmake BuildRequires: libudev-devel BuildRequires: gcc-c++ BuildRequires: pcre-devel -BuildRequires: glib2-devel >= 2.28 +BuildRequires: glib2-devel BuildRequires: sigar-devel
%if %{with qmf}
If the function is missing (in older glib-2 libraries) use our implementation. Copied from glib-2.29.8.
Signed-off-by: Roman Rakus rrakus@redhat.com --- src/CMakeLists.txt | 8 ++++++-- src/include/config.h.in | 1 + src/include/matahari/utilities.h | 10 ++++++++++ src/lib/utilities.c | 9 +++++++++ 4 files changed, 26 insertions(+), 2 deletions(-)
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index a9ad3d1..e0a9914 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -42,8 +42,6 @@ check_include_files (resolv.h HAVE_RESOLV_H) include (CheckFunctionExists) check_function_exists (asprintf HAVE_ASPRINTF) check_function_exists (time HAVE_TIME) -configure_file (${CMAKE_CURRENT_SOURCE_DIR}/include/config.h.in ${CMAKE_CURRENT_BINARY_DIR}/config.h) -configure_file (${CMAKE_CURRENT_SOURCE_DIR}/include/matahari.h.in ${CMAKE_CURRENT_BINARY_DIR}/include/matahari.h)
if(NOT PKG_CONFIG_FOUND) message("pkg-config not found") @@ -80,6 +78,8 @@ if(NOT glib_FOUND) message(FATAL_ERROR "Glib2 header/library not found.") endif(NOT glib_FOUND) include_directories(${glib_INCLUDE_DIRS}) +SET(CMAKE_REQUIRED_LIBRARIES ${glib_LIBRARIES}) +check_function_exists (g_list_free_full HAVE_G_LIST_FREE_FULL)
# Include QMF and DBus generation macros include(MatahariMacros) @@ -156,3 +156,7 @@ if(WITH-DBUS) install(FILES include/matahari/mh_dbus_common.h DESTINATION include/matahari) install(FILES include/matahari/mh_gobject_class.h DESTINATION include/matahari) endif(WITH-DBUS) + +configure_file (${CMAKE_CURRENT_SOURCE_DIR}/include/config.h.in ${CMAKE_CURRENT_BINARY_DIR}/config.h) +configure_file (${CMAKE_CURRENT_SOURCE_DIR}/include/matahari.h.in ${CMAKE_CURRENT_BINARY_DIR}/include/matahari.h) + diff --git a/src/include/config.h.in b/src/include/config.h.in index 4a2ff46..9253178 100644 --- a/src/include/config.h.in +++ b/src/include/config.h.in @@ -3,3 +3,4 @@ #cmakedefine HAVE_ASPRINTF 1 #cmakedefine HAVE_RESOLV_H 1 #cmakedefine HAVE_TIME 1 +#cmakedefine HAVE_G_LIST_FREE_FULL 1 diff --git a/src/include/matahari/utilities.h b/src/include/matahari/utilities.h index 127f298..cf416a1 100644 --- a/src/include/matahari/utilities.h +++ b/src/include/matahari/utilities.h @@ -51,6 +51,16 @@ extern wchar_t *char2wide(const char *str); extern int asprintf(char **ret, const char *fmt, ...); #endif
+#ifndef HAVE_G_LIST_FREE_FULL +/** + * Custom implementation of g_list_free_full() + * + * This version of g_list_free_full() is only used when the build system + * doesn't find g_list_free_full() on the system. + */ +extern void g_list_free_full(GList *list, GDestroyNotify free_func); +#endif + #define DIMOF(a) ((int) (sizeof(a) / sizeof(0[a])))
#ifndef __GNUC__ diff --git a/src/lib/utilities.c b/src/lib/utilities.c index 7047cff..96e98c7 100644 --- a/src/lib/utilities.c +++ b/src/lib/utilities.c @@ -452,3 +452,12 @@ asprintf(char **ret, const char *fmt, ...) return len; } #endif /* HAVE_ASPRINTF */ + +#ifndef HAVE_G_LIST_FREE_FULL +void +g_list_free_full (GList *list, GDestroyNotify free_func) +{ + g_list_foreach (list, (GFunc) free_func, NULL); + g_list_free (list); +} +#endif /* HAVE_G_LIST_FREE_FULL */
ACK
-- Russell Bryant
On Mon, Jul 11, 2011 at 7:51 AM, Roman Rakus rrakus@redhat.com wrote:
If the function is missing (in older glib-2 libraries) use our implementation. Copied from glib-2.29.8.
Signed-off-by: Roman Rakus rrakus@redhat.com
src/CMakeLists.txt | 8 ++++++-- src/include/config.h.in | 1 + src/include/matahari/utilities.h | 10 ++++++++++ src/lib/utilities.c | 9 +++++++++ 4 files changed, 26 insertions(+), 2 deletions(-)
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index a9ad3d1..e0a9914 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -42,8 +42,6 @@ check_include_files (resolv.h HAVE_RESOLV_H) include (CheckFunctionExists) check_function_exists (asprintf HAVE_ASPRINTF) check_function_exists (time HAVE_TIME) -configure_file (${CMAKE_CURRENT_SOURCE_DIR}/include/config.h.in ${CMAKE_CURRENT_BINARY_DIR}/config.h) -configure_file (${CMAKE_CURRENT_SOURCE_DIR}/include/matahari.h.in ${CMAKE_CURRENT_BINARY_DIR}/include/matahari.h)
if(NOT PKG_CONFIG_FOUND) message("pkg-config not found") @@ -80,6 +78,8 @@ if(NOT glib_FOUND) message(FATAL_ERROR "Glib2 header/library not found.") endif(NOT glib_FOUND) include_directories(${glib_INCLUDE_DIRS}) +SET(CMAKE_REQUIRED_LIBRARIES ${glib_LIBRARIES}) +check_function_exists (g_list_free_full HAVE_G_LIST_FREE_FULL)
# Include QMF and DBus generation macros include(MatahariMacros) @@ -156,3 +156,7 @@ if(WITH-DBUS) install(FILES include/matahari/mh_dbus_common.h DESTINATION include/matahari) install(FILES include/matahari/mh_gobject_class.h DESTINATION include/matahari) endif(WITH-DBUS)
+configure_file (${CMAKE_CURRENT_SOURCE_DIR}/include/config.h.in ${CMAKE_CURRENT_BINARY_DIR}/config.h) +configure_file (${CMAKE_CURRENT_SOURCE_DIR}/include/matahari.h.in ${CMAKE_CURRENT_BINARY_DIR}/include/matahari.h)
diff --git a/src/include/config.h.in b/src/include/config.h.in index 4a2ff46..9253178 100644 --- a/src/include/config.h.in +++ b/src/include/config.h.in @@ -3,3 +3,4 @@ #cmakedefine HAVE_ASPRINTF 1 #cmakedefine HAVE_RESOLV_H 1 #cmakedefine HAVE_TIME 1 +#cmakedefine HAVE_G_LIST_FREE_FULL 1 diff --git a/src/include/matahari/utilities.h b/src/include/matahari/utilities.h index 127f298..cf416a1 100644 --- a/src/include/matahari/utilities.h +++ b/src/include/matahari/utilities.h @@ -51,6 +51,16 @@ extern wchar_t *char2wide(const char *str); extern int asprintf(char **ret, const char *fmt, ...); #endif
+#ifndef HAVE_G_LIST_FREE_FULL +/**
- Custom implementation of g_list_free_full()
- This version of g_list_free_full() is only used when the build system
- doesn't find g_list_free_full() on the system.
- */
+extern void g_list_free_full(GList *list, GDestroyNotify free_func); +#endif
#define DIMOF(a) ((int) (sizeof(a) / sizeof(0[a])))
#ifndef __GNUC__ diff --git a/src/lib/utilities.c b/src/lib/utilities.c index 7047cff..96e98c7 100644 --- a/src/lib/utilities.c +++ b/src/lib/utilities.c @@ -452,3 +452,12 @@ asprintf(char **ret, const char *fmt, ...) return len; } #endif /* HAVE_ASPRINTF */
+#ifndef HAVE_G_LIST_FREE_FULL +void +g_list_free_full (GList *list, GDestroyNotify free_func) +{
- g_list_foreach (list, (GFunc) free_func, NULL);
- g_list_free (list);
+}
+#endif /* HAVE_G_LIST_FREE_FULL */
1.7.6
Matahari mailing list Matahari@lists.fedorahosted.org https://fedorahosted.org/mailman/listinfo/matahari
Just a question; On 07/11/2011 02:51 PM, Roman Rakus wrote:
@@ -80,6 +78,8 @@ if(NOT glib_FOUND) message(FATAL_ERROR "Glib2 header/library not found.") endif(NOT glib_FOUND) include_directories(${glib_INCLUDE_DIRS}) +SET(CMAKE_REQUIRED_LIBRARIES ${glib_LIBRARIES}) +check_function_exists (g_list_free_full HAVE_G_LIST_FREE_FULL)
# Include QMF and DBus generation macros include(MatahariMacros)
this will test if the specific function is defined. Is it better to check for function or check library version?
RR
On Tue, Jul 12, 2011 at 4:22 AM, Roman Rakus rrakus@redhat.com wrote:
Just a question; On 07/11/2011 02:51 PM, Roman Rakus wrote:
@@ -80,6 +78,8 @@ if(NOT glib_FOUND) message(FATAL_ERROR "Glib2 header/library not found.") endif(NOT glib_FOUND) include_directories(${glib_INCLUDE_DIRS}) +SET(CMAKE_REQUIRED_LIBRARIES ${glib_LIBRARIES}) +check_function_exists (g_list_free_full HAVE_G_LIST_FREE_FULL)
# Include QMF and DBus generation macros include(MatahariMacros)
this will test if the specific function is defined. Is it better to check for function or check library version?
I prefer this approach of checking for specific features that are known to be an issue. It's much more explicit and more reliable IMO. The only place it is used in the code is around the custom implementation of this function being checked for.
On 07/12/2011 02:36 PM, Russell Bryant wrote:
On Tue, Jul 12, 2011 at 4:22 AM, Roman Rakusrrakus@redhat.com wrote:
Just a question; On 07/11/2011 02:51 PM, Roman Rakus wrote:
@@ -80,6 +78,8 @@ if(NOT glib_FOUND) message(FATAL_ERROR "Glib2 header/library not found.") endif(NOT glib_FOUND) include_directories(${glib_INCLUDE_DIRS}) +SET(CMAKE_REQUIRED_LIBRARIES ${glib_LIBRARIES}) +check_function_exists (g_list_free_full HAVE_G_LIST_FREE_FULL)
# Include QMF and DBus generation macros include(MatahariMacros)
this will test if the specific function is defined. Is it better to check for function or check library version?
I prefer this approach of checking for specific features that are known to be an issue. It's much more explicit and more reliable IMO. The only place it is used in the code is around the custom implementation of this function being checked for.
ok, so I will also change a patch sent few minutes before, which is for polkit function, but is checking for specific version and not function name.
RR
On Tue, Jul 12, 2011 at 7:38 AM, Roman Rakus rrakus@redhat.com wrote:
On 07/12/2011 02:36 PM, Russell Bryant wrote:
On Tue, Jul 12, 2011 at 4:22 AM, Roman Rakusrrakus@redhat.com wrote:
Just a question; On 07/11/2011 02:51 PM, Roman Rakus wrote:
@@ -80,6 +78,8 @@ if(NOT glib_FOUND) message(FATAL_ERROR "Glib2 header/library not found.") endif(NOT glib_FOUND) include_directories(${glib_INCLUDE_DIRS}) +SET(CMAKE_REQUIRED_LIBRARIES ${glib_LIBRARIES}) +check_function_exists (g_list_free_full HAVE_G_LIST_FREE_FULL)
# Include QMF and DBus generation macros include(MatahariMacros)
this will test if the specific function is defined. Is it better to check for function or check library version?
I prefer this approach of checking for specific features that are known to be an issue. It's much more explicit and more reliable IMO. The only place it is used in the code is around the custom implementation of this function being checked for.
ok, so I will also change a patch sent few minutes before, which is for polkit function, but is checking for specific version and not function name.
Thanks, sounds good!
ACK
-- Russell Bryant
On Mon, Jul 11, 2011 at 7:51 AM, Roman Rakus rrakus@redhat.com wrote:
This reverts commit 8ea93e95f4fd6f5ff004ba9b3e7132e5a673c8bf.
README.markdown | 8 ++++---- matahari.spec | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/README.markdown b/README.markdown index 4040aef..114c548 100644 --- a/README.markdown +++ b/README.markdown @@ -11,7 +11,7 @@ Matahari has build dependencies on the following packages:
1. pcre-devel -2. glib2-devel (version 2.28 at least) +2. glib2-devel 3. qmf 4. qmf-devel 5. qpid-cpp-client @@ -21,10 +21,10 @@ Matahari has build dependencies on the following packages: 9. sigar 10. sigar-devel
-These packages may be available in your distribution. In Fedora 15, they can +These packages may be available in your distribution. In Fedora 14, they can be installed via the yum command.
-*Step 2* - Build Matahari +*Step 2* - Build Mataharhi
user% make user% cd linux.build @@ -43,7 +43,7 @@ On your Fedora box first:
yum install mingw32-matahari
- copy the /usr/share/matahari*/*iso to Windows machine (or burn iso).
- copy the /usr/share/matahari*/*iso to Windows machine.( or burn iso )
load iso/cd; run setup
Please see: https://fedorahosted.org/matahari/ diff --git a/matahari.spec b/matahari.spec index ae31bad..49f9eca 100644 --- a/matahari.spec +++ b/matahari.spec @@ -30,7 +30,7 @@ BuildRequires: cmake BuildRequires: libudev-devel BuildRequires: gcc-c++ BuildRequires: pcre-devel -BuildRequires: glib2-devel >= 2.28 +BuildRequires: glib2-devel BuildRequires: sigar-devel
%if %{with qmf}
1.7.6
Matahari mailing list Matahari@lists.fedorahosted.org https://fedorahosted.org/mailman/listinfo/matahari
matahari@lists.fedorahosted.org