summaryrefslogtreecommitdiff
path: root/configure
diff options
context:
space:
mode:
authorLaurent Bercot <ska-skaware@skarnet.org>2017-01-25 15:52:18 +0000
committerLaurent Bercot <ska-skaware@skarnet.org>2017-01-25 15:52:18 +0000
commit00c9cb1b22cc17c4db573e0e613a5f116ff0092e (patch)
tree53178b2c52c6e97c6193f73378f3c5e5a781a914 /configure
parent2746b131aa482ac17c94bc6b82e58dbcc1b752cf (diff)
downloadskalibs-00c9cb1b22cc17c4db573e0e613a5f116ff0092e.tar.xz
More work on the types. This commit builds but has errors.
Rework src/headers entirely: build skalibs/types.h Convert skalibs/fmtscan.h types. Propagate changes until it builds. There are a lot of incompatible pointer issues remaining, those will be fixed with the buffer overhaul.
Diffstat (limited to 'configure')
-rwxr-xr-xconfigure36
1 files changed, 21 insertions, 15 deletions
diff --git a/configure b/configure
index 1579025..fe7f1b8 100755
--- a/configure
+++ b/configure
@@ -155,16 +155,26 @@ choose () {
fi
}
-trytypesize () {
- echo "Checking size of $3..."
- $CC_AUTO $CPPFLAGS_AUTO $CFLAGS_AUTO $LDFLAGS_AUTO -o trysizeof$1 src/sysdeps/trysizeof$1.c
- type_size=$(./trysizeof$1) || fail "$0: unable to determine size of $3"
- type_bits=$(expr 8 \* $type_size)
- rm -f trysizeof$1
- echo "sizeof$1: $type_size" >> $sysdeps/sysdeps
- echo "#define ${package_macro_name}_SIZEOF$2 $type_size" >> $sysdeps/sysdeps.h
- echo "#define ${package_macro_name}_$2_BITS $type_bits" >> $sysdeps/sysdeps.h
- echo " ... $type_size"
+trytypes () {
+ echo "Checking size and signedness of standard types..."
+ $CC_AUTO $CPPFLAGS_AUTO $CFLAGS_AUTO $LDFLAGS_AUTO -o output-types src/sysdeps/output-types.c
+ ./output-types >> $sysdeps/sysdeps
+ ./output-types | grep -F sizeof | while read key value ; do
+ caps=$(echo $key | sed s/:\$// | tr a-z A-Z)
+ echo "#define ${package_macro_name}_${caps} $value" >> $sysdeps/sysdeps.h
+ done
+ ./output-types | grep -F signed | while read key value ; do
+ caps=$(echo $key | sed s/:\$// | tr a-z A-Z)
+ if test $value = yes ; then
+ echo "#define ${package_macro_name}_HASSIGNED${caps}"
+ echo "#undef ${package_macro_name}_HASUNSIGNED${caps}"
+ else
+ echo "#undef ${package_macro_name}_HASSIGNED${caps}"
+ echo "#define ${package_macro_name}_HASUNSIGNED${caps}"
+ fi >> $sysdeps/sysdeps.h
+ done
+ rm -f output-types
+ echo " ... done"
}
trylibs () {
@@ -471,11 +481,7 @@ EOF
echo " ... $endianness"
rm -f tryendianness
- trytypesize ushort USHORT "unsigned short"
- trytypesize uint UINT "unsigned int"
- trytypesize ulong ULONG "unsigned long"
- trytypesize gid GID "gid_t"
- trytypesize time TIME "time_t"
+ trytypes
choose clr accept4 ACCEPT4 'accept4()'
choose clr ancilautoclose ANCILAUTOCLOSE 'auto-close after fd-passing'
choose c cmsgcloexec CMSGCLOEXEC 'MSG_CMSG_CLOEXEC'