Changeset: b9b9abe42004 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=b9b9abe42004
Modified Files:
        configure.ag
        sql/src/backends/monet5/merovingian/utils/Makefile.ag
        sql/src/backends/monet5/merovingian/utils/utils.c
Branch: default
Log Message:

uuid: only link against uuid when this is necessary

Make AC_CHECK_HEADERS list easily editable, check and define libs for
uuid in UUID_LIBS such that we don't try to link everything against
-luuid on platforms that don't have uuid in their libc.


diffs (106 lines):

diff -r 8a1be7a26624 -r b9b9abe42004 configure.ag
--- a/configure.ag      Mon Jan 10 14:00:04 2011 +0100
+++ b/configure.ag      Mon Jan 10 14:33:43 2011 +0100
@@ -609,6 +609,13 @@
 
 AM_ICONV
 
+save_LIBS="$LIBS"
+LIBS=
+AC_SEARCH_LIBS([uuid_generate], [uuid], [AC_DEFINE([HAVE_UUID], 1, [uuid])])
+UUID_LIBS="$LIBS"
+LIBS="$save_LIBS"
+AC_SUBST(UUID_LIBS)
+
 dnl OpenSSL library
 dnl required for MonetDB5 (and SQL), optional otherwise
 PKG_CHECK_EXISTS([openssl >= 0.9.8f], [have_openssl=yes], [have_openssl=no])
@@ -1143,11 +1150,51 @@
 AC_HEADER_TIME
 AC_HEADER_DIRENT
 # NOTE: these header files are in alphabetical order to ease maintenance
-AC_CHECK_HEADERS([crypt.h dlfcn.h fcntl.h getopt.h iconv.h ieeefp.h io.h 
langinfo.h libgen.h libintl.h limits.h locale.h malloc.h netdb.h procfs.h pwd.h 
regex.h rlimit.h signal.h stddef.h stdint.h string.h strings.h stropts.h 
sys/file.h sys/ioctl.h sys/mman.h sys/param.h sys/resource.h sys/socket.h 
sys/sysctl.h sys/time.h sys/times.h sys/types.h sys/un.h sys/utime.h sys/wait.h 
termios.h time.h unistd.h utime.h winsock.h xmmintrin.h])
-AC_CHECK_HEADERS([uuid/uuid.h],
-         AC_SEARCH_LIBS([uuid_generate], [uuid],
-                [AC_DEFINE([HAVE_UUID], 1,
-                       [Define when uuid_* is available and linkable on this 
system])]))
+AC_CHECK_HEADERS([crypt.h \
+                                 dlfcn.h \
+                                 fcntl.h \
+                                 getopt.h \
+                                 iconv.h \
+                                 ieeefp.h \
+                                 io.h \
+                                 langinfo.h \
+                                 libgen.h \
+                                 libintl.h \
+                                 limits.h \
+                                 locale.h \
+                                 malloc.h \
+                                 netdb.h \
+                                 procfs.h \
+                                 pwd.h \
+                                 regex.h \
+                                 rlimit.h \
+                                 signal.h \
+                                 stddef.h \
+                                 stdint.h \
+                                 string.h \
+                                 strings.h \
+                                 stropts.h \
+                                 sys/file.h \
+                                 sys/ioctl.h \
+                                 sys/mman.h \
+                                 sys/param.h \
+                                 sys/resource.h \
+                                 sys/socket.h \
+                                 sys/sysctl.h \
+                                 sys/time.h \
+                                 sys/times.h \
+                                 sys/types.h \
+                                 sys/un.h \
+                                 sys/utime.h \
+                                 sys/wait.h \
+                                 termios.h \
+                                 time.h \
+                                 unistd.h \
+                                 utime.h \
+                                 uuid/uuid.h \
+                                 winsock.h \
+                                 xmmintrin.h \
+                                 ])
 
 AC_LANG_PUSH([C++])
 AC_CHECK_HEADER(iostream,
diff -r 8a1be7a26624 -r b9b9abe42004 
sql/src/backends/monet5/merovingian/utils/Makefile.ag
--- a/sql/src/backends/monet5/merovingian/utils/Makefile.ag     Mon Jan 10 
14:00:04 2011 +0100
+++ b/sql/src/backends/monet5/merovingian/utils/Makefile.ag     Mon Jan 10 
14:33:43 2011 +0100
@@ -37,6 +37,7 @@
 
 lib_meroutil = {
        NOINST
+       LIBS = $(UUID_LIBS)
        SOURCES = \
                control.c \
                database.c \
diff -r 8a1be7a26624 -r b9b9abe42004 
sql/src/backends/monet5/merovingian/utils/utils.c
--- a/sql/src/backends/monet5/merovingian/utils/utils.c Mon Jan 10 14:00:04 
2011 +0100
+++ b/sql/src/backends/monet5/merovingian/utils/utils.c Mon Jan 10 14:33:43 
2011 +0100
@@ -33,7 +33,7 @@
 #include <string.h> /* memcpy */
 #include <strings.h> /* strcasecmp */
 #include <gdk.h> /* GDKmalloc */
-#ifdef HAVE_UUID
+#ifdef HAVE_UUID_UUID_H
 #include <uuid/uuid.h>
 #endif
 
@@ -345,7 +345,7 @@
 char *
 generateUUID(void)
 {
-#ifdef HAVE_UUID
+#ifdef HAVE_UUID_UUID_H
 # ifdef UUID_PRINTABLE_STRING_LENGTH
        /* Solaris */
        char out[UUID_PRINTABLE_STRING_LENGTH];
_______________________________________________
Checkin-list mailing list
[email protected]
http://mail.monetdb.org/mailman/listinfo/checkin-list

Reply via email to