@@ -224,107 +224,124 @@ if test "$LIBRARY_DIRS" -o "$SRCH_LIB"; then
224
224
done
225
225
fi
226
226
227
+ ##
228
+ ## Command line options
229
+ ##
227
230
228
- AC_MSG_CHECKING(whether to support locale)
229
- AC_ARG_ENABLE(
230
- locale,
231
- [ --enable-locale enable locale support ],
232
- [AC_DEFINE(USE_LOCALE) AC_MSG_RESULT(enabled)],
233
- AC_MSG_RESULT(disabled)
234
- )
235
231
236
- dnl We exclude cyrillic recode support unless we override it with
237
- dnl --enable-recode to explicitly enable it
238
- dnl It defaults to disabled
239
- AC_MSG_CHECKING(whether to support cyrillic recode)
240
- AC_ARG_ENABLE(
241
- recode,
242
- [ --enable-recode enable cyrillic recode support ],
243
- [AC_DEFINE(CYR_RECODE) AC_MSG_RESULT(enabled)],
244
- AC_MSG_RESULT(disabled)
245
- )
232
+ #
233
+ # Locale (--enable-locale)
234
+ #
235
+ AC_MSG_CHECKING([whether to build with locale support])
236
+ AC_ARG_ENABLE(locale, [ --enable-locale enable locale support],
237
+ [if test x"$enable_locale" != x"no" ; then
238
+ enable_locale=yes
239
+ AC_DEFINE(USE_LOCALE, [], [Set to 1 if you want LOCALE support (--enable-locale)])
240
+ fi],
241
+ [enable_locale=no])
242
+ AC_MSG_RESULT([$enable_locale])
246
243
247
- dnl Multibyte support
248
244
249
- AC_MSG_CHECKING(whether to support multibyte)
250
- AC_ARG_ENABLE(multibyte,
251
- [ --enable-multibyte enable multibyte character support ],
252
- [
253
- MULTIBYTE=SQL_ASCII
254
- if test "$enableval" != "yes"; then
255
- case "$enableval" in
256
- SQL_ASCII|EUC_JP|EUC_CN|EUC_KR|EUC_TW|UNICODE|MULE_INTERNAL|LATIN1|LATIN2|LATIN3|LATIN4|LATIN5|KOI8|WIN|ALT)
257
- # ok
258
- ;;
259
- *)
260
- AC_MSG_ERROR(
261
- [Argument to --enable-multibyte must be one of:
245
+ #
246
+ # Cyrillic recode (--enable-recode)
247
+ #
248
+ AC_MSG_CHECKING([whether to build with Cyrillic recode support])
249
+ AC_ARG_ENABLE(recode, [ --enable-recode enable cyrillic recode support],
250
+ [if test x"$enable_recode" != x"no" ; then
251
+ enable_recode=yes
252
+ AC_DEFINE(CYR_RECODE, [], [Set to 1 if you want cyrillic recode support (--enable-recode)])
253
+ fi],
254
+ [enable_recode=no])
255
+ AC_MSG_RESULT([$enable_recode])
256
+
257
+
258
+ #
259
+ # Multibyte support
260
+ #
261
+ MULTIBYTE=
262
+ AC_MSG_CHECKING([whether to build with multibyte character support])
263
+ AC_ARG_ENABLE(multibyte, [ --enable-multibyte enable multibyte character support],
264
+ [
265
+ case $enableval in
266
+ no) enable_multibyte=no;;
267
+ yes) enable_multibyte=yes; MULTIBYTE=SQL_ASCII;;
268
+ SQL_ASCII|EUC_JP|EUC_CN|EUC_KR|EUC_TW|UNICODE|MULE_INTERNAL|LATIN1|LATIN2|LATIN3|LATIN4|LATIN5|KOI8|WIN|ALT)
269
+ enable_multibyte=yes; MULTIBYTE=$enableval;;
270
+ *) AC_MSG_ERROR(
271
+ [argument to --enable-multibyte must be one of:
262
272
SQL_ASCII, EUC_JP, EUC_CN, EUC_KR, EUC_TW,
263
273
UNICODE, MULE_INTERNAL,
264
274
LATIN1, LATIN2, LATIN3, LATIN4, LATIN5,
265
275
KOI8, WIN, ALT
266
- Or do not specify an argument to the option to use the default.])
267
- esac
268
- MULTIBYTE=$enableval
269
- fi
270
- AC_DEFINE(MULTIBYTE)
271
- AC_MSG_RESULT(enabled)
272
- ],
273
- AC_MSG_RESULT("disabled")
274
- )
276
+ Or do not specify an argument to the option to use the default.]) ;;
277
+ esac
278
+ ],
279
+ [enable_multibyte=no])
280
+
281
+ AC_SUBST(MULTIBYTE)
275
282
276
- dnl Old option variant
277
- if test "${with_mb}"; then
278
- AC_MSG_ERROR([--with-mb is not supported anymore. Use --enable-multibyte instead.])
283
+ if test "$enable_multibyte" = yes ; then
284
+ AC_DEFINE(MULTIBYTE, [], [Set to 1 if you want to use multibyte characters (--enable-multibyte)])
285
+ AC_MSG_RESULT([yes, default $MULTIBYTE])
286
+ else
287
+ AC_MSG_RESULT(no)
279
288
fi
280
289
281
290
282
- dnl We use the default value of 5432 for the DEF_PGPORT value. If
283
- dnl we over-ride it with --with-pgport=port then we bypass this piece
284
- AC_MSG_CHECKING(setting DEF_PGPORT)
285
- AC_ARG_WITH(
286
- pgport,
287
- [ --with-pgport=PORTNUM change default postmaster port ],
288
- [default_port="$withval"],
289
- [default_port=5432]
290
- )
291
- dnl Need both of these because backend wants an integer and frontend a string
291
+ #
292
+ # Default port number (--with-pgport), default 5432
293
+ #
294
+ AC_MSG_CHECKING([for default port number])
295
+ AC_ARG_WITH(pgport, [ --with-pgport=PORTNUM change default port number [5432]],
296
+ [case $withval in
297
+ yes|no) AC_MSG_ERROR([You must supply an argument to the --with-pgport option]);;
298
+ *) default_port=$withval;;
299
+ esac
300
+ ],
301
+ [default_port=5432])
302
+ # Need both of these because backend wants an integer and frontend a string
292
303
AC_DEFINE_UNQUOTED(DEF_PGPORT, ${default_port})
293
304
AC_DEFINE_UNQUOTED(DEF_PGPORT_STR, "${default_port}")
294
- AC_MSG_RESULT(${ default_port} )
305
+ AC_MSG_RESULT([$ default_port] )
295
306
296
307
297
- dnl DEF_MAXBACKENDS can be set by --with-maxbackends. Default value is 32.
298
- AC_MSG_CHECKING(setting DEF_MAXBACKENDS)
299
- AC_ARG_WITH(
300
- maxbackends,
301
- [ --with-maxbackends=N set default maximum number of server processes ],
302
- AC_DEFINE_UNQUOTED(DEF_MAXBACKENDS, ${withval}) AC_MSG_RESULT($with_maxbackends),
303
- AC_DEFINE_UNQUOTED(DEF_MAXBACKENDS, 32) AC_MSG_RESULT(32)
304
- )
308
+ #
309
+ # Maximum number of allowed connections (--with-maxbackends), default 32
310
+ #
311
+ AC_MSG_CHECKING([for default soft limit on number of connections])
312
+ AC_ARG_WITH(maxbackends, [ --with-maxbackends=N set default maximum number of connections [32]],
313
+ [case $withval in
314
+ yes|no) AC_MSG_ERROR([You must supply an argument to the --with-maxbackends option]);;
315
+ esac],
316
+ [with_maxbackends=32])
317
+ AC_MSG_RESULT([$with_maxbackends])
318
+ AC_DEFINE_UNQUOTED(DEF_MAXBACKENDS, [$with_maxbackends], [The default soft limit on the number of concurrent connections, i.e., the default for the postmaster -N switch (--with-maxbackends)])
305
319
306
320
307
- dnl Check for C support (allow override if needed)
308
- dnl Note: actually, setting CC environment variable works just as well.
309
- AC_ARG_WITH(CC,
310
- [ --with-CC=compiler use specific C compiler],
311
- [
312
- case "$withval" in
313
- "" | y | ye | yes | n | no)
314
- AC_MSG_ERROR([*** You must supply an argument to the --with-CC option.])
315
- ;;
316
- esac
317
- CC="$withval"
318
- ])
321
+ #
322
+ # For historical reasons you can also use --with-CC to specify the C compiler
323
+ # to use, although the standard way to do this is to set the CC environment
324
+ # variable.
325
+ #
326
+ if test "${with_CC+set}" = set; then
327
+ case $with_CC in
328
+ yes | no) AC_MSG_ERROR([You must supply an argument to the --with-CC option.]);;
329
+ *) CC=$with_CC;;
330
+ esac
331
+ fi
319
332
320
- dnl Find a compiler if CC is not already set.
333
+
334
+ #
335
+ # C compiler
336
+ #
321
337
AC_PROG_CC
322
- dnl Find CPP, then check traditional.
323
- dnl Caution: these macros must be called in this order...
324
338
AC_PROG_CPP
325
339
AC_PROG_GCC_TRADITIONAL
326
340
AC_SUBST(GCC)
327
341
342
+ #
343
+ # Create compiler version string
344
+ #
328
345
if test x"$GCC" = x"yes" ; then
329
346
cc_string="GCC `${CC} --version`"
330
347
else
@@ -671,7 +688,6 @@ AC_SUBST(DL_LIB)
671
688
AC_SUBST(USE_TCL)
672
689
AC_SUBST(USE_TK)
673
690
AC_SUBST(WISH)
674
- AC_SUBST(MULTIBYTE)
675
691
676
692
677
693
dnl
@@ -748,6 +764,10 @@ AC_PROG_YACC
748
764
AC_SUBST(YFLAGS)
749
765
750
766
767
+ ##
768
+ ## Libraries
769
+ ##
770
+
751
771
AC_CHECK_LIB(sfio, main)
752
772
AC_CHECK_LIB(ncurses, main, [], [AC_CHECK_LIB(curses, main)])
753
773
AC_CHECK_LIB(termcap, main)
@@ -795,31 +815,14 @@ if test "$with_openssl" = yes ; then
795
815
fi
796
816
797
817
798
- dnl
799
- dnl Checks for header files.
800
- dnl
801
- AC_HEADER_STDC
802
- AC_HEADER_SYS_WAIT
803
- AC_CHECK_HEADERS(arpa/inet.h)
804
- AC_CHECK_HEADERS(crypt.h)
805
- AC_CHECK_HEADERS(dld.h)
806
- AC_CHECK_HEADERS(endian.h)
807
- AC_CHECK_HEADERS(float.h)
808
- AC_CHECK_HEADERS(fp_class.h)
809
- AC_CHECK_HEADERS(getopt.h)
810
- AC_CHECK_HEADERS(ieeefp.h)
811
- AC_CHECK_HEADERS(limits.h)
812
- AC_CHECK_HEADERS(netdb.h)
813
- AC_CHECK_HEADERS(netinet/in.h)
818
+ ##
819
+ ## Header files
820
+ ##
821
+ dnl sys/socket.h and sys/types.h are required by AC_FUNC_ACCEPT_ARGTYPES
822
+ AC_CHECK_HEADERS([crypt.h dld.h endian.h fp_class.h getopt.h ieeefp.h pwd.h sys/pstat.h sys/select.h sys/socket.h sys/types.h termios.h values.h])
823
+
814
824
AC_CHECK_HEADERS([readline/readline.h readline.h], [break])
815
825
AC_CHECK_HEADERS([readline/history.h history.h], [break])
816
- AC_CHECK_HEADERS(sys/select.h)
817
- AC_CHECK_HEADERS(termios.h)
818
- AC_CHECK_HEADERS(unistd.h)
819
- AC_CHECK_HEADERS(values.h)
820
- AC_CHECK_HEADERS(sys/pstat.h)
821
- AC_CHECK_HEADERS(sys/types.h sys/socket.h)
822
- AC_CHECK_HEADERS(sys/param.h pwd.h)
823
826
824
827
if test "$with_krb4" = yes ; then
825
828
AC_CHECK_HEADER(krb.h, [], [AC_MSG_ERROR([header file <krb.h> is required for Kerberos 4])])
@@ -836,26 +839,24 @@ if test "$with_openssl" = yes ; then
836
839
fi
837
840
838
841
839
- dnl
840
- dnl Checks for typedefs , structures, and compiler characteristics.
841
- dnl
842
+ ##
843
+ ## Types , structures, compiler characteristics
844
+ ##
842
845
AC_C_CONST
843
846
AC_C_INLINE
844
847
AC_C_STRINGIZE
845
- AC_TYPE_UID_T
846
- AC_TYPE_MODE_T
847
- AC_TYPE_OFF_T
848
- AC_TYPE_SIZE_T
849
- AC_STRUCT_TIMEZONE
850
848
PGAC_C_SIGNED
851
849
PGAC_C_VOLATILE
852
- AC_FUNC_ACCEPT_ARGTYPES
850
+ AC_STRUCT_TIMEZONE
851
+ PGAC_UNION_SEMUN
853
852
854
853
854
+ ##
855
+ ## Functions, global variables
856
+ ##
855
857
PGAC_VAR_INT_TIMEZONE
858
+ AC_FUNC_ACCEPT_ARGTYPES
856
859
PGAC_FUNC_GETTIMEOFDAY_1ARG
857
- PGAC_UNION_SEMUN
858
-
859
860
860
861
AC_MSG_CHECKING(for fcntl(F_SETLK))
861
862
if test "$os" != linux ; then
@@ -871,13 +872,7 @@ else
871
872
AC_MSG_RESULT([broken on Linux])
872
873
fi
873
874
874
- dnl Checks for library functions.
875
- AC_FUNC_MEMCMP
876
- AC_TYPE_SIGNAL
877
- AC_FUNC_VPRINTF
878
- AC_CHECK_FUNCS(memmove sysconf)
879
- AC_CHECK_FUNCS(sigprocmask waitpid setsid fcvt)
880
- AC_CHECK_FUNCS(setproctitle pstat)
875
+ AC_CHECK_FUNCS([fcvt getopt_long memmove pstat setproctitle setsid sigprocmask sysconf waitpid])
881
876
882
877
AC_CACHE_CHECK([for PS_STRINGS], [pgac_cv_var_PS_STRINGS],
883
878
[AC_TRY_LINK(
@@ -892,7 +887,6 @@ if test "$pgac_cv_var_PS_STRINGS" = yes ; then
892
887
AC_DEFINE([HAVE_PS_STRINGS], [], [Define if the PS_STRINGS thing exists.])
893
888
fi
894
889
895
- AC_CHECK_FUNCS(fpclass fp_class fp_class_d class)
896
890
dnl We use our snprintf.c emulation if either snprintf() or vsnprintf()
897
891
dnl is missing. Yes, there are machines that have only one.
898
892
dnl We may also decide to use snprintf.c if snprintf() is present but does
@@ -914,24 +908,26 @@ dnl declares vsnprintf() but not snprintf(). Hopefully there are no
914
908
dnl systems that are *that* brain-damaged...
915
909
AC_EGREP_HEADER(snprintf, stdio.h, AC_DEFINE(HAVE_SNPRINTF_DECL))
916
910
AC_EGREP_HEADER(vsnprintf, stdio.h, AC_DEFINE(HAVE_VSNPRINTF_DECL))
917
- dnl
918
- dnl do this one the hard way in case isinf() is a macro
919
- AC_MSG_CHECKING(for isinf)
920
- AC_CACHE_VAL(ac_cv_func_or_macro_isinf,
911
+
912
+ # do this one the hard way in case isinf() is a macro
913
+ AC_CACHE_CHECK([for isinf], ac_cv_func_isinf,
921
914
[AC_TRY_LINK(
922
- [#include <math.h>],
915
+ [#include <math.h>
916
+ ],
923
917
[double x = 0.0; int res = isinf(x);],
924
- [ac_cv_func_or_macro_isinf =yes],
925
- [ac_cv_func_or_macro_isinf =no])])
926
- if [[ $ac_cv_func_or_macro_isinf = yes ]]; then
927
- AC_MSG_RESULT( yes)
918
+ [ac_cv_func_isinf =yes],
919
+ [ac_cv_func_isinf =no])])
920
+
921
+ if test $ac_cv_func_isinf = yes ; then
928
922
AC_DEFINE(HAVE_ISINF)
929
- ISINF=''
923
+ ISINF=
930
924
else
931
- AC_MSG_RESULT(no)
932
925
ISINF='isinf.o'
926
+ # Look for a way to implement a substitute for isinf()
927
+ AC_CHECK_FUNCS([fpclass fp_class fp_class_d class], [break])
933
928
fi
934
929
AC_SUBST(ISINF)
930
+
935
931
AC_CHECK_FUNC(getrusage,
936
932
AC_DEFINE(HAVE_GETRUSAGE),
937
933
GETRUSAGE='getrusage.o')
@@ -1011,8 +1007,6 @@ AC_CHECK_FUNCS(filename_completion_function,
1011
1007
AC_SUBST(HAVE_FILENAME_COMPLETION_FUNCTION)
1012
1008
AC_SUBST(HAVE_FILENAME_COMPLETION_FUNCTION_DECL)
1013
1009
1014
- dnl Check for GNU style long options support (getopt_long)
1015
- AC_CHECK_FUNCS(getopt_long)
1016
1010
1017
1011
dnl Cannot use AC_CHECK_FUNC because finite may be a macro
1018
1012
AC_MSG_CHECKING(for finite)
0 commit comments