Merge lp:~brianaker/drizzle/autoconf-foo-update into lp:~drizzle-trunk/drizzle/development
- autoconf-foo-update
- Merge into development
Proposed by
Brian Aker
Status: | Merged |
---|---|
Approved by: | Brian Aker |
Approved revision: | 2498 |
Merged at revision: | 2499 |
Proposed branch: | lp:~brianaker/drizzle/autoconf-foo-update |
Merge into: | lp:~drizzle-trunk/drizzle/development |
Diff against target: |
605 lines (+205/-178) 10 files modified
bootstrap.sh (+0/-26) client/drizzle.cc (+20/-4) config/autorun.sh (+1/-1) drizzled/drizzled.cc (+1/-1) libdrizzle-1.0/structs.h (+2/-3) libdrizzle/conn.cc (+137/-93) libdrizzle/conn_uds.cc (+12/-14) libdrizzle/drizzle.cc (+1/-1) m4/pkg.m4 (+30/-33) win32/include.am (+1/-2) |
To merge this branch: | bzr merge lp:~brianaker/drizzle/autoconf-foo-update |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Drizzle Merge Team | Pending | ||
Review via email: mp+90599@code.launchpad.net |
Commit message
Description of the change
To post a comment you must log in.
- 2499. By Brian Aker
-
Fix NI_SERV
- 2500. By Brian Aker
-
Fix unix domain socket to not require that we keep the addr structure sitting around.
Preview Diff
[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1 | === modified file 'bootstrap.sh' |
2 | --- bootstrap.sh 2011-12-14 20:53:40 +0000 |
3 | +++ bootstrap.sh 2012-01-30 06:09:24 +0000 |
4 | @@ -1,31 +1,5 @@ |
5 | #!/bin/bash |
6 | |
7 | -# Copyright (C) 2011 Brian Aker |
8 | -# All rights reserved. |
9 | -# |
10 | -# Redistribution and use in source and binary forms, with or without |
11 | -# modification, are permitted provided that the following conditions are met: |
12 | -# |
13 | -# 1. Redistributions of source code must retain the above copyright |
14 | -# notice, this list of conditions and the following disclaimer. |
15 | -# 2. Redistributions in binary form must reproduce the above copyright |
16 | -# notice, this list of conditions and the following disclaimer in the |
17 | -# documentation and/or other materials provided with the distribution. |
18 | -# 3. The name of the author may not be used to endorse or promote products |
19 | -# derived from this software without specific prior written permission. |
20 | -# |
21 | -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS |
22 | -# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT |
23 | -# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR |
24 | -# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR |
25 | -# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, |
26 | -# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, |
27 | -# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR |
28 | -# PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF |
29 | -# LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING |
30 | -# NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS |
31 | -# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
32 | - |
33 | if test -f configure; then make clean; make merge-clean; make distclean; fi; |
34 | |
35 | rm -r -f autom4te.cache |
36 | |
37 | === modified file 'client/drizzle.cc' |
38 | --- client/drizzle.cc 2011-11-26 23:14:59 +0000 |
39 | +++ client/drizzle.cc 2012-01-30 06:09:24 +0000 |
40 | @@ -324,6 +324,8 @@ |
41 | opt_password, |
42 | opt_protocol; |
43 | |
44 | +static std::string socket_file; |
45 | + |
46 | static const char* get_day_name(int day_of_week) |
47 | { |
48 | switch(day_of_week) |
49 | @@ -1476,6 +1478,8 @@ |
50 | ("host,h", po::value<string>(¤t_host)->default_value("localhost"), |
51 | _("Connect to host")) |
52 | ("password,P", po::value<string>(¤t_password)->default_value(PASSWORD_SENTINEL), |
53 | + _("Socket file to use when connecting to server.")) |
54 | + ("socket", po::value<string>(&socket_file), |
55 | _("Password to use when connecting to server. If password is not given it's asked from the tty.")) |
56 | ("port,p", po::value<uint32_t>()->default_value(0), |
57 | _("Port number to use for connection or 0 for default to, in order of preference, drizzle.cnf, $DRIZZLE_TCP_PORT, built-in default")) |
58 | @@ -4199,10 +4203,22 @@ |
59 | return 1; |
60 | } |
61 | |
62 | - if ((con= drizzle_con_add_tcp(drizzle, host.c_str(), |
63 | - opt_drizzle_port, user.c_str(), |
64 | - password.c_str(), database.c_str(), |
65 | - global_con_options)) == NULL) |
66 | + if (socket_file.size()) |
67 | + { |
68 | + if ((con= drizzle_con_add_uds(drizzle, socket_file.c_str(), |
69 | + user.c_str(), password.c_str(), |
70 | + database.c_str(), |
71 | + global_con_options)) == NULL) |
72 | + { |
73 | + (void) put_error(con, NULL); |
74 | + (void) fflush(stdout); |
75 | + return 1; |
76 | + } |
77 | + } |
78 | + else if ((con= drizzle_con_add_tcp(drizzle, host.c_str(), |
79 | + opt_drizzle_port, user.c_str(), |
80 | + password.c_str(), database.c_str(), |
81 | + global_con_options)) == NULL) |
82 | { |
83 | (void) put_error(con, NULL); |
84 | (void) fflush(stdout); |
85 | |
86 | === modified file 'config/autorun.sh' |
87 | --- config/autorun.sh 2011-08-09 05:28:47 +0000 |
88 | +++ config/autorun.sh 2012-01-30 06:09:24 +0000 |
89 | @@ -25,4 +25,4 @@ |
90 | # NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS |
91 | # SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
92 | |
93 | -autoreconf -ivf |
94 | +autoreconf --install --force --verbose -Wall |
95 | |
96 | === modified file 'drizzled/drizzled.cc' |
97 | --- drizzled/drizzled.cc 2012-01-06 18:52:56 +0000 |
98 | +++ drizzled/drizzled.cc 2012-01-30 06:09:24 +0000 |
99 | @@ -1366,7 +1366,7 @@ |
100 | } |
101 | catch (po::unknown_option &err) |
102 | { |
103 | - unireg_abort << "Use --help to get a list of available options. " << err.what(); |
104 | + unireg_abort << "Use --help to get a list of available options. " << err.what(); |
105 | } |
106 | |
107 | try |
108 | |
109 | === modified file 'libdrizzle-1.0/structs.h' |
110 | --- libdrizzle-1.0/structs.h 2011-12-28 23:32:47 +0000 |
111 | +++ libdrizzle-1.0/structs.h 2012-01-30 06:09:24 +0000 |
112 | @@ -94,7 +94,7 @@ |
113 | in_port_t port; |
114 | struct addrinfo *addrinfo; |
115 | char *host; |
116 | - char host_buffer[NI_MAXHOST]; |
117 | + char host_buffer[LIBDRIZZLE_NI_MAXHOST]; |
118 | }; |
119 | |
120 | /** |
121 | @@ -102,8 +102,7 @@ |
122 | */ |
123 | struct drizzle_con_uds_st |
124 | { |
125 | - struct addrinfo addrinfo; |
126 | - struct sockaddr_un sockaddr; |
127 | + char path_buffer[LIBDRIZZLE_NI_MAXHOST]; |
128 | }; |
129 | |
130 | /** |
131 | |
132 | === modified file 'libdrizzle/conn.cc' |
133 | --- libdrizzle/conn.cc 2012-01-05 06:31:25 +0000 |
134 | +++ libdrizzle/conn.cc 2012-01-30 06:09:24 +0000 |
135 | @@ -1062,7 +1062,7 @@ |
136 | break; |
137 | |
138 | case DRIZZLE_CON_SOCKET_UDS: |
139 | - con->socket.uds.addrinfo.ai_addr= NULL; |
140 | + con->socket.uds.path_buffer[0]= 0; |
141 | break; |
142 | |
143 | default: |
144 | @@ -1150,7 +1150,6 @@ |
145 | break; |
146 | |
147 | case DRIZZLE_CON_SOCKET_UDS: |
148 | - con->addrinfo_next= &(con->socket.uds.addrinfo); |
149 | break; |
150 | |
151 | default: |
152 | @@ -1179,102 +1178,147 @@ |
153 | con->fd= -1; |
154 | } |
155 | |
156 | - if (con->addrinfo_next == NULL) |
157 | - { |
158 | - drizzle_set_error(con->drizzle, __func__, "could not connect"); |
159 | - drizzle_state_reset(con); |
160 | - return DRIZZLE_RETURN_COULD_NOT_CONNECT; |
161 | - } |
162 | - |
163 | - con->fd= socket(con->addrinfo_next->ai_family, |
164 | - con->addrinfo_next->ai_socktype, |
165 | - con->addrinfo_next->ai_protocol); |
166 | - if (con->fd == -1) |
167 | - { |
168 | - drizzle_set_error(con->drizzle, __func__, "socket:%s", strerror(errno)); |
169 | - con->drizzle->last_errno= errno; |
170 | - return DRIZZLE_RETURN_COULD_NOT_CONNECT; |
171 | - } |
172 | - |
173 | - dret= _con_setsockopt(con); |
174 | - if (dret != DRIZZLE_RETURN_OK) |
175 | - { |
176 | - con->drizzle->last_errno= errno; |
177 | - return DRIZZLE_RETURN_COULD_NOT_CONNECT; |
178 | - } |
179 | - |
180 | - while (1) |
181 | - { |
182 | - ret= connect(con->fd, con->addrinfo_next->ai_addr, |
183 | - con->addrinfo_next->ai_addrlen); |
184 | + if (con->socket_type == DRIZZLE_CON_SOCKET_UDS) |
185 | + { |
186 | +#ifndef WIN32 |
187 | + if ((con->fd= socket(AF_UNIX, SOCK_STREAM, 0)) < 0) |
188 | + { |
189 | + con->drizzle->last_errno= errno; |
190 | + return DRIZZLE_RETURN_COULD_NOT_CONNECT; |
191 | + } |
192 | + |
193 | + struct sockaddr_un servAddr; |
194 | + |
195 | + memset(&servAddr, 0, sizeof (struct sockaddr_un)); |
196 | + servAddr.sun_family= AF_UNIX; |
197 | + strncpy(servAddr.sun_path, con->socket.uds.path_buffer, sizeof(servAddr.sun_path)); /* Copy filename */ |
198 | + |
199 | + do { |
200 | + if (connect(con->fd, (struct sockaddr *)&servAddr, sizeof(servAddr)) < 0) |
201 | + { |
202 | + switch (errno) |
203 | + { |
204 | + case EINPROGRESS: |
205 | + case EALREADY: |
206 | + case EINTR: |
207 | + continue; |
208 | + |
209 | + case EISCONN: /* We were spinning waiting on connect */ |
210 | + { |
211 | + break; |
212 | + } |
213 | + |
214 | + default: |
215 | + con->drizzle->last_errno= errno; |
216 | + return DRIZZLE_RETURN_COULD_NOT_CONNECT; |
217 | + } |
218 | + } |
219 | + } while (0); |
220 | + |
221 | + return DRIZZLE_RETURN_OK; |
222 | +#else |
223 | + return DRIZZLE_RETURN_COULD_NOT_CONNECT; |
224 | +#endif |
225 | + } |
226 | + else |
227 | + { |
228 | + if (con->addrinfo_next == NULL) |
229 | + { |
230 | + drizzle_set_error(con->drizzle, __func__, "could not connect"); |
231 | + drizzle_state_reset(con); |
232 | + return DRIZZLE_RETURN_COULD_NOT_CONNECT; |
233 | + } |
234 | + |
235 | + con->fd= socket(con->addrinfo_next->ai_family, |
236 | + con->addrinfo_next->ai_socktype, |
237 | + con->addrinfo_next->ai_protocol); |
238 | + if (con->fd == -1) |
239 | + { |
240 | + drizzle_set_error(con->drizzle, __func__, "socket:%s", strerror(errno)); |
241 | + con->drizzle->last_errno= errno; |
242 | + return DRIZZLE_RETURN_COULD_NOT_CONNECT; |
243 | + } |
244 | + |
245 | + dret= _con_setsockopt(con); |
246 | + if (dret != DRIZZLE_RETURN_OK) |
247 | + { |
248 | + con->drizzle->last_errno= errno; |
249 | + return DRIZZLE_RETURN_COULD_NOT_CONNECT; |
250 | + } |
251 | + |
252 | + while (1) |
253 | + { |
254 | + ret= connect(con->fd, con->addrinfo_next->ai_addr, |
255 | + con->addrinfo_next->ai_addrlen); |
256 | |
257 | #ifdef _WIN32 |
258 | - errno = WSAGetLastError(); |
259 | - switch(errno) { |
260 | - case WSAEINVAL: |
261 | - case WSAEALREADY: |
262 | - case WSAEWOULDBLOCK: |
263 | - errno= EINPROGRESS; |
264 | - break; |
265 | - case WSAECONNREFUSED: |
266 | - errno= ECONNREFUSED; |
267 | - break; |
268 | - case WSAENETUNREACH: |
269 | - errno= ENETUNREACH; |
270 | - break; |
271 | - case WSAETIMEDOUT: |
272 | - errno= ETIMEDOUT; |
273 | - break; |
274 | - case WSAECONNRESET: |
275 | - errno= ECONNRESET; |
276 | - break; |
277 | - case WSAEADDRINUSE: |
278 | - errno= EADDRINUSE; |
279 | - break; |
280 | - case WSAEOPNOTSUPP: |
281 | - errno= EOPNOTSUPP; |
282 | - break; |
283 | - case WSAENOPROTOOPT: |
284 | - errno= ENOPROTOOPT; |
285 | - break; |
286 | - default: |
287 | - break; |
288 | - } |
289 | + errno = WSAGetLastError(); |
290 | + switch(errno) { |
291 | + case WSAEINVAL: |
292 | + case WSAEALREADY: |
293 | + case WSAEWOULDBLOCK: |
294 | + errno= EINPROGRESS; |
295 | + break; |
296 | + case WSAECONNREFUSED: |
297 | + errno= ECONNREFUSED; |
298 | + break; |
299 | + case WSAENETUNREACH: |
300 | + errno= ENETUNREACH; |
301 | + break; |
302 | + case WSAETIMEDOUT: |
303 | + errno= ETIMEDOUT; |
304 | + break; |
305 | + case WSAECONNRESET: |
306 | + errno= ECONNRESET; |
307 | + break; |
308 | + case WSAEADDRINUSE: |
309 | + errno= EADDRINUSE; |
310 | + break; |
311 | + case WSAEOPNOTSUPP: |
312 | + errno= EOPNOTSUPP; |
313 | + break; |
314 | + case WSAENOPROTOOPT: |
315 | + errno= ENOPROTOOPT; |
316 | + break; |
317 | + default: |
318 | + break; |
319 | + } |
320 | #endif /* _WIN32 */ |
321 | - |
322 | - drizzle_log_crazy(con->drizzle, "connect return=%d errno=%s", ret, strerror(errno)); |
323 | - |
324 | - if (ret == 0) |
325 | - { |
326 | - con->addrinfo_next= NULL; |
327 | - break; |
328 | - } |
329 | - |
330 | - if (errno == EAGAIN || errno == EINTR) |
331 | - { |
332 | - continue; |
333 | - } |
334 | - |
335 | - if (errno == EINPROGRESS) |
336 | - { |
337 | - drizzle_state_pop(con); |
338 | - drizzle_state_push(con, drizzle_state_connecting); |
339 | - return DRIZZLE_RETURN_OK; |
340 | - } |
341 | - |
342 | - if (errno == ECONNREFUSED || errno == ENETUNREACH || errno == ETIMEDOUT) |
343 | - { |
344 | - con->addrinfo_next= con->addrinfo_next->ai_next; |
345 | - return DRIZZLE_RETURN_OK; |
346 | - } |
347 | - |
348 | - drizzle_set_error(con->drizzle, __func__, "connect:%s", strerror(errno)); |
349 | - con->drizzle->last_errno= errno; |
350 | - return DRIZZLE_RETURN_COULD_NOT_CONNECT; |
351 | + |
352 | + drizzle_log_crazy(con->drizzle, "connect return=%d errno=%s", ret, strerror(errno)); |
353 | + |
354 | + if (ret == 0) |
355 | + { |
356 | + con->addrinfo_next= NULL; |
357 | + break; |
358 | + } |
359 | + |
360 | + if (errno == EAGAIN || errno == EINTR) |
361 | + { |
362 | + continue; |
363 | + } |
364 | + |
365 | + if (errno == EINPROGRESS) |
366 | + { |
367 | + drizzle_state_pop(con); |
368 | + drizzle_state_push(con, drizzle_state_connecting); |
369 | + return DRIZZLE_RETURN_OK; |
370 | + } |
371 | + |
372 | + if (errno == ECONNREFUSED || errno == ENETUNREACH || errno == ETIMEDOUT) |
373 | + { |
374 | + con->addrinfo_next= con->addrinfo_next->ai_next; |
375 | + return DRIZZLE_RETURN_OK; |
376 | + } |
377 | + |
378 | + drizzle_set_error(con->drizzle, __func__, "connect:%s", strerror(errno)); |
379 | + con->drizzle->last_errno= errno; |
380 | + return DRIZZLE_RETURN_COULD_NOT_CONNECT; |
381 | + } |
382 | + |
383 | + drizzle_state_pop(con); |
384 | } |
385 | |
386 | - drizzle_state_pop(con); |
387 | - |
388 | return DRIZZLE_RETURN_OK; |
389 | } |
390 | |
391 | |
392 | === modified file 'libdrizzle/conn_uds.cc' |
393 | --- libdrizzle/conn_uds.cc 2011-12-28 21:59:11 +0000 |
394 | +++ libdrizzle/conn_uds.cc 2012-01-30 06:09:24 +0000 |
395 | @@ -51,11 +51,15 @@ |
396 | |
397 | if (con->socket_type == DRIZZLE_CON_SOCKET_UDS) |
398 | { |
399 | - if (con->socket.uds.sockaddr.sun_path[0] != 0) |
400 | - return con->socket.uds.sockaddr.sun_path; |
401 | + if (con->socket.uds.path_buffer[0] != 0) |
402 | + { |
403 | + return con->socket.uds.path_buffer; |
404 | + } |
405 | |
406 | if (con->options & DRIZZLE_CON_MYSQL) |
407 | + { |
408 | return DRIZZLE_DEFAULT_UDS_MYSQL; |
409 | + } |
410 | |
411 | return DRIZZLE_DEFAULT_UDS; |
412 | } |
413 | @@ -77,16 +81,10 @@ |
414 | if (uds == NULL) |
415 | { |
416 | uds= ""; |
417 | - } |
418 | - |
419 | - con->socket.uds.sockaddr.sun_family= AF_UNIX; |
420 | - strncpy(con->socket.uds.sockaddr.sun_path, uds, |
421 | - sizeof(con->socket.uds.sockaddr.sun_path)); |
422 | - con->socket.uds.sockaddr.sun_path[sizeof(con->socket.uds.sockaddr.sun_path) - 1]= 0; |
423 | - |
424 | - con->socket.uds.addrinfo.ai_family= AF_UNIX; |
425 | - con->socket.uds.addrinfo.ai_socktype= SOCK_STREAM; |
426 | - con->socket.uds.addrinfo.ai_protocol= 0; |
427 | - con->socket.uds.addrinfo.ai_addrlen= sizeof(struct sockaddr_un); |
428 | - con->socket.uds.addrinfo.ai_addr= (struct sockaddr *)&(con->socket.uds.sockaddr); |
429 | + con->socket.uds.path_buffer[0]= 0; |
430 | + } |
431 | + else |
432 | + { |
433 | + strncpy(con->socket.uds.path_buffer, uds, sizeof(con->socket.uds.path_buffer)); |
434 | + } |
435 | } |
436 | |
437 | === modified file 'libdrizzle/drizzle.cc' |
438 | --- libdrizzle/drizzle.cc 2012-01-05 06:31:25 +0000 |
439 | +++ libdrizzle/drizzle.cc 2012-01-30 06:09:24 +0000 |
440 | @@ -492,7 +492,7 @@ |
441 | break; |
442 | |
443 | case DRIZZLE_CON_SOCKET_UDS: |
444 | - drizzle_con_set_uds(con, from->socket.uds.sockaddr.sun_path); |
445 | + drizzle_con_set_uds(con, from->socket.uds.path_buffer); |
446 | break; |
447 | |
448 | default: |
449 | |
450 | === modified file 'm4/pkg.m4' |
451 | --- m4/pkg.m4 2010-11-17 22:14:45 +0000 |
452 | +++ m4/pkg.m4 2012-01-30 06:09:24 +0000 |
453 | @@ -1,4 +1,5 @@ |
454 | # pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*- |
455 | +# serial 1 (pkg-config-0.24) |
456 | # |
457 | # Copyright © 2004 Scott James Remnant <scott@netsplit.com>. |
458 | # |
459 | @@ -14,7 +15,7 @@ |
460 | # |
461 | # You should have received a copy of the GNU General Public License |
462 | # along with this program; if not, write to the Free Software |
463 | -# Foundation, Inc., 51 Franklin Place - Suite 330, Boston, MA 02110-1301, USA. |
464 | +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
465 | # |
466 | # As a special exception to the GNU General Public License, if you |
467 | # distribute this file as part of a program that contains a |
468 | @@ -26,7 +27,10 @@ |
469 | AC_DEFUN([PKG_PROG_PKG_CONFIG], |
470 | [m4_pattern_forbid([^_?PKG_[A-Z_]+$]) |
471 | m4_pattern_allow([^PKG_CONFIG(_PATH)?$]) |
472 | -AC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])dnl |
473 | +AC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility]) |
474 | +AC_ARG_VAR([PKG_CONFIG_PATH], [directories to add to pkg-config's search path]) |
475 | +AC_ARG_VAR([PKG_CONFIG_LIBDIR], [path overriding pkg-config's built-in search path]) |
476 | + |
477 | if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then |
478 | AC_PATH_TOOL([PKG_CONFIG], [pkg-config]) |
479 | fi |
480 | @@ -39,7 +43,6 @@ |
481 | AC_MSG_RESULT([no]) |
482 | PKG_CONFIG="" |
483 | fi |
484 | - |
485 | fi[]dnl |
486 | ])# PKG_PROG_PKG_CONFIG |
487 | |
488 | @@ -48,37 +51,31 @@ |
489 | # Check to see whether a particular set of modules exists. Similar |
490 | # to PKG_CHECK_MODULES(), but does not set variables or print errors. |
491 | # |
492 | -# |
493 | -# Similar to PKG_CHECK_MODULES, make sure that the first instance of |
494 | -# this or PKG_CHECK_MODULES is called, or make sure to call |
495 | -# PKG_CHECK_EXISTS manually |
496 | +# Please remember that m4 expands AC_REQUIRE([PKG_PROG_PKG_CONFIG]) |
497 | +# only at the first occurence in configure.ac, so if the first place |
498 | +# it's called might be skipped (such as if it is within an "if", you |
499 | +# have to call PKG_CHECK_EXISTS manually |
500 | # -------------------------------------------------------------- |
501 | AC_DEFUN([PKG_CHECK_EXISTS], |
502 | [AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl |
503 | if test -n "$PKG_CONFIG" && \ |
504 | AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then |
505 | - m4_ifval([$2], [$2], [:]) |
506 | + m4_default([$2], [:]) |
507 | m4_ifvaln([$3], [else |
508 | $3])dnl |
509 | fi]) |
510 | |
511 | - |
512 | # _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES]) |
513 | # --------------------------------------------- |
514 | m4_define([_PKG_CONFIG], |
515 | -[if test -n "$PKG_CONFIG"; then |
516 | - if test -n "$$1"; then |
517 | - pkg_cv_[]$1="$$1" |
518 | - else |
519 | - PKG_CHECK_EXISTS([$3], |
520 | - [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null | sed 's/-I/-isystem/g' `], |
521 | - [pkg_failed=yes]) |
522 | - if test "$GCC" = "yes"; then |
523 | - pkg_cv_[]$1=`echo $pkg_cv_[]$1 | sed 's/-I/-isystem/g' ` |
524 | - fi |
525 | - fi |
526 | -else |
527 | - pkg_failed=untried |
528 | +[if test -n "$$1"; then |
529 | + pkg_cv_[]$1="$$1" |
530 | + elif test -n "$PKG_CONFIG"; then |
531 | + PKG_CHECK_EXISTS([$3], |
532 | + [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`], |
533 | + [pkg_failed=yes]) |
534 | + else |
535 | + pkg_failed=untried |
536 | fi[]dnl |
537 | ])# _PKG_CONFIG |
538 | |
539 | @@ -120,16 +117,17 @@ |
540 | See the pkg-config man page for more details.]) |
541 | |
542 | if test $pkg_failed = yes; then |
543 | + AC_MSG_RESULT([no]) |
544 | _PKG_SHORT_ERRORS_SUPPORTED |
545 | if test $_pkg_short_errors_supported = yes; then |
546 | - $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --errors-to-stdout --print-errors "$2"` |
547 | + $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "$2" 2>&1` |
548 | else |
549 | - $1[]_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "$2"` |
550 | + $1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors "$2" 2>&1` |
551 | fi |
552 | # Put the nasty error message in config.log where it belongs |
553 | echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD |
554 | |
555 | - ifelse([$4], , [AC_MSG_ERROR(dnl |
556 | + m4_default([$4], [AC_MSG_ERROR( |
557 | [Package requirements ($2) were not met: |
558 | |
559 | $$1_PKG_ERRORS |
560 | @@ -137,24 +135,23 @@ |
561 | Consider adjusting the PKG_CONFIG_PATH environment variable if you |
562 | installed software in a non-standard prefix. |
563 | |
564 | -_PKG_TEXT |
565 | -])], |
566 | - [AC_MSG_RESULT([no]) |
567 | - $4]) |
568 | +_PKG_TEXT]) |
569 | + ]) |
570 | elif test $pkg_failed = untried; then |
571 | - ifelse([$4], , [AC_MSG_FAILURE(dnl |
572 | + AC_MSG_RESULT([no]) |
573 | + m4_default([$4], [AC_MSG_FAILURE( |
574 | [The pkg-config script could not be found or is too old. Make sure it |
575 | is in your PATH or set the PKG_CONFIG environment variable to the full |
576 | path to pkg-config. |
577 | |
578 | _PKG_TEXT |
579 | |
580 | -To get pkg-config, see <http://pkg-config.freedesktop.org/>.])], |
581 | - [$4]) |
582 | +To get pkg-config, see <http://pkg-config.freedesktop.org/>.]) |
583 | + ]) |
584 | else |
585 | $1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS |
586 | $1[]_LIBS=$pkg_cv_[]$1[]_LIBS |
587 | AC_MSG_RESULT([yes]) |
588 | - ifelse([$3], , :, [$3]) |
589 | + $3 |
590 | fi[]dnl |
591 | ])# PKG_CHECK_MODULES |
592 | |
593 | === modified file 'win32/include.am' |
594 | --- win32/include.am 2011-11-04 21:06:16 +0000 |
595 | +++ win32/include.am 2012-01-30 06:09:24 +0000 |
596 | @@ -19,8 +19,7 @@ |
597 | |
598 | |
599 | if BUILD_WIN32 |
600 | -libdrizzle_2_0_libdrizzle_2_0_la_SOURCES+= win32/conn_uds.cc |
601 | -libdrizzle_1_0_libdrizzle_la_SOURCES+= win32/conn_uds.c |
602 | +libdrizzle_1_0_libdrizzle_la_SOURCES+= win32/conn_uds.cc |
603 | endif |
604 | |
605 | noinst_HEADERS+= \ |