Fix pkgmgr fr native build
[scm/bb/meta-tizen.git] / recipes-tizen / pkgmgr / files / remove-dlog-for-native-build.patch
1 diff --git a/CMakeLists.txt b/CMakeLists.txt
2 index 96a28f1..471bb77 100644
3 --- a/CMakeLists.txt
4 +++ b/CMakeLists.txt
5 @@ -18,6 +18,8 @@ SET(LIBDIR ${LIB_INSTALL_DIR})
6  SET(INCLUDEDIR "\${prefix}/include")
7  
8  
9 +ADD_DEFINITIONS("-DNDEBUG")
10 +
11  set(CMAKE_SKIP_BUILD_RPATH true)
12  
13  #Verbose
14 @@ -28,16 +28,16 @@ INCLUDE(FindPkgConfig)
15  OPTION(X11_SUPPORT "Enable X support" ON)
16  IF(X11_SUPPORT)
17      ADD_DEFINITIONS("-DHAVE_X11")
18 -    pkg_check_modules(pkgs REQUIRED security-server dlog elementary evas ecore appcore-efl ecore-x ail ecore-file pkgmgr-parser pkgmgr-info iniparser libtzplatform-config)
19 +    pkg_check_modules(pkgs REQUIRED security-server  elementary evas ecore appcore-efl ecore-x ail ecore-file pkgmgr-parser pkgmgr-info iniparser libtzplatform-config)
20  ELSE()
21 -    pkg_check_modules(pkgs REQUIRED security-server dlog elementary evas ecore appcore-efl ecore-wayland ail ecore-file pkgmgr-parser pkgmgr-info iniparser libtzplatform-config)
22 +    pkg_check_modules(pkgs REQUIRED security-server  elementary evas ecore appcore-efl ail ecore-file pkgmgr-parser pkgmgr-info iniparser libtzplatform-config)
23  ENDIF(X11_SUPPORT)
24  
25  FOREACH(flag ${pkgs_CFLAGS})
26         SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} ${flag}")
27  ENDFOREACH(flag)
28  
29 -pkg_check_modules(libpkgs REQUIRED dbus-glib-1 dlog ail pkgmgr-parser pkgmgr-info iniparser libtzplatform-config xdgmime)
30 +pkg_check_modules(libpkgs REQUIRED dbus-glib-1  ail pkgmgr-parser pkgmgr-info iniparser libtzplatform-config xdgmime)
31  
32  FOREACH(flag ${libpkgs_CFLAGS})
33         SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} ${flag}")
34 diff --git a/client/include/pkgmgr-debug.h b/client/include/pkgmgr-debug.h
35 index 7ec0523..7599fd1 100644
36 --- a/client/include/pkgmgr-debug.h
37 +++ b/client/include/pkgmgr-debug.h
38 @@ -22,10 +22,14 @@
39  #ifndef __PKGMGR_DEBUG_H__
40  #define __PKGMGR_DEBUG_H__
41  
42 -#include <dlog.h>
43 -
44 -#define _LOGE(fmt, arg...) LOGE(fmt, ##arg)
45 -#define _LOGD(fmt, arg...) LOGD(fmt, ##arg)
46 +//#include <dlog.h>
47 +#define NATIVEFAKELOG(fmt, ...) \
48 +       do\
49 +       {\
50 +               printf("\n [%s: %s(): %d] " fmt"\n",  rindex(__FILE__, '/')+1, __FUNCTION__, __LINE__, ##__VA_ARGS__);\
51 +       } while (0)
52 +#define _LOGE(fmt, arg...) NATIVEFAKELOG(fmt, ##arg)
53 +#define _LOGD(fmt, arg...) NATIVEFAKELOG(fmt, ##arg)
54  
55  
56  #define COLOR_RED              "\033[0;31m"
57 @@ -35,25 +35,21 @@
58  #define PKGMGR_DEBUG(fmt, ...)\
59         do\
60         {\
61 -               LOGD("[%s(): %d]" fmt, __FUNCTION__, __LINE__,##__VA_ARGS__);\
62         } while (0)
63  
64  #define PKGMGR_DEBUG_ERR(fmt, ...)\
65         do\
66         {\
67 -               LOGE(COLOR_RED"[%s(): %d]" fmt COLOR_END, __FUNCTION__, __LINE__,##__VA_ARGS__);\
68         }while (0)
69  
70  #define PKGMGR_BEGIN() \
71         do\
72      {\
73 -               LOGD(COLOR_BLUE"[%s(): %d] BEGIN >>>>"COLOR_END, __FUNCTION__ ,__LINE__);\
74      } while( 0 )
75  
76  #define PKGMGR_END() \
77         do\
78      {\
79 -               LOGD(COLOR_BLUE"[%s(): %d] END <<<<"COLOR_END, __FUNCTION__,__LINE__ );\
80      } \
81      while( 0 )
82  
83 diff --git a/comm/CMakeLists.txt b/comm/CMakeLists.txt
84 index 7378df5..fd5a714 100755
85 --- a/comm/CMakeLists.txt
86 +++ b/comm/CMakeLists.txt
87 @@ -25,7 +25,7 @@ message(STATUS "version/major : ${VERSION} / ${VERSION_MAJOR}")
88  ### Get required CFLAGS, LDFLAGS from pkg-config
89  
90  include(FindPkgConfig)
91 -pkg_check_modules(comm_pkgs REQUIRED dbus-1 dbus-glib-1 dlog pkgmgr-info)
92 +pkg_check_modules(comm_pkgs REQUIRED dbus-1 dbus-glib-1 pkgmgr-info)
93  
94  foreach(flag ${comm_pkgs_CFLAGS})
95         set(comm_pkgs_CFLAGS_str "${comm_pkgs_CFLAGS_str} ${flag}")
96 diff --git a/comm/comm_config.h b/comm/comm_config.h
97 index 6fa50a9..7570b93 100755
98 --- a/comm/comm_config.h
99 +++ b/comm/comm_config.h
100 @@ -36,7 +36,7 @@
101  #endif
102  
103  /* Debug message macro */
104 -#define USE_DLOG 1             /* Use dlog! */
105 +//#define USE_DLOG 1           /* Use dlog! */
106  
107  #ifndef NDEBUG
108  #ifdef USE_DLOG
109 @@ -54,14 +54,14 @@
110  #include <sys/types.h>
111  #include <unistd.h>
112  #define dbg(fmtstr, args...) \
113 -       do {
114 +       do {\
115                 fprintf(stdout, "[%d:comm]%s:%d:%s(): " \
116                 fmtstr "\n", getpid(),\
117                 basename(__FILE__), __LINE__, __func__, ##args);\
118         } while (0)
119  
120  #define ERR(fmtstr, args...) \
121 -       do {
122 +       do {\
123                 fprintf(stderr, "[%d:comm]%s:%d:%s(): " \
124                 fmtstr "\n", getpid(),\
125                 basename(__FILE__), __LINE__, __func__, ##args);\
126 @@ -69,6 +69,14 @@
127  #endif                         /* USE_DLOG */
128  #else
129  #define dbg(fmtstr, args...)
130 +#define NATIVEFAKELOG(fmt, ...) \
131 +       do\
132 +       {\
133 +               printf("\n [%s: %s(): %d] " fmt"\n",  rindex(__FILE__, '/')+1, __FUNCTION__, __LINE__, ##__VA_ARGS__);\
134 +       } while (0)
135 +#define ERR(fmt, arg...) NATIVEFAKELOG(fmt, ##arg)
136 +#define LOGD(fmt, arg...) NATIVEFAKELOG(fmt, ##arg)
137 +#define LOGE(fmt, arg...) NATIVEFAKELOG(fmt, ##arg)
138  #endif
139  
140  /* from comm_pkg_mgr.xml
141 diff --git a/comm/pkgmgr_installer.h b/comm/pkgmgr_installer.h
142 index 661249b..126b893 100755
143 --- a/comm/pkgmgr_installer.h
144 +++ b/comm/pkgmgr_installer.h
145 @@ -40,7 +40,7 @@ extern "C" {
146  
147  #include <stdlib.h>
148  #include <getopt.h>
149 -#include <dlog.h>
150 +//#include <dlog.h>
151  
152  
153  
154 diff --git a/comm/test/CMakeLists.txt b/comm/test/CMakeLists.txt
155 index 016aca7..48c547e 100755
156 --- a/comm/test/CMakeLists.txt
157 +++ b/comm/test/CMakeLists.txt
158 @@ -1,5 +1,5 @@
159  include(FindPkgConfig)
160 -pkg_check_modules(test_pkgs REQUIRED dbus-glib-1 glib-2.0 dlog)
161 +pkg_check_modules(test_pkgs REQUIRED dbus-glib-1 glib-2.0 )
162  
163  add_definitions(${test_pkgs_CFLAGS})
164  
165 diff --git a/installers/sample/CMakeLists.txt b/installers/sample/CMakeLists.txt
166 index 162c8f4..6a027a1 100755
167 --- a/installers/sample/CMakeLists.txt
168 +++ b/installers/sample/CMakeLists.txt
169 @@ -1,5 +1,5 @@
170  include(FindPkgConfig)
171 -pkg_check_modules(parser_pkgs REQUIRED dlog libxml-2.0)
172 +pkg_check_modules(parser_pkgs REQUIRED libxml-2.0)
173  
174  foreach(flag ${parser_pkgs_CFLAGS})
175          set(parser_pkgs_CFLAGS_str "${parser_pkgs_CFLAGS_str} ${flag}")
176 diff --git a/installers/sample/sample_parserlib.c b/installers/sample/sample_parserlib.c
177 index 4eb175b..d017318 100755
178 --- a/installers/sample/sample_parserlib.c
179 +++ b/installers/sample/sample_parserlib.c
180 @@ -33,7 +33,7 @@
181  #include <libxml/xmlreader.h>
182  
183  /* debug output */
184 -#include <dlog.h>
185 +//#include <dlog.h>
186  #undef LOG_TAG
187  #define LOG_TAG "PKGMGR_PARSER"
188  
189 diff --git a/tool/CMakeLists.txt b/tool/CMakeLists.txt
190 index 0eeb65b..f2f951b 100755
191 --- a/tool/CMakeLists.txt
192 +++ b/tool/CMakeLists.txt
193 @@ -17,7 +17,7 @@ FOREACH(flag ${pkgs_test_CFLAGS})
194         SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} ${flag}")
195  ENDFOREACH(flag)
196  
197 -pkg_check_modules(toolpkgs REQUIRED appcore-efl dlog bundle glib-2.0 pkgmgr-parser vconf security-server pkgmgr-info libtzplatform-config)
198 +pkg_check_modules(toolpkgs REQUIRED appcore-efl bundle glib-2.0 pkgmgr-parser vconf security-server pkgmgr-info libtzplatform-config)
199  FOREACH(flag ${libpkgs_CFLAGS})
200         SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} ${flag}")
201  ENDFOREACH(flag)
202 diff --git a/server/src/pkgmgr-server.c b/server/src/pkgmgr-server.c
203 index 8865c2f..45a775f 100755
204 --- a/server/src/pkgmgr-server.c
205 +++ b/server/src/pkgmgr-server.c
206 @@ -59,6 +59,7 @@
207  
208  /* debug output */
209  #if defined(NDEBUG)
210 +#define DBGE(fmt, args...)
211  #define DBG(fmt, args...)
212  #define __SET_DBG_OUTPUT(fp)
213  #elif defined(PRINT)