📄 configure.in
字号:
#include <stdio.h>
#include <stdlib.h>
int main()
{
int major, minor, micro;
char *tmp_version;
tmp_version = g_strdup("$min_gtk_version");
sscanf(tmp_version, "%d.%d.%d", &major, &minor, µ);
if ((gtk_major_version != $gtk_config_major) ||
(gtk_minor_version != $gtk_config_minor) ||
(gtk_micro_version != $gtk_config_micro))
exit(1);
if ((gtk_major_version > major) ||
((gtk_major_version == major) && (gtk_minor_version > minor)) ||
((gtk_major_version == major) && (gtk_minor_version == minor) && (gtk_micro_version >= micro)))
return 0;
printf("\n*** An old version of GTK+ (%d.%d.%d) was found.\n",
gtk_major_version, gtk_minor_version, gtk_micro_version);
return 1;
}], , have_gtk=false, have_gtk=false])
CFLAGS="$ac_save_CFLAGS"
LIBS="$ac_save_LIBS"
if test "$have_gtk" = "false"; then
AC_MSG_RESULT(no)
else
AC_MSG_RESULT(yes)
fi
fi
fi
if test "$have_gtk" = "true"; then
OSDEPPLUGINS="$OSDEPPLUGINS plugins/musicbrowser.ui"
OSDEPPLUGINS="$OSDEPPLUGINS plugins/freeamp.ui"
OSDEPPLUGINS="$OSDEPPLUGINS plugins/download.ui"
OSDEPPLUGINS="$OSDEPPLUGINS plugins/winamp.ftf"
OSDEPPLUGINS="$OSDEPPLUGINS plugins/kjofol.ftf"
OSINC="$OSINC -I$srcdir/ui/musicbrowser/unix/include"
OSINC="$OSINC -I$srcdir/ui/freeamp/include -I$srcdir/ui/freeamp/unix/include"
OSINC="$OSINC -I$srcdir/ui/download/unix/include"
OSINC="$OSINC -I$srcdir/ui/musicbrowser/include"
OSINC="$OSINC -I$srcdir/ftc/kjofol"
CFLAGS="$CFLAGS $GTK_CFLAGS"
AC_DEFINE(HAVE_GTK)
elif test "$host_os" = "beos"; then
OSDEPPLUGINS="$OSDEPPLUGINS plugins/musicbrowser.ui"
OSDEPPLUGINS="$OSDEPPLUGINS plugins/freeamp.ui"
OSINC="$OSINC -Iui/musicbrowser/beos/include"
# freeampui's Font.h and friends conflict with Be API, thus the junk below.
OSINC="-Iui/freeamp/include -I- -Iui/freeamp/beos/include $OSINC"
OSINC="$OSINC -Iconfig -Iio/local -Iio/http -Iui/cmdline -Iui/mpg123 -Ilmc/xingmp3/src -Iplm/metadata/cddb -Iplm/metadata/id3v1 -Iplm/metadata/id3v2 -Iplm/metadata/misc -Iplm/playlist/m3u -Iplm/playlist/pls -Idlm/rmp -Iftc/winamp"
else
GTK_CFLAGS=""
GTK_LIBS=""
echo "WARNING: GTK+ was not found on this system. This means you won't be"
echo "able to use any of the graphical user interfaces. That's a bad thing,"
echo "so go get the latest version of GTK+ from http://www.gtk.org"
fi
if test "$host_os" = "qnx"; then
EXTRALIBS="$EXTRALIBS $GTK_LIBS"
GTK_LIBS=""
fi
AC_SUBST(GTK_CFLAGS)
AC_SUBST(GTK_LIBS)
AC_SUBST(EXTRALIBS)
AC_SUBST(CFLAGS)
dnl orbit crap
save_CPPFLAGS="$CPPFLAGS"
CPPFLAGS="$CPPFLAGS $GTK_CFLAGS"
AC_LANG_SAVE
AC_LANG_C
AC_CHECK_HEADERS(orb/orbit.h, have_orbit="true", have_orbit="false")
CPPFLAGS="$save_CPPFLAGS"
AC_LANG_RESTORE
ORBIT_LIBS=""
ORBIT_IDL=""
if test "$have_orbit" = "true"; then
ORBIT_LIBS=`orbit-config --libs server`
AC_DEFINE(HAVE_ORBIT)
OSDEPPLUGINS="$OSDEPPLUGINS plugins/corba.ui"
OSINC="$OSINC `orbit-config --cflags server`"
ORBIT_IDL=`which orbit-idl`
fi
AC_SUBST(ORBIT_LIBS)
AC_SUBST(ORBIT_IDL)
dnl rio stuff
AC_ARG_ENABLE(rio, [ --enable-rio Compile the rio pmp300 support plugin], enable_rio=yes, enable_rio=no)
if test "x$enable_rio" = "xyes"; then
OSDEPPLUGINS="$OSDEPPLUGINS plugins/pmp300.ppp"
else
echo "Not building the rio pmp300 plugin"
fi
mp3prof="false"
AC_ARG_ENABLE(mp3prof,
[ --enable-mp3prof Enable profiling of the MP3 decoder (linux only!)],
[case "${enableval}" in
yes) mp3prof="true" ;;
no) mp3prof="false" ;;
*) AC_MSG_ERROR(bad value ${enableval} for --enable-mp3prof) ;;
esac])
if test "$mp3prof" = "true"; then
AC_DEFINE(MP3_PROF)
fi
dnl *****
dnl Check for type of threads.
dnl This is largely OS driven, but we verify the existance of the pthread
dnl library if we are on a unixen.
dnl I feel largely justified in this move because there is currently no support
dnl for other than pthreads in the unix code.
dnl *****
if test "$host_os" = "beos"; then
AC_MSG_RESULT([This is BeOS; using BeOS threads.])
elif test "$host_os" = "freebsd"; then
AC_CHECK_HEADER(pthread.h, ,
AC_MSG_ERROR([FreeAmp requires pthreads]))
else
AC_CHECK_LIB(pthread, pthread_create, foo="bar",
AC_CHECK_LIB(c, pthread_create, foor="bar",
AC_MSG_ERROR([FreeAmp requires pthreads (-lpthread must work)])))
fi
dnl *****
#AM_CONDITIONAL(AM_HAVE_LINUXTHREADS, test "$hblt" = "true")
AC_ARG_ENABLE(cmdline,
[ --enable-cmdline Build command line freeamp],
[case "${enableval}" in
yes) cmdline="true" ;;
no) cmdline="false" ;;
*) AC_MSG_ERROR(bad value ${enableval} for --enable-cmdline) ;;
esac])
#AM_CONDITIONAL(AM_ENABLE_CMDLINE, test "$cmdline" = "true")
AC_CHECK_LIB(ncurses,initscr,curses="ncurses", [
AC_CHECK_LIB(curses,initscr,curses="curses", [
echo "curses/ncurses not found. disabling curses UI."
])
])
if test "$curses" != ""; then
OSDEPPLUGINS="$OSDEPPLUGINS plugins/ncurses.ui";
CURSES="$curses";
AC_SUBST(CURSES)
fi
dnl ****
dnl Check for alsa
dnl ****
AC_CHECK_HEADER(sys/asoundlib.h,
AC_CHECK_LIB(asound, main,
have_alsa="true"
,
have_alsa="false"
)
,
have_alsa="false"
)
AC_ARG_ENABLE(alsa, [ --disable-alsa Don't compile the ALSA output plugin], enable_alsa=no, enable_alsa=yes)
if test "x$enable_alsa" = "xno"; then
have_alsa="false";
fi
if test "$have_alsa" = "true"; then
AC_MSG_CHECKING(for libasound headers version >= 0.5.0)
alsa_min_major_version=0
alsa_min_minor_version=5
alsa_min_micro_version=0
ac_save_CFLAGS="$CFLAGS"
ac_save_LIBS="$LIBS"
LIBS="$LIBS -lasound"
AC_LANG_SAVE
AC_LANG_C
AC_TRY_RUN([
#include <sys/asoundlib.h>
void main(void)
{
/* ensure backward compatibility */
#if !defined(SND_LIB_MAJOR) && defined(SOUNDLIB_VERSION_MAJOR)
#define SND_LIB_MAJOR SOUNDLIB_VERSION_MAJOR
#endif
#if !defined(SND_LIB_MINOR) && defined(SOUNDLIB_VERSION_MINOR)
#define SND_LIB_MINOR SOUNDLIB_VERSION_MINOR
#endif
#if !defined(SND_LIB_SUBMINOR) && defined(SOUNDLIB_VERSION_SUBMINOR)
#define SND_LIB_SUBMINOR SOUNDLIB_VERSION_SUBMINOR
#endif
# if(SND_LIB_MAJOR > $alsa_min_major_version)
exit(0);
# else
# if(SND_LIB_MAJOR < $alsa_min_major_version)
# error not present
# endif
# if(SND_LIB_MINOR > $alsa_min_minor_version)
exit(0);
# else
# if(SND_LIB_MINOR < $alsa_min_minor_version)
# error not present
# endif
# if(SND_LIB_SUBMINOR < $alsa_min_micro_version)
# error not present
# endif
# endif
# endif
exit(0);
}
], , have_alsa=false, have_alsa=false
)
AC_LANG_RESTORE
CFLAGS="$ac_save_CFLAGS"
LIBS="$ac_save_LIBS"
if test "$have_alsa" = "false"; then
AC_MSG_RESULT(no)
else
AC_MSG_RESULT(yes)
fi
fi
if test "$host_os" = "qnx"; then
have_alsa=false
fi
ALSAPMOPLUGIN=plugins/alsa.pmo
if test "$have_alsa" = "true"; then
OSDEPPLUGINS="$OSDEPPLUGINS $ALSAPMOPLUGIN";
OSINC="$OSINC -I$srcdir/io/alsa/$OSDEP/include"
AC_MSG_RESULT([compiling alsa pmo plugin])
fi
AC_CHECK_LIB(ogg, ogg_sync_init, have_ogg="yes",)
AC_CHECK_LIB(vorbisfile, ov_info, have_vorbis="yes",, -lvorbis -logg)
if test "$have_ogg" = "yes"; then
if test "$have_vorbis" = "yes"; then
OSINC="$OSINC -I$srcdir/lmc/vorbis/include"
OSDEPPLUGINS="$OSDEPPLUGINS plugins/vorbis.lmc";
OSDEPPLUGINS="$OSDEPPLUGINS plugins/vorbis.mdf";
AC_MSG_RESULT([compiling vorbis codec plugin])
fi
fi
ID3_LIBS=""
AC_CHECK_LIB(z, uncompress,
ID3_LIBS=-lz
AC_MSG_RESULT([compiling id3lib with zlib])
AC_DEFINE(HAVE_ZLIB)
)
AC_SUBST(ID3_LIBS)
AC_CHECK_HEADERS(kde/artsc/artsc.h, have_arts="true", have_arts="false")
if test "$have_arts" = "false"; then
AC_CHECK_HEADERS(artsc/artsc.h, have_arts="true",
have_arts="false")
fi
ARTS_LIBS=""
AC_CHECK_LIB(artsc, arts_init,
OSDEPPLUGINS="$OSDEPPLUGINS plugins/arts.pmo";
OSINC="$OSINC -I$srcdir/io/arts/include"
ARTS_LIBS="-lartsc -laudiofile"
AC_MSG_RESULT([compiling arts pmo plugin])
)
AC_SUBST(ARTS_LIBS)
AC_SUBST(EXTRALIBS)
AC_SUBST(OSDEPPLUGINS)
AC_SUBST(OSINC)
AC_ARG_ENABLE(x86opts, [ --disable-x86opts Don't use any x86 assembly optimizations], enable_x86=no, enable_x86=yes)
if test "x$enable_x86" = "xyes"; then
if expr "$host_cpu" : "i.86$" > /dev/null; then
if test -n "$NASM"; then
AC_MSG_RESULT([Using x86 optimizations])
XINGASM="`echo lmc/xingmp3/src/cdctasm.o \
lmc/xingmp3/src/cwinasm.o \
lmc/xingmp3/src/cwin8asm.o \
lmc/xingmp3/src/mdctasm.o \
lmc/xingmp3/src/msisasm.o`"
AC_DEFINE(ASM_X86)
fi
fi
fi
AC_SUBST(XINGASM)
AC_ARG_ENABLE(mutex-debug, [ --enable-mutex-debug Enable verbose mutex debugging output], AC_DEFINE(DEBUG_MUTEXES), )
AC_ARG_ENABLE(dmalloc, [ --enable-dmalloc Enable debugging with dmalloc], AC_DEFINE(USING_DMALLOC), )
if test "x$enable_dmalloc" = "xyes"; then
DMALLOCLIB="-ldmallocxx"
else
DMALLOCLIB=""
fi
AC_SUBST(DMALLOCLIB)
AC_PATH_PROG(GDK_PIXBUF_CONFIG, gdk-pixbuf-config, no)
min_gdk_pixbuf_version=0.8.0
AC_MSG_CHECKING(for GDK_PIXBUF - version >= $min_gdk_pixbuf_version)
no_gdk_pixbuf=""
if test "$GDK_PIXBUF_CONFIG" = "no" ; then
no_gdk_pixbuf=yes
else
GDK_PIXBUF_CFLAGS=`$GDK_PIXBUF_CONFIG $gdk_pixbufconf_args --cflags`
GDK_PIXBUF_LIBS=`$GDK_PIXBUF_CONFIG $gdk_pixbufconf_args --libs`
gdk_pixbuf_major_version=`$GDK_PIXBUF_CONFIG $gdk_pixbuf_args --version | \
sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
gdk_pixbuf_minor_version=`$GDK_PIXBUF_CONFIG $gdk_pixbuf_args --version | \
sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
gdk_pixbuf_micro_version=`$GDK_PIXBUF_CONFIG $gdk_pixbuf_config_args --version | \
sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
if test "x$enable_gdk_pixbuftest" = "xyes" ; then
ac_save_CFLAGS="$CFLAGS"
ac_save_LIBS="$LIBS"
CFLAGS="$CFLAGS $GDK_PIXBUF_CFLAGS"
LIBS="$LIBS $GDK_PIXBUF_LIBS"
dnl
dnl Now check if the installed GDK_PIXBUF is sufficiently new. (Also sanity
dnl checks the results of gdk-pixbuf-config to some extent
dnl
rm -f conf.gdk_pixbuftest
AC_TRY_RUN([
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <gdk-pixbuf/gdk-pixbuf.h>
char*
my_strdup (char *str)
{
char *new_str;
if (str)
{
new_str = malloc ((strlen (str) + 1) * sizeof(char));
strcpy (new_str, str);
}
else
new_str = NULL;
return new_str;
}
int main ()
{
int major, minor, micro;
char *tmp_version;
system ("touch conf.gdk_pixbuftest");
/* HP/UX 9 (%@#!) writes to sscanf strings */
tmp_version = my_strdup("$min_gdk_pixbuf_version");
if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, µ) != 3) {
printf("%s, bad version string\n", "$min_gdk_pixbuf_version");
exit(1);
}
if (($gdk_pixbuf_major_version > major) ||
(($gdk_pixbuf_major_version == major) && ($gdk_pixbuf_minor_version > minor)) ||
(($gdk_pixbuf_major_version == major) && ($gdk_pixbuf_minor_version == minor) && ($gdk_pixbuf_micro_version >= micro)))
{
return 0;
}
else
{
printf("\n*** 'gdk-pixbuf-config --version' returned %d.%d.%d, but the minimum version\n", $gdk_pixbuf_major_version, $gdk_pixbuf_minor_version, $gdk_pixbuf_micro_version);
printf("*** of GDK_PIXBUF required is %d.%d.%d. If gdk-pixbuf-config is correct, then it is\n", major, minor, micro);
printf("*** best to upgrade to the required version.\n");
printf("*** If gdk-pixbuf-config was wrong, set the environment variable GDK_PIXBUF_CONFIG\n");
printf("*** to point to the correct copy of gdk-pixbuf-config, and remove the file\n");
printf("*** config.cache before re-running configure\n");
return 1;
}
}
],, no_gdk_pixbuf=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
CFLAGS="$ac_save_CFLAGS"
LIBS="$ac_save_LIBS"
fi
fi
if test "x$no_gdk_pixbuf" = x ; then
AC_MSG_RESULT(yes)
AC_DEFINE(USING_GDKPIXBUF)
else
AC_MSG_RESULT(no)
if test "$GDK_PIXBUF_CONFIG" = "no" ; then
echo "*** The gdk-pixbuf-config script installed by GDK_PIXBUF could not be found"
echo "*** If GDK_PIXBUF was installed in PREFIX, make sure PREFIX/bin is in"
echo "*** your path, or set the GDK_PIXBUF_CONFIG environment variable to the"
echo "*** full path to gdk-pixbuf-config."
else
if test -f conf.gdk_pixbuftest ; then
:
else
echo "*** Could not run GDK_PIXBUF test program, checking why..."
CFLAGS="$CFLAGS $GDK_PIXBUF_CFLAGS"
LIBS="$LIBS $GDK_PIXBUF_LIBS"
AC_TRY_LINK([
#include <stdio.h>
#include <gdk-pixbuf/gdk-pixbuf.h>
], [ return 0; ],
[ echo "*** The test program compiled, but did not run. This usually means"
echo "*** that the run-time linker is not finding GDK_PIXBUF or finding the wrong"
echo "*** version of GDK_PIXBUF. If it is not finding GDK_PIXBUF, you'll need to set your"
echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point"
echo "*** to the installed location Also, make sure you have run ldconfig if that"
echo "*** is required on your system"
echo "***"
echo "*** If you have an old version installed, it is best to remove it, although"
echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH"],
[ echo "*** The test program failed to compile or link. See the file config.log for the"
echo "*** exact error that occured. This usually means GDK_PIXBUF was incorrectly installed"
echo "*** or that you have moved GDK_PIXBUF since it was installed. In the latter case, you"
echo "*** may want to edit the gdk-pixbuf-config script: $GDK_PIXBUF_CONFIG" ])
CFLAGS="$ac_save_CFLAGS"
LIBS="$ac_save_LIBS"
fi
fi
GDK_PIXBUF_CFLAGS=""
GDK_PIXBUF_LIBS=""
fi
AC_SUBST(GDK_PIXBUF_CFLAGS)
AC_SUBST(GDK_PIXBUF_LIBS)
rm -f conf.gdk_pixbuftest
CFLAGS="$CFLAGS $GDK_PIXBUF_CFLAGS"
AC_SUBST(CFLAGS)
AC_LANG_SAVE
AC_LANG_CPLUSPLUS
AC_CHECK_LIB(musicbrainz, mb_New, ,
AC_MSG_ERROR([FreeAmp requires that the MusicBrainz client library be installed.]))
AC_LANG_RESTORE
AC_CONFIG_HEADER(config/config.h)
AC_OUTPUT(Makefile Makefile-plugins Makefile.header Makefile.towav)
touch .config.check
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -