]> git.tuebingen.mpg.de Git - paraslash.git/commitdiff
build: cppflags/ldflags conversion: libid3tag
authorAndre Noll <maan@systemlinux.org>
Fri, 13 Sep 2013 05:12:58 +0000 (05:12 +0000)
committerAndre Noll <maan@systemlinux.org>
Sun, 1 Dec 2013 10:51:58 +0000 (11:51 +0100)
This removes the rule for mp3_afh.o so that this object will instead
be created by means of the generic rule. To make this work, CPPFLAGS is
modified for this target to include suitable cpp options for libid3tag
as determined during configure.

Similarly, the linker flags for libid3tag are removed from
server_ldflags, afh_ldflags, play_ldflags, recv_ldflags and
play_ldflags, and appropriate linker flags are added to LDFLAGS for
all executables that need it.

Makefile.in
configure.ac

index df61b2fb273b5a0ec37ffba9c60f99c1b3014a09..54cfd44128f7fa9864ccd88e204a619648778af2 100644 (file)
@@ -19,6 +19,8 @@ GENGETOPT := @gengetopt@
 HELP2MAN := @help2man@
 MKDIR_P := mkdir -p
 
+id3tag_ldflags := @id3tag_ldflags@
+
 build_date := $(shell date)
 uname_s := $(shell uname -s 2>/dev/null || echo "UNKNOWN_OS")
 uname_rs := $(shell uname -rs)
@@ -198,9 +200,9 @@ $(object_dir)/aac_afh.o: aac_afh.c | $(object_dir)
        @[ -z "$(Q)" ] || echo 'CC $<'
        $(Q) $(CC) -c -o $@ $(CPPFLAGS) $(DEBUG_CPPFLAGS) @faad_cppflags@ $<
 
+
+$(object_dir)/mp3_afh.o: CPPFLAGS += @id3tag_cppflags@
 $(object_dir)/mp3_afh.o: mp3_afh.c | $(object_dir)
-       @[ -z "$(Q)" ] || echo 'CC $<'
-       $(Q) $(CC) -c -o $@ $(CPPFLAGS) $(DEBUG_CPPFLAGS) @id3tag_cppflags@ $<
 
 $(object_dir)/gui%.o: gui%.c | $(object_dir)
        @[ -z "$(Q)" ] || echo 'CC $<'
@@ -251,6 +253,8 @@ ifeq ($(findstring clean, $(MAKECMDGOALS)),)
 -include $(m4_deps)
 endif
 
+para_recv para_afh para_play para_server: LDFLAGS += $(id3tag_ldflags)
+
 para_recv: $(recv_objs)
        @[ -z "$(Q)" ] || echo 'LD $@'
        $(Q) $(CC) $(recv_objs) -o $@ @recv_ldflags@ $(LDFLAGS)
index dec0636f8acec1333d261bfd597868b51b28e54e..f4049373d56391b3dbff79d166ed9969eff5607d 100644 (file)
@@ -823,14 +823,8 @@ AC_MSG_RESULT($have_libid3tag)
 
 if test ${have_libid3tag} = yes; then
        AC_DEFINE(HAVE_LIBID3TAG, 1, define to 1 you have libid3tag)
-       server_ldflags="$server_ldflags $id3tag_libs -lid3tag -lz"
-       afh_ldflags="$afh_ldflags $id3tag_libs -lid3tag -lz"
-       play_ldflags="$play_ldflags -lz"
-       recv_ldflags="$recv_ldflags $id3tag_libs -lid3tag"
-       play_ldflags="$play_ldflags $id3tag_libs -lid3tag"
        AC_SUBST(id3tag_cppflags)
-else
-       AC_MSG_WARN([no support for id3v2 tags])
+       AC_SUBST(id3tag_ldflags, "$id3tag_libs -lid3tag -lz")
 fi
 CPPFLAGS="$OLD_CPPFLAGS"
 LDFLAGS="$OLD_LDFLAGS"