summaryrefslogtreecommitdiffstats
path: root/configure.in.in
blob: 4cbaa9072b67e7bcb20d915743f6171d1ed22380 (plain)
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
#MIN_CONFIG(3.2.0)

KDE_ENABLE_HIDDEN_VISIBILITY

AM_INIT_AUTOMAKE(soundkonverter, 0.3.7)
AC_C_BIGENDIAN
AC_CHECK_KDEMAXPATHLEN


###############################################################################
# BEGIN CDPARANOIA CHECK
###############################################################################
#
#AC_CHECK_HEADER([cdda_interface.h], [with_cdparanoia=yes], [with_cdparanoia=no])
#
#if test "$with_cdparanoia" != "yes" ; then
#    soundkonverter_error_nocdparanoia=yes
#    DO_NOT_COMPILE="$DO_NOT_COMPILE soundkonverter"
#    no_soundkonverter=yes
#
#    echo ""
#    echo "-----------------------------------------"
#    echo "ERROR: Could not find cdparanoia headers."
#    echo "-----------------------------------------"
#    echo ""
#
#    AC_MSG_ERROR([could not find cdparanoia headers])
#fi
#
###############################################################################
# END CDPARANOIA CHECK
###############################################################################


dnl -------------------------------------
dnl       cdparanoia check
dnl -------------------------------------

AC_CHECK_HEADERS(cdda_interface.h, have_paranoia="yes", have_paranoia="no" )
if test x$have_paranoia != xyes; then
  AC_CHECK_HEADERS(cdda/cdda_interface.h, have_paranoia="yes", have_paranoia="no" )
  if test x$have_paranoia = xyes; then
    cdda_includes="-I/usr/include/cdda"
  fi
fi
AC_SUBST(cdda_includes)

dnl ----------------------------------
dnl    Can soundkonverter be compiled?
dnl ----------------------------------

if test x$have_paranoia != xyes; then
    DO_NOT_COMPILE="$DO_NOT_COMPILE soundkonverter"
    no_paranoia=yes
fi

###############################################################################
# BEGIN TAGLIB CHECK
###############################################################################

TAGLIB_REQ_VERSION="1.4.0";
AC_DEFUN([VERSION_TO_NUMBER], [`$1 | awk 'BEGIN { FS = "."; } { printf "%d",  ([$]1* 1000 + [$]2) * 1000 + [$]3;}'`])

AC_PATH_PROG(TAGLIB_CONFIG, taglib-config, no)

if test "x$TAGLIB_CONFIG" = "xno" ; then
    soundkonverter_error_notaglib=yes
    DO_NOT_COMPILE="$DO_NOT_COMPILE soundkonverter"
    no_soundkonverter=yes
else
    AC_DEFINE(HAVE_TAGLIB, 1, [have TagLib])
    taglib_includes=[`$TAGLIB_CONFIG --cflags`]
    taglib_libs=[`$TAGLIB_CONFIG --libs`]
    taglib_version=[`$TAGLIB_CONFIG --version`]

    if test VERSION_TO_NUMBER(echo $taglib_version) -lt VERSION_TO_NUMBER(echo $TAGLIB_REQ_VERSION); then
        soundkonverter_error_taglibold=yes
        DO_NOT_COMPILE="$DO_NOT_COMPILE soundkonverter"
        no_soundkonverter=yes
    fi
fi

AC_SUBST(taglib_includes)
AC_SUBST(taglib_libs)

###############################################################################
# END TAGLIB CHECK
###############################################################################


###############################################################################
# BEGIN MP4V2 CHECK
###############################################################################
# m4a/aac tag reading and writing needs libmp4v2 from faad2 or better mpeg4ip

AC_ARG_WITH(mp4v2,
    AC_HELP_STRING([--with-mp4v2],[build soundkonverter with M4A/AAC tag support from mp4v2/faad2]),
    [have_mp4v2=$withval],
    [have_mp4v2=no]
)

AC_ARG_WITH(mp4v2-dir,
    AC_HELP_STRING([--with-mp4v2-dir],[path to mp4v2  [default=/usr]]),
    [mp4v2_dir="$withval"],
    [mp4v2_dir=/usr]
)

if test "$have_mp4v2" != "no"; then
    AC_LANG_SAVE
    AC_LANG_CPLUSPLUS
    ac_cxxflags_save=$CXXFLAGS
    CXXFLAGS="$CXXFLAGS -I$mp4v2_dir/include"
    ac_ldflags_save=$LDFLAGS
    LDFLAGS="$LDFLAGS -L$mp4v2_dir/lib"

    # not even everyone using faad2 has <systems.h>
    if ! test -f config.h; then
        echo "#include \"confdefs.h\"" > config.h
    fi
    ac_cppflags_save=$CPPFLAGS
    CPPFLAGS="$CPPFLAGS -I."
    AC_CHECK_HEADERS(systems.h)
    AC_CHECK_HEADERS([mp4.h], [have_mp4_h=yes], [],
        [#ifdef HAVE_SYSTEMS_H
         # include <systems.h>
         #endif
        ])

    AC_CHECK_LIB( mp4v2, MP4Read, have_mp4v2=yes, have_mp4v2=no )

    if test "$have_mp4v2" = "yes" -a "$have_mp4_h" = "yes"; then
        AC_DEFINE(HAVE_MP4V2, 1, [have mp4v2])
        MP4V2_INCLUDES="-I$mp4v2_dir/include"
        MP4V2_LIBS="-L$mp4v2_dir/lib -lmp4v2"
    else
        have_mp4v2=no
    fi

    CPPFLAGS=$ac_cppflags_save
    CXXFLAGS=$ac_cxxflags_save
    LDFLAGS=$ac_ldflags_save
    AC_LANG_RESTORE
fi

AC_SUBST(MP4V2_INCLUDES)
AC_SUBST(MP4V2_LIBS)

AM_CONDITIONAL(with_mp4v2, [test x$have_mp4v2 != xno ])

###############################################################################
# END MP4V2 CHECK
###############################################################################