Compiling contrib/uuid-ossp on my Debian laptop failed, because
apparently on Debian the uuid.h header is installed as ossp/uuid.h.
That's probably to avoid confusion with other UUID implementations;
there's at least one included with e2fsprogs, but fortunately the header
file for that is called uuid/uuid.h.

Attached is a patch that adds some autoconf magic to deal with that. I'm
testing ossp/uuid.h first, because presumably if that exists it's the
right one, while I suspect there might be other files called just uuid.h
on other systems that are not the same thing.

-- 
  Heikki Linnakangas
  EnterpriseDB   http://www.enterprisedb.com
Index: configure.in
===================================================================
RCS file: /home/hlinnaka/pgcvsrepository/pgsql/configure.in,v
retrieving revision 1.529
diff -c -r1.529 configure.in
*** configure.in	5 Oct 2007 02:55:41 -0000	1.529
--- configure.in	23 Oct 2007 16:09:21 -0000
***************
*** 899,904 ****
--- 899,911 ----
    AC_CHECK_HEADER(DNSServiceDiscovery/DNSServiceDiscovery.h, [], [AC_MSG_ERROR([header file <DNSServiceDiscovery/DNSServiceDiscovery.h> is required for Bonjour])])
  fi
  
+ # for contrib/uuid-ossp
+ if test "$with_ossp_uuid" = yes ; then
+   AC_CHECK_HEADERS(ossp/uuid.h, [], [
+     AC_CHECK_HEADERS(uuid.h, [],
+       [AC_MSG_ERROR([header file <ossp/uuid.h> or <uuid.h> is required for OSSP-UUID])])])
+ fi
+ 
  
  ##
  ## Types, structures, compiler characteristics
Index: contrib/uuid-ossp/uuid-ossp.c
===================================================================
RCS file: /home/hlinnaka/pgcvsrepository/pgsql/contrib/uuid-ossp/uuid-ossp.c,v
retrieving revision 1.2
diff -c -r1.2 uuid-ossp.c
*** contrib/uuid-ossp/uuid-ossp.c	15 May 2007 19:47:51 -0000	1.2
--- contrib/uuid-ossp/uuid-ossp.c	23 Oct 2007 16:20:09 -0000
***************
*** 14,21 ****
  #include "utils/builtins.h"
  #include "utils/uuid.h"
  
! #include <uuid.h>
! 
  
  /* better both be 16 */
  #if (UUID_LEN != UUID_LEN_BIN)
--- 14,35 ----
  #include "utils/builtins.h"
  #include "utils/uuid.h"
  
! /*
!  * There's some confusion over the location of the uuid.h header file.
!  * On Debian, it's installed as ossp/uuid.h, while on Fedora, or if you
!  * install ossp-uuid from a tarball, it's installed as uuid.h. Don't know
!  * what other systems do.
!  */
! 
! #ifdef HAVE_OSSP_UUID_H
! # include <ossp/uuid.h>
! #else
! # ifdef HAVE_UUID_H
! #  include <uuid.h>
! # else
! #  error OSSP uuid.h not found
! # endif
! #endif
  
  /* better both be 16 */
  #if (UUID_LEN != UUID_LEN_BIN)
Index: src/include/pg_config.h.in
===================================================================
RCS file: /home/hlinnaka/pgcvsrepository/pgsql/src/include/pg_config.h.in,v
retrieving revision 1.123
diff -c -r1.123 pg_config.h.in
*** src/include/pg_config.h.in	2 Oct 2007 00:25:20 -0000	1.123
--- src/include/pg_config.h.in	23 Oct 2007 16:16:59 -0000
***************
*** 302,307 ****
--- 302,310 ----
  /* Define to 1 if you have the `on_exit' function. */
  #undef HAVE_ON_EXIT
  
+ /* Define to 1 if you have the <ossp/uuid.h> header file. */
+ #undef HAVE_OSSP_UUID_H
+ 
  /* Define to 1 if you have the <pam/pam_appl.h> header file. */
  #undef HAVE_PAM_PAM_APPL_H
  
***************
*** 562,567 ****
--- 565,573 ----
  /* Define to 1 if you have the <utime.h> header file. */
  #undef HAVE_UTIME_H
  
+ /* Define to 1 if you have the <uuid.h> header file. */
+ #undef HAVE_UUID_H
+ 
  /* Define to 1 if you have the `vsnprintf' function. */
  #undef HAVE_VSNPRINTF
  
---------------------------(end of broadcast)---------------------------
TIP 7: You can help support the PostgreSQL project by donating at

                http://www.postgresql.org/about/donate

Reply via email to