Newer
Older
AC_DEFUN([CURL_CONFIGURE_CURL_OFF_T], [
AC_REQUIRE([CURL_INCLUDES_INTTYPES])dnl
#
AC_BEFORE([$0],[AC_SYS_LARGEFILE])dnl
AC_BEFORE([$0],[CURL_CONFIGURE_REENTRANT])dnl
AC_BEFORE([$0],[CURL_CHECK_AIX_ALL_SOURCE])dnl
#
if test -z "$SED"; then
AC_MSG_ERROR([SED not set. Cannot continue without SED being set.])
fi
#
AC_CHECK_SIZEOF(long)
AC_CHECK_SIZEOF(void*)
#
if test -z "$ac_cv_sizeof_long" ||
test "$ac_cv_sizeof_long" -eq "0"; then
AC_MSG_ERROR([cannot find out size of long.])
fi
3019
3020
3021
3022
3023
3024
3025
3026
3027
3028
3029
3030
3031
3032
3033
3034
3035
3036
3037
3038
3039
3040
if test -z "$ac_cv_sizeof_voidp" ||
test "$ac_cv_sizeof_voidp" -eq "0"; then
AC_MSG_ERROR([cannot find out size of void*.])
fi
#
x_LP64_long=""
x_LP32_long=""
x_LP16_long=""
#
if test "$ac_cv_sizeof_long" -eq "8" &&
test "$ac_cv_sizeof_voidp" -ge "8"; then
x_LP64_long="long"
elif test "$ac_cv_sizeof_long" -eq "4" &&
test "$ac_cv_sizeof_voidp" -ge "4"; then
x_LP32_long="long"
elif test "$ac_cv_sizeof_long" -eq "2" &&
test "$ac_cv_sizeof_voidp" -ge "2"; then
x_LP16_long="long"
fi
#
dnl DO_CURL_OFF_T_CHECK results are stored in next 3 vars
#
curl_typeof_curl_off_t="unknown"
curl_sizeof_curl_off_t="unknown"
curl_format_curl_off_t="unknown"
curl_format_curl_off_tu="unknown"
if test "$curl_typeof_curl_off_t" = "unknown"; then
AC_MSG_CHECKING([for 64-bit curl_off_t data type])
for t8 in \
"$x_LP64_long" \
'int64_t' \
'__int64' \
'long long' \
'__longlong' \
'__longlong_t' ; do
DO_CURL_OFF_T_CHECK([$t8], [8])
done
AC_MSG_RESULT([$curl_typeof_curl_off_t])
if test "$curl_typeof_curl_off_t" = "unknown"; then
AC_MSG_CHECKING([for 32-bit curl_off_t data type])
for t4 in \
"$x_LP32_long" \
'int32_t' \
'__int32' \
'int' ; do
DO_CURL_OFF_T_CHECK([$t4], [4])
done
AC_MSG_RESULT([$curl_typeof_curl_off_t])
if test "$curl_typeof_curl_off_t" = "unknown"; then
AC_MSG_CHECKING([for 16-bit curl_off_t data type])
for t2 in \
"$x_LP16_long" \
'int16_t' \
'__int16' \
'int' ; do
DO_CURL_OFF_T_CHECK([$t2], [2])
done
AC_MSG_RESULT([$curl_typeof_curl_off_t])
if test "$curl_typeof_curl_off_t" = "unknown"; then
AC_MSG_ERROR([cannot find data type for curl_off_t.])
fi
#
AC_MSG_CHECKING([size of curl_off_t])
AC_MSG_RESULT([$curl_sizeof_curl_off_t])
#
AC_MSG_CHECKING([formatting string directive for curl_off_t])
if test "$curl_format_curl_off_t" != "unknown"; then
x_pull_headers="yes"
curl_format_curl_off_t=`echo "$curl_format_curl_off_t" | "$SED" 's/[["]]//g'`
curl_format_curl_off_tu=`echo "$curl_format_curl_off_t" | "$SED" 's/i$/u/'`
curl_format_curl_off_tu=`echo "$curl_format_curl_off_tu" | "$SED" 's/d$/u/'`
curl_format_curl_off_tu=`echo "$curl_format_curl_off_tu" | "$SED" 's/D$/U/'`
else
x_pull_headers="no"
case AS_TR_SH([$curl_typeof_curl_off_t]) in
long_long | __longlong | __longlong_t)
curl_format_curl_off_t="lld"
curl_format_curl_off_tu="llu"
curl_format_curl_off_t="ld"
curl_format_curl_off_tu="lu"
curl_format_curl_off_t="d"
curl_format_curl_off_tu="u"
curl_format_curl_off_t="I64d"
curl_format_curl_off_tu="I64u"
curl_format_curl_off_t="I32d"
curl_format_curl_off_tu="I32u"
curl_format_curl_off_t="I16d"
curl_format_curl_off_tu="I16u"
;;
*)
AC_MSG_ERROR([cannot find print format string for curl_off_t.])
;;
esac
fi
AC_MSG_RESULT(["$curl_format_curl_off_t"])
#
AC_MSG_CHECKING([formatting string directive for unsigned curl_off_t])
AC_MSG_RESULT(["$curl_format_curl_off_tu"])
#
DO_CURL_OFF_T_SUFFIX_CHECK([$curl_typeof_curl_off_t])
#
if test "$x_pull_headers" = "yes"; then
if test "x$ac_cv_header_sys_types_h" = "xyes"; then
CURL_DEFINE_UNQUOTED([CURL_PULL_SYS_TYPES_H])
fi
if test "x$ac_cv_header_stdint_h" = "xyes"; then
CURL_DEFINE_UNQUOTED([CURL_PULL_STDINT_H])
fi
if test "x$ac_cv_header_inttypes_h" = "xyes"; then
CURL_DEFINE_UNQUOTED([CURL_PULL_INTTYPES_H])
fi
fi
#
CURL_DEFINE_UNQUOTED([CURL_TYPEOF_CURL_OFF_T], [$curl_typeof_curl_off_t])
CURL_DEFINE_UNQUOTED([CURL_FORMAT_CURL_OFF_T], ["$curl_format_curl_off_t"])
CURL_DEFINE_UNQUOTED([CURL_FORMAT_CURL_OFF_TU], ["$curl_format_curl_off_tu"])
CURL_DEFINE_UNQUOTED([CURL_FORMAT_OFF_T], ["%$curl_format_curl_off_t"])
CURL_DEFINE_UNQUOTED([CURL_SIZEOF_CURL_OFF_T], [$curl_sizeof_curl_off_t])
CURL_DEFINE_UNQUOTED([CURL_SUFFIX_CURL_OFF_T], [$curl_suffix_curl_off_t])
CURL_DEFINE_UNQUOTED([CURL_SUFFIX_CURL_OFF_TU], [$curl_suffix_curl_off_tu])
3156
3157
3158
3159
3160
3161
3162
3163
3164
3165
3166
3167
3168
3169
3170
3171
3172
3173
3174
3175
3176
3177
3178
3179
3180
3181
3182
3183
3184
3185
3186
3187
3188
3189
3190
3191
3192
3193
3194
3195
3196
3197
3198
3199
3200
3201
3202
3203
3204
3205
3206
3207
3208
3209
3210
3211
dnl CURL_CHECK_WIN32_LARGEFILE
dnl -------------------------------------------------
dnl Check if curl's WIN32 large file will be used
AC_DEFUN([CURL_CHECK_WIN32_LARGEFILE], [
AC_REQUIRE([CURL_CHECK_HEADER_WINDOWS])dnl
AC_MSG_CHECKING([whether build target supports WIN32 file API])
curl_win32_file_api="no"
if test "$ac_cv_header_windows_h" = "yes"; then
if test x"$enable_largefile" != "xno"; then
AC_COMPILE_IFELSE([
AC_LANG_PROGRAM([[
]],[[
#if !defined(_WIN32_WCE) && \
(defined(__MINGW32__) || \
(defined(_MSC_VER) && (defined(_WIN32) || defined(_WIN64))))
int dummy=1;
#else
WIN32 large file API not supported.
#endif
]])
],[
curl_win32_file_api="win32_large_files"
])
fi
if test "$curl_win32_file_api" = "no"; then
AC_COMPILE_IFELSE([
AC_LANG_PROGRAM([[
]],[[
#if defined(_WIN32_WCE) || defined(__MINGW32__) || defined(_MSC_VER)
int dummy=1;
#else
WIN32 small file API not supported.
#endif
]])
],[
curl_win32_file_api="win32_small_files"
])
fi
fi
case "$curl_win32_file_api" in
win32_large_files)
AC_MSG_RESULT([yes (large file enabled)])
AC_DEFINE_UNQUOTED(USE_WIN32_LARGE_FILES, 1,
[Define to 1 if you are building a Windows target with large file support.])
;;
win32_small_files)
AC_MSG_RESULT([yes (large file disabled)])
AC_DEFINE_UNQUOTED(USE_WIN32_LARGE_FILES, 1,
[Define to 1 if you are building a Windows target without large file support.])
;;
*)
AC_MSG_RESULT([no])
;;
esac
])
Daniel Stenberg
committed
3213
3214
3215
3216
3217
3218
3219
3220
3221
3222
3223
3224
3225
3226
3227
3228
3229
3230
3231
3232
3233
3234
3235
3236
3237
3238
3239
3240
3241
3242
3243
3244
3245
dnl CURL_CHECK_PKGCONFIG ($module)
dnl ------------------------
dnl search for the pkg-config tool (if not cross-compiling). Set the PKGCONFIG
dnl variable to hold the path to it, or 'no' if not found/present.
dnl
dnl If pkg-config is present, check that it has info about the $module or return
dnl "no" anyway!
dnl
AC_DEFUN([CURL_CHECK_PKGCONFIG], [
if test x$cross_compiling != xyes; then
dnl only do pkg-config magic when not cross-compiling
AC_PATH_PROG( PKGCONFIG, pkg-config, no, $PATH:/usr/bin:/usr/local/bin)
if test x$PKGCONFIG != xno; then
AC_MSG_CHECKING([for $1 options with pkg-config])
dnl ask pkg-config about $1
$PKGCONFIG --exists $1
if test "$?" -ne "0"; then
dnl pkg-config does not have info about the given module! set the
dnl variable to 'no'
PKGCONFIG="no"
AC_MSG_RESULT([no])
else
AC_MSG_RESULT([found])
fi
fi
else
PKGCONFIG="no"
fi
])