[Xfce4-commits] [apps/xfce4-volumed-pulse] 46/62: redo proper autotoolize similar to xfce components

noreply at xfce.org noreply at xfce.org
Thu Sep 8 10:33:08 CEST 2016


This is an automated email from the git hooks/post-receive script.

ochosi pushed a commit to branch master
in repository apps/xfce4-volumed-pulse.

commit 33e6ea9e4e5db7505fabe3d81d2e266547467990
Author: Lionel Le Folgoc <lionel at lefolgoc.net>
Date:   Fri May 25 17:56:04 2012 +0200

    redo proper autotoolize similar to xfce components
---
 ChangeLog                        |  86 --------------------------------
 Makefile.am                      |  15 +++++-
 configure.ac                     |  83 -------------------------------
 configure.ac.in                  | 104 +++++++++++++++++++++++++++++++++++++++
 data/Makefile.am                 |  16 ++----
 data/xfce4-volumed-pulse.desktop |   7 +++
 data/xfce4-volumed.desktop       |  10 ----
 src/Makefile.am                  |  81 +++++++++++++++++++-----------
 src/xvd_data_types.h             |  18 ++++---
 src/xvd_keys.h                   |   4 ++
 10 files changed, 198 insertions(+), 226 deletions(-)

diff --git a/ChangeLog b/ChangeLog
deleted file mode 100644
index 2ac6d93..0000000
--- a/ChangeLog
+++ /dev/null
@@ -1,86 +0,0 @@
-2001-03-06  Steve Dodier <sidnioulz at gmail.com>
-	* Changed CFLAGS again in configure.ac
-
-2011-03-03  Steve Dodier <sidnioulz at gmail.com>
-	* Removed deprecated "Encoding" entry in .desktop file (thanks to Samuli Suominen)
-
-2011-03-03  Steve Dodier <sidnioulz at gmail.com>
-	* Allow compatibility with Libnotify 0.7 (thanks to Samuli Suominen for the patch)
-
-2011-03-03  Steve Dodier <sidnioulz at gmail.com>
-	* Partially applying a patch from Yves-Alexis Perez to allow custom CFLAGS when building in release mode
-
-2011-03-02  Steve Dodier <sidnioulz at gmail.com>
-	* Another check to avoid SIGFPE when calculating average volume (valid card/track but no volume channels)
-
-2010-11-18  Steve Dodier <sidnioulz at gmail.com>
-	* Check for volume channels before getting a GStreamer track's volume (fixes lp #667617)
-
-2010-11-18  Steve Dodier <sidnioulz at gmail.com>
-	* Add a value check incase a GStreamer track has a volume range of 0 (fixes lp #624520)
-
-2010-11-18  Steve Dodier <sidnioulz at gmail.com>
-	* Fix xfce4-volumed.desktop's exec argument (fixes lp #538407)
-
-2010-11-02  Steve Dodier <sidnioulz at gmail.com>
-	* Bind all variants of the volume keys with modifiers (fixes lp #665146)
-
-2010-06-07  Jérôme Guelfucci <jeromeg at xfce.org>
-	* Use libkeybinder instead of libxcb for key grabbing
-
-2009-11-05  Steve Dodier <sidnioulz at gmail.com>
-
-	* Use xfce4-dev-tools
-	* Now show the actual current volume with a mute icon when muting the volume
-	* Make sure the desktop file uses the correct prefix for its Exec value
-	* Fix a bug with sound cards without device names
-	* Use the low volume icon when volume is 0%, instead of the muted one
-	* Prevent a crash if there is no XF86Volume key on the system
-
-2009-10-31  Steve Dodier <sidnioulz at gmail.com>
-
-	* Add debug messages when a key is pressed
-	* Turn icon names into XDG-compliant names
-	* Remove x-canonical-private-synchronous from needed caps for gauge-based notifications
-
-2009-10-28  Steve Dodier <sidnioulz at gmail.com>
-
-	* Fix a build error with --disable-libnotify, patch from Ṣalāḥ ad-Dīn Yūsuf ibn Ayyūb
-
-2009-10-27  Steve Dodier <sidnioulz at gmail.com>
-
-	* Support for asynchronous libnotify daemons
-	* Move support for legacy libxcb-keysyms to the main branch with a build toggle
-	
-2009-09-04  Steve Dodier <sidnioulz at gmail.com>
-
-	* Volume initialisation now includes mute check
-	* Fixed a bug in volume calculation due to float truncating
-	* Replaced g_utf8_collate by g_strcmp0. Less accurate but at least doesn't corrupt strings
-	* Removed obsolete code
-	* Fixed an error preventing from building without libnotify
-
-2009-09-03  Steve Dodier <sidnioulz at gmail.com>
-
-	* Reworking the whole xfconf / mixer code to make it more solid
-
-2009-08-23  Steve Dodier <sidnioulz at gmail.com>
-
-	* Making sure that nothing wrong is done if the card exists but is trackless
-
-2009-08-17  Steve Dodier <sidnioulz at gmail.com>
-
-	* Adding debug mode
-
-2009-08-04	Steve Dodier <sidnioulz at gmail.com>
-
-	* Handle absence of sound card 
-
-2009-07-17	Steve Dodier <sidnioulz at gmail.com>
-
-	* Changed xfconf "/volume-step" to "/volume-step-size"
-	* Added a .desktop file for autostart 
-
-2009-06-21	Steve Dodier <sidnioulz at gmail.com>
-
-	* Setting up the files for the package 
diff --git a/Makefile.am b/Makefile.am
index 9768a98..b3ae02c 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -1 +1,14 @@
-SUBDIRS = src data
+# $Id$
+
+SUBDIRS = \
+	data \
+	src
+
+.PHONY: ChangeLog
+
+ChangeLog: Makefile
+	(GIT_DIR=$(top_srcdir)/.git git log > .changelog.tmp \
+	&& mv .changelog.tmp ChangeLog; rm -f .changelog.tmp) \
+	|| (touch ChangeLog; echo 'Git directory not found: installing possibly empty changelog.' >&2)
+
+dist-hook: ChangeLog
diff --git a/configure.ac b/configure.ac
deleted file mode 100644
index 86e00a5..0000000
--- a/configure.ac
+++ /dev/null
@@ -1,83 +0,0 @@
-AC_INIT([xfce4-volumed], [0.1.13], [http://bugs.launchpad.net/xfce4-volumed])
-AM_INIT_AUTOMAKE([AC_PACKAGE_TARNAME()], [AC_PACKAGE_VERSION()])
-
-AC_CONFIG_SRCDIR([src/main.c])
-AC_CONFIG_HEADER(config.h)
-
-AC_PROG_CC
-AM_PROG_CC_C_O
-
-PKG_CHECK_MODULES(GLIB, [glib-2.0])
-AC_SUBST(GLIB_CFLAGS)
-AC_SUBST(GLIB_LIBS)
-
-PKG_CHECK_MODULES(XFCONF, [libxfconf-0])
-AC_SUBST(XFCONF_CFLAGS)
-AC_SUBST(XFCONF_LIBS)
-
-PKG_CHECK_MODULES(LIBPULSE, [libpulse])
-AC_SUBST(LIBPULSE_CFLAGS)
-AC_SUBST(LIBPULSE_LIBS)
-
-PKG_CHECK_MODULES(LIBPULSEMAINLOOPGLIB, [libpulse-mainloop-glib])
-AC_SUBST(LIBPULSEMAINLOOPGLIB_CFLAGS)
-AC_SUBST(LIBPULSEMAINLOOPGLIB_LIBS)
-
-PKG_CHECK_MODULES(LIBKEYBINDER, [keybinder])
-AC_SUBST(LIBKEYBINDER_CFLAGS)
-AC_SUBST(LIBKEYBINDER_LIBS)
-
-AC_ARG_WITH(libnotify,
-   AS_HELP_STRING([--with-libnotify], [enable notifications (default=autodetect)]),
-   with_libnotify=$withval,
-   with_libnotify="autodetect")
-
-AC_ARG_ENABLE(debug,
-   [--enable-debug enable debug symbols (default=no)],
-   [case "${enableval}" in
-      yes)  enable_debug=yes ;;
-      no)   enable_debug=no ;;
-      *) AC_MSG_ERROR([wrong value "${enableval}" for --enable-debug, use "yes" or "no" (default).]) ;;
-esac],[])
-
-HAVE_LIBNOTIFY=0
-if test "$with_libnotify" = "autodetect"; then
-   PKG_CHECK_EXISTS([libnotify], HAVE_LIBNOTIFY=1, )
-fi
-if test "$with_libnotify" = "yes" || test "$HAVE_LIBNOTIFY" = "1"; then
-   with_libnotify="yes"
-   PKG_CHECK_MODULES(LIBNOTIFY, [libnotify])
-   HAVE_LIBNOTIFY=1
-   AC_SUBST(LIBNOTIFY_CFLAGS)
-   AC_SUBST(LIBNOTIFY_LIBS)
-   AC_DEFINE(HAVE_LIBNOTIFY, 1, [LIBNOTIFY support])
-fi
-AC_SUBST(HAVE_LIBNOTIFY)
-AM_CONDITIONAL(HAVE_LIBNOTIFY, [test "$HAVE_LIBNOTIFY" = "1"])
-
-
-if test "x$enable_debug" = "xyes"; then
-  CFLAGS="$CFLAGS -g -O0"
-else
-  CFLAGS="-O2 -DNDEBUG $CFLAGS"
-fi
-
-AC_OUTPUT([
-Makefile
-src/Makefile
-data/Makefile
-])
-
-echo "----------------------------------------"
-echo "Xfce4-Volumed"
-echo "	Installing in : ${prefix}"
-echo "	Using LibNotify : ${with_libnotify}"
-echo "	Compiler : ${CC}"
-if test "x$enable_debug" = "xyes"; then
-	echo "	Compiler flags : ${CFLAGS} (edit configure.ac to change them)"
-else
-	echo "	Compiler flags : ${CFLAGS}"
-fi
-echo ""
-echo "	Configuration is done OK."
-echo "" 
diff --git a/configure.ac.in b/configure.ac.in
new file mode 100644
index 0000000..fc3a064
--- /dev/null
+++ b/configure.ac.in
@@ -0,0 +1,104 @@
+dnl ***************************
+dnl *** Version information ***
+dnl ***************************
+m4_define([xfce4_volumed_pulse_version_major], [0])
+m4_define([xfce4_volumed_pulse_version_minor], [1])
+m4_define([xfce4_volumed_pulse_version_micro], [13])
+m4_define([xfce4_volumed_pulse_version_nano], [])
+m4_define([xfce4_volumed_pulse_version_build], [@REVISION@])
+m4_define([xfce4_volumed_pulse_version_tag], [git]) # Leave empty for releases
+m4_define([xfce4_volumed_pulse_version], [xfce4_volumed_pulse_version_major().xfce4_volumed_pulse_version_minor().xfce4_volumed_pulse_version_micro()ifelse(xfce4_volumed_pulse_version_nano(), [], [], [.xfce4_volumed_pulse_version_nano()])ifelse(xfce4_volumed_pulse_version_tag(), [git], [xfce4_volumed_pulse_version_tag()-xfce4_volumed_pulse_version_build()], [xfce4_volumed_pulse_version_tag()])])
+
+dnl ***************************
+dnl *** Initialize autoconf ***
+dnl ***************************
+AC_INIT([xfce4-volumed-pulse], [xfce4_volumed_pulse_version], [http://bugs.launchpad.net/xfce4-volumed])
+AC_PREREQ([2.50])
+AC_REVISION([@REVISION@])
+
+dnl ***************************
+dnl *** Initialize automake ***
+dnl ***************************
+AM_INIT_AUTOMAKE([1.8 dist-bzip2 tar-ustar])
+AM_CONFIG_HEADER([config.h])
+AM_MAINTAINER_MODE()
+m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
+
+dnl *******************************
+dnl *** Check for UNIX variants ***
+dnl *******************************
+AC_AIX()
+AC_ISC_POSIX()
+AC_MINIX()
+
+dnl ********************************
+dnl *** Check for basic programs ***
+dnl ********************************
+AC_PROG_CC()
+AM_PROG_CC_C_O
+AC_PROG_LD()
+AC_PROG_INSTALL()
+
+dnl **********************************
+dnl *** Check for standard headers ***
+dnl **********************************
+AC_CHECK_HEADERS([stdio.h stdlib.h string.h unistd.h])
+AC_CHECK_FUNCS([daemon setsid])
+
+dnl ***********************************
+dnl *** Check for required packages ***
+dnl ***********************************
+XDT_CHECK_PACKAGE([GLIB], [glib-2.0], [2.16])
+XDT_CHECK_PACKAGE([XFCONF], [libxfconf-0], [4.6.0])
+XDT_CHECK_PACKAGE([LIBPULSE], [libpulse], [0.9.19])
+XDT_CHECK_PACKAGE([LIBPULSEMAINLOOPGLIB], [libpulse-mainloop-glib], [0.9.19])
+XDT_CHECK_PACKAGE([LIBKEYBINDER], [keybinder], [0.2.2])
+
+dnl **************************************
+dnl *** Optional support for Libnotify ***
+dnl **************************************
+XDT_CHECK_OPTIONAL_PACKAGE([LIBNOTIFY], [libnotify], [0.1.3],
+                           [libnotify], [Notification support])
+
+dnl ***********************************
+dnl *** Check for debugging support ***
+dnl ***********************************
+XDT_FEATURE_DEBUG()
+
+dnl **************************************
+dnl *** Check for linker optimizations ***
+dnl **************************************
+XDT_FEATURE_LINKER_OPTS()
+
+dnl *********************************
+dnl *** Substitute platform flags ***
+dnl *********************************
+AC_MSG_CHECKING([PLATFORM_CPPFLAGS])
+AC_MSG_RESULT([$PLATFORM_CPPFLAGS])
+AC_SUBST([PLATFORM_CPPFLAGS])
+AC_MSG_CHECKING([PLATFORM_CFLAGS])
+AC_MSG_RESULT([$PLATFORM_CFLAGS])
+AC_SUBST([PLATFORM_CFLAGS])
+AC_MSG_CHECKING([PLATFORM_LDFLAGS])
+AC_MSG_RESULT([$PLATFORM_LDFLAGS])
+AC_SUBST([PLATFORM_LDFLAGS])
+
+AC_OUTPUT([
+Makefile
+data/Makefile
+src/Makefile
+])
+
+dnl ***************************
+dnl *** Print configuration ***
+dnl ***************************
+echo
+echo "Build Configuration:"
+echo
+echo "* Installation prefix:       $prefix"
+echo "* Debug Support:             $enable_debug"
+if test x"$LIBNOTIFY_FOUND" = x"yes"; then
+echo "* Libnotify support:         yes"
+else
+echo "* Libnotify support:         no"
+fi
diff --git a/data/Makefile.am b/data/Makefile.am
index 2cc81b9..50fd257 100644
--- a/data/Makefile.am
+++ b/data/Makefile.am
@@ -1,15 +1,9 @@
-desktopdir = $(sysconfdir)/xdg/autostart
+# $Id$
 
-# Desktop file for the application
-desktop_in_in_files = xfce4-volumed.desktop.in.in
-desktop_in_files = $(desktop_in_in_files:.desktop.in.in=.desktop.in)
-desktop_DATA = $(desktop_in_files:.desktop.in=.desktop)
+autostartdir = $(sysconfdir)/xdg/autostart
 
-xfce4-volumed.desktop.in: xfce4-volumed.desktop.in.in
-	$(AM_V_GEN) ( \
-		sed -e "s^@PREFIX@^$(prefix)^" \
-			$< > $@ \
-	)
+autostart_DATA = xfce4-volumed-pulse.desktop
 
-EXTRA_DIST = $(desktop_DATA)
+EXTRA_DIST = $(autostart_DATA)
 
+# vi:set ts=8 sw=8 noet ai nocindent syntax=automake:
diff --git a/data/xfce4-volumed-pulse.desktop b/data/xfce4-volumed-pulse.desktop
new file mode 100644
index 0000000..72600b4
--- /dev/null
+++ b/data/xfce4-volumed-pulse.desktop
@@ -0,0 +1,7 @@
+[Desktop Entry]
+Type=Application
+Terminal=false
+Name=XFCE Volume Daemon (Pulseaudio)
+Comment=Daemon managing the volume multimedia keys and displaying volume notifications for Pulseaudio
+Exec=xfce4-volumed-pulse
+OnlyShowIn=XFCE;
diff --git a/data/xfce4-volumed.desktop b/data/xfce4-volumed.desktop
deleted file mode 100644
index be362c5..0000000
--- a/data/xfce4-volumed.desktop
+++ /dev/null
@@ -1,10 +0,0 @@
-
-[Desktop Entry]
-Type=Application
-Terminal=false
-Name=XFCE Volume Daemon
-Name[fr_FR]=Démon de volume XFCE
-Comment=Daemon managing the volume multimedia keys and displaying volume notifications
-Comment[fr_FR]=Démon gérant les touches multimédia liées au volume et affichant des notifications de volume
-Exec=xfce4-volumed
-OnlyShowIn=XFCE;
diff --git a/src/Makefile.am b/src/Makefile.am
index 5bde29b..2bb8d5d 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -1,30 +1,53 @@
-bin_PROGRAMS = xfce4-volumed
-
-xfce4_volumed_SOURCES = \
-	main.c				\
-	xvd_data_types.h	\
-	xvd_keys.c			\
-	xvd_keys.h			\
-	xvd_pulse.c			\
-	xvd_pulse.h			\
-	xvd_notify.c		\
-	xvd_notify.h		\
-	xvd_xfconf.c		\
-	xvd_xfconf.h
-
-INCLUDES = 							\
-	@GLIB_CFLAGS@					\
-	@XFCONF_CFLAGS@					\
-	@LIBPULSE_CFLAGS@				\
-	@LIBPULSEMAINLOOPGLIB_CFLAGS@	\
-	@LIBKEYBINDER_CFLAGS@			\
-	@LIBNOTIFY_CFLAGS@
-
-xfce4_volumed_LDADD = 			\
-	@GLIB_LIBS@					\
-	@XFCONF_LIBS@				\
-	@LIBPULSE_LIBS@				\
-	@LIBPULSEMAINLOOPGLIB_LIBS@	\
-	@LIBKEYBINDER_LIBS@			\
-	@LIBNOTIFY_LIBS@
+INCLUDES = \
+	-I${top_srcdir} \
+	-DG_LOG_DOMAIN=\"xfce4-volumed-pulse\" \
+	$(PLATFORM_CPPFLAGS)
 
+bin_PROGRAMS = \
+	xfce4-volumed-pulse
+
+xfce4_volumed_pulse_SOURCES = \
+	main.c \
+	xvd_data_types.h \
+	xvd_keys.c \
+	xvd_keys.h \
+	xvd_pulse.c \
+	xvd_pulse.h \
+	xvd_xfconf.c \
+	xvd_xfconf.h \
+
+xfce4_volumed_pulse_CFLAGS = \
+	$(GLIB_CFLAGS) \
+	$(XFCONF_CFLAGS) \
+	$(LIBKEYBINDER_CFLAGS) \
+	$(LIBPULSE_CFLAGS) \
+	$(LIBPULSEMAINLOOPGLIB_CFLAGS) \
+	$(PLATFORM_CFLAGS)
+
+xfce4_volumed_pulse_LDFLAGS = \
+	-no-undefined \
+	$(PLATFORM_LDFLAGS)
+
+xfce4_volumed_pulse_LDADD = \
+	$(GLIB_LIBS) \
+	$(XFCONF_LIBS) \
+	$(LIBKEYBINDER_LIBS) \
+	$(LIBPULSE_LIBS) \
+	$(LIBPULSEMAINLOOPGLIB_LIBS)
+
+#
+# Optional support for libnotify
+#
+if HAVE_LIBNOTIFY
+xfce4_volumed_pulse_SOURCES += \
+	xvd_notify.c \
+	xvd_notify.h
+
+xfce4_volumed_pulse_CFLAGS += \
+	$(LIBNOTIFY_CFLAGS)
+
+xfce4_volumed_pulse_LDADD += \
+	$(LIBNOTIFY_LIBS)
+endif
+
+# vi:set ts=8 sw=8 noet ai nocindent syntax=automake:
diff --git a/src/xvd_data_types.h b/src/xvd_data_types.h
index c26bef0..9d6f47e 100644
--- a/src/xvd_data_types.h
+++ b/src/xvd_data_types.h
@@ -24,14 +24,12 @@
 #include "config.h"
 #endif
 
-#define XFCONF_MIXER_CHANNEL_NAME "xfce4-mixer"
-#define XFCONF_MIXER_VOL_STEP "/volume-step-size"
-#define VOL_STEP_DEFAULT_VAL 5
-
-#define XVD_APPNAME "Xfce volume daemon"
-
+#ifdef HAVE_STDLIB_H
 #include <stdlib.h>
+#endif
+#ifdef HAVE_UNISTD_H
 #include <unistd.h>
+#endif
 
 #include <xfconf/xfconf.h>
 
@@ -40,10 +38,18 @@
 #include <pulse/volume.h>
 
 #include <keybinder.h>
+
 #ifdef HAVE_LIBNOTIFY
 #include <libnotify/notification.h>
 #endif
 
+#define XFCONF_MIXER_CHANNEL_NAME "xfce4-mixer"
+#define XFCONF_MIXER_VOL_STEP "/volume-step-size"
+#define VOL_STEP_DEFAULT_VAL 5
+
+#define XVD_APPNAME "Xfce volume daemon"
+
+
 typedef enum _XvdVolStepDirection
 {
   XVD_UP,
diff --git a/src/xvd_keys.h b/src/xvd_keys.h
index 1e70970..38fafbd 100644
--- a/src/xvd_keys.h
+++ b/src/xvd_keys.h
@@ -20,8 +20,12 @@
 #ifndef _XVD_KEYS_H
 #define _XVD_KEYS_H
 
+#ifdef HAVE_STDIO_H
 #include <stdio.h>
+#endif
+#ifdef HAVE_STRING_H
 #include <string.h>
+#endif
 
 #include "xvd_data_types.h"
 

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Xfce4-commits mailing list