Re: [flac-dev] [PATCH 2/2] Update and improve autotools build

2012-04-07 Thread Erik de Castro Lopo
Cristian Rodríguez wrote:

> - INCLUDES is deprecated, and CPPFLAGS is an user-defined
>   variable, use the proper AM_CPPFLAGS instead
> 
> - Remove FLAC__INLINE definition, providing proper
>   replacement for MSVC compilers.
> 
> - Detect if we have C99 's lround and provide a replacement
>   for windows...

Applied all that. This patch was really three patches bundled
into one. In future, if you are fixing there separate things,
please send three separate patches. Smaller, separate patches
makes it easier for me to evaluate.

Thanks and cheers,
Erik

-- 
--
Erik de Castro Lopo
http://www.mega-nerd.com/
___
flac-dev mailing list
flac-dev@xiph.org
http://lists.xiph.org/mailman/listinfo/flac-dev


[flac-dev] [PATCH 2/2] Update and improve autotools build

2012-04-07 Thread Cristian Rodríguez
- INCLUDES is deprecated, and CPPFLAGS is an user-defined
  variable, use the proper AM_CPPFLAGS instead

- Remove FLAC__INLINE definition, providing proper
  replacement for MSVC compilers.

- Detect if we have C99 's lround and provide a replacement
  for windows...
---
 configure.ac   |   32 
 examples/c/decode/file/Makefile.am |2 +-
 examples/c/encode/file/Makefile.am |2 +-
 examples/cpp/decode/file/Makefile.am   |2 +-
 examples/cpp/encode/file/Makefile.am   |2 +-
 include/FLAC++/Makefile.am |2 +-
 src/flac/Makefile.am   |2 +-
 src/libFLAC++/Makefile.am  |2 +-
 src/libFLAC/Makefile.am|5 +++--
 src/libFLAC/bitreader.c|   14 +---
 src/libFLAC/bitwriter.c|   16 ++
 src/libFLAC/ia32/Makefile.am   |2 +-
 src/libFLAC/include/private/macros.h   |6 ++
 src/libFLAC/lpc.c  |   28 
 src/libFLAC/stream_encoder.c   |7 ++
 src/metaflac/Makefile.am   |2 +-
 src/plugin_common/Makefile.am  |2 +-
 src/plugin_xmms/Makefile.am|3 +--
 src/share/getopt/Makefile.am   |2 +-
 src/share/grabbag/Makefile.am  |2 +-
 src/share/replaygain_analysis/Makefile.am  |2 +-
 src/share/replaygain_synthesis/Makefile.am |2 +-
 src/share/utf8/Makefile.am |2 +-
 src/test_grabbag/cuesheet/Makefile.am  |1 +
 src/test_grabbag/picture/Makefile.am   |2 +-
 src/test_libFLAC++/Makefile.am |2 +-
 src/test_libFLAC/Makefile.am   |2 +-
 src/test_libs_common/Makefile.am   |2 +-
 src/test_seeking/Makefile.am   |2 +-
 src/test_streams/Makefile.am   |2 +-
 30 files changed, 68 insertions(+), 86 deletions(-)

diff --git a/configure.ac b/configure.ac
index 7627fb7..e794ca2 100644
--- a/configure.ac
+++ b/configure.ac
@@ -18,27 +18,18 @@
 # 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])])
 
 
 #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])
-
+LT_INIT([win32-dll disable-static pic-only])
 AM_PROG_AS
 AC_PROG_CXX
 AC_PROG_MAKE_SET
@@ -47,7 +38,7 @@ AC_SYS_LARGEFILE
 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)
 
@@ -348,18 +339,13 @@ AC_DEFINE(FLAC__HAS_GAS)
 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"
+CFLAGS="-O3 -funroll-loops -Wall -W -Winline $CFLAGS"
fi
 fi
 
diff --git a/examples/c/decode/file/Makefile.am 
b/examples/c/decode/file/Makefile.am
index 11a48bf..30f8691 100644
--- a/examples/c/decode/file/Makefile.am
+++ b/examples/c/decode/file/Makefile.am
@@ -19,7 +19,7 @@ EXTRA_DIST = \
Makefile.lite \
example_c_decode_file.dsp \
example_c_decode_file.vcproj
-
+AM_CPPFLAGS = -I$(top_builddir) -I$(srcdir)/include -I$(top_srcdir)/include
 noinst_PROGRAMS = example_c_decode_file
 example_c_decode_file_LDADD = \
$(top_builddir)/src/libFLAC/libFLAC.la \
diff --git a/examples/c/encode/file/Makefile.am 
b/examples/c/encode/file/Makefile.am
index 5ae7a63..0ed519a 100644
--- a/examples/c/encode/file/Makefile.am
+++ b/examples/c/encode/f