summaryrefslogtreecommitdiff
path: root/configure
diff options
context:
space:
mode:
authorTom Lane2012-10-08 01:52:07 +0000
committerTom Lane2012-10-08 01:52:43 +0000
commit95d035e66d8e4371d35830d81f39face03cd4c45 (patch)
tree450c4e30491bd17f6499e8a33c094f9353238f79 /configure
parentea72bb8ae527d371ccaf53647540a33224df92a6 (diff)
Autoconfiscate selection of 64-bit int type for 64-bit large object API.
Get rid of the fundamentally indefensible assumption that "long long int" exists and is exactly 64 bits wide on every platform Postgres runs on. Instead let the configure script select the type to use for "pg_int64". This is a bit of a pain in the rear since we do not want to pollute client namespace with all the random symbols that pg_config.h defines; instead we have to create a separate generated header file, "pg_config_ext.h". But now that the infrastructure is there, we might have the ability to add some other stuff that's long been wanting in this area.
Diffstat (limited to 'configure')
-rwxr-xr-xconfigure21
1 files changed, 19 insertions, 2 deletions
diff --git a/configure b/configure
index c6dcc8bfaaf..b20df66363a 100755
--- a/configure
+++ b/configure
@@ -24238,7 +24238,9 @@ _ACEOF
fi
-if test x"$HAVE_LONG_INT_64" = x"no" ; then
+if test x"$HAVE_LONG_INT_64" = x"yes" ; then
+ pg_int64_type="long int"
+else
{ $as_echo "$as_me:$LINENO: checking whether long long int is 64 bits" >&5
$as_echo_n "checking whether long long int is 64 bits... " >&6; }
if test "${pgac_cv_type_long_long_int_64+set}" = set; then
@@ -24374,7 +24376,9 @@ _ACEOF
fi
- if test x"$HAVE_LONG_LONG_INT_64" = x"no" ; then
+ if test x"$HAVE_LONG_LONG_INT_64" = x"yes" ; then
+ pg_int64_type="long long int"
+ else
{ { $as_echo "$as_me:$LINENO: error: Cannot find a working 64-bit integer type." >&5
$as_echo "$as_me: error: Cannot find a working 64-bit integer type." >&2;}
{ (exit 1); exit 1; }; }
@@ -24382,6 +24386,11 @@ $as_echo "$as_me: error: Cannot find a working 64-bit integer type." >&2;}
fi
+cat >>confdefs.h <<_ACEOF
+#define PG_INT64_TYPE $pg_int64_type
+_ACEOF
+
+
if test x"$HAVE_LONG_LONG_INT_64" = xyes ; then
cat >conftest.$ac_ext <<_ACEOF
@@ -29930,6 +29939,9 @@ fi
ac_config_headers="$ac_config_headers src/include/pg_config.h"
+ac_config_headers="$ac_config_headers src/include/pg_config_ext.h"
+
+
ac_config_headers="$ac_config_headers src/interfaces/ecpg/include/ecpg_config.h"
@@ -30550,6 +30562,7 @@ do
"src/Makefile.port") CONFIG_LINKS="$CONFIG_LINKS src/Makefile.port:src/makefiles/Makefile.${template}" ;;
"check_win32_symlinks") CONFIG_COMMANDS="$CONFIG_COMMANDS check_win32_symlinks" ;;
"src/include/pg_config.h") CONFIG_HEADERS="$CONFIG_HEADERS src/include/pg_config.h" ;;
+ "src/include/pg_config_ext.h") CONFIG_HEADERS="$CONFIG_HEADERS src/include/pg_config_ext.h" ;;
"src/interfaces/ecpg/include/ecpg_config.h") CONFIG_HEADERS="$CONFIG_HEADERS src/interfaces/ecpg/include/ecpg_config.h" ;;
*) { { $as_echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5
@@ -31221,6 +31234,10 @@ $as_echo "$as_me: WARNING: *** link for $FILE -- please fix by hand" >&2;}
# Update timestamp for pg_config.h (see Makefile.global)
echo >src/include/stamp-h
;;
+ "src/include/pg_config_ext.h":H)
+# Update timestamp for pg_config_ext.h (see Makefile.global)
+echo >src/include/stamp-ext-h
+ ;;
"src/interfaces/ecpg/include/ecpg_config.h":H) echo >src/interfaces/ecpg/include/stamp-h ;;
esac