# NOTE that for many of the AM_CONDITIONALs we use the prefix FLaC__
# instead of FLAC__ since autoconf triggers off 'AC_' in strings
-AC_INIT(src/flac/main.c)
-AM_INIT_AUTOMAKE(flac, 1.2.1)
+AC_PREREQ(2.60)
+AC_INIT([flac], [1.2.1])
+AC_CONFIG_SRCDIR([src/flac/main.c])
+AC_CONFIG_MACRO_DIR([m4])
+AM_INIT_AUTOMAKE([foreign -Wall tar-pax no-dist-gzip dist-xz subdir-objects])
m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
+user_cflags=$CFLAGS
#Prefer whatever the current ISO standard is.
AC_PROG_CC_STDC
AC_USE_SYSTEM_EXTENSIONS
-# Enable the generation of shared libraries under Win32
-AC_LIBTOOL_WIN32_DLL
-
-# We need two libtools, one that builds both shared and static, and
-# one that builds only static. This is because the resulting libtool
-# does not allow us to choose which to build at runtime.
-AM_PROG_LIBTOOL
-sed -e 's/^build_old_libs=yes/build_old_libs=no/' libtool > libtool-disable-static
-chmod +x libtool-disable-static
-
-AC_SUBST(ACLOCAL_AMFLAGS, "-I m4")
-AC_CONFIG_MACRO_DIR([m4])
-
+m4_ifdef([AM_PROG_AR], [AM_PROG_AR])
+LT_INIT([win32-dll disable-static pic-only])
AM_PROG_AS
AC_PROG_CXX
AC_PROG_MAKE_SET
AC_FUNC_FSEEKO
AC_CHECK_SIZEOF(void*,0)
-
+AC_SEARCH_LIBS([lround],[m], [AC_DEFINE(HAVE_LROUND,1,lround support)])
#@@@ new name is AC_CONFIG_HEADERS
AM_CONFIG_HEADER(config.h)
XIPH_C_BSWAP32
-XIPH_C_FIND_ENDIAN
+ac_cv_c_big_endian=0
+ac_cv_c_little_endian=0
+AC_C_BIGENDIAN([ac_cv_c_big_endian=1], [ac_cv_c_little_endian=1], [
+ AC_MSG_WARN([[*****************************************************************]])
+ AC_MSG_WARN([[*** Not able to determine endian-ness of target processor. ]])
+ AC_MSG_WARN([[*** The constants CPU_IS_BIG_ENDIAN and CPU_IS_LITTLE_ENDIAN in ]])
+ AC_MSG_WARN([[*** config.h may need to be hand editied. ]])
+ AC_MSG_WARN([[*****************************************************************]])
+])
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},
AM_CONDITIONAL(FLaC__HAS_OGG, [test "x$have_ogg" = xyes])
if test "x$have_ogg" = xyes ; then
-AC_DEFINE(FLAC__HAS_OGG)
-AH_TEMPLATE(FLAC__HAS_OGG, [define if you have the ogg library])
+ AC_DEFINE_UNQUOTED([FLAC__HAS_OGG],1,[define if you have the ogg library])
+else
+ AC_DEFINE_UNQUOTED([FLAC__HAS_OGG],0)
fi
dnl check for i18n(internationalization); these are from libiconv/gettext
AH_TEMPLATE(FLAC__HAS_GAS, [define if you are compiling for PowerPC and have the 'gas' assembler])
fi
-CPPFLAGS='-I$(top_builddir) -I$(srcdir)/include -I$(top_srcdir)/include'" $CPPFLAGS"
if test "x$debug" = xtrue; then
- CPPFLAGS="-DDEBUG -DFLaC__INLINE= $CPPFLAGS"
+ CPPFLAGS="-DDEBUG $CPPFLAGS"
CFLAGS="-g $CFLAGS"
else
CPPFLAGS="-DNDEBUG $CPPFLAGS"
- # $ac_cv_c_inline from AC_C_INLINE
- if test "x$ac_cv_c_inline" != xno ; then
- CPPFLAGS="-DFLaC__INLINE=$ac_cv_c_inline $CPPFLAGS"
- fi
if test "x$GCC" = xyes; then
- CFLAGS="-O3 -funroll-loops -finline-functions -Wall -W -Winline $CFLAGS"
+ if test "x$user_cflags" = x; then
+ CFLAGS="-O3 -funroll-loops -Wall -W -Winline"
+ fi
fi
fi
if test x$ac_cv_c_compiler_gnu = xyes ; then
if test x$enable_gcc_werror = "xyes" ; then
- CFLAGS="-Werror $CFLAGS"
- CXXFLAGS="-Werror $CXXFLAGS"
- fi
+ CFLAGS="-Wall -Wextra -Werror $CFLAGS"
+ CXXFLAGS="-Wall -Wextra -Werror $CXXFLAGS"
fi
+ if test "$GCC_MAJOR_VERSION" -ge 4 && test "$OBJ_FORMAT" = elf; then
+ CPPFLAGS="$CPPFLAGS -DFLAC__USE_VISIBILITY_ATTR"
+ CFLAGS="$CFLAGS -fvisibility=hidden"
+ CXXFLAGS="$CXXFLAGS -fvisibility=hidden"
+ fi
+fi
+
#@@@
AM_CONDITIONAL(FLaC__HAS_AS__TEMPORARILY_DISABLED, test "yes" = "no")