summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2016-12-22 11:19:04 -0500
committerTom Lane <tgl@sss.pgh.pa.us>2016-12-22 11:19:13 -0500
commit60ad2ff586b1bb37930460f4fbba9e4a1c83ded1 (patch)
treeeeb9872be5fca1b27cdfc101a2b99612e27e1325
parentfd2a5547c523768b662cd2ea056080ad16c9f23f (diff)
Give a useful error message if uuid-ossp is built without preconfiguration.
Before commit b8cc8f947, it was possible to build contrib/uuid-ossp without having told configure you meant to; you could just cd into that directory and "make". That no longer works because the code depends on configure to have done header and library probes, but the ensuing error messages are not so easy to interpret if you're not an old C hand. We've gotten a couple of complaints recently from people trying to do this the low-tech way, so add an explicit #error directing the user to use --with-uuid. (In principle we might want to do something similar in the other optionally-built contrib modules; but I don't think any of the others have ever worked without preconfiguration, so there are no bad habits to break people of.) Back-patch to 9.4 where the previous commit came in. Report: https://postgr.es/m/CAHeEsBf42AWTnk=1qJvFv+mYgRFm07Knsfuc86Ono8nRjf3tvQ@mail.gmail.com Report: https://postgr.es/m/CAKYdkBrUaZX+F6KpmzoHqMtiUqCtAW_w6Dgvr6F0WTiopuGxow@mail.gmail.com
-rw-r--r--contrib/uuid-ossp/uuid-ossp.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/contrib/uuid-ossp/uuid-ossp.c b/contrib/uuid-ossp/uuid-ossp.c
index 5d00f392ccc..fca39d79378 100644
--- a/contrib/uuid-ossp/uuid-ossp.c
+++ b/contrib/uuid-ossp/uuid-ossp.c
@@ -30,14 +30,14 @@
*/
#define uuid_hash bsd_uuid_hash
-#ifdef HAVE_UUID_H
+#if defined(HAVE_UUID_H)
#include <uuid.h>
-#endif
-#ifdef HAVE_OSSP_UUID_H
+#elif defined(HAVE_OSSP_UUID_H)
#include <ossp/uuid.h>
-#endif
-#ifdef HAVE_UUID_UUID_H
+#elif defined(HAVE_UUID_UUID_H)
#include <uuid/uuid.h>
+#else
+#error "please use configure's --with-uuid switch to select a UUID library"
#endif
#undef uuid_hash