⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 configure.in

📁 FreeAMP(MP3播放)程序源代码-用来研究MP3解码
💻 IN
📖 第 1 页 / 共 2 页
字号:
dnl FreeAmp - The Free MP3 Player
dnl Portions copyright (C) 1998-2000 EMusic.com
dnl
dnl This program is free software; you can redistribute it and/or modify
dnl it under the terms of the GNU General Public License as published by
dnl the Free Software Foundation; either version 2 of the License, or
dnl (at your option) any later version.
dnl
dnl This program is distributed in the hope that it will be useful,
dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
dnl GNU General Public License for more details.
dnl
dnl You should have received a copy of the GNU General Public License
dnl along with this program; if not, write to the Free Software
dnl Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
dnl
dnl $Id: configure.in,v 1.129 2001/03/05 04:45:55 robert Exp $

dnl Process this file with your mom to produce a configure script
AC_INIT(base/src/player.cpp)
AC_CONFIG_AUX_DIR(config)
AC_CANONICAL_HOST

AC_DEFINE_UNQUOTED(FREEAMP_VERSION, "2.1")

AC_PROG_MAKE_SET

dnl Checks for programs.
AC_PROG_CC
AC_PROG_CXX
AC_ISC_POSIX
AC_PROG_RANLIB
AC_PROG_INSTALL
AC_CHECK_PROGS(PERL, perl)
AC_CHECK_PROGS(NASM, nasm)

dnl libcdaudio stuff
AC_HEADER_STDC
AC_CHECK_HEADERS(stdarg.h linux/cdrom.h linux/ucdrom.h sys/cdio.h io/cam/cdrom.h mntent.h sys/mntent.h sys/ucred.h sys/mount.h)
AC_CHECK_FUNCS(getmntinfo shmget shmat shmdt semget semctl shmctl snprintf)
AC_FUNC_GETMNTENT

AC_C_CONST
case "$cross_compiling" in
  yes)
    ;;
  no)
    AC_C_BIGENDIAN
    AC_CHECK_SIZEOF(long)
    ;;
esac

dnl Checks for libraries.

dnl Checks for header files.
AC_STDC_HEADERS
AC_HAVE_HEADERS(unistd.h io.h pthread.h errno.h)

AC_CHECK_LIB(socket, connect, [EXTRALIBS="$EXTRALIBS -lsocket"])
AC_CHECK_LIB(nsl, gethostbyname, [EXTRALIBS="$EXTRALIBS -lnsl"])

dnl Checks for gdbm

AC_ST_BLKSIZE
AC_OFF_T
AC_HAVE_FUNCS(rename ftruncate flock fsync)
AC_CONST
AC_HAVE_HEADERS(sys/file.h string.h stdlib.h memory.h fcntl.h)

dnl end checks for gdbm


AC_DEFUN([AC_PROTOTYPE],[
 pushdef([function],translit([$1], [a-z], [A-Z]))
 pushdef([tags],[AC_PROTOTYPE_TAGS(builtin([shift],builtin([shift],builtin([shift],$@))))])
 for i in 1
 do
   AC_PROTOTYPE_LOOP(AC_PROTOTYPE_REVERSE($1, AC_PROTOTYPE_SUBST($2,tags),AC_PROTOTYPE_SUBST($3, tags),builtin([shift],builtin([shift],builtin([shift],$@)))))
   AC_MSG_ERROR($1 unable to find a working combination)
 done
 popdef([tags])
 popdef([function])
])

AC_DEFUN([AC_PROTOTYPE_REVERSE],[ifelse($#,0,,$#,1,[[$1]],[AC_PROTOTYPE_REVERSE(builtin([shift],$@)),[$1]])])

AC_DEFUN([AC_PROTOTYPE_SUBST],[ifelse($2,,[$1],[AC_PROTOTYPE_SUBST(patsubst([$1],[$2],[$2[]_VAL]),builtin([shift],builtin([shift],$@)))])])

AC_DEFUN([AC_PROTOTYPE_TAGS],[ifelse($1,,[],[$1, AC_PROTOTYPE_TAGS(builtin([shift],builtin([shift],$@)))])])

AC_DEFUN([AC_PROTOTYPE_DEFINES],[ifelse($1,,[],[AC_DEFINE(function[]_$1, $1_VAL) AC_PROTOTYPE_DEFINES(builtin([shift],$@))])])

AC_DEFUN([AC_PROTOTYPE_STATUS],[ifelse($1,,[],[$1 => $1_VAL AC_PROTOTYPE_STATUS(builtin([shift],$@))])])

AC_DEFUN([AC_PROTOTYPE_EACH],[
  ifelse($2,, [
  ], [
    pushdef([$1_VAL], $2)
    AC_PROTOTYPE_LOOP(rest)
    popdef([$1_VAL])
    AC_PROTOTYPE_EACH($1, builtin([shift], builtin([shift], $@)))
  ])
])

AC_DEFUN([AC_PROTOTYPE_LOOP],[
  ifelse(builtin([eval], $# > 3), 1,
  [
    pushdef([rest],[builtin([shift],builtin([shift],$@))])
    AC_PROTOTYPE_EACH($2,$1)
    popdef([rest])
  ], [
    AC_MSG_CHECKING($3 AC_PROTOTYPE_STATUS(tags))
    ac_save_CPPFLAGS="$CPPFLAGS"
    ifelse(AC_LANG,CPLUSPLUS,if test "$GXX" = "yes" ; then CPPFLAGS="$CPPFLAGS -Werror" ; fi)
    ifelse(AC_LANG,C,if test "$GCC" = "yes" ; then CPPFLAGS="$CPPFLAGS -Werror" ; fi)
    AC_TRY_COMPILE($2, $1, [
      CPPFLAGS="$ac_save_CPPFLAGS"
      AC_MSG_RESULT(ok)
      AC_PROTOTYPE_DEFINES(tags)
      break;
    ], [
      CPPFLAGS="$ac_save_CPPFLAGS"
      AC_MSG_RESULT(not ok)
    ])
  ]
 )
])

AC_DEFUN([AC_PROTOTYPE_ACCEPT],[
AC_PROTOTYPE(accept,
 [
  #include <sys/types.h>
  #include <sys/socket.h>
 ],
 [
  int a = 0;
  ARG2 * b = 0;
  ARG3 * c = 0;
  accept(a, b, c);
 ],
 ARG2, [struct sockaddr, void],
 ARG3, [socklen_t, size_t, int, unsigned int, long unsigned int])
])

AC_PROTOTYPE_ACCEPT

dnl Check for some more stuff

cmdline="true"
isunix="true"
UNIX_AUDIO_API="linux"
OSLINK=""
FPIC="-fPIC"
LINKMOD="$CXX -shared"
LIBMOD="ar -r"
OSTYPE="UNIX";

case "$host_os" in
  windowsnt)
    cmdline="false"
    isunix="false"
    ;;
  win32)
    isunix="false"
    OSTYPE="CYGWIN"
    ;;
  beos*)
    AC_DEFINE(HAVE_BEOS)
    OSTYPE="BEOS"
    CFLAGS="$CFLAGS -Wno-multichar -Wno-ctor-dtor-privacy"
    LINKMOD='g++ -nostart -Xlinker -soname=${@F} freeamp'
    isunix="false"
    ;;
  freebsd*)
    host_os="freebsd"
    CFLAGS="$CFLAGS -D_THREAD_SAFE -pthread -I/usr/local/include"
    LDFLAGS="$LDFLAGS -Wl,-export-dynamic -L/usr/local/lib"
    ;;
  netbsd*)
    host_os="freebsd"
    CFLAGS="$CFLAGS -I/usr/pkg/include -D_THREAD_SAFE -pthread"
    LDFLAGS="$LDFLAGS -L/usr/pkg/lib -Wl,-export-dynamic"
    ;;
  irix*)
    host_os="irix"
    AC_DEFINE(IRIX_CDAUDIO)
    CFLAGS="$CFLAGS -fsquangle"
    ;;
  linux*)
    host_os="linux"
    AC_DEFINE(HAVE_LINUX)
    LDFLAGS="$LDFLAGS -Wl,-export-dynamic -L/usr/lib"
    CFLAGS="$CFLAGS"
    ;;
  *qnx*)
    host_os="qnx"
    AC_DEFINE(QNX)
    CFLAGS="-Wall -O2 -gdwarf-2 -I/usr/local/include"
    LDFLAGS="$LDFLAGS -Wl,-export-dynamic -L/usr/local/lib"
    LIBS="$LIBS -lsocket -lasound"
    UNIX_AUDIO_API="qnx"
    ;;
  solaris*)
    AC_DEFINE(SOLARIS_GETMNTENT)
    AC_DEFINE(BROKEN_SOLARIS_LEADOUT)
    host_os="solaris"
    LIBS="$LIBS -lsocket -lnsl"
    if test "$GCC" != "yes" ; then
      dnl probably Sun CC.
      FPIC="-Kpic"
      LINKMOD="$CC -G"	
    else
      CFLAGS="$CFLAGS -fpermissive"
    fi	
    UNIX_AUDIO_API="solaris"
    ;;
  *)
    echo "what are you?"
    ;;
    
esac  

if test "$UNIX_AUDIO_API" = "qnx"; then
   AC_DEFINE(NO_CDAUDIO)
else
   OSDEPPLUGINS="$OSDEPPLUGINS plugins/cd.lmc"
   OSDEPPLUGINS="$OSDEPPLUGINS plugins/cd.pmo"
fi

dnl *********************************
dnl Check for dynamic loading library
dnl *********************************

if test "$host_os" = "beos"; then
  AC_MSG_WARN([skipping libdl check, using BeOS add-on mechanism])
elif test "$host_os" = "freebsd"; then
  AC_CHECK_LIB(c, dlopen, foo="bar",
    AC_MSG_ERROR([FreeAmp requires the ability to load libraries dynamically (using dlopen)])
  )
else
  AC_CHECK_LIB(dl, dlopen, foo="bar", 
     AC_CHECK_LIB(c, dlopen, foo="bar",
         AC_MSG_ERROR([FreeAmp requires the ability to load libraries dynamically (using dlopen)]))
  )
fi

if test "$isunix" = "true" ; then
    AC_LANG_SAVE
    AC_LANG_C dnl PLUSPLUS
    AC_MSG_CHECKING(for G++ >= 2.91)
    AC_TRY_RUN([
int main() {
#if defined (__GNUC__)
#if (__GNUC__ == 2 && __GNUC_MINOR__ >= 91) || __GNUC__ > 2
    return 0;
#else
    return 1;
#endif
#else
    return 0;
#endif
}
    ], gcc_good=true, gcc_good=false, gcc_good=true)
    if test "$gcc_good" = "true"; then
        AC_MSG_RESULT(yes)
    else
        AC_MSG_RESULT(no)
        echo "You have a version of gcc that is too old to compile FreeAmp."
        echo "We would recommend upgrading your gcc to something relatively"
        echo "recent.  GCC is available at http://gcc.cygnus.com"
        echo "Re-run this configure script after you have a newer version."
        exit 1
    fi
    AC_LANG_RESTORE
fi
 
AC_SUBST(OSTYPE)
AC_DEFINE_UNQUOTED(HOST_OS, "${host_os}")
AC_DEFINE_UNQUOTED(HOST_CPU, "${host_cpu}")


dnl the following is to so that the right includes (and only the right
dnl includes) are added in at compile time.
OSINC="-I$srcdir/base/unix/include -I$srcdir/base/unix/$host_os/include"
OSDEP="unix/$host_os"

if test "$isunix" = "false"  ; then
  OSINC="-I$srcdir/base/$host_os/include -I$srcdir/ui/freeamp/$host_os"
  OSDEP="$host_os"
fi

dnl AC_SUBST(OSDEPSRC)
AC_SUBST(OSDEPOBJ)
AC_SUBST(OSDEP)
AC_SUBST(OSINC)
AC_SUBST(OSLINK)
AC_SUBST(FPIC)
AC_SUBST(LINKMOD)
AC_SUBST(LIBMOD)
AC_SUBST(build_cpu)
AC_SUBST(UNIX_AUDIO_API)

AC_CHECK_HEADER(esd.h, have_esound="true", have_esound="false")

AC_ARG_ENABLE(esd, [  --disable-esd           Don't compile the EsounD output plugin], enable_esd=no, enable_esd=yes)

if test "x$enable_esd" = "xno"; then
   have_esound="false"; 
fi

if test "$have_esound" = "true"; then
  AC_PATH_PROG(ESD_CONFIG, esd-config, no)
  if test "$ESD_CONFIG" = "no" ; then
     ESD_LIBS=""
     have_esound="false"
  else
     AC_LANG_SAVE
     AC_LANG_C
     ESD_CFLAGS=`$ESD_CONFIG --cflags`
     ESD_LIBS=`$ESD_CONFIG --libs`
     min_esd_version=0.2.12
     esd_major_version=`$ESD_CONFIG $esd_args --version | \
           sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
     esd_minor_version=`$ESD_CONFIG $esd_args --version | \
           sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
     esd_micro_version=`$ESD_CONFIG $esd_config_args --version | \
           sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
     ac_save_CFLAGS="$CFLAGS"
     ac_save_LIBS="$LIBS"
     CFLAGS="$CFLAGS $ESD_CFLAGS"
     LIBS="$LIBS $ESD_LIBS"
     rm -f conf.esdtest
     AC_MSG_CHECKING(for ESD - version >= $min_esd_version)
     AC_TRY_RUN([
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <esd.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.esdtest");

  /* HP/UX 9 (%@#!) writes to sscanf strings */
  tmp_version = my_strdup("$min_esd_version");
  if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, &micro) != 3) {
     printf("%s, bad version string\n", "$min_esd_version");
     exit(1);
   }

   if (($esd_major_version > major) ||
      (($esd_major_version == major) && ($esd_minor_version > minor)) ||
      (($esd_major_version == major) && ($esd_minor_version == minor) && ($esd_micro_version >= micro)))
    {
      return 0;
    }
  else
    {
      printf("\n*** 'esd-config --version' returned %d.%d.%d, but the minimum version\n", $esd_major_version, $esd_minor_version, $esd_micro_version);
      printf("*** of ESD required is %d.%d.%d. If esd-config is correct, then it is\n", major, minor, micro);
      printf("*** best to upgrade to the required version.\n");
      printf("*** If esd-config was wrong, set the environment variable ESD_CONFIG\n");
      printf("*** to point to the correct copy of esd-config, and remove the file\n");
      printf("*** config.cache before re-running configure\n");
      return 1;
    }
}

],, have_esound=false, have_esound=false)
     CFLAGS="$ac_save_CFLAGS"
     LIBS="$ac_save_LIBS"
     AC_LANG_RESTORE
     rm -f conf.esdtest
  fi

   if test "$have_esound" = "true"; then
     AC_MSG_RESULT(yes)
     ESOUNDPLUGIN=plugins/esound.pmo
     OSDEPPLUGINS="$OSDEPPLUGINS $ESOUNDPLUGIN"
     OSINC="$OSINC -I$srcdir/io/esound/include"
   else
     AC_MSG_RESULT(no)
     echo "WARNING: You have an old version of the EsounD software.  If you"
     echo "want EsounD support in FreeAmp, please upgrade to the latest"
     echo "version, which can be found at:"
     echo "ftp://ftp.gnome.org/pub/GNOME/stable/sources/esound"  
     ESD_LIBS=""
     have_esound="false"
   fi
fi


AC_SUBST(ESD_LIBS)

dnl optional freetype support..
save_CPPFLAGS="$CPPFLAGS"
CPPFLAGS="$CPPFLAGS -I/usr/local/include"
AC_LANG_SAVE
AC_LANG_C
AC_CHECK_HEADERS(freetype.h, have_freetype="true", have_freetype="false")

if test "$have_freetype" = "false"; then
  AC_CHECK_HEADERS(freetype/freetype.h, have_freetype="true", 
                    have_freetype="false")
fi
CPPFLAGS="$save_CPPFLAGS"
AC_LANG_RESTORE

TTF_LIBS=""
if test "$have_freetype" = "true"; then
  AC_CHECK_LIB(ttf, TT_Init_FreeType, have_freetype="true", 
               have_freetype = "false", -lm)
fi

if test "$have_freetype" = "true"; then
  TTF_LIBS="-lttf"
  AC_DEFINE(HAVE_FREETYPE)
else
  echo "WARNING: You don't have FreeType installed.  This means that FreeAmp"
  echo "will fall back on X fonts.  To make FreeAmp's GUI interface all pretty,"
  echo "you need FreeType.  Get the latest stable version at: "
  echo "http://www.freetype.org/download.html"
fi
 
AC_SUBST(TTF_LIBS)

dnl gtk+ junk

have_gtk="true"

if test "$have_gtk" = "true"; then
  AC_PATH_PROG(GTK_CONFIG, gtk-config, no)
  if test "$GTK_CONFIG" = "no"; then
     have_gtk="false"
  else
     GTK_CFLAGS=`$GTK_CONFIG --cflags`
     GTK_LIBS=`$GTK_CONFIG --libs gthread`
     min_gtk_version="1.2.5"
     AC_MSG_CHECKING(for GTK+ version >= $min_gtk_version)
     gtk_config_major=`$GTK_CONFIG --version | sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
     gtk_config_minor=`$GTK_CONFIG --version | sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
     gtk_config_micro=`$GTK_CONFIG --version | sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
     ac_save_CFLAGS="$CFLAGS"
     ac_save_LIBS="$LIBS"
     CFLAGS="$CFLAGS $GTK_CFLAGS"
     LIBS="$GTK_LIBS $LIBS"

     AC_TRY_RUN([
#include <gtk/gtk.h>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -