Skip to content

Commit 05885c2

Browse files
committed
Build system tweaks.
1 parent 21bac83 commit 05885c2

File tree

3 files changed

+185
-2
lines changed

3 files changed

+185
-2
lines changed

config.h.in

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
/* config.h.in. Generated from configure.ac by autoheader. */
22

3+
/* Define to 1 if you have the <fcntl.h> header file. */
4+
#undef HAVE_FCNTL_H
5+
36
/* Define to 1 if you have the <inttypes.h> header file. */
47
#undef HAVE_INTTYPES_H
58

@@ -25,18 +28,30 @@
2528
/* Define to 1 if you have the <memory.h> header file. */
2629
#undef HAVE_MEMORY_H
2730

31+
/* Define to 1 if you have the `memset' function. */
32+
#undef HAVE_MEMSET
33+
2834
/* Define to 1 if you have the <stdint.h> header file. */
2935
#undef HAVE_STDINT_H
3036

3137
/* Define to 1 if you have the <stdlib.h> header file. */
3238
#undef HAVE_STDLIB_H
3339

40+
/* Define to 1 if you have the `strerror' function. */
41+
#undef HAVE_STRERROR
42+
3443
/* Define to 1 if you have the <strings.h> header file. */
3544
#undef HAVE_STRINGS_H
3645

3746
/* Define to 1 if you have the <string.h> header file. */
3847
#undef HAVE_STRING_H
3948

49+
/* Define to 1 if you have the <sys/ioctl.h> header file. */
50+
#undef HAVE_SYS_IOCTL_H
51+
52+
/* Define to 1 if you have the <sys/param.h> header file. */
53+
#undef HAVE_SYS_PARAM_H
54+
4055
/* Define to 1 if you have the <sys/stat.h> header file. */
4156
#undef HAVE_SYS_STAT_H
4257

@@ -75,17 +90,31 @@
7590
#define below would cause a syntax error. */
7691
#undef _UINT32_T
7792

93+
/* Define for Solaris 2.5.1 so the uint64_t typedef from <sys/synch.h>,
94+
<pthread.h>, or <semaphore.h> is not used. If the typedef were allowed, the
95+
#define below would cause a syntax error. */
96+
#undef _UINT64_T
97+
7898
/* Define for Solaris 2.5.1 so the uint8_t typedef from <sys/synch.h>,
7999
<pthread.h>, or <semaphore.h> is not used. If the typedef were allowed, the
80100
#define below would cause a syntax error. */
81101
#undef _UINT8_T
82102

103+
/* Define to `__inline__' or `__inline' if that's what the C compiler
104+
calls it, or to nothing if 'inline' is not supported under any name. */
105+
#ifndef __cplusplus
106+
#undef inline
107+
#endif
108+
83109
/* Define to rpl_malloc if the replacement function should be used. */
84110
#undef malloc
85111

86112
/* Define to `unsigned int' if <sys/types.h> does not define. */
87113
#undef size_t
88114

115+
/* Define to `int' if <sys/types.h> does not define. */
116+
#undef ssize_t
117+
89118
/* Define to the type of an unsigned integer type of width exactly 16 bits if
90119
such a type exists and the standard includes do not define it. */
91120
#undef uint16_t
@@ -94,6 +123,10 @@
94123
such a type exists and the standard includes do not define it. */
95124
#undef uint32_t
96125

126+
/* Define to the type of an unsigned integer type of width exactly 64 bits if
127+
such a type exists and the standard includes do not define it. */
128+
#undef uint64_t
129+
97130
/* Define to the type of an unsigned integer type of width exactly 8 bits if
98131
such a type exists and the standard includes do not define it. */
99132
#undef uint8_t

configure

Lines changed: 147 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1768,6 +1768,73 @@ $as_echo "$ac_res" >&6; }
17681768
eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
17691769

17701770
} # ac_fn_c_find_uintX_t
1771+
1772+
# ac_fn_c_check_func LINENO FUNC VAR
1773+
# ----------------------------------
1774+
# Tests whether FUNC exists, setting the cache variable VAR accordingly
1775+
ac_fn_c_check_func ()
1776+
{
1777+
as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
1778+
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
1779+
$as_echo_n "checking for $2... " >&6; }
1780+
if eval \${$3+:} false; then :
1781+
$as_echo_n "(cached) " >&6
1782+
else
1783+
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
1784+
/* end confdefs.h. */
1785+
/* Define $2 to an innocuous variant, in case <limits.h> declares $2.
1786+
For example, HP-UX 11i <limits.h> declares gettimeofday. */
1787+
#define $2 innocuous_$2
1788+
1789+
/* System header to define __stub macros and hopefully few prototypes,
1790+
which can conflict with char $2 (); below.
1791+
Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
1792+
<limits.h> exists even on freestanding compilers. */
1793+
1794+
#ifdef __STDC__
1795+
# include <limits.h>
1796+
#else
1797+
# include <assert.h>
1798+
#endif
1799+
1800+
#undef $2
1801+
1802+
/* Override any GCC internal prototype to avoid an error.
1803+
Use char because int might match the return type of a GCC
1804+
builtin and then its argument prototype would still apply. */
1805+
#ifdef __cplusplus
1806+
extern "C"
1807+
#endif
1808+
char $2 ();
1809+
/* The GNU C library defines this for functions which it implements
1810+
to always fail with ENOSYS. Some functions are actually named
1811+
something starting with __ and the normal name is an alias. */
1812+
#if defined __stub_$2 || defined __stub___$2
1813+
choke me
1814+
#endif
1815+
1816+
int
1817+
main ()
1818+
{
1819+
return $2 ();
1820+
;
1821+
return 0;
1822+
}
1823+
_ACEOF
1824+
if ac_fn_c_try_link "$LINENO"; then :
1825+
eval "$3=yes"
1826+
else
1827+
eval "$3=no"
1828+
fi
1829+
rm -f core conftest.err conftest.$ac_objext \
1830+
conftest$ac_exeext conftest.$ac_ext
1831+
fi
1832+
eval ac_res=\$$3
1833+
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
1834+
$as_echo "$ac_res" >&6; }
1835+
eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
1836+
1837+
} # ac_fn_c_check_func
17711838
cat >config.log <<_ACEOF
17721839
This file contains any messages produced by compilers while
17731840
running configure, to aid debugging if configure makes a mistake.
@@ -3688,7 +3755,7 @@ fi
36883755
done
36893756

36903757

3691-
for ac_header in memory.h stdint.h stdlib.h string.h
3758+
for ac_header in fcntl.h memory.h stdint.h stdlib.h string.h strings.h sys/ioctl.h sys/param.h unistd.h
36923759
do :
36933760
as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
36943761
ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
@@ -3790,6 +3857,48 @@ _ACEOF
37903857
fi
37913858

37923859

3860+
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for inline" >&5
3861+
$as_echo_n "checking for inline... " >&6; }
3862+
if ${ac_cv_c_inline+:} false; then :
3863+
$as_echo_n "(cached) " >&6
3864+
else
3865+
ac_cv_c_inline=no
3866+
for ac_kw in inline __inline__ __inline; do
3867+
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
3868+
/* end confdefs.h. */
3869+
#ifndef __cplusplus
3870+
typedef int foo_t;
3871+
static $ac_kw foo_t static_foo () {return 0; }
3872+
$ac_kw foo_t foo () {return 0; }
3873+
#endif
3874+
3875+
_ACEOF
3876+
if ac_fn_c_try_compile "$LINENO"; then :
3877+
ac_cv_c_inline=$ac_kw
3878+
fi
3879+
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
3880+
test "$ac_cv_c_inline" != no && break
3881+
done
3882+
3883+
fi
3884+
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_inline" >&5
3885+
$as_echo "$ac_cv_c_inline" >&6; }
3886+
3887+
case $ac_cv_c_inline in
3888+
inline | yes) ;;
3889+
*)
3890+
case $ac_cv_c_inline in
3891+
no) ac_val=;;
3892+
*) ac_val=$ac_cv_c_inline;;
3893+
esac
3894+
cat >>confdefs.h <<_ACEOF
3895+
#ifndef __cplusplus
3896+
#define inline $ac_val
3897+
#endif
3898+
_ACEOF
3899+
;;
3900+
esac
3901+
37933902
ac_fn_c_check_type "$LINENO" "size_t" "ac_cv_type_size_t" "$ac_includes_default"
37943903
if test "x$ac_cv_type_size_t" = xyes; then :
37953904

@@ -3801,6 +3910,17 @@ _ACEOF
38013910

38023911
fi
38033912

3913+
ac_fn_c_check_type "$LINENO" "ssize_t" "ac_cv_type_ssize_t" "$ac_includes_default"
3914+
if test "x$ac_cv_type_ssize_t" = xyes; then :
3915+
3916+
else
3917+
3918+
cat >>confdefs.h <<_ACEOF
3919+
#define ssize_t int
3920+
_ACEOF
3921+
3922+
fi
3923+
38043924
ac_fn_c_find_uintX_t "$LINENO" "16" "ac_cv_c_uint16_t"
38053925
case $ac_cv_c_uint16_t in #(
38063926
no|yes) ;; #(
@@ -3827,6 +3947,20 @@ _ACEOF
38273947
;;
38283948
esac
38293949

3950+
ac_fn_c_find_uintX_t "$LINENO" "64" "ac_cv_c_uint64_t"
3951+
case $ac_cv_c_uint64_t in #(
3952+
no|yes) ;; #(
3953+
*)
3954+
3955+
$as_echo "#define _UINT64_T 1" >>confdefs.h
3956+
3957+
3958+
cat >>confdefs.h <<_ACEOF
3959+
#define uint64_t $ac_cv_c_uint64_t
3960+
_ACEOF
3961+
;;
3962+
esac
3963+
38303964
ac_fn_c_find_uintX_t "$LINENO" "8" "ac_cv_c_uint8_t"
38313965
case $ac_cv_c_uint8_t in #(
38323966
no|yes) ;; #(
@@ -3910,6 +4044,18 @@ $as_echo "#define malloc rpl_malloc" >>confdefs.h
39104044
fi
39114045

39124046

4047+
for ac_func in memset strerror
4048+
do :
4049+
as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
4050+
ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
4051+
if eval test \"x\$"$as_ac_var"\" = x"yes"; then :
4052+
cat >>confdefs.h <<_ACEOF
4053+
#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
4054+
_ACEOF
4055+
4056+
fi
4057+
done
4058+
39134059

39144060
ac_config_files="$ac_config_files Makefile src/Makefile"
39154061

configure.ac

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,17 +33,21 @@ AC_CHECK_LIB([argp], [argp_parse], [], [
3333
])
3434

3535
# Checks for header files.
36-
AC_CHECK_HEADERS([memory.h stdint.h stdlib.h string.h])
36+
AC_CHECK_HEADERS([fcntl.h memory.h stdint.h stdlib.h string.h strings.h sys/ioctl.h sys/param.h unistd.h])
3737

3838
# Checks for typedefs, structures, and compiler characteristics.
3939
AC_CHECK_HEADER_STDBOOL
40+
AC_C_INLINE
4041
AC_TYPE_SIZE_T
42+
AC_TYPE_SSIZE_T
4143
AC_TYPE_UINT16_T
4244
AC_TYPE_UINT32_T
45+
AC_TYPE_UINT64_T
4346
AC_TYPE_UINT8_T
4447

4548
# Checks for library functions.
4649
AC_FUNC_MALLOC
50+
AC_CHECK_FUNCS([memset strerror])
4751

4852
AC_CONFIG_FILES([Makefile
4953
src/Makefile])

0 commit comments

Comments
 (0)