Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 07d0a37

Browse files
committed
Make configure probe for the location of the <uuid.h> header file.
Needed to accommodate different layout on some platforms (Debian for one). Heikki Linnakangas
1 parent dbaec70 commit 07d0a37

File tree

4 files changed

+339
-3
lines changed

4 files changed

+339
-3
lines changed

configure

+310
Original file line numberDiff line numberDiff line change
@@ -12123,6 +12123,316 @@ echo "$as_me: error: header file <DNSServiceDiscovery/DNSServiceDiscovery.h> is
1212312123
fi
1212412124

1212512125

12126+
fi
12127+
12128+
# for contrib/uuid-ossp
12129+
if test "$with_ossp_uuid" = yes ; then
12130+
12131+
for ac_header in ossp/uuid.h
12132+
do
12133+
as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
12134+
if eval "test \"\${$as_ac_Header+set}\" = set"; then
12135+
echo "$as_me:$LINENO: checking for $ac_header" >&5
12136+
echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
12137+
if eval "test \"\${$as_ac_Header+set}\" = set"; then
12138+
echo $ECHO_N "(cached) $ECHO_C" >&6
12139+
fi
12140+
echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
12141+
echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
12142+
else
12143+
# Is the header compilable?
12144+
echo "$as_me:$LINENO: checking $ac_header usability" >&5
12145+
echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6
12146+
cat >conftest.$ac_ext <<_ACEOF
12147+
/* confdefs.h. */
12148+
_ACEOF
12149+
cat confdefs.h >>conftest.$ac_ext
12150+
cat >>conftest.$ac_ext <<_ACEOF
12151+
/* end confdefs.h. */
12152+
$ac_includes_default
12153+
#include <$ac_header>
12154+
_ACEOF
12155+
rm -f conftest.$ac_objext
12156+
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
12157+
(eval $ac_compile) 2>conftest.er1
12158+
ac_status=$?
12159+
grep -v '^ *+' conftest.er1 >conftest.err
12160+
rm -f conftest.er1
12161+
cat conftest.err >&5
12162+
echo "$as_me:$LINENO: \$? = $ac_status" >&5
12163+
(exit $ac_status); } &&
12164+
{ ac_try='test -z "$ac_c_werror_flag"
12165+
|| test ! -s conftest.err'
12166+
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
12167+
(eval $ac_try) 2>&5
12168+
ac_status=$?
12169+
echo "$as_me:$LINENO: \$? = $ac_status" >&5
12170+
(exit $ac_status); }; } &&
12171+
{ ac_try='test -s conftest.$ac_objext'
12172+
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
12173+
(eval $ac_try) 2>&5
12174+
ac_status=$?
12175+
echo "$as_me:$LINENO: \$? = $ac_status" >&5
12176+
(exit $ac_status); }; }; then
12177+
ac_header_compiler=yes
12178+
else
12179+
echo "$as_me: failed program was:" >&5
12180+
sed 's/^/| /' conftest.$ac_ext >&5
12181+
12182+
ac_header_compiler=no
12183+
fi
12184+
rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
12185+
echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
12186+
echo "${ECHO_T}$ac_header_compiler" >&6
12187+
12188+
# Is the header present?
12189+
echo "$as_me:$LINENO: checking $ac_header presence" >&5
12190+
echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6
12191+
cat >conftest.$ac_ext <<_ACEOF
12192+
/* confdefs.h. */
12193+
_ACEOF
12194+
cat confdefs.h >>conftest.$ac_ext
12195+
cat >>conftest.$ac_ext <<_ACEOF
12196+
/* end confdefs.h. */
12197+
#include <$ac_header>
12198+
_ACEOF
12199+
if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
12200+
(eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
12201+
ac_status=$?
12202+
grep -v '^ *+' conftest.er1 >conftest.err
12203+
rm -f conftest.er1
12204+
cat conftest.err >&5
12205+
echo "$as_me:$LINENO: \$? = $ac_status" >&5
12206+
(exit $ac_status); } >/dev/null; then
12207+
if test -s conftest.err; then
12208+
ac_cpp_err=$ac_c_preproc_warn_flag
12209+
ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
12210+
else
12211+
ac_cpp_err=
12212+
fi
12213+
else
12214+
ac_cpp_err=yes
12215+
fi
12216+
if test -z "$ac_cpp_err"; then
12217+
ac_header_preproc=yes
12218+
else
12219+
echo "$as_me: failed program was:" >&5
12220+
sed 's/^/| /' conftest.$ac_ext >&5
12221+
12222+
ac_header_preproc=no
12223+
fi
12224+
rm -f conftest.err conftest.$ac_ext
12225+
echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
12226+
echo "${ECHO_T}$ac_header_preproc" >&6
12227+
12228+
# So? What about this header?
12229+
case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
12230+
yes:no: )
12231+
{ echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
12232+
echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
12233+
{ echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
12234+
echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
12235+
ac_header_preproc=yes
12236+
;;
12237+
no:yes:* )
12238+
{ echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
12239+
echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
12240+
{ echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5
12241+
echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;}
12242+
{ echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
12243+
echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
12244+
{ echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5
12245+
echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;}
12246+
{ echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
12247+
echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
12248+
{ echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
12249+
echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
12250+
(
12251+
cat <<\_ASBOX
12252+
## ---------------------------------------- ##
12253+
## Report this to pgsql-bugs@postgresql.org ##
12254+
## ---------------------------------------- ##
12255+
_ASBOX
12256+
) |
12257+
sed "s/^/$as_me: WARNING: /" >&2
12258+
;;
12259+
esac
12260+
echo "$as_me:$LINENO: checking for $ac_header" >&5
12261+
echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
12262+
if eval "test \"\${$as_ac_Header+set}\" = set"; then
12263+
echo $ECHO_N "(cached) $ECHO_C" >&6
12264+
else
12265+
eval "$as_ac_Header=\$ac_header_preproc"
12266+
fi
12267+
echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
12268+
echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
12269+
12270+
fi
12271+
if test `eval echo '${'$as_ac_Header'}'` = yes; then
12272+
cat >>confdefs.h <<_ACEOF
12273+
#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
12274+
_ACEOF
12275+
12276+
else
12277+
12278+
12279+
for ac_header in uuid.h
12280+
do
12281+
as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
12282+
if eval "test \"\${$as_ac_Header+set}\" = set"; then
12283+
echo "$as_me:$LINENO: checking for $ac_header" >&5
12284+
echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
12285+
if eval "test \"\${$as_ac_Header+set}\" = set"; then
12286+
echo $ECHO_N "(cached) $ECHO_C" >&6
12287+
fi
12288+
echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
12289+
echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
12290+
else
12291+
# Is the header compilable?
12292+
echo "$as_me:$LINENO: checking $ac_header usability" >&5
12293+
echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6
12294+
cat >conftest.$ac_ext <<_ACEOF
12295+
/* confdefs.h. */
12296+
_ACEOF
12297+
cat confdefs.h >>conftest.$ac_ext
12298+
cat >>conftest.$ac_ext <<_ACEOF
12299+
/* end confdefs.h. */
12300+
$ac_includes_default
12301+
#include <$ac_header>
12302+
_ACEOF
12303+
rm -f conftest.$ac_objext
12304+
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
12305+
(eval $ac_compile) 2>conftest.er1
12306+
ac_status=$?
12307+
grep -v '^ *+' conftest.er1 >conftest.err
12308+
rm -f conftest.er1
12309+
cat conftest.err >&5
12310+
echo "$as_me:$LINENO: \$? = $ac_status" >&5
12311+
(exit $ac_status); } &&
12312+
{ ac_try='test -z "$ac_c_werror_flag"
12313+
|| test ! -s conftest.err'
12314+
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
12315+
(eval $ac_try) 2>&5
12316+
ac_status=$?
12317+
echo "$as_me:$LINENO: \$? = $ac_status" >&5
12318+
(exit $ac_status); }; } &&
12319+
{ ac_try='test -s conftest.$ac_objext'
12320+
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
12321+
(eval $ac_try) 2>&5
12322+
ac_status=$?
12323+
echo "$as_me:$LINENO: \$? = $ac_status" >&5
12324+
(exit $ac_status); }; }; then
12325+
ac_header_compiler=yes
12326+
else
12327+
echo "$as_me: failed program was:" >&5
12328+
sed 's/^/| /' conftest.$ac_ext >&5
12329+
12330+
ac_header_compiler=no
12331+
fi
12332+
rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
12333+
echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
12334+
echo "${ECHO_T}$ac_header_compiler" >&6
12335+
12336+
# Is the header present?
12337+
echo "$as_me:$LINENO: checking $ac_header presence" >&5
12338+
echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6
12339+
cat >conftest.$ac_ext <<_ACEOF
12340+
/* confdefs.h. */
12341+
_ACEOF
12342+
cat confdefs.h >>conftest.$ac_ext
12343+
cat >>conftest.$ac_ext <<_ACEOF
12344+
/* end confdefs.h. */
12345+
#include <$ac_header>
12346+
_ACEOF
12347+
if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
12348+
(eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
12349+
ac_status=$?
12350+
grep -v '^ *+' conftest.er1 >conftest.err
12351+
rm -f conftest.er1
12352+
cat conftest.err >&5
12353+
echo "$as_me:$LINENO: \$? = $ac_status" >&5
12354+
(exit $ac_status); } >/dev/null; then
12355+
if test -s conftest.err; then
12356+
ac_cpp_err=$ac_c_preproc_warn_flag
12357+
ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
12358+
else
12359+
ac_cpp_err=
12360+
fi
12361+
else
12362+
ac_cpp_err=yes
12363+
fi
12364+
if test -z "$ac_cpp_err"; then
12365+
ac_header_preproc=yes
12366+
else
12367+
echo "$as_me: failed program was:" >&5
12368+
sed 's/^/| /' conftest.$ac_ext >&5
12369+
12370+
ac_header_preproc=no
12371+
fi
12372+
rm -f conftest.err conftest.$ac_ext
12373+
echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
12374+
echo "${ECHO_T}$ac_header_preproc" >&6
12375+
12376+
# So? What about this header?
12377+
case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
12378+
yes:no: )
12379+
{ echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
12380+
echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
12381+
{ echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
12382+
echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
12383+
ac_header_preproc=yes
12384+
;;
12385+
no:yes:* )
12386+
{ echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
12387+
echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
12388+
{ echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5
12389+
echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;}
12390+
{ echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
12391+
echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
12392+
{ echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5
12393+
echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;}
12394+
{ echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
12395+
echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
12396+
{ echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
12397+
echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
12398+
(
12399+
cat <<\_ASBOX
12400+
## ---------------------------------------- ##
12401+
## Report this to pgsql-bugs@postgresql.org ##
12402+
## ---------------------------------------- ##
12403+
_ASBOX
12404+
) |
12405+
sed "s/^/$as_me: WARNING: /" >&2
12406+
;;
12407+
esac
12408+
echo "$as_me:$LINENO: checking for $ac_header" >&5
12409+
echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
12410+
if eval "test \"\${$as_ac_Header+set}\" = set"; then
12411+
echo $ECHO_N "(cached) $ECHO_C" >&6
12412+
else
12413+
eval "$as_ac_Header=\$ac_header_preproc"
12414+
fi
12415+
echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
12416+
echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
12417+
12418+
fi
12419+
if test `eval echo '${'$as_ac_Header'}'` = yes; then
12420+
cat >>confdefs.h <<_ACEOF
12421+
#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
12422+
_ACEOF
12423+
12424+
else
12425+
{ { echo "$as_me:$LINENO: error: header file <ossp/uuid.h> or <uuid.h> is required for OSSP-UUID" >&5
12426+
echo "$as_me: error: header file <ossp/uuid.h> or <uuid.h> is required for OSSP-UUID" >&2;}
12427+
{ (exit 1); exit 1; }; }
12428+
fi
12429+
12430+
done
12431+
12432+
fi
12433+
12434+
done
12435+
1212612436
fi
1212712437

1212812438

configure.in

+8-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
dnl Process this file with autoconf to produce a configure script.
2-
dnl $PostgreSQL: pgsql/configure.in,v 1.529 2007/10/05 02:55:41 scrappy Exp $
2+
dnl $PostgreSQL: pgsql/configure.in,v 1.530 2007/10/23 21:38:16 tgl Exp $
33
dnl
44
dnl Developers, please strive to achieve this order:
55
dnl
@@ -899,6 +899,13 @@ if test "$with_bonjour" = yes ; then
899899
AC_CHECK_HEADER(DNSServiceDiscovery/DNSServiceDiscovery.h, [], [AC_MSG_ERROR([header file <DNSServiceDiscovery/DNSServiceDiscovery.h> is required for Bonjour])])
900900
fi
901901

902+
# for contrib/uuid-ossp
903+
if test "$with_ossp_uuid" = yes ; then
904+
AC_CHECK_HEADERS(ossp/uuid.h, [], [
905+
AC_CHECK_HEADERS(uuid.h, [],
906+
[AC_MSG_ERROR([header file <ossp/uuid.h> or <uuid.h> is required for OSSP-UUID])])])
907+
fi
908+
902909

903910
##
904911
## Types, structures, compiler characteristics

contrib/uuid-ossp/uuid-ossp.c

+15-2
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
*
55
* Copyright (c) 2007 PostgreSQL Global Development Group
66
*
7-
* $PostgreSQL: pgsql/contrib/uuid-ossp/uuid-ossp.c,v 1.2 2007/05/15 19:47:51 adunstan Exp $
7+
* $PostgreSQL: pgsql/contrib/uuid-ossp/uuid-ossp.c,v 1.3 2007/10/23 21:38:16 tgl Exp $
88
*
99
*-------------------------------------------------------------------------
1010
*/
@@ -14,8 +14,21 @@
1414
#include "utils/builtins.h"
1515
#include "utils/uuid.h"
1616

17+
/*
18+
* There's some confusion over the location of the uuid.h header file.
19+
* On Debian, it's installed as ossp/uuid.h, while on Fedora, or if you
20+
* install ossp-uuid from a tarball, it's installed as uuid.h. Don't know
21+
* what other systems do.
22+
*/
23+
#ifdef HAVE_OSSP_UUID_H
24+
#include <ossp/uuid.h>
25+
#else
26+
#ifdef HAVE_UUID_H
1727
#include <uuid.h>
18-
28+
#else
29+
#error OSSP uuid.h not found
30+
#endif
31+
#endif
1932

2033
/* better both be 16 */
2134
#if (UUID_LEN != UUID_LEN_BIN)

src/include/pg_config.h.in

+6
Original file line numberDiff line numberDiff line change
@@ -302,6 +302,9 @@
302302
/* Define to 1 if you have the `on_exit' function. */
303303
#undef HAVE_ON_EXIT
304304

305+
/* Define to 1 if you have the <ossp/uuid.h> header file. */
306+
#undef HAVE_OSSP_UUID_H
307+
305308
/* Define to 1 if you have the <pam/pam_appl.h> header file. */
306309
#undef HAVE_PAM_PAM_APPL_H
307310

@@ -562,6 +565,9 @@
562565
/* Define to 1 if you have the <utime.h> header file. */
563566
#undef HAVE_UTIME_H
564567

568+
/* Define to 1 if you have the <uuid.h> header file. */
569+
#undef HAVE_UUID_H
570+
565571
/* Define to 1 if you have the `vsnprintf' function. */
566572
#undef HAVE_VSNPRINTF
567573

0 commit comments

Comments
 (0)