Fix -Werror=format-security errors.
[flac.git] / configure.ac
index 9daa52c..f56c188 100644 (file)
@@ -22,10 +22,6 @@ AC_INIT(src/flac/main.c)
 AM_INIT_AUTOMAKE(flac, 1.2.1)
 m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
 
-# Don't automagically regenerate autoconf/automake generated files unless
-# explicitly requested.  Eases autobuilding -mdz
-AM_MAINTAINER_MODE
-
 # Enable the generation of shared libraries under Win32
 AC_LIBTOOL_WIN32_DLL
 
@@ -37,6 +33,7 @@ sed -e 's/^build_old_libs=yes/build_old_libs=no/' libtool > libtool-disable-stat
 chmod +x libtool-disable-static
 
 AC_SUBST(ACLOCAL_AMFLAGS, "-I m4")
+AC_CONFIG_MACRO_DIR([m4])
 
 AM_PROG_AS
 AC_PROG_CXX
@@ -57,8 +54,11 @@ if test $ac_cv_c_vararrays = yes; then
        AC_DEFINE([HAVE_CXX_VARARRAYS], 1, [Define to 1 if C++ supports variable-length arrays.])
 fi
 AC_LANG_POP(C++)
+
 # c flavor
 AC_HEADER_STDC
+AC_C_INLINE
+AC_C_VARARRAYS
 
 AC_CHECK_HEADERS(stdint.h)
 AC_SUBST(HAVE_STDINT_H)
@@ -67,11 +67,17 @@ AC_SUBST(HAVE_INTTYPES_H)
 AC_CHECK_HEADERS(byteswap.h)
 AC_SUBST(HAVE_BYTESWAP_H)
 
-AC_C_VARARRAYS
+XIPH_C_BSWAP32
 
-AC_C_BIGENDIAN
-AC_C_INLINE
+XIPH_C_FIND_ENDIAN
+AC_DEFINE_UNQUOTED(CPU_IS_BIG_ENDIAN, ${ac_cv_c_big_endian},
+                                       [Target processor is big endian.])
+AC_DEFINE_UNQUOTED(CPU_IS_LITTLE_ENDIAN, ${ac_cv_c_little_endian},
+                                       [Target processor is little endian.])
+AC_DEFINE_UNQUOTED(WORDS_BIGENDIAN, ${ac_cv_c_big_endian},
+                                       [Target processor is big endian.])
 
+# For the XMMS plugin.
 AC_CHECK_TYPES(socklen_t, [], [])
 
 dnl check for getopt in standard library
@@ -103,24 +109,29 @@ case "$host" in
        i386-*-openbsd3.[[0-3]]) OBJ_FORMAT=aoutb ;;
        *-*-cygwin|*mingw*) OBJ_FORMAT=win32 ;;
        *-*-darwin*) OBJ_FORMAT=macho ;;
+       *emx*) OBJ_FORMAT=aout ;;
        *) OBJ_FORMAT=elf ;;
 esac
 AC_SUBST(OBJ_FORMAT)
+case "$host" in
+       *-gnuspe)
+               abi_spe=true
+               AC_DEFINE(FLAC__CPU_PPC_SPE)
+               AH_TEMPLATE(FLAC__CPU_PPC_SPE, [define if building for PowerPC with SPE ABI])
+               ;;
+esac
+AM_CONDITIONAL(FLaC__CPU_PPC_SPE, test "x$abi_spe" = xtrue)
 
 case "$host" in
-       *-*-cygwin|*mingw*)
-               # define this variable for enabling strict exports with libtool; for now, it's only supported by Win32
+       *-*-cygwin|*mingw*|*emx*)
+               # define this variable for enabling strict exports with libtool; for now, it's supported by Win32 and OS/2
                LT_NO_UNDEFINED="-no-undefined"
-               # -lwsock32 only needed because of ntohl() usage, can get rid of after that's gone:
-               MINGW_WINSOCK_LIBS=-lwsock32
                ;;
        *)
                LT_NO_UNDEFINED=
-               MINGW_WINSOCK_LIBS=
                ;;
 esac
 AC_SUBST(LT_NO_UNDEFINED)
-AC_SUBST(MINGW_WINSOCK_LIBS)
 
 case "$host" in
        *-pc-linux-gnu)