ref: bfb2951086121fb7f774d8ddc98a0be5ae25f181
parent: b5f7aadc6009f79c62fcb2ed96a34a9ce5ddb49f
author: cbagwell <cbagwell>
date: Fri Nov 7 13:06:12 EST 2008
Cleaning up symlink code so that play/rec can be disabled but not soxi for both install and uninstall paths. Also, platforms that don't support symlinks (mingw, OS/2) turn it into a copy operation so these platforms will usually want to use global --disable-symlinks to save disk space.
--- a/configure.ac
+++ b/configure.ac
@@ -255,18 +255,21 @@
AM_CONDITIONAL(HAVE_COREAUDIO, test x$enable_coreaudio = xyes)
AC_SUBST(COREAUDIO_LIBS)
-dnl Check if we want play/rec links
-AC_MSG_CHECKING([whether to make play and rec symlinks])
-AC_ARG_ENABLE(playrec-symlinks,
- AC_HELP_STRING([--disable-playrec-symlinks], [Don't make play and rec symlinks to sox.]),,enable_playrec_symlinks=yes)
-AC_MSG_RESULT($enable_playrec_symlinks)
-if test "$enable_playrec_symlinks" = "yes"; then
+dnl Check if we want to disable all symlinks
+AC_MSG_CHECKING([whether to enable symlinks])
+AC_ARG_ENABLE(symlinks,
+ AC_HELP_STRING([--disable-symlinks], [Don't make any symlinks to sox.]),,enable_symlinks=yes)
+AC_MSG_RESULT($enable_symlinks)
+
+enable_playrec_symlinks=no
+if test "$enable_symlinks" = "yes"; then
+ SYMLINKS=yes
if test "$audio_driver_found" = "yes"; then
PLAYRECLINKS=yes
- else
- enable_playrec_symlinks=no
+ enable_playrec_symlinks=yes
fi
fi
+AC_SUBST(SYMLINKS)
AC_SUBST(PLAYRECLINKS)
dnl Check for libgsm
@@ -606,6 +609,7 @@
echo "OSS driver........................ $enable_oss"
echo "SUN audio driver.................. $enable_sun_audio"
echo "CoreAudio driver.................. $enable_coreaudio"
+echo "symlinks enabled.................. $enable_symlinks"
echo "play and rec symlinks............. $enable_playrec_symlinks"
echo "libgsm............................ $gsm_option"
echo "liblpc10.......................... $lpc10_option"
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -385,16 +385,24 @@
fi
soxi: sox$(EXEEXT)
- test -f sox$(EXEEXT) && ( $(RM) $@ && $(LN_S) sox$(EXEEXT) $@ ) || $(LN_S) sox $@;
+ if test "$(SYMLINKS)" = "yes"; then \
+ test -f sox$(EXEEXT) && ( $(RM) $@ && $(LN_S) sox$(EXEEXT) $@ ) || $(LN_S) sox $@; \
+ fi
install-exec-hook:
if test "$(PLAYRECLINKS)" = "yes"; then \
- cd $(DESTDIR)$(bindir); $(RM) play rec soxi; $(LN_S) sox play; $(LN_S) sox rec; $(LN_S) sox soxi; \
+ cd $(DESTDIR)$(bindir); $(RM) play rec; $(LN_S) sox play; $(LN_S) sox rec; \
fi
+ if test "$(SYMLINKS)" = "yes"; then \
+ cd $(DESTDIR)$(bindir); $(RM) soxi; $(LN_S) sox soxi; \
+ fi
uninstall-hook:
if test "$(PLAYRECLINKS)" = "yes"; then \
- cd $(DESTDIR)$(bindir); $(RM) play rec soxi; \
+ cd $(DESTDIR)$(bindir); $(RM) play rec; \
+ fi
+ if test "$(SYMLINKS)" = "yes"; then \
+ cd $(DESTDIR)$(bindir); $(RM) soxi; \
fi
clean-local: