Commit e0653e1f e0653e1f24179d598c84855b7c86b5354aaedf4b by Sergey Poznyakoff

Determine the size of off_t and define an

equivalent mu_off_t type. We cannot use off_t in the library since
its size depends on whether large file support is used or not,
which will lead to arbitrary crashes if a user application and the
library use off_t of different sizes.
(MU_COMMON_INCLUDES): New substitute variable
1 parent 4a8e607d
...@@ -372,6 +372,23 @@ m4_copy([MU_SAVE_AC_LIBOBJ],[AC_LIBOBJ]) ...@@ -372,6 +372,23 @@ m4_copy([MU_SAVE_AC_LIBOBJ],[AC_LIBOBJ])
372 372
373 libmuaux_GNULIB 373 libmuaux_GNULIB
374 374
375 #####
376 # Determine the size of off_t and define an equivalent mu_off_t type.
377 # We cannot use off_t in the library since its size depends on whether
378 # large file support is used or not, which will lead to arbitrary crashes
379 # if a user application and the library use off_t of different sizes.
380 AC_CHECK_SIZEOF(off_t)
381 AC_CHECK_SIZEOF(long)
382 AC_CHECK_SIZEOF(long long)
383 AC_SUBST(MU_OFF_TYPE)
384 if test $ac_cv_sizeof_off_t -eq $ac_cv_sizeof_long; then
385 MU_OFF_TYPE=long
386 elif test $ac_cv_sizeof_off_t -eq $ac_cv_sizeof_long_long; then
387 MU_OFF_TYPE="long long"
388 else
389 AC_MSG_ERROR([Cannot find ${ac_cv_sizeof_off_t}-byte type, suitable for mu_off_t])
390 fi
391
375 AC_FUNC_MMAP 392 AC_FUNC_MMAP
376 393
377 AC_CHECK_DECLS([strtok_r, strchrnul, strndup, asprintf, vasprintf, strsignal], 394 AC_CHECK_DECLS([strtok_r, strchrnul, strndup, asprintf, vasprintf, strsignal],
...@@ -971,6 +988,7 @@ LTLIBOBJS=`echo "$LIB@&t@OBJS" | ...@@ -971,6 +988,7 @@ LTLIBOBJS=`echo "$LIB@&t@OBJS" |
971 AC_SUBST(LTLIBOBJS) 988 AC_SUBST(LTLIBOBJS)
972 989
973 S=`echo "$MU_LIBOBJS" | 990 S=`echo "$MU_LIBOBJS" |
991 tr ' ' '\n' | sort | uniq | tr '\n' ' ' |
974 sed 's,\.[[^.]]* ,$U&,g;s,\.[[^.]]*$,$U&,'` 992 sed 's,\.[[^.]]* ,$U&,g;s,\.[[^.]]*$,$U&,'`
975 MU_LTLIBOBJS=`echo "$S" | 993 MU_LTLIBOBJS=`echo "$S" |
976 sed 's,\.[[^.]]* ,.lo ,g;s,\.[[^.]]*$,.lo,'` 994 sed 's,\.[[^.]]* ,.lo ,g;s,\.[[^.]]*$,.lo,'`
...@@ -982,6 +1000,9 @@ SIEVE_MODDIR='$(libdir)/$(PACKAGE)' ...@@ -982,6 +1000,9 @@ SIEVE_MODDIR='$(libdir)/$(PACKAGE)'
982 AC_SUBST(MU_COMMON_LIBRARIES) 1000 AC_SUBST(MU_COMMON_LIBRARIES)
983 MU_COMMON_LIBRARIES='$(LTLIBINTL) $(LTLIBICONV)' 1001 MU_COMMON_LIBRARIES='$(LTLIBINTL) $(LTLIBICONV)'
984 1002
1003 AC_SUBST(MU_COMMON_INCLUDES)
1004 MU_COMMON_INCLUDES='-I${srcdir} -I${top_srcdir}/include -I${top_srcdir}/lib -I${top_builddir} -I${top_builddir}/include -I${top_builddir}/include/mailutils/gnu -I${top_srcdir}/mailbox'
1005
985 ### Display the status 1006 ### Display the status
986 1007
987 AC_CONFIG_COMMANDS([status],[ 1008 AC_CONFIG_COMMANDS([status],[
......