Fix cygwin compile. Initial mingw cleanup.

cygwin and mingw is now hiding M_PI_2 defines with -ansi flag.
Remove to fix cygwin compile.
Mingw doesn't support fork() so default to pthreads.
Add u_short to complete definition of u_* types which helps out mingw
when we define _BSDTYPES_DEFINED.

Signed-off-by: Chris Bagwell <chris@cnpbagwell.com>
merge-requests/1/head
Chris Bagwell 2010-04-07 20:43:32 -05:00
rodzic a0f203c998
commit 3c21ae5f70
4 zmienionych plików z 158 dodań i 34 usunięć

Wyświetl plik

@ -1,3 +1,10 @@
2010-04-07 Chris Bagwell <chris at cnpbagwell dot com>
* acinclude.m4: cygwin and mingw is now hiding M_PI_2
defines with -ansi flag. Remove to fix cygwin compile.
Mingw doesn't support fork() so default to pthreads.
Add u_short to complete definition of u_* types which
helps out ming when we define _BSDTYPES_DEFINED.
2010-03-25 Stéphane Voltz <stef.dev at free.fr>
* backend/p5.c backend/p5_device.[ch] backend/genesys_gl646.c:
replace u_int8_t and u_int16_t by uint8_t and uint16_t

Wyświetl plik

@ -41,10 +41,10 @@ if test "${ac_cv_c_compiler_gnu}" = "yes"; then
-Wstrict-prototypes \
-pedantic"
# OS/2 and others don't include some headers with -ansi enabled
# Some platforms are overly strict with -ansi enabled. Exclude those.
ANSI_FLAG=-ansi
case "${host_os}" in
solaris* | hpux* | os2* | darwin* )
solaris* | hpux* | os2* | darwin* | cygwin* | mingw*)
ANSI_FLAG=
;;
esac
@ -220,7 +220,7 @@ AC_DEFUN([SANE_CHECK_PTHREAD],
[
case "${host_os}" in
darwin*) # currently only enabled on MacOS X
darwin* | mingw*) # currently only enabled on MacOS X on MINGW
use_pthread=yes
;;
*)
@ -234,7 +234,7 @@ AC_DEFUN([SANE_CHECK_PTHREAD],
AC_ARG_ENABLE([pthread],
AC_HELP_STRING([--enable-pthread],
[use pthread instead of fork (default=yes for MacOS X, no for everything else)]),
[use pthread instead of fork (default=yes for MacOS X/MINGW, no for everything else)]),
[
if test $enableval = yes ; then
use_pthread=yes
@ -428,7 +428,7 @@ dnl Use new style of check types that doesn't take default to use.
dnl The old style would add an #undef of the type check on platforms
dnl that defined that type... That is not portable to platform that
dnl define it as a #define.
AC_CHECK_TYPES([u_char, u_int, u_long],,,)
AC_CHECK_TYPES([u_char, u_short, u_int, u_long],,,)
])
#
@ -663,9 +663,16 @@ AC_DEFUN([SANE_PROTOTYPES],
[
AH_BOTTOM([
#if defined(__MINGW32__)
#define _BSDTYPES_DEFINED
#endif
#ifndef HAVE_U_CHAR
#define u_char unsigned char
#endif
#ifndef HAVE_U_SHORT
#define u_short unsigned short
#endif
#ifndef HAVE_U_INT
#define u_int unsigned int
#endif
@ -744,7 +751,6 @@ unsigned int usleep (unsigned int useconds);
/* Prototype for vsyslog */
#ifndef HAVE_VSYSLOG
#define vsyslog sanei_vsyslog
#include <stdarg.h>
void vsyslog(int priority, const char *format, va_list args);
#endif

156
configure vendored
Wyświetl plik

@ -1656,7 +1656,7 @@ Optional Features:
--enable-warnings turn on tons of compiler warnings (GCC only)
--enable-rpath use runtime library search path [default=yes]
--enable-pthread use pthread instead of fork (default=yes for MacOS
X, no for everything else)
X/MINGW, no for everything else)
--enable-locking activate device locking (default=yes, but only used
by some backends)
--enable-avahi enable Avahi support for saned and the net backend
@ -5095,10 +5095,10 @@ if test "${ac_cv_c_compiler_gnu}" = "yes"; then
-Wstrict-prototypes \
-pedantic"
# OS/2 and others don't include some headers with -ansi enabled
# Some platforms are overly strict with -ansi enabled. Exclude those.
ANSI_FLAG=-ansi
case "${host_os}" in
solaris* | hpux* | os2* | darwin* )
solaris* | hpux* | os2* | darwin* | cygwin* | mingw*)
ANSI_FLAG=
;;
esac
@ -11515,7 +11515,7 @@ _ACEOF
case "${host_os}" in
darwin*) # currently only enabled on MacOS X
darwin* | mingw*) # currently only enabled on MacOS X on MINGW
use_pthread=yes
;;
*)
@ -13684,6 +13684,108 @@ cat >>confdefs.h <<_ACEOF
_ACEOF
fi
{ $as_echo "$as_me:$LINENO: checking for u_short" >&5
$as_echo_n "checking for u_short... " >&6; }
if test "${ac_cv_type_u_short+set}" = set; then
$as_echo_n "(cached) " >&6
else
ac_cv_type_u_short=no
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
$ac_includes_default
int
main ()
{
if (sizeof (u_short))
return 0;
;
return 0;
}
_ACEOF
rm -f conftest.$ac_objext
if { (ac_try="$ac_compile"
case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
$as_echo "$ac_try_echo") >&5
(eval "$ac_compile") 2>conftest.er1
ac_status=$?
grep -v '^ *+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
$as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } && {
test -z "$ac_c_werror_flag" ||
test ! -s conftest.err
} && test -s conftest.$ac_objext; then
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
$ac_includes_default
int
main ()
{
if (sizeof ((u_short)))
return 0;
;
return 0;
}
_ACEOF
rm -f conftest.$ac_objext
if { (ac_try="$ac_compile"
case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
$as_echo "$ac_try_echo") >&5
(eval "$ac_compile") 2>conftest.er1
ac_status=$?
grep -v '^ *+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
$as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } && {
test -z "$ac_c_werror_flag" ||
test ! -s conftest.err
} && test -s conftest.$ac_objext; then
:
else
$as_echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
ac_cv_type_u_short=yes
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
else
$as_echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
fi
{ $as_echo "$as_me:$LINENO: result: $ac_cv_type_u_short" >&5
$as_echo "$ac_cv_type_u_short" >&6; }
if test "x$ac_cv_type_u_short" = x""yes; then
cat >>confdefs.h <<_ACEOF
#define HAVE_U_SHORT 1
_ACEOF
fi
{ $as_echo "$as_me:$LINENO: checking for u_int" >&5
$as_echo_n "checking for u_int... " >&6; }
@ -18861,7 +18963,7 @@ ia64-*-hpux*)
;;
*-*-irix6*)
# Find out which ABI we are using.
echo '#line 18864 "configure"' > conftest.$ac_ext
echo '#line 18966 "configure"' > conftest.$ac_ext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
(eval $ac_compile) 2>&5
ac_status=$?
@ -21760,11 +21862,11 @@ else
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
(eval echo "\"\$as_me:21763: $lt_compile\"" >&5)
(eval echo "\"\$as_me:21865: $lt_compile\"" >&5)
(eval "$lt_compile" 2>conftest.err)
ac_status=$?
cat conftest.err >&5
echo "$as_me:21767: \$? = $ac_status" >&5
echo "$as_me:21869: \$? = $ac_status" >&5
if (exit $ac_status) && test -s "$ac_outfile"; then
# The compiler can only warn and ignore the option if not recognized
# So say no if there are warnings other than the usual output.
@ -22050,11 +22152,11 @@ else
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
(eval echo "\"\$as_me:22053: $lt_compile\"" >&5)
(eval echo "\"\$as_me:22155: $lt_compile\"" >&5)
(eval "$lt_compile" 2>conftest.err)
ac_status=$?
cat conftest.err >&5
echo "$as_me:22057: \$? = $ac_status" >&5
echo "$as_me:22159: \$? = $ac_status" >&5
if (exit $ac_status) && test -s "$ac_outfile"; then
# The compiler can only warn and ignore the option if not recognized
# So say no if there are warnings other than the usual output.
@ -22154,11 +22256,11 @@ else
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
(eval echo "\"\$as_me:22157: $lt_compile\"" >&5)
(eval echo "\"\$as_me:22259: $lt_compile\"" >&5)
(eval "$lt_compile" 2>out/conftest.err)
ac_status=$?
cat out/conftest.err >&5
echo "$as_me:22161: \$? = $ac_status" >&5
echo "$as_me:22263: \$? = $ac_status" >&5
if (exit $ac_status) && test -s out/conftest2.$ac_objext
then
# The compiler can only warn and ignore the option if not recognized
@ -24556,7 +24658,7 @@ else
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<EOF
#line 24559 "configure"
#line 24661 "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
@ -24656,7 +24758,7 @@ else
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<EOF
#line 24659 "configure"
#line 24761 "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
@ -27069,11 +27171,11 @@ else
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
(eval echo "\"\$as_me:27072: $lt_compile\"" >&5)
(eval echo "\"\$as_me:27174: $lt_compile\"" >&5)
(eval "$lt_compile" 2>conftest.err)
ac_status=$?
cat conftest.err >&5
echo "$as_me:27076: \$? = $ac_status" >&5
echo "$as_me:27178: \$? = $ac_status" >&5
if (exit $ac_status) && test -s "$ac_outfile"; then
# The compiler can only warn and ignore the option if not recognized
# So say no if there are warnings other than the usual output.
@ -27173,11 +27275,11 @@ else
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
(eval echo "\"\$as_me:27176: $lt_compile\"" >&5)
(eval echo "\"\$as_me:27278: $lt_compile\"" >&5)
(eval "$lt_compile" 2>out/conftest.err)
ac_status=$?
cat out/conftest.err >&5
echo "$as_me:27180: \$? = $ac_status" >&5
echo "$as_me:27282: \$? = $ac_status" >&5
if (exit $ac_status) && test -s out/conftest2.$ac_objext
then
# The compiler can only warn and ignore the option if not recognized
@ -28758,11 +28860,11 @@ else
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
(eval echo "\"\$as_me:28761: $lt_compile\"" >&5)
(eval echo "\"\$as_me:28863: $lt_compile\"" >&5)
(eval "$lt_compile" 2>conftest.err)
ac_status=$?
cat conftest.err >&5
echo "$as_me:28765: \$? = $ac_status" >&5
echo "$as_me:28867: \$? = $ac_status" >&5
if (exit $ac_status) && test -s "$ac_outfile"; then
# The compiler can only warn and ignore the option if not recognized
# So say no if there are warnings other than the usual output.
@ -28862,11 +28964,11 @@ else
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
(eval echo "\"\$as_me:28865: $lt_compile\"" >&5)
(eval echo "\"\$as_me:28967: $lt_compile\"" >&5)
(eval "$lt_compile" 2>out/conftest.err)
ac_status=$?
cat out/conftest.err >&5
echo "$as_me:28869: \$? = $ac_status" >&5
echo "$as_me:28971: \$? = $ac_status" >&5
if (exit $ac_status) && test -s out/conftest2.$ac_objext
then
# The compiler can only warn and ignore the option if not recognized
@ -31083,11 +31185,11 @@ else
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
(eval echo "\"\$as_me:31086: $lt_compile\"" >&5)
(eval echo "\"\$as_me:31188: $lt_compile\"" >&5)
(eval "$lt_compile" 2>conftest.err)
ac_status=$?
cat conftest.err >&5
echo "$as_me:31090: \$? = $ac_status" >&5
echo "$as_me:31192: \$? = $ac_status" >&5
if (exit $ac_status) && test -s "$ac_outfile"; then
# The compiler can only warn and ignore the option if not recognized
# So say no if there are warnings other than the usual output.
@ -31373,11 +31475,11 @@ else
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
(eval echo "\"\$as_me:31376: $lt_compile\"" >&5)
(eval echo "\"\$as_me:31478: $lt_compile\"" >&5)
(eval "$lt_compile" 2>conftest.err)
ac_status=$?
cat conftest.err >&5
echo "$as_me:31380: \$? = $ac_status" >&5
echo "$as_me:31482: \$? = $ac_status" >&5
if (exit $ac_status) && test -s "$ac_outfile"; then
# The compiler can only warn and ignore the option if not recognized
# So say no if there are warnings other than the usual output.
@ -31477,11 +31579,11 @@ else
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
(eval echo "\"\$as_me:31480: $lt_compile\"" >&5)
(eval echo "\"\$as_me:31582: $lt_compile\"" >&5)
(eval "$lt_compile" 2>out/conftest.err)
ac_status=$?
cat out/conftest.err >&5
echo "$as_me:31484: \$? = $ac_status" >&5
echo "$as_me:31586: \$? = $ac_status" >&5
if (exit $ac_status) && test -s out/conftest2.$ac_objext
then
# The compiler can only warn and ignore the option if not recognized

Wyświetl plik

@ -402,6 +402,9 @@
/* Define to 1 if the system has the type `u_long'. */
#undef HAVE_U_LONG
/* Define to 1 if the system has the type `u_short'. */
#undef HAVE_U_SHORT
/* Define to 1 if you have the `vsyslog' function. */
#undef HAVE_VSYSLOG
@ -558,9 +561,16 @@
#if defined(__MINGW32__)
#define _BSDTYPES_DEFINED
#endif
#ifndef HAVE_U_CHAR
#define u_char unsigned char
#endif
#ifndef HAVE_U_SHORT
#define u_short unsigned short
#endif
#ifndef HAVE_U_INT
#define u_int unsigned int
#endif
@ -639,7 +649,6 @@ unsigned int usleep (unsigned int useconds);
/* Prototype for vsyslog */
#ifndef HAVE_VSYSLOG
#define vsyslog sanei_vsyslog
#include <stdarg.h>
void vsyslog(int priority, const char *format, va_list args);
#endif