View | Details | Raw Unified | Return to bug 321 | Differences between
and this patch

Collapse All | Expand All

(-)configure.ac (-29 / +66 lines)
Lines 503-509 Link Here
503
)
503
)
504
504
505
AC_MSG_CHECKING(compiler and flags for sanity)
505
AC_MSG_CHECKING(compiler and flags for sanity)
506
AC_TRY_RUN([
506
AC_RUN_IFELSE([
507
#include <stdio.h>
507
#include <stdio.h>
508
int main(){exit(0);}
508
int main(){exit(0);}
509
	],
509
	],
Lines 511-517 Link Here
511
	[
511
	[
512
		AC_MSG_RESULT(no)
512
		AC_MSG_RESULT(no)
513
		AC_MSG_ERROR([*** compiler cannot create working executables, check config.log ***])
513
		AC_MSG_ERROR([*** compiler cannot create working executables, check config.log ***])
514
	]
514
	],
515
	[	AC_MSG_WARN([cross compiling: not checking compiler sanity]) ]
515
)
516
)
516
517
517
# Checks for header files.
518
# Checks for header files.
Lines 637-643 Link Here
637
)
638
)
638
639
639
AC_MSG_CHECKING(for zlib 1.1.4 or greater)
640
AC_MSG_CHECKING(for zlib 1.1.4 or greater)
640
AC_TRY_RUN([
641
AC_RUN_IFELSE([
641
#include <zlib.h>
642
#include <zlib.h>
642
int main()
643
int main()
643
{
644
{
Lines 662-668 Link Here
662
	  else
663
	  else
663
		AC_MSG_WARN([zlib version may have security problems])
664
		AC_MSG_WARN([zlib version may have security problems])
664
	  fi
665
	  fi
665
	]
666
	],
667
	[	AC_MSG_WARN([cross compiling: not checking zlib version]) ]
666
)
668
)
667
669
668
dnl UnixWare 2.x
670
dnl UnixWare 2.x
Lines 716-722 Link Here
716
)
718
)
717
719
718
AC_MSG_CHECKING([whether struct dirent allocates space for d_name])
720
AC_MSG_CHECKING([whether struct dirent allocates space for d_name])
719
AC_TRY_RUN(
721
AC_RUN_IFELSE(
720
	[
722
	[
721
#include <sys/types.h>
723
#include <sys/types.h>
722
#include <dirent.h>
724
#include <dirent.h>
Lines 726-731 Link Here
726
	[
728
	[
727
		AC_MSG_RESULT(no)
729
		AC_MSG_RESULT(no)
728
		AC_DEFINE(BROKEN_ONE_BYTE_DIRENT_D_NAME)
730
		AC_DEFINE(BROKEN_ONE_BYTE_DIRENT_D_NAME)
731
	],
732
	[ 
733
		AC_MSG_WARN([cross compiling: assuming BROKEN_ONE_BYTE_DIRENT_D_NAME])
734
		AC_DEFINE(BROKEN_ONE_BYTE_DIRENT_D_NAME)
729
	]
735
	]
730
)
736
)
731
737
Lines 924-930 Link Here
924
# Check for broken snprintf
930
# Check for broken snprintf
925
if test "x$ac_cv_func_snprintf" = "xyes" ; then
931
if test "x$ac_cv_func_snprintf" = "xyes" ; then
926
	AC_MSG_CHECKING([whether snprintf correctly terminates long strings])
932
	AC_MSG_CHECKING([whether snprintf correctly terminates long strings])
927
	AC_TRY_RUN(
933
	AC_RUN_IFELSE(
928
		[
934
		[
929
#include <stdio.h>
935
#include <stdio.h>
930
int main(void){char b[5];snprintf(b,5,"123456789");exit(b[4]!='\0');}
936
int main(void){char b[5];snprintf(b,5,"123456789");exit(b[4]!='\0');}
Lines 934-940 Link Here
934
			AC_MSG_RESULT(no)
940
			AC_MSG_RESULT(no)
935
			AC_DEFINE(BROKEN_SNPRINTF)
941
			AC_DEFINE(BROKEN_SNPRINTF)
936
			AC_MSG_WARN([****** Your snprintf() function is broken, complain to your vendor])
942
			AC_MSG_WARN([****** Your snprintf() function is broken, complain to your vendor])
937
		]
943
		],
944
		[ AC_MSG_WARN([cross compiling: Assuming working snprintf()]) ]
938
	)
945
	)
939
fi
946
fi
940
947
Lines 1195-1201 Link Here
1195
1202
1196
# Determine OpenSSL header version
1203
# Determine OpenSSL header version
1197
AC_MSG_CHECKING([OpenSSL header version])
1204
AC_MSG_CHECKING([OpenSSL header version])
1198
AC_TRY_RUN(
1205
AC_RUN_IFELSE(
1199
	[
1206
	[
1200
#include <stdio.h>
1207
#include <stdio.h>
1201
#include <string.h>
1208
#include <string.h>
Lines 1222-1233 Link Here
1222
	[
1229
	[
1223
		AC_MSG_RESULT(not found)
1230
		AC_MSG_RESULT(not found)
1224
		AC_MSG_ERROR(OpenSSL version header not found.)
1231
		AC_MSG_ERROR(OpenSSL version header not found.)
1232
	],
1233
	[
1234
		AC_MSG_WARN([cross compiling: not checking])
1225
	]
1235
	]
1226
)
1236
)
1227
1237
1228
# Determine OpenSSL library version
1238
# Determine OpenSSL library version
1229
AC_MSG_CHECKING([OpenSSL library version])
1239
AC_MSG_CHECKING([OpenSSL library version])
1230
AC_TRY_RUN(
1240
AC_RUN_IFELSE(
1231
	[
1241
	[
1232
#include <stdio.h>
1242
#include <stdio.h>
1233
#include <string.h>
1243
#include <string.h>
Lines 1255-1266 Link Here
1255
	[
1265
	[
1256
		AC_MSG_RESULT(not found)
1266
		AC_MSG_RESULT(not found)
1257
		AC_MSG_ERROR(OpenSSL library not found.)
1267
		AC_MSG_ERROR(OpenSSL library not found.)
1268
	],
1269
	[
1270
		AC_MSG_WARN([cross compiling: not checking])
1258
	]
1271
	]
1259
)
1272
)
1260
1273
1261
# Sanity check OpenSSL headers
1274
# Sanity check OpenSSL headers
1262
AC_MSG_CHECKING([whether OpenSSL's headers match the library])
1275
AC_MSG_CHECKING([whether OpenSSL's headers match the library])
1263
AC_TRY_RUN(
1276
AC_RUN_IFELSE(
1264
	[
1277
	[
1265
#include <string.h>
1278
#include <string.h>
1266
#include <openssl/opensslv.h>
1279
#include <openssl/opensslv.h>
Lines 1274-1279 Link Here
1274
		AC_MSG_ERROR([Your OpenSSL headers do not match your library.
1287
		AC_MSG_ERROR([Your OpenSSL headers do not match your library.
1275
Check config.log for details.
1288
Check config.log for details.
1276
Also see contrib/findssl.sh for help identifying header/library mismatches.])
1289
Also see contrib/findssl.sh for help identifying header/library mismatches.])
1290
	],
1291
	[
1292
		AC_MSG_WARN([cross compiling: not checking])
1277
	]
1293
	]
1278
)
1294
)
1279
1295
Lines 1294-1300 Link Here
1294
1310
1295
# Check wheter OpenSSL seeds itself
1311
# Check wheter OpenSSL seeds itself
1296
AC_MSG_CHECKING([whether OpenSSL's PRNG is internally seeded])
1312
AC_MSG_CHECKING([whether OpenSSL's PRNG is internally seeded])
1297
AC_TRY_RUN(
1313
AC_RUN_IFELSE(
1298
	[
1314
	[
1299
#include <string.h>
1315
#include <string.h>
1300
#include <openssl/rand.h>
1316
#include <openssl/rand.h>
Lines 1309-1314 Link Here
1309
		# Default to use of the rand helper if OpenSSL doesn't
1325
		# Default to use of the rand helper if OpenSSL doesn't
1310
		# seed itself
1326
		# seed itself
1311
		USE_RAND_HELPER=yes
1327
		USE_RAND_HELPER=yes
1328
	],
1329
	[
1330
		AC_MSG_WARN([cross compiling: assuming yes])
1331
		# This is safe, since all recent OpenSSL versions will
1332
		# complain at runtime if not seeded correctly. 
1333
		OPENSSL_SEEDS_ITSELF=yes
1312
	]
1334
	]
1313
)
1335
)
1314
1336
Lines 1875-1881 Link Here
1875
	exit 1;
1897
	exit 1;
1876
else
1898
else
1877
dnl test snprintf (broken on SCO w/gcc)
1899
dnl test snprintf (broken on SCO w/gcc)
1878
	AC_TRY_RUN(
1900
	AC_RUN_IFELSE(
1879
		[
1901
		[
1880
#include <stdio.h>
1902
#include <stdio.h>
1881
#include <string.h>
1903
#include <string.h>
Lines 1899-1905 Link Here
1899
#else
1921
#else
1900
main() { exit(0); }
1922
main() { exit(0); }
1901
#endif
1923
#endif
1902
		], [ true ], [ AC_DEFINE(BROKEN_SNPRINTF) ]
1924
		], [ true ], [ AC_DEFINE(BROKEN_SNPRINTF) ],
1925
		AC_MSG_WARN([cross compiling: Assuming working snprintf()])
1903
	)
1926
	)
1904
fi
1927
fi
1905
1928
Lines 2004-2016 Link Here
2004
dnl make sure we're using the real structure members and not defines
2027
dnl make sure we're using the real structure members and not defines
2005
AC_CACHE_CHECK([for msg_accrights field in struct msghdr],
2028
AC_CACHE_CHECK([for msg_accrights field in struct msghdr],
2006
		ac_cv_have_accrights_in_msghdr, [
2029
		ac_cv_have_accrights_in_msghdr, [
2007
	AC_TRY_RUN(
2030
	AC_COMPILE_IFELSE(
2008
		[
2031
		[
2009
#include <sys/types.h>
2032
#include <sys/types.h>
2010
#include <sys/socket.h>
2033
#include <sys/socket.h>
2011
#include <sys/uio.h>
2034
#include <sys/uio.h>
2012
int main() {
2035
int main() {
2013
#ifdef msg_accrights
2036
#ifdef msg_accrights
2037
#error "msg_accrights is a macro"
2014
exit(1);
2038
exit(1);
2015
#endif
2039
#endif
2016
struct msghdr m;
2040
struct msghdr m;
Lines 2028-2040 Link Here
2028
2052
2029
AC_CACHE_CHECK([for msg_control field in struct msghdr],
2053
AC_CACHE_CHECK([for msg_control field in struct msghdr],
2030
		ac_cv_have_control_in_msghdr, [
2054
		ac_cv_have_control_in_msghdr, [
2031
	AC_TRY_RUN(
2055
	AC_COMPILE_IFELSE(
2032
		[
2056
		[
2033
#include <sys/types.h>
2057
#include <sys/types.h>
2034
#include <sys/socket.h>
2058
#include <sys/socket.h>
2035
#include <sys/uio.h>
2059
#include <sys/uio.h>
2036
int main() {
2060
int main() {
2037
#ifdef msg_control
2061
#ifdef msg_control
2062
#error "msg_control is a macro"
2038
exit(1);
2063
exit(1);
2039
#endif
2064
#endif
2040
struct msghdr m;
2065
struct msghdr m;
Lines 2368-2373 Link Here
2368
	AC_DEFINE_UNQUOTED(MAIL_DIRECTORY, "$maildir")
2393
	AC_DEFINE_UNQUOTED(MAIL_DIRECTORY, "$maildir")
2369
fi
2394
fi
2370
2395
2396
if test ! -z "$cross_compiling"; then
2397
	AC_MSG_WARN([cross compiling: Disabling /dev/ptmx test])
2398
	disable_ptmx_check=yes
2399
fi
2371
if test -z "$no_dev_ptmx" ; then
2400
if test -z "$no_dev_ptmx" ; then
2372
	if test "x$disable_ptmx_check" != "xyes" ; then
2401
	if test "x$disable_ptmx_check" != "xyes" ; then
2373
		AC_CHECK_FILE("/dev/ptmx",
2402
		AC_CHECK_FILE("/dev/ptmx",
Lines 2378-2389 Link Here
2378
		)
2407
		)
2379
	fi
2408
	fi
2380
fi
2409
fi
2381
AC_CHECK_FILE("/dev/ptc",
2410
2382
	[
2411
if test -z "$cross_compiling"; then
2383
		AC_DEFINE_UNQUOTED(HAVE_DEV_PTS_AND_PTC)
2412
	AC_CHECK_FILE("/dev/ptc",
2384
		have_dev_ptc=1
2413
		[
2385
	]
2414
			AC_DEFINE_UNQUOTED(HAVE_DEV_PTS_AND_PTC)
2386
)
2415
			have_dev_ptc=1
2416
		]
2417
	)
2418
else
2419
	AC_MSG_WARN([cross compiling: Disabling /dev/ptc test])
2420
fi
2387
2421
2388
# Options from here on. Some of these are preset by platform above
2422
# Options from here on. Some of these are preset by platform above
2389
AC_ARG_WITH(mantype,
2423
AC_ARG_WITH(mantype,
Lines 2479-2492 Link Here
2479
2513
2480
# check for /etc/default/login and use it if present.
2514
# check for /etc/default/login and use it if present.
2481
AC_ARG_ENABLE(etc-default-login,
2515
AC_ARG_ENABLE(etc-default-login,
2482
	[  --disable-etc-default-login       Disable using PATH from /etc/default/login [no]],,
2516
	[ --disable-etc-default-login       Disable using PATH from /etc/default/login [no]],,
2483
[
2517
	[ AC_CHECK_FILE("/etc/default/login",
2484
AC_CHECK_FILE("/etc/default/login", [ external_path_file=/etc/default/login ])
2518
	    [ external_path_file=/etc/default/login ])
2485
2519
2486
if test "x$external_path_file" = "x/etc/default/login"; then
2520
	if test ! -z "$cross_compiling"; then
2487
	AC_DEFINE(HAVE_ETC_DEFAULT_LOGIN)
2521
		AC_MSG_WARN([cross compiling: Disabling /etc/default/login test])
2488
fi
2522
	elif test "x$external_path_file" = "x/etc/default/login"; then
2489
])
2523
		AC_DEFINE(HAVE_ETC_DEFAULT_LOGIN)
2524
	fi
2525
	]
2526
)
2490
2527
2491
dnl BSD systems use /etc/login.conf so --with-default-path= has no effect
2528
dnl BSD systems use /etc/login.conf so --with-default-path= has no effect
2492
if test $ac_cv_func_login_getcapbool = "yes" -a \
2529
if test $ac_cv_func_login_getcapbool = "yes" -a \

Return to bug 321