*** empty log message ***
[arla.git] / scripts / mingwin.sh
blob2e4828a5840b7fcd59cd4a7fde1f4e8a30d037c9
1 #!/bin/sh
3 # $Id$
5 # A warper around configure for the mingw environment.
6 # Enables the user to at least get thru running configure
7 # and compileing libroken.
9 # It also serves as documentaion of what is lacking the
10 # current implementation (like in roken, and c/o)
14 progname=`basename $0`
15 srcdir=`dirname $0`/..
17 toolchain=/usr/pkg/cross/i386-mingw32/bin
19 while true
21 case $1 in
22 --mingw-arla-srcdir)
23 if [ X$2 = X ] ; then
24 echo $progname: missing argument to --srcdir
25 exit 1;
27 srcdir=$2
28 shift 2
30 --mingw-toolchain)
31 if [ X$2 = X ] ; then
32 echo $progname: missing argument to --srcdir
33 exit 1;
35 toolchain=$2
36 shift 2
38 *) break;;
39 esac
40 done
42 echo $srcdir
44 if [ ! -f $srcdir/arlad/arla.c ]; then
45 echo Missing arla srcdir as first argument
46 exit 1
49 if [ ! -f $toolchain/gcc ]; then
50 echo Missing mingw toolchain
51 exit 1
54 PATH="$toolchain:$PATH"
55 export PATH
57 ARGS="$ARGS --enable-littleendian"
58 ARGS="$ARGS --without-x"
59 ARGS="$ARGS --disable-mmap"
60 ARGS="$ARGS --without-krb5"
61 ARGS="$ARGS --without-krb4"
63 env \
64 ac_cv_htonl_works=yes \
65 ac_cv_var_h_errno=yes \
66 ac_cv_func_localtime_r=yes \
67 ac_cv_func_getusershell=yes \
68 ac_cv_func_vsyslog=yes \
69 $srcdir/configure $ARGS $* i386-unknown-mingw32
71 touch include/bits.o
72 touch include/bits
74 cat > include/atypes.h <<EOF
75 #ifndef __ATYPES_H
76 #define __ATYPES_H 1
78 #include <stdint.h>
80 typedef u_int8_t uint8_t;
81 typedef u_int16_t uint16_t;
82 typedef u_int32_t uint32_t;
83 typedef u_int64_t uint64_t;
85 #endif
87 EOF