File: configure.in

package info (click to toggle)
mp3blaster 2-0b16-1.1
  • links: PTS
  • area: main
  • in suites: potato
  • size: 1,012 kB
  • ctags: 1,241
  • sloc: cpp: 12,228; ansic: 1,557; sh: 362; makefile: 107
file content (158 lines) | stat: -rw-r--r-- 4,870 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
dnl Process this file with autoconf to produce a configure script.
AC_INIT(src/main.cc)
AM_INIT_AUTOMAKE(mp3blaster, 2.0b16)

dnl CPLUS_INCLUDE_PATH=$C_INCLUDE_PATH:/usr/local/lib/qt/include

dnl Checks for programs.
AC_PROG_CC
AC_PROG_CXX
AC_PROG_LN_S
AC_PROG_INSTALL
AC_PROG_RANLIB

#For FreeBSD, look in /usr/local/(lib,include) first, since ncurses4
#must be installed as an add-on on these systems in /usr/local
FRIET="`uname -sr|cut -d'.' -f1`"
if test "$FRIET" = "FreeBSD 3" -o "$FRIET" = "FreeBSD 4" ; then
  echo "FreeBSD 3/4 detected."
  LDFLAGS="-L/usr/local/lib $LDFLAGS"
  CPPFLAGS="-I/usr/local/include $CPPFLAGS"
fi

dnl Checks for libraries.
AC_CHECK_LIB(m,main,,AC_MSG_ERROR("No libm or no cos"))
AC_CHECK_LIB(pthread,main,INCLUDEPTHREAD=1)
AC_CHECK_LIB(ncurses,main,INCLUDENCURSES=1)
AC_CHECK_LIB(curses,main,INCLUDECURSES=1)
AC_CHECK_LIB(ossaudio,main)

dnl Checks for header files.
AC_HEADER_STDC
AC_CHECK_HEADERS(fcntl.h malloc.h sys/ioctl.h unistd.h errno.h)
AC_CHECK_HEADERS(bool.h)
AC_CHECK_HEADERS(pthread.h pthread/mit/pthread.h)
AC_CHECK_HEADERS(ncurses/ncurses.h ncurses/curses.h ncurses.h curses.h)
AC_CHECK_HEADERS(sys/soundcard.h machine/soundcard.h soundcard.h getopt.h)

AC_ARG_WITH(pthread,  [  --with-pthread          playing with pthread], \
  if test "$withval" = "yes" ; then
    INCLUDEPTHREAD=1
  else
    INCLUDEPTHREAD=0
  fi;)

AC_ARG_WITH(nas,  [  --with-nas              network audio system (default=no)], \
  if test "$withval" = "yes" ; then
    WANTNAS=1
  else
    WANTNAS=0
  fi;)

dnl Checks for typedefs, structures, and compiler characteristics.
AC_C_CONST
AC_C_BIGENDIAN

dnl Checks for library functions.
AC_PROG_GCC_TRADITIONAL
AC_CHECK_FUNCS(strdup strstr)

dnl check argument

SRCDIRS="mpegsound nmixer src"
AC_SUBST(SRCDIRS)

LIBMPEGSOUND="../mpegsound/libmpegsound.a"
LIBNMIXER="../nmixer/libnmixer.a"
AC_SUBST(LIBMPEGSOUND)
AC_SUBST(LIBNMIXER)

AC_CHECK_LIB(sidplay, main, INCLUDESIDPLAY=1)

if test "$INCLUDESIDPLAY" = 1 ; then
  SID_LIBS="-lsidplay"
  AC_DEFINE(HAVE_SIDPLAYER)
fi

if test "`uname -s`" = "OpenBSD" ; then
  SOUNDDEV="/dev/audio"
else
  SOUNDDEV="/dev/dsp"
fi
AC_DEFINE_UNQUOTED(SOUND_DEVICE, "$SOUNDDEV")

if test "$INCLUDEPTHREAD" = 1 ; then
  LIBS="$LIBS -lpthread"
  AC_DEFINE(PTHREADEDMPEG)
  AC_DEFINE(_REENTRANT)
fi

if test "$INCLUDENCURSES" = 1 ; then
  LIBS="$LIBS -lncurses"
elif test "$INCLUDECURSES" = 1 ; then
  LIBS="$LIBS -lcurses"
else
  echo 'You need a decent ncurses (called curses on OpenBSD) library!'
  exit 1
fi

dnl A check for a particular __math.h file that causes sigsegv's in combination
dnl with gcc 2.7.*  / egcs-1.1.1 or older versions
if test -f /usr/include/__math.h -a "`grep 'long long int __p = (long long int) __y' /usr/include/__math.h 2>/dev/null`" != "" -a \( "`$CXX -v 2>&1|grep 'gcc version 2.[[567]]'`" != "" -o "`$CXX -v 2>&1|tail -1|grep egcs|cut -d'(' -f2|egrep 'egcs-(0|1.(0|1.[[01]]))'`" != "" \) ; then
    CXXFLAGS="$CXXFLAGS -D__NO_MATH_INLINES"
fi
CXXFLAGS="$CXXFLAGS -D__NO_MATH_INLINES"

dnl check for Network Audio System library

if test "$WANTNAS" = "1" ; then
  AC_PATH_XTRA
  dnl X_CFLAGS are needed to find audio/audiolib.h on many systems
  tmp_CPPFLAGS=$CPPFLAGS
  echo "X_CFLAGSi: $X_CFLAGS"
  CPPFLAGS="$CPPFLAGS $X_CFLAGS"
  
  dnl AC_CHECK_LIB(audio, AuOpenServer,INCLUDENAS=1,,-lXt -lX11 -lm)
  AC_CHECK_LIB(audio, AuOpenServer,INCLUDENAS=1,,$X_LIBS $X_PRE_LIBS $X_EXTRA_LIBS -lXt -lX11 -lm)
  AC_CHECK_HEADER(audio/audiolib.h,INCLUDENASH=1)
  dnl LIBS=$tmp_LIBS
  dnl CXXFLAGS is not checked during configure, CPPFLAGS is though.
  CPPFLAGS=$tmp_CPPFLAGS
  
  if test "$INCLUDENAS" = 1 -a "$INCLUDENASH" = 1; then
    NAS_LIBS="$X_LIBS $X_PRE_LIBS $X_EXTRA_LIBS -laudio -lXt -lX11 -lm"
    NAS_CFLAGS=$X_CFLAGS
    AC_DEFINE(HAVE_NASPLAYER)
    AC_SUBST(NAS_LIBS)
    AC_SUBST(NAS_CFLAGS)
    echo "************************"
    echo "* NAS support included *"
    echo "************************"
  fi
fi

AC_SUBST(SID_LIBS)

CXXFLAGS="$CXXFLAGS -g -Wall -Wstrict-prototypes -W -fno-strength-reduce "

dnl Huh? -SKY-
dnl PACKAGE=mp3blaster
dnl VERSION=2.0b12
dnl PACKAGE_VERSION="$PACKAGE-$VERSION"
dnl AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE")
dnl AC_DEFINE_UNQUOTED(VERSION, "$VERSION")
dnl AC_SUBST(PACKAGE)
dnl AC_SUBST(VERSION)


AC_OUTPUT(src/Makefile mpegsound/Makefile Makefile nmixer/Makefile)

echo 
echo "******************************************************************"
echo "If configure can't find certain libraries or include files, you can" 
echo "specify them on the commandline like:"
echo "CPPFLAGS=\"-I/usr/local/nas/include\" LDFLAGS=\"-L/usr/local/nas/lib\" "\
	"./configure"
echo "If mp3blaster's layout  is incorrect, or if  mp3blaster only plays "
echo "while holding a key, UPGRADE your ncurses library and includefiles"
echo "to  version 4.0  or better. This  is generally a GOOD IDEA anyway."