File: configure.ac

package info (click to toggle)
openh323 1.18.0.dfsg-1
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 27,616 kB
  • ctags: 26,979
  • sloc: cpp: 178,986; ansic: 33,179; sh: 3,483; makefile: 937
file content (184 lines) | stat: -rw-r--r-- 5,376 bytes parent folder | download | duplicates (3)
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
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
AC_INIT(configure.ac)

AC_PROG_CXX
AC_HEADER_STDC

dnl ########################################################################
dnl set the PREFIX accordingly
if test "x$prefix" = "xNONE"; then
   INSTALLPREFIX="/usr/local"
else
   INSTALLPREFIX="${prefix}"
fi

AC_SUBST(INSTALLPREFIX)


dnl ########################################################################
dnl set LIBDIR accordingly
LIBDIR="${libdir}"

AC_SUBST(LIBDIR)

dnl ########################################################################
AC_CANONICAL_TARGET()
LDSO=
case "$target_os" in
	solaris*) LDSO="-Bdynamic -G -h" ;;
        darwin*)  ;;
        *)        LDSO="-shared -Wl,-soname,";;
esac
AC_SUBST(LDSO, ${LDSO})

dnl ########################################################################
dnl look for amr-nb_float

H323_GSMAMR_NB_FLOAT=0
if test -r "./audio/gsm-amr/src/c-code/interf_dec.h" ; then
  AC_MSG_NOTICE(Enabling GSM-AMR plugin)
  H323_GSMAMR_NB_FLOAT=1
else
  AC_MSG_NOTICE(GSM-AMR plugin disabled (no 3GPP source))
fi
AC_SUBST(H323_GSMAMR_NB_FLOAT, $H323_GSMAMR_NB_FLOAT)


dnl ########################################################################
dnl look for embedded GSM

H323_EMBEDDED_GSM=0
AC_ARG_ENABLE(embeddedgsm,
       [  --enable-embeddedgsm    embed GSM codec via static linking],
       H323_EMBEDDED_GSM=$enableval)
if test "${H323_EMBEDDED_GSM}" != "0" ; then
  AC_MSG_NOTICE(Embedding GSM codec)
  LDFLAGS="$LDFLAGS -L../../plugins/audio/GSM0610"
  ENDLDLIBS="$ENDLDLIBS -libgsm0610_audio"
  AC_DEFINE(H323_EMBEDDED_GSM)
  H323_EMBEDDED_GSM=1
fi
AC_SUBST(H323_EMBEDDED_GSM, $H323_EMBEDDED_GSM)

dnl ########################################################################
dnl Look for system GSM
dnl
dnl It would be nice if we could use system GSM libraries, but it 
dnl appears that standard builds are not compiled with the WAV49 option
dnl Without this, MS-GSM cannot work, so we just don't bother 
dnl
dnl H323_SYSTEM_GSM=0
dnl localgsm="xxx"
dnl AC_ARG_ENABLE(localgsm,
dnl        [  --enable-localgsm         use local version of GSM library rather than system version],
dnl        localgsm=$enableval)
dnl 
dnl if test "${localgsm}" = "yes" ; then
dnl   AC_MSG_NOTICE(Forcing use of local GSM sources)
dnl elif test "${localgsm}" = "no" ; then
dnl   AC_MSG_NOTICE(Forcing use of system GSM library)
dnl   H323_SYSTEM_GSM=1
dnl else
dnl   AC_CHECK_LIB(gsm, gsm_create, GSM=1)
dnl   if test "x$GSM" != "x"; then
dnl     H323_SYSTEM_GSM=1
dnl   fi
dnl fi
dnl AC_SUBST(H323_SYSTEM_GSM, $H323_SYSTEM_GSM)
dnl AC_DEFINE_UNQUOTED(H323_SYSTEM_GSM, $H323_SYSTEM_GSM)

dnl ########################################################################
dnl Look for system libspeex

localspeex="xxx"
AC_ARG_ENABLE(localspeex,
       [  --enable-localspeex       use local version of Speex library rather than system version],
       localspeex=$enableval)

if test "${localspeex}" = "yes" ; then
  AC_MSG_NOTICE(Forcing use of local Speex sources)
elif test "${localspeex}" = "no" ; then
  AC_MSG_NOTICE(Forcing use of system Speex library)
  AC_DEFINE(H323_SYSTEM_SPEEX, 1)
  AC_SUBST(H323_SYSTEM_SPEEX, 1)
else
  AC_CHECK_LIB(speex, speex_encoder_destroy, SPEEX=1)
  if test "x$SPEEX" = "x"; then
    AC_MSG_NOTICE(Forcing use of local Speex library)
  else
    AC_MSG_CHECKING(system Speex version)
    cat > t.c <<C_FILE
    #include <speex.h>
    #include <speex_header.h>
    #include <stdio.h>
    int main(int argc,char *argv[])
    {
      SpeexHeader header;
      speex_init_header(&header, 1, 1, &speex_nb_mode);
      printf("%s\n", header.speex_version);
    }
C_FILE
    cc -o t t.c -lspeex > /dev/null 2>&1
    if test \! -x t ; then
      AC_MSG_RESULT(cannot determine - using library version)
    else
      SYSVER=`./t`
      rm -f t t.c
      AC_MSG_RESULT($SYSVER)
      AC_MSG_CHECKING(library Speex version)
      LIBVER=`grep "#define VERSION" ./audio/Speex/libspeex/misc.h | sed -e 's/^.*speex\-//' -e 's/\"//'`
      AC_MSG_RESULT($LIBVER)
      AC_MSG_CHECKING(Speex versions)
      cat > t.pl <<P_FILE
      [
      \$sysver = @ARGV[0];
      \$libver = @ARGV[1];
      @lib = split /\./, \$libver;
      while (@lib < 3) {
        @lib[0+@lib] = "0";
      }
      @sys = split /\./, \$sysver;
      while (@sys < 3) {
        @sys[0+@sys] = "0";
      }
      \$i = 0;
      while (\$i < 3) {
        #print "comparing " . @sys[\$i] . " and " . @lib[\$i] . "\n";
        if (\@sys[\$i] < @lib[\$i]) {
          print "0";
          die;
        }
        \$i++;
      }
      print "1";
      ]
P_FILE
      SPEEX=`perl t.pl $SYSVER $LIBVER`
      rm t.pl
      if test "x$SPEEX" = "x" ; then
        AC_MSG_RESULT(library version is more recent)
      else
        AC_MSG_RESULT(system version is more recent)
        AC_DEFINE(H323_SYSTEM_SPEEX, 1)
        AC_SUBST(H323_SYSTEM_SPEEX, 1)
      fi
    fi
  fi
fi

dnl ########################################################################

AC_CONFIG_FILES(audio/gsm-amr/Makefile)
AC_CONFIG_FILES(audio/GSM0610/Makefile)
AC_CONFIG_FILES(audio/Speex/Makefile)
AC_CONFIG_FILES(audio/LPC_10/Makefile)
AC_CONFIG_FILES(audio/G726/Makefile)
AC_CONFIG_FILES(audio/IMA_ADPCM/Makefile)

dnl ########################################################################
dnl Header file

dnl ########################################################################
dnl Output configured files

AC_OUTPUT()