bunch of autotool cleanups

git-svn-id: https://svn.musicpd.org/mpd/trunk@271 09075e82-0dd4-0310-85a5-a0d7c8717e4f
This commit is contained in:
Warren Dukes 2004-03-18 03:29:25 +00:00
parent 02346f2f1a
commit 91450723b2
44 changed files with 119 additions and 98 deletions

View File

@ -107,6 +107,9 @@ fi
echo " $ACLOCAL $ACLOCAL_FLAGS"
$ACLOCAL $ACLOCAL_FLAGS
echo " autoheader"
autoheader
echo " $LIBTOOLIZE --automake"
$LIBTOOLIZE --automake

View File

@ -13,8 +13,8 @@ AC_SUBST(MAD_SUBDIR)
AC_SUBST(MAD_LIB)
AC_SUBST(ID3_SUBDIR)
AC_SUBST(ID3_LIB)
AC_SUBST(MP4FF_SUBDIR)
AC_SUBST(MP4FF_LIB)
AC_SUBST(MP4FF_SUBDIR)
AC_SUBST(MPD_LIBS)
AC_SUBST(MPD_CFLAGS)
@ -22,10 +22,11 @@ AC_PROG_CC
AC_PROG_INSTALL
AC_PROG_LIBTOOL
AM_CONFIG_HEADER(config.h)
MPD_CFLAGS="-Wall"
MPD_LIBS=""
AC_ARG_ENABLE(iconv,[ --disable-iconv disable iconv support],,enable_iconv=yes)
AC_ARG_ENABLE(ipv6,[ --disable-ipv6 disable IPv6 support],,enable_ipv6=yes)
AC_ARG_ENABLE(ogg,[ --disable-ogg disable ogg support],,enable_ogg=yes)
AC_ARG_ENABLE(flac,[ --disable-flac disable flac support],,enable_flac=yes)
@ -44,9 +45,9 @@ AC_ARG_WITH(mad,[ --with-mad=PFX Prefix where libmad is installed (optional)]
AC_ARG_WITH(mad-libraries,[ --with-mad-libraries=DIR Directory where libmad library is installed (optional)], mad_libraries="$withval", mad_libraries="")
AC_ARG_WITH(mad-includes,[ --with-mad-includes=DIR Directory where mad header files are installed (optional)], mad_includes="$withval", mad_includes="")
AC_ARG_WITH(faad2,[ --with-faad2=PFX Prefix where faad2 is installed], faad_prefix="$withval", faad_prefix="")
AC_ARG_WITH(faad2-libraries,[ --with-faad-libraries=DIR Directory where faad2 library is installed (optional)], faad_libraries="$withval", faad_libraries="")
AC_ARG_WITH(faad2-includes,[ --with-faad-includes=DIR Directory where faad2 header files are installed (optional)], faad_includes="$withval", faad_includes="")
AC_ARG_WITH(faad,[ --with-faad=PFX Prefix where faad2 is installed], faad_prefix="$withval", faad_prefix="")
AC_ARG_WITH(faad-libraries,[ --with-faad-libraries=DIR Directory where faad2 library is installed (optional)], faad_libraries="$withval", faad_libraries="")
AC_ARG_WITH(faad-includes,[ --with-faad-includes=DIR Directory where faad2 header files are installed (optional)], faad_includes="$withval", faad_includes="")
AC_C_BIGENDIAN
@ -55,20 +56,17 @@ AC_CHECK_SIZEOF(int)
AC_CHECK_SIZEOF(long)
AC_CHECK_SIZEOF(long long)
AC_CHECK_FUNCS(strsep)
AC_CHECK_LIB(socket,socket,MPD_LIBS="$MPD_LIBS -lsocket",)
AC_CHECK_LIB(nsl,gethostbyname,MPD_LIBS="$MPD_LIBS -lnsl",)
AC_CHECK_LIB(m,exp,MPD_LIBS="$MPD_LIBS -lm",)
AC_CHECK_HEADER(langinfo.h,MPD_CFLAGS="$MPD_CFLAGS -DHAVE_LANGINFO",)
AC_CHECK_HEADER(locale.h,MPD_CFLAGS="$MPD_CFLAGS -DHAVE_LOCALE",)
if test x$enable_iconv = xyes; then
AC_CHECK_HEADER(iconv.h,MPD_CFLAGS="$MPD_CFLAGS -DHAVE_ICONV",enable_iconv=no)
if test x$enable_iconv = xyes; then
AC_CHECK_LIB(iconv,iconv,MPD_LIBS="$MPD_LIBS -liconv",)
fi
fi
AM_ICONV
MPD_LIBS="$MPD_LIBS $LIBICONV"
AM_LANGINFO_CODESET
AM_LC_MESSAGES
if test x$enable_ipv6 = xyes; then
AC_MSG_CHECKING(for ipv6)
@ -83,14 +81,14 @@ AP_maGiC_VALUE
#endif
#endif
],
MPD_CFLAGS="$MPD_CFLAGS -DHAVE_IPV6"
AC_DEFINE(HAVE_IPV6, 1, [Define if IPv6 support present])
AC_MSG_RESULT([yes]),
AC_MSG_RESULT([no])
)
fi
XIPH_PATH_AO(MPD_LIBS="$MPD_LIBS $AO_LIBS" MPD_CFLAGS="$MPD_CFLAGS $AO_CFLAGS",AC_MSG_ERROR(Must have libao installed!!!))
AC_CHECK_HEADER(sys/soundcard.h,,[MPD_CFLAGS="$MPD_CFLAGS -DNO_OSS_MIXER";AC_MSG_WARN(Soundcard headers not found -- disabling mixer)])
AC_CHECK_HEADER(sys/soundcard.h,,[AC_MSG_WARN(Soundcard headers not found -- disabling mixer);AC_DEFINE(NO_OSS_MIXER,1,[Define to disable OSS mixer support])])
AC_MSG_CHECKING(for alsa)
AC_EGREP_CPP([AP_maGiC_VALUE],
@ -102,7 +100,7 @@ AP_maGiC_VALUE
#endif
#endif
],
MPD_CFLAGS="$MPD_CFLAGS -DHAVE_ALSA"
AC_DEFINE(HAVE_ALSA,1,[Define if alsa support is present])
MPD_LIBS="$MPD_LIBS -lasound"
AC_MSG_RESULT([yes]),
AC_MSG_RESULT([no])
@ -146,12 +144,12 @@ if test x$enable_id3 = xyes; then
LIBS=$oldlibs
fi
if test x$use_mpd_id3tag = xyes; then
MPD_CFLAGS="$MPD_CFLAGS -DUSE_MPD_ID3TAG"
AC_DEFINE(USE_MPD_ID3TAG,1,[Define to use mpd libid3tag])
ID3_LIB="libid3tag/libid3tag.la"
ID3_SUBDIR="libid3tag"
AC_CONFIG_SUBDIRS(src/libid3tag)
fi
MPD_CFLAGS="$MPD_CFLAGS -DHAVE_ID3TAG"
AC_DEFINE(HAVE_ID3TAG,1,[Define to use id3tag])
fi
MAD_SUBDIR=""
@ -189,12 +187,12 @@ if test x$enable_mp3 = xyes; then
LIBS=$oldlibs
fi
if test x$use_mpd_mad = xyes; then
MPD_CFLAGS="$MPD_CFLAGS -DUSE_MPD_MAD"
AC_DEFINE(USE_MPD_MAD,1,[Define to use mpd libmad])
MAD_LIB="libmad/libmad.la"
MAD_SUBDIR="libmad"
AC_CONFIG_SUBDIRS(src/libmad)
fi
MPD_CFLAGS="$MPD_CFLAGS -DHAVE_MAD"
AC_DEFINE(HAVE_MAD,1,[Define to use libmad])
fi
MP4FF_SUBDIR=""
@ -208,7 +206,7 @@ if test x$enable_aac = xyes; then
FAAD_LIBS="-L$libdir"
fi
FAAD_LIBS="$FAAD_LIBS -lfaad -lmp4v2"
FAAD_LIBS="$FAAD_LIBS -lfaad -lmp4v2 -lstdc++"
if test "x$faad_includes" != "x" ; then
FAAD_CFLAGS="-I$faad_includes"
@ -220,11 +218,14 @@ if test x$enable_aac = xyes; then
oldcflags=$CFLAGS
oldlibs=$LIBS
CFLAGS="$CFLAGS $MPD_CFLAGS $FAAD_CFLAGS"
CFLAGS="$CFLAGS $MPD_CFLAGS $FAAD_CFLAGS -I."
LIBS="$LIBS $MPD_LIBS $FAAD_LIBS"
AC_CHECK_HEADER(faad.h,,enable_aac=no)
if test x$enable_aac = xyes; then
AC_CHECK_HEADER(mp4.h,,[enable_aac=no;AC_MSG_WARN(You need mp4v2 installed for AAC/MP4 decoding)])
AC_CHECK_HEADER(mp4.h,,[enable_aac=no;AC_MSG_WARN(
You need mp4v2 installed for AAC/MP4 decoding.
If mp4.h is present, be sure that mpeg4ip.h does not
include systems.h)])
fi
if test x$enable_aac = xyes; then
AC_CHECK_LIB(mp4v2, MP4Create,,[enable_aac=no;AC_MSG_WARN(You need mp4v2 installed for AAC/MP4 decoding)])
@ -233,7 +234,10 @@ if test x$enable_aac = xyes; then
AC_CHECK_LIB(mp4v2, MP4MetadataDelete,,[enable_aac=no;AC_MSG_WARN(You need mp4v2 installed for AAC/MP4 decoding)])
fi
if test x$enable_aac = xyes; then
AC_CHECK_LIB(faad, faacDecDecode,[MPD_LIBS="$MPD_LIBS $FAAD_LIBS";MPD_CFLAGS="$MPD_CFLAGS $FAAD_CFLAGS -DHAVE_FAAD";MP4FF_SUBDIR="mp4ff";MP4FF_LIB="mp4ff/libmp4ff.la"],enable_aac=no)
AC_CHECK_LIB(faad, faacDecDecode,[MPD_LIBS="$MPD_LIBS $FAAD_LIBS";MPD_CFLAGS="$MPD_CFLAGS $FAAD_CFLAGS";MP4FF_SUBDIR="mp4ff";MP4FF_LIB="mp4ff/libmp4ff.la"],enable_aac=no)
fi
if test x$enable_aac = xyes; then
AC_DEFINE(HAVE_FAAD,1,[Define to use FAAD2 for AAC decoding])
fi
CFLAGS=$oldcflags
LIBS=$oldlibs
@ -299,7 +303,7 @@ dnl
fi
if test x$enable_ogg = xyes; then
MPD_CFLAGS="$MPD_CFLAGS -DHAVE_OGG"
AC_DEFINE(HAVE_OGG,1,[Define for ogg vorbis support])
fi
if test x$enable_flac = xyes; then
@ -325,14 +329,18 @@ fi
if test x$enable_flac = xyes; then
MPD_CFLAGS="$MPD_CFLAGS -DHAVE_FLAC"
AC_DEFINE(HAVE_FLAC,1,[Define for FLAC support])
fi
if test x$enable_audiofile = xyes; then
AM_PATH_AUDIOFILE(0.1.7, MPD_LIBS="$MPD_LIBS -laudiofile" MPD_CFLAGS="$MPD_CFLAGS -DHAVE_AUDIOFILE",
AM_PATH_AUDIOFILE(0.1.7, MPD_LIBS="$MPD_LIBS $AUDIOFILE_LIBS" MPD_CFLAGS="$MPD_CFLAGS $AUDIOFILE_CFLAGS",
[enable_audiofile=no;AC_MSG_WARN(You need audiofile -- disabling audiofile support)])
fi
if test x$enable_audiofile = xyes; then
AC_DEFINE(HAVE_AUDIOFILE,1,[Define for audiofile support])
fi
AC_OUTPUT(src/mp4ff/Makefile doc/Makefile src/Makefile Makefile )
echo ""

View File

@ -1,4 +1,4 @@
make distclean
./autogen.sh --enable-mpd-mad --enable-mpd-id3tag
./autogen.sh --enable-mpd-mad --enable-mpd-id3tag --disable-aac
make
make dist

View File

@ -13,3 +13,5 @@ mpd_SOURCES = main.c buffer2array.c interface.c command.c playlist.c ls.c \
mpd_CFLAGS = $(MPD_CFLAGS)
mpd_LDADD = $(MPD_LIBS) $(ID3_LIB) $(MAD_LIB) $(MP4FF_LIB)
DIST_SUBDIRS = mp4ff

View File

@ -19,6 +19,8 @@
#ifndef AUDIO_H
#define AUDIO_H
#include "../config.h"
#include "mpd_types.h"
#include <stdio.h>

View File

@ -18,10 +18,10 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#ifdef HAVE_AUDIOFILE
#include "audiofile_decode.h"
#ifdef HAVE_AUDIOFILE
#include "command.h"
#include "utils.h"
#include "audio.h"

View File

@ -21,6 +21,8 @@
#ifndef AUDIOFILE_DECODE_H
#define AUDIOFILE_DECODE_H
#include "../config.h"
#ifdef HAVE_AUDIOFILE
#include "playerData.h"

View File

@ -19,6 +19,8 @@
#ifndef BUFFER_2_ARRAY_H
#define BUFFER_2_ARRAY_H
#include "../config.h"
int buffer2array(char * buffer, char *** array);
void freeArgArray(char ** array, int argArrayLength);

View File

@ -19,6 +19,8 @@
#ifndef CHAR_CONV_H
#define CHAR_CONV_H
#include "../config.h"
int setCharSetConversion(char * to, char * from);
char * convStrDup(char * string);

View File

@ -19,6 +19,8 @@
#ifndef COMMAND_H
#define COMMAND_H
#include "../config.h"
#include <stdio.h>
#define COMMAND_RETURN_KILL 10

View File

@ -19,6 +19,8 @@
#ifndef CONF_H
#define CONF_H
#include "../config.h"
#define CONF_PORT 0
#define CONF_MUSIC_DIRECTORY 1
#define CONF_PLAYLIST_DIRECTORY 2

View File

@ -19,6 +19,8 @@
#ifndef DECODE_H
#define DECODE_H
#include "../config.h"
#include <stdio.h>
#include <sys/param.h>
@ -26,8 +28,7 @@
#define DECODE_TYPE_OGG 1
#define DECODE_TYPE_FLAC 2
#define DECODE_TYPE_AUDIOFILE 3
#define DECODE_TYPE_AAC 4
#define DECODE_TYPE_MP4 5
#define DECODE_TYPE_MP4 4
#define DECODE_STATE_STOP 0
#define DECODE_STATE_DECODE 1

View File

@ -19,6 +19,8 @@
#ifndef DIRECTORY_H
#define DIRECTORY_H
#include "../config.h"
#include "song.h"
#include <stdio.h>

View File

@ -16,9 +16,10 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#ifdef HAVE_FLAC
#include "flac_decode.h"
#ifdef HAVE_FLAC
#include "utils.h"
#include "log.h"
#include "pcm_utils.h"

View File

@ -19,6 +19,8 @@
#ifndef FLAC_DECODE_H
#define FLAC_DECODE_H
#include "../config.h"
#include "playerData.h"
#include <stdio.h>

View File

@ -19,6 +19,8 @@
#ifndef INTERFACE_H
#define INTERFACE_H
#include "../config.h"
#include <stdio.h>
#include <time.h>
#include <sys/types.h>

View File

@ -20,6 +20,8 @@
#ifndef LIST_H
#define LIST_H
#include "../config.h"
#include <stdlib.h>
/* used to make a list where free() will be used to free data in list */

View File

@ -19,6 +19,8 @@
#ifndef LISTEN_H
#define LISTEN_H
#include "../config.h"
extern int listenSocket;
int establish(unsigned short port);

View File

@ -19,6 +19,8 @@
#ifndef LOG_H
#define LOG_H
#include "../config.h"
#include "myfprintf.h"
#define LOG_LEVEL_LOW 0

View File

@ -126,7 +126,6 @@ int isMusic(char * utf8file, time_t * mtime) {
if((ret = isWave(utf8file,mtime))) return ret;
#endif
#ifdef HAVE_FAAD
if((ret = isAac(utf8file,mtime))) return ret;
if((ret = isMp4(utf8file,mtime))) return ret;
#endif
@ -281,35 +280,6 @@ int isMp4(char * utf8file, time_t * mtime) {
return 0;
}
int isAac(char * utf8file, time_t * mtime) {
struct stat st;
char * file = utf8ToFsCharset(utf8file);
char * actualFile = file;
if(actualFile[0]!='/') actualFile = rmp2amp(file);
if(stat(actualFile,&st)==0) {
if(S_ISREG(st.st_mode)) {
char * dup;
char * cLast;
char * cNext;
int ret = 0;
dup = strdup(file);
cNext = cLast = strtok(dup,".");
while((cNext = strtok(NULL,"."))) cLast = cNext;
if(cLast && 0==strcasecmp(cLast,"aac")) {
if(mtime) *mtime = st.st_mtime;
ret = 1;
}
free(dup);
return ret;
}
else return 0;
}
return 0;
}
int isMp3(char * utf8file, time_t * mtime) {
struct stat st;
char * file = utf8ToFsCharset(utf8file);

View File

@ -19,6 +19,8 @@
#ifndef LS_H
#define LS_H
#include "../config.h"
#include <stdio.h>
#include <time.h>
@ -26,8 +28,6 @@ int lsPlaylists(FILE * fp, char * utf8path);
int isMp3(char * utf8file, time_t * mtime);
int isAac(char * utf8file, time_t * mtime);
int isMp4(char * utf8file, time_t * mtime);
int isOgg(char * utf8file, time_t * mtime);

View File

@ -16,9 +16,10 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include "mp3_decode.h"
#ifdef HAVE_MAD
#include "mp3_decode.h"
#include "pcm_utils.h"
#ifdef USE_MPD_MAD
#include "libmad/mad.h"

View File

@ -19,6 +19,8 @@
#ifndef MP3_DECODE_H
#define MP3_DECODE_H
#include "../config.h"
#ifdef HAVE_MAD
#include "playerData.h"

View File

@ -19,6 +19,8 @@
#ifndef MPD_TYPES_H
#define MPD_TYPES_H
#include "../config.h"
typedef unsigned char mpd_uint8;
typedef signed char mpd_sint8;

View File

@ -19,6 +19,8 @@
#ifndef MYFPRINTF_H
#define MYFPRINTF_H
#include "../config.h"
#include <stdio.h>
void myfprintfStdLogMode(FILE * out, FILE * err);

View File

@ -16,9 +16,10 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#ifdef HAVE_OGG
#include "ogg_decode.h"
#ifdef HAVE_OGG
#include "command.h"
#include "utils.h"
#include "audio.h"

View File

@ -19,6 +19,8 @@
#ifndef OGG_DECODE_H
#define OGG_DECODE_H
#include "../config.h"
#include "playerData.h"
#include <stdio.h>

View File

@ -24,8 +24,8 @@
#include <stdlib.h>
#include <string.h>
#ifdef HAVE_LOCALE
#ifdef HAVE_LANGINFO
#ifdef HAVE_LC_MESSAGES
#ifdef HAVE_LANGINFO_CODESET
#include <locale.h>
#include <langinfo.h>
#endif
@ -87,8 +87,8 @@ char * getFsCharset() {
}
void initPaths() {
#ifdef HAVE_LOCALE
#ifdef HAVE_LANGINFO
#ifdef HAVE_LC_MESSAGES
#ifdef HAVE_LANGINFO_CODESET
char * originalLocale;
#endif
#endif
@ -97,8 +97,8 @@ void initPaths() {
if(getConf()[CONF_FS_CHARSET]) {
charset = strdup(getConf()[CONF_FS_CHARSET]);
}
#ifdef HAVE_LOCALE
#ifdef HAVE_LANGINFO
#ifdef HAVE_LC_MESSAGES
#ifdef HAVE_LANGINFO_CODESET
else if((originalLocale = setlocale(LC_ALL,""))) {
char * temp;

View File

@ -19,6 +19,8 @@
#ifndef PATH_H
#define PATH_H
#include "../config.h"
#include <sys/param.h>
extern char musicDir[MAXPATHLEN+1];

View File

@ -19,6 +19,8 @@
#ifndef PCM_UTILS_H
#define PMC_UTILS_H
#include "../config.h"
#include "audio.h"
#include <stdlib.h>

View File

@ -19,6 +19,8 @@
#ifndef PERMISSION_H
#define PERMISSION_H
#include "../config.h"
#define PERMISSION_READ 1
#define PERMISSION_ADD 2
#define PERMISSION_CONTROL 4

View File

@ -178,7 +178,6 @@ int playerPlay(FILE * fp, char * utf8file) {
else if(isWave(utf8file,NULL)) pc->decodeType = DECODE_TYPE_AUDIOFILE;
#endif
#ifdef HAVE_FAAD
else if(isAac(utf8file,NULL)) pc->decodeType = DECODE_TYPE_AAC;
else if(isMp4(utf8file,NULL)) pc->decodeType = DECODE_TYPE_MP4;
#endif
else {

View File

@ -19,6 +19,8 @@
#ifndef PLAYER_H
#define PLAYER_H
#include "../config.h"
#include "mpd_types.h"
#include <stdio.h>

View File

@ -19,6 +19,8 @@
#ifndef PLAYER_DATA_H
#define PLAYER_DATA_H
#include "../config.h"
#include "audio.h"
#include "player.h"
#include "decode.h"

View File

@ -19,6 +19,8 @@
#ifndef PLAYLIST_H
#define PLAYLIST_H
#include "../config.h"
#include "song.h"
#include <stdio.h>

View File

@ -19,6 +19,8 @@
#ifndef SIG_HANDLERS_H
#define SIG_HANDLERS_H
#include "../config.h"
void initSigHandlers();
void finishSigHandlers();

View File

@ -79,9 +79,6 @@ Song * newSong(char * utf8file) {
}
#endif
#ifdef HAVE_FAAD
else if(isAac(utf8file,&(song->mtime))) {
song->tag = aacTagDup(utf8file);
}
else if(isMp4(utf8file,&(song->mtime))) {
song->tag = mp4TagDup(utf8file);
}
@ -249,9 +246,6 @@ int updateSongInfo(Song * song) {
}
#endif
#ifdef HAVE_FAAD
else if(isAac(utf8file,&(song->mtime))) {
song->tag = aacTagDup(utf8file);
}
else if(isMp4(utf8file,&(song->mtime))) {
song->tag = mp4TagDup(utf8file);
}

View File

@ -19,6 +19,8 @@
#ifndef SONG_H
#define SONG_H
#include "../config.h"
#define SONG_BEGIN "songList begin"
#define SONG_END "songList end"

View File

@ -19,6 +19,8 @@
#ifndef STATS_H
#define STATS_H
#include "../config.h"
#include <stdio.h>
typedef struct _Stats {

View File

@ -19,6 +19,8 @@
#ifndef TABLES_H
#define TABLES_H
#include "../config.h"
#include "song.h"
#include <stdio.h>

View File

@ -299,22 +299,6 @@ MpdTag * mp4TagDup(char * utf8file) {
return ret;
}
MpdTag * aacTagDup(char * utf8file) {
MpdTag * ret = NULL;
int time;
#warning getMp4TotalTime needs implementing
//time = getAacTotalTime(rmp2amp(utf8ToFsCharset(utf8file)));
time = 0;
if(time>=0) {
if(!ret) ret = newMpdTag();
ret->time = time;
}
return ret;
}
#endif
#ifdef HAVE_OGG

View File

@ -19,6 +19,8 @@
#ifndef TAG_H
#define TAG_H
#include "../config.h"
#include <stdio.h>
typedef struct _MpdTag {
@ -39,7 +41,6 @@ MpdTag * mp3TagDup(char * utf8file);
#ifdef HAVE_FAAD
MpdTag * mp4TagDup(char * utf8file);
MpdTag * aacTagDup(char * utf8file);
#endif
#ifdef HAVE_OGG

View File

@ -19,6 +19,8 @@
#ifndef UTILS_H
#define UTILS_H
#include "../config.h"
#include <stdio.h>
char * myFgets(char * buffer, int bufferSize, FILE * fp);

View File

@ -19,6 +19,8 @@
#ifndef VOLUME_H
#define VOLUME_H
#include "../config.h"
#include <stdio.h>
#define VOLUME_MIXER_OSS "oss"