[flac-dev] [PATCH 1/5] configure.ac: Allow the programs to be disabled

Hugo Beauzée-Luyssen hugo at beauzee.fr
Fri Jan 6 12:53:35 UTC 2017


In case one only wants the libflac to be built
---
 configure.ac             |  3 +++
 src/flac/Makefile.am     | 13 +++++++++----
 src/metaflac/Makefile.am |  8 ++++++--
 3 files changed, 18 insertions(+), 6 deletions(-)

diff --git a/configure.ac b/configure.ac
index 070ab357..94449510 100644
--- a/configure.ac
+++ b/configure.ac
@@ -359,6 +359,9 @@ AC_DEFINE_UNQUOTED([FLAC__HAS_OGG],$FLAC__HAS_OGG,[define if you have the ogg li
 AC_SUBST(FLAC__HAS_OGG)
 AC_SUBST(OGG_PACKAGE)
 
+AC_ARG_ENABLE([bin], AC_HELP_STRING([--disable-bin], [Do not build the flac program]))
+AM_CONDITIONAL([FLaC__HAS_BIN], [test "${enable_bin}" != "no"])
+
 dnl check for i18n(internationalization); these are from libiconv/gettext
 AM_ICONV
 AM_LANGINFO_CODESET
diff --git a/src/flac/Makefile.am b/src/flac/Makefile.am
index bf3bf468..a6de246d 100644
--- a/src/flac/Makefile.am
+++ b/src/flac/Makefile.am
@@ -16,10 +16,6 @@
 #  with this program; if not, write to the Free Software Foundation, Inc.,
 #  51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
 
-bin_PROGRAMS = flac
-
-AM_CFLAGS = @OGG_CFLAGS@
-AM_CPPFLAGS = -I$(top_builddir) -I$(srcdir)/include -I$(top_srcdir)/include
 EXTRA_DIST = \
 	Makefile.lite \
 	Makefile.lite.iffscan \
@@ -31,6 +27,13 @@ EXTRA_DIST = \
 	iffscan.vcxproj \
 	iffscan.vcxproj.filters
 
+if FLaC__HAS_BIN
+
+bin_PROGRAMS = flac
+
+AM_CFLAGS = @OGG_CFLAGS@
+AM_CPPFLAGS = -I$(top_builddir) -I$(srcdir)/include -I$(top_srcdir)/include
+
 flac_SOURCES = \
 	analyze.c \
 	decode.c \
@@ -64,3 +67,5 @@ flac_LDADD = \
 	-lm
 
 CLEANFILES = flac.exe
+
+endif
diff --git a/src/metaflac/Makefile.am b/src/metaflac/Makefile.am
index 7a4ec6b6..5913139b 100644
--- a/src/metaflac/Makefile.am
+++ b/src/metaflac/Makefile.am
@@ -16,8 +16,6 @@
 #  with this program; if not, write to the Free Software Foundation, Inc.,
 #  51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
 
-bin_PROGRAMS = metaflac
-
 AM_CFLAGS = @OGG_CFLAGS@
 AM_CPPFLAGS = -I$(top_builddir) -I$(srcdir)/include -I$(top_srcdir)/include
 EXTRA_DIST = \
@@ -26,6 +24,10 @@ EXTRA_DIST = \
 	metaflac.vcxproj \
 	metaflac.vcxproj.filters
 
+if FLaC__HAS_BIN
+
+bin_PROGRAMS = metaflac
+
 metaflac_SOURCES = \
 	main.c \
 	operations.c \
@@ -58,3 +60,5 @@ metaflac_LDADD = \
 	@LIBICONV@
 
 CLEANFILES = metaflac.exe
+
+endif
-- 
2.11.0



More information about the flac-dev mailing list