source: roaraudio/configure @ 5056:b31e60545552

Last change on this file since 5056:b31e60545552 was 5056:b31e60545552, checked in by phi, 11 years ago

support auto reconf bits=32->16 in case not supported (See: #48)

  • Property exe set to *
File size: 63.6 KB
Line 
1#!/bin/sh
2
3# check for bash...
4
5if [ "$(echo -n)" = '-n' ]
6then
7 SHELL=$(which bash ksh sh 2> /dev/null | grep ^/ | head -n 1)
8 exec $SHELL $0 "$@"
9fi
10
11PATH="$PATH":/sbin:/usr/sbin:/usr/local/sbin:/usr/pkg/sbin # Ensure superuser paths
12
13# wine prints errors to stdout so stderr redirects do not work.
14# To avoid common problems with wine and $LANG/$LC_* we just reset them.
15
16LANG=C
17LC_CTYPE=C
18LC_NUMERIC=C
19LC_TIME=C
20LC_COLLATE=C
21LC_MONETARY=C
22
23#set -x
24
25# IDs officaly assigned
26DEV_VENDOR=0
27DEV_VENDOR_NAME='RoarAudio'
28#--------
29
30DISTRIBUTION_VERSION_STRING=''
31
32
33TF_C=testit.c
34TF_E=./testit
35LDPATH=''
36INCPATH=''
37
38OPTI_O=2
39
40CROSS_COMPILE=false
41
42SYSNAME='unknown'
43SHARED='-shared'
44SHARED_CF=''
45SHARED_SUFFIX='.so'
46COMPBIN_SUFFIX='.r'
47fPIC=true
48Wextra=false
49MMCU=''
50LINK_DEPS=full
51PKG_CONFIG=false
52RUNTIME_DETECT=false
53
54NEED_GNU_SOURCE=false
55
56PREFIX='/usr/local'
57PREFIX_BIN=''
58PREFIX_LIB=''
59PREFIX_INC=''
60PREFIX_MAN=''
61PREFIX_PC=''
62PREFIX_COMP_LIBS=''
63PREFIX_COMP_BINS=''
64
65CDROM_IS_DEV=true
66CDROM=""
67OSS_DEV=""
68OSS_MIX_DEV=""
69PROC_NET_DECNET="/proc/net/decnet"
70PROC_NET_DECNET_NEIGH=""
71PROC_NET_ARP=""
72TTY_DEV=""
73
74ROOT_UID=''
75
76VORBIS_BITS=32
77
78FSYNC=false
79
80DEFAULT_GRP=''
81
82AO_INST_DIR=''
83XMMS_INST_DIR=''
84AUDACIOUS_INST_DIR=''
85
86SNDIO_EMUL=true
87
88LIBAO=true
89XMMS=true
90AUDACIOUS=true
91
92DEFAULT_RATE=''
93DEFAULT_CHANNELS=''
94DEFAULT_BITS=''
95
96COMP_LIBS=true
97COMP_ROARD=true
98COMP_CLIENTS=true
99COMP_DOC=true
100COMP_COMP_BINS=true
101
102ALAW=true
103MULAW=true
104ALAW_RW=true
105MULAW_RW=true
106
107PROXY=true
108
109PASSWORD_API=true
110
111NO_LISTEN=false
112
113META_DATA=true
114
115SUPPORT_TRAP=false
116
117USE_MEMMGR=false
118
119WITHOUT_CF='cmd'
120
121WITHOUT_VIO=''
122
123WITHOUT_DCOMP=''
124
125HAVE_MAIN_ARGS=true
126
127MINIMAL=false
128BETA=true
129EXPERIMENTAL=true
130
131TARGET_WIN32=false
132TARGET_MICROCONTROLLER=false
133TARGET_CYGWIN=false
134
135EXEC_HELPER=''
136
137ROAR_DRIVER_DEFAULT=''
138ROAR_DRIVER_CODEC=''
139
140ROARD_CFREQ='' # cycle frequens for roard, normally 100Hz
141
142# Libs which are per default disabled:
143no_lib_ssl=true
144
145_CARGS="$@";
146
147# some very basic string functions:
148to_upper() {
149 tr 'a-z' 'A-Z'
150}
151
152to_escaped() {
153 tr 'A-Z/.+-' 'a-z____'
154}
155
156echo -n "checking for version of this package... "
157VERSION=`head -n 1 ChangeLog | cut -d' ' -f2`
158echo "$VERSION"
159
160
161echo -n "checking for C compiler... "
162if [ "$CC" != '' ]
163then
164 echo $CC
165else
166 CC=$(which gcc cc 2> /dev/null | grep ^/ | head -n 1)
167 if [ "$CC" = '' ]
168 then
169  echo 'none'
170  exit 1;
171 fi
172 echo $CC
173fi
174
175echo -n "checking for ranlib... "
176if [ "$RANLIB" != '' ]
177then
178 echo $RANLIB
179else
180 _guess=`echo $CC | sed 's/[gp]*cc\(-.*\)*//'`
181 RANLIB=$(which ${_guess}ranlib ranlib 2> /dev/null | grep ^/ | head -n 1)
182 if [ "$RANLIB" = '' ]
183 then
184  echo 'none'
185 fi
186 echo $RANLIB
187fi
188
189echo -n "checking for pkg-config... "
190PKG_CONFIG=$(which pkg-config false 2> /dev/null | grep ^/ | head -n 1)
191if $PKG_CONFIG --help > /dev/null 2> /dev/null
192then
193 echo $PKG_CONFIG
194else
195 echo no
196fi
197
198#Makefile.conf not yet open, write it later
199
200echo -n "checking for sysname... "
201SYSNAME=$(uname -s)
202echo "$SYSNAME"
203
204while [ "$1" != '' ]
205do
206 case "$1" in
207  '--help')
208   echo 'OPTIONS:'
209   echo
210   echo '--help                      - This Help'
211   echo
212   echo '--ldpath DIR                - Add DIR to (compile time) search list for libs'
213   echo '--incpath DIR               - Add DIR to search list for headers'
214   echo '--addpath DIR               - Add DIR/lib to lib, DIR/include to header search list'
215   echo
216   echo '--cflags FLAGS              - Sets additional compiler flags (default: '"$CFLAGS"')'
217   echo '--ldflags FLAGS             - Sets additional linker flags (default: '"$LDFLAGS"')'
218   echo '--opti LEVEL                - Sets optimizer level (default: '"$OPTI_O"')'
219   echo '--link-deps MODE            - Model for linking dependencys: full or indirect'
220   echo
221   echo '--cc CC                     - Set name of C compiler (CC) to CC'
222   echo '--ranlib RANLIB             - Set name of ranlib (RANLIB) to RANLIB'
223   echo
224   echo '--cdrom DEV                 - Set default CDRum device'
225   echo '--tty DEV                   - Set default TTY'
226   echo '--oss-dev DEV               - Set default OSS device'
227   echo '--oss-mixer-dev DEV         - Set default OSS mixer device'
228   echo '--proc-net-decnet FILE      - Set DECnet file for DECnet support auto detecting'
229   echo '                              (ignore this on non-Linux)'
230   echo '--proc-net-decnet-neigh FILE'
231   echo '                            - Set file for DECnet neighbour table'
232   echo '--proc-net-arp FILE         - Set file for IP neighbour (ARP) table'
233   echo '--audio-group GROUP         - Sets group of audio permitted users'
234   echo '--root-uid UID              - Sets User ID (UID) of the root user/superuser'
235   echo
236   echo '--no-LIB                    - disable library LIB'
237   echo '--maybe-LIB                 - autodetect library LIB (default)'
238   echo '--runtime-detect            - do as much as posible auto detecting on runtime (for distributors)'
239   echo
240   echo '--ao-install-dir DIR        - Set install dir for libao plugin'
241   echo '--xmms-install-dir DIR      - Set install dir for XMMS plugin'
242   echo '--audacious-install-dir DIR - Set install dir for Audacious plugin'
243   echo
244   echo '--prefix DIR                - Set general prefix (default: '"$PREFIX"')'
245   echo '--prefix-bin DIR            - Set prefix for binarys (default: $PREFIX/bin)'
246   echo '--prefix-lib DIR            - Set prefix for librarys (default: $PREFIX/libs)'
247   echo '--prefix-inc DIR            - Set prefix for include files (default: $PREFIX/include)'
248   echo '--prefix-man DIR            - Set prefix for manpages (default: $PREFIX/man)'
249   echo '--prefix-pc DIR             - Set prefix for pkg-config (default: $PREFIX_LIB/pkgconfig)'
250   echo '--prefix-comp-libs DIR      - Set prefix for compatibility librarys (default: $PREFIX_LIB/roaraudio/complibs)'
251   echo '--prefix-comp-bins DIR      - Set prefix for compatibility binarys  (default: $PREFIX_LIB/roaraudio/compbins)'
252   echo
253   echo '--default-rate RATE         - Set default sample rate for roard and roarclients'
254   echo '--default-channels CHANNELS - Set default number of channels for roard and roarclients'
255   echo '--default-bits BITS         - Set default number of bits per sample for roard and roarclients'
256   echo '--default-driver DRIVER     - Set default driver for roard'
257   echo '--default-codec CODEC       - Set default codec used for the default driver'
258   echo
259   echo '--without-alaw              - Disable support of A-Law codec (de- and encoding)'
260   echo '--without-alaw-rw           - Disable support for writing A-Law (saves 8KB)'
261   echo '--without-mulaw             - Disable support of mu-Law codec (de- and encoding)'
262   echo '--without-mulaw-rw          - Disable support for writing mu-Law (saves 16KB)'
263   echo '--without-proxy             - Disable support for proxys'
264   echo
265   echo '--without-comp-libs         - Disable build of librarys'
266   echo '--without-comp-roard        - Disable build of roard'
267   echo '--without-comp-clients      - Disable build of clients'
268   echo '--without-comp-doc          - Disable build of documentation'
269   echo '--without-comp-comp-bins    - Disable build of compatibility binarys'
270   echo
271   echo '--without-dcomp-COMP        - Disable build of roard'\''s component COMP'
272   echo
273   echo '--without-meta-data         - Disable support for Meta Data'
274   echo
275   echo '--without-cf-cmd            - Disable support for command codecfilter'
276   echo
277   echo '--without-vio-MODULE        - Disable support for VIO module MODULE'
278   echo
279   echo '--without-password-api      - Disable build of Password API'
280   echo '--with-trap-api             - Build with Trap support'
281   echo
282   echo '--with-memory-api           - Use internal memory API (memmgr)'
283   echo '--without-memory-api        - Do not use internal memory API (memmgr)'
284   echo
285   echo '--without-listen            - Disable listening sockets in roard'
286   echo '                              This is the same as allways using --no-listen'
287   echo
288   echo '--without-beta              - Disable beta code'
289   echo '--without-experimental      - Disable experimental code'
290   echo
291   echo '--distribution-version-string STRING'
292   echo '                            - Sets distribution part of version string'
293   echo
294   echo '--roard-cfreq FREQ          - Sets the cycle frequency of roard in Hz.'
295   echo '--vorbis-bits BITS          - Sets bits per sample used by Vorbis code'
296   echo
297#   echo '--without-libao             - Disable build of libao plugin'
298   echo '--without-xmms              - Disable build of XMMS plugin'
299#   echo '--without-audacious         - Disable build of Audacious plugin'
300   echo
301   echo '--mmcu MMCU                 - Sets -mmcu compiler/linker option'
302   echo '--minimal                   - Disable all optional components'
303   echo '--cross-compile             - Enable cross compiler workarounds'
304   echo '--target-microcontroller    - Set Options for mircocontrollers without a OS'
305   echo '                              Implys --cross-compile'
306   echo '--target-win32              - Disable everything useful'
307   echo '--exec-helper HELPER        - Exec all test programms using this command (HELPER $cmd $args)'
308   echo '                              use '\''--exec-helper wine'\'' when building win32 binarys'
309   echo
310   echo
311   echo 'LIBRARY NAMES (to be used with --no-* and --maybe-*):'
312   echo
313   grep '^test_lib_defmake ROAR_' configure | awk '{print $5}' | cut -d/ -f1 | sort | uniq | grep -v ^c$ | \
314    while read lib
315    do
316     envlib=`echo "$lib" | to_escaped`
317     eval _no="\$no_lib_$envlib";
318     if [ "$_no" != '' ]
319     then
320      echo -n "$lib (disabled) "
321     else
322      echo -n "$lib "
323     fi
324    done
325   echo '' # print \n
326   exit 0;
327  ;;
328  '--ldpath')
329   LDPATH="$LDPATH -L$2"
330   shift;
331  ;;
332  '--incpath')
333   INCPATH="$INCPATH -I$2"
334   shift;
335  ;;
336  '--addpath')
337   LDPATH="$LDPATH -L$2/lib/"
338   INCPATH="$INCPATH -I$2/include/"
339   shift;
340  ;;
341  '--cflags')
342   CFLAGS="$2"
343   shift;
344  ;;
345  '--ldflags')
346   LDFLAGS="$2"
347   shift;
348  ;;
349  '--opti')
350   OPTI_O="$2"
351   shift;
352  ;;
353  '--link-deps')
354   LINK_DEPS="$2"
355   shift;
356  ;;
357  '--cc')
358   CC="$2"
359   shift;
360  ;;
361  '--ranlib')
362   RANLIB="$2"
363   shift;
364  ;;
365  '--cdrom')
366   CDROM="$2"
367   shift;
368  ;;
369  '--tty')
370   TTY_DEV="$2"
371   shift;
372  ;;
373  '--oss-dev')
374   OSS_DEV="$2"
375   shift;
376  ;;
377  '--oss-mixer-dev')
378   OSS_MIX_DEV="$2"
379   shift;
380  ;;
381  '--proc-net-decnet')
382   PROC_NET_DECNET="$2"
383   shift;
384  ;;
385  '--proc-net-decnet-neigh')
386   PROC_NET_DECNET_NEIGH="$2"
387   shift;
388  ;;
389  '--proc-net-arp')
390   PROC_NET_ARP="$2"
391   shift;
392  ;;
393  '--audio-group')
394   DEFAULT_GRP="$2"
395   shift;
396  ;;
397  '--root-uid')
398   ROOT_UID="$2"
399   shift;
400  ;;
401  '--no-'*)
402   lib=$(echo "$1" | sed 's/^--no-//' | to_escaped)
403   eval no_lib_$lib=true
404  ;;
405  '--maybe-'*)
406   lib=$(echo "$1" | sed 's/^--maybe-//' | to_escaped)
407   eval unset no_lib_$lib
408  ;;
409  '--runtime-detect')
410   RUNTIME_DETECT=true
411  ;;
412  '--ao-install-dir')
413   AO_INST_DIR="$2"
414   shift;
415  ;;
416  '--xmms-install-dir')
417   XMMS_INST_DIR="$2"
418   shift;
419  ;;
420  '--audacious-install-dir')
421   AUDACIOUS_INST_DIR="$2"
422   shift;
423  ;;
424  '--default-rate')
425   DEFAULT_RATE="$2"
426   shift;
427  ;;
428  '--default-channels')
429   DEFAULT_CHANNELS="$2"
430   shift;
431  ;;
432  '--default-bits')
433   DEFAULT_BITS="$2"
434   shift;
435  ;;
436  '--default-driver')
437   ROAR_DRIVER_DEFAULT="$2"
438   shift;
439  ;;
440  '--default-codec')
441   ROAR_DRIVER_CODEC="$2"
442   shift;
443  ;;
444  '--without-alaw')
445   ALAW=false
446   ALAW_RW=false
447  ;;
448  '--without-alaw-rw')
449   ALAW_RW=false
450  ;;
451  '--without-mulaw')
452   MULAW=false
453   MULAW_RW=false
454  ;;
455  '--without-mulaw-rw')
456   MULAW_RW=false
457  ;;
458  '--without-proxy')
459   PROXY=false
460  ;;
461  '--without-comp-libs')
462   COMP_LIBS=false
463  ;;
464  '--without-comp-roard')
465   COMP_ROARD=false
466  ;;
467  '--without-comp-clients')
468   COMP_CLIENTS=false
469  ;;
470  '--without-comp-doc')
471   COMP_DOC=false
472  ;;
473  '--without-comp-comp-bins')
474   COMP_COMP_BINS=false
475  ;;
476  '--without-meta-data')
477   META_DATA=false
478  ;;
479  '--without-cf-'*)
480   WITHOUT_CF="$WITHOUT_CF"' '$(echo "$1" | cut -d- -f5)
481  ;;
482  '--without-vio-'*)
483   WITHOUT_VIO="$WITHOUT_VIO"' '$(echo "$1" | cut -d- -f5)
484  ;;
485  '--without-dcomp-'*)
486   WITHOUT_DCOMP="$WITHOUT_DCOMP"' '$(echo "$1" | cut -d- -f5)
487  ;;
488  '--without-password-api')
489   PASSWORD_API=false
490  ;;
491  '--with-trap-api')
492   SUPPORT_TRAP=true
493  ;;
494  '--with-memory-api'|'--use-memory-api')
495   USE_MEMMGR=true
496  ;;
497  '--without-memory-api')
498   USE_MEMMGR=false
499  ;;
500  '--without-listen')
501   NO_LISTEN=true
502  ;;
503  '--distribution-version-string')
504   DISTRIBUTION_VERSION_STRING="$2"
505   shift;
506  ;;
507  '--roard-cfreq')
508   ROARD_CFREQ="$2"
509   shift;
510  ;;
511  '--vorbis-bits')
512   VORBIS_BITS="$2"
513   shift;
514  ;;
515  '--without-libao')
516   LIBAO=false
517   no_lib_ao=true
518  ;;
519  '--without-xmms')
520   XMMS=false
521  ;;
522  '--without-audacious')
523   AUDACIOUS=false
524  ;;
525  '--minimal')
526   MINIMAL=true
527   RUNTIME_DETECT=false
528   XMMS=false
529   AUDACIOUS=false
530   LIBAO=false
531   PROXY=false
532   MULAW=false
533   MULAW_RW=false
534   ALAW=false
535   ALAW_RW=false
536   META_DATA=false
537   PASSWORD_API=false
538   SUPPORT_TRAP=false
539   USE_MEMMGR=false
540   WITHOUT_VIO="$WITHOUT_VIO"' dstr cmd stdio'
541   WITHOUT_CF="$WITHOUT_CF"' wave cmd cf au'
542   WITHOUT_DCOMP="$WITHOUT_DCOMP"' sources ssynth cb midi light raw rdtcs cdriver emul_esd emul_simple emul_rsound emul_rplay emul_gopher mixer'
543  ;;
544  '--without-beta')
545   BETA=false
546   EXPERIMENTAL=false
547  ;;
548  '--without-experimental')
549   EXPERIMENTAL=false
550  ;;
551  '--prefix')
552   PREFIX="$2"
553   shift;
554  ;;
555  '--prefix-bin')
556   PREFIX_BIN="$2"
557   shift;
558  ;;
559  '--prefix-lib')
560   PREFIX_LIB="$2"
561   shift;
562  ;;
563  '--prefix-inc')
564   PREFIX_INC="$2"
565   shift;
566  ;;
567  '--prefix-man')
568   PREFIX_MAN="$2"
569   shift;
570  ;;
571  '--prefix-pc')
572   PREFIX_PC="$2"
573   shift;
574  ;;
575  # we should remove --prefix-comp soon
576  '--prefix-comp'|'--prefix-comp-libs')
577   PREFIX_COMP_LIBS="$2"
578   shift;
579  ;;
580  '--prefix-comp-bins')
581   PREFIX_COMP_BINS="$2"
582   shift;
583  ;;
584####################################
585# autof* options block:
586  '--prefix='*)
587   PREFIX=$(echo "$1" | cut -d= -f2)
588  ;;
589  '--prefix-bin='*)
590   PREFIX_BIN=$(echo "$1" | cut -d= -f2)
591  ;;
592  '--prefix-lib='*)
593   PREFIX_LIB=$(echo "$1" | cut -d= -f2)
594  ;;
595  '--prefix-inc='*)
596   PREFIX_INC=$(echo "$1" | cut -d= -f2)
597  ;;
598  '--prefix-man='*)
599   PREFIX_MAN=$(echo "$1" | cut -d= -f2)
600  ;;
601  '--prefix-pc='*)
602   PREFIX_PC=$(echo "$1" | cut -d= -f2)
603  ;;
604  '--prefix-comp-libs='*)
605   PREFIX_COMP_LIBS=$(echo "$1" | cut -d= -f2)
606  ;;
607  '--prefix-comp-bins='*)
608   PREFIX_COMP_BINS=$(echo "$1" | cut -d= -f2)
609  ;;
610####################################
611  '--mmcu')
612   MMCU="$2"
613   shift;
614  ;;
615  '--cross-compile')
616   CROSS_COMPILE=true
617   RUNTIME_DETECT=true
618  ;;
619  '--exec-helper')
620   EXEC_HELPER="$2"
621   shift;
622  ;;
623  '--target-microcontroller')
624   TARGET_MICROCONTROLLER=true
625   CROSS_COMPILE=true
626   RUNTIME_DETECT=true
627   HAVE_MAIN_ARGS=false
628   XMMS=false
629   AUDACIOUS=false
630   LIBAO=false
631   WITHOUT_VIO="$WITHOUT_VIO"' cmd'
632  ;;
633  '--target-win32')
634   TARGET_WIN32=true
635  ;;
636 esac;
637
638 shift;
639done
640
641[ "$no_lib_yiff" != '' ] && no_lib_y2=true
642
643if $BETA
644then
645 :
646else
647 WITHOUT_DCOMP="$WITHOUT_DCOMP"' cb midi rdtcs'
648 no_lib_gcrypt=true
649 no_lib_jack=true
650 no_lib_dbus_1=true
651fi
652
653if $EXPERIMENTAL
654then
655 :
656else
657 : # Add list of experimental things here.
658fi
659
660CCTF="false"
661
662test_lib () {
663 echo > $TF_C
664
665 name="$1"
666 echo -n "checking for $name... "
667 echo "TEST LIB: $name" >&5
668 shift;
669
670 LIBS=''
671
672 while [ "$1" != '--' ]
673 do
674  case "$1" in
675   'c'|'-lc')
676    :; # no need to do anything
677   ;;
678   '-'*)
679    LIBS="$LIBS $1"
680   ;;
681   *)
682    LIBS="-l$1"
683   ;;
684  esac
685  shift;
686 done
687
688 shift;
689
690 echo "LIB($name) IS TESTED USING LIBS: $LIBS" >&5
691
692 while [ "$1" != '' ]
693 do
694  _h="$1";
695  shift;
696  _envname=`echo "$_h" | to_escaped`
697  eval "_t=\$libname_$_envname"
698  echo "LIB($name) DEPENDS ON $_h($_envname) with state '$_t'" >&5
699  if [ "$_t" = 'false' ]
700  then
701   echo "// not including <$_h> as it was tested as not present"  >> $TF_C
702  else
703   echo "#include <$_h>"  >> $TF_C
704  fi
705 done
706
707 echo 'int main (void) { return 0; }' >> $TF_C
708
709 echo "LIB($name) IS TESTED USING TEST CODE:" >&5
710 echo "--- BEGIN OF CODE BLOCK ---" >&5
711 cat $TF_C >&5
712 echo "--- END OF CODE BLOCK ---" >&5
713
714 echo "LIB($name) HAS COMPILER/LINKER OUTPUT:" >&5
715 echo "--- BEGIN OF CHILD OUTPUT BLOCK ---" >&5
716 $CCTF $LIBS >&5 2>&5;
717 R=$?
718 echo "--- END OF CHILD OUTPUT BLOCK ---" >&5
719
720 if [ "$R" = '0' ]
721 then
722  echo 'yes'
723  echo "LIB($name) WAS FOUND" >&5
724 else
725  echo 'no'
726  echo "LIB($name) NOT FOUND" >&5
727 fi
728
729 return $R
730}
731
732test_lib_defmake () {
733 def="$1"
734 subdir="$2"
735 shift
736 shift
737 name="$1"
738 lib="$2"
739 shift
740
741 echo "TEST LIB: $name" >&5
742
743 [ "$subdir" = '%' ] && subdir=''
744
745 envlib=`echo "$lib"   | cut -d/ -f1 | to_escaped`
746 envname=`echo "$name" | to_escaped`
747
748 echo "LIB($name) HAS envlib='$envlib', envname='$envname'" >&5
749
750 if [ "$lib" != '--' ]
751 then
752  echo "EVAL: _no=\$no_lib_$envlib" >&5
753  eval _no="\$no_lib_$envlib";
754  $MINIMAL && _no='XXX'
755
756  if [ "$_no" != '' ]
757  then
758    echo "checking for $name... disabled by user"
759    echo "LIB($name) IS DISABLED BY USER" >&5
760   [ "$subdir" != '' ] && \
761    echo "subdir_$subdir=" >&4
762   echo "lib_$envlib=" >&4
763   return;
764  fi
765 fi
766
767 lib="$lib/"
768
769 libn=`echo $lib | cut -d/ -f1`
770 is_fatal=`echo $lib | cut -d/ -f2`
771
772 lib="$libn"
773
774# echo "is_fatal(i)=$is_fatal" >&5
775
776 if [ "$is_fatal" = '' -o "$is_fatal" = 'no' -o "$is_fatal" = 'false' ]
777 then
778  is_fatal=false
779 else
780  is_fatal=true
781  shift; # maybe we have a pkg name, not a lib
782 fi
783
784 echo "LIB($name) HAS FATAL FLAG SET TO $is_fatal" >&5
785
786# echo "is_fatal(b)=$is_fatal" >&5
787
788 LIBS=$($PKG_CONFIG --silence-errors --cflags --libs $lib 2> /dev/null)
789 if [ "$?" != '0' ]
790 then
791  if $is_fatal
792  then
793   echo "checking for $name... no (fatal config errors)"
794   echo "LIB($name) HAS FATAL ERRORS" >&5
795   echo "LIB($name) NOT FOUND" >&5
796   [ "$subdir" != '' ] && \
797    echo "subdir_$subdir=" >&4
798   echo "lib_$envlib=" >&4
799   return
800  fi
801  LIBS="-l$lib"
802 fi
803
804 echo "LIB($name) HAS LIBS: $LIBS" >&5
805
806 if test_lib "$name" $LIBS "$@"
807 then
808  subdir_var='subdir_'"`echo $subdir | to_escaped`"
809  echo "#define $def"            >&3
810  [ "$subdir" != '' ] && \
811   echo "$subdir_var=$subdir" >&4
812  [ "$lib" != 'c' ] && \
813   echo "lib_$envlib=$LIBS" >&4
814  if [ "$lib" != 'c' ]
815  then
816   eval "lib_$envlib='$LIBS'"
817  else
818   echo "LIB($name) SETS libname_$envname=true" >&5
819   eval "libname_$envname=true"
820  fi
821 else
822  [ "$subdir" != '' ] && \
823   echo "subdir_$subdir=" >&4
824  [ "$lib" != 'c' ] && \
825   echo "lib_$envlib=" >&4
826  echo "LIB($name) SETS libname_$envname=false" >&5
827  eval "libname_$envname=false"
828 fi
829 echo >&5
830 echo >&5
831}
832
833test_tool_defmake () {
834 DEF="$1"
835 NAME="$2"
836 shift;
837 shift;
838 echo -n "checking for $NAME... "
839
840 echo "TEST TOOL: $NAME" >&5
841
842 if $RUNTIME_DETECT
843 then
844  echo "$1 (runtime detect)"
845  echo "TOOL($NAME) WILL BE RUNTIME DETECTED" >&5
846  echo "#define $DEF "\""$1"\" >&3
847 elif $MINIMAL
848 then
849  echo "disabled by user (minimalstic build)"
850  echo "TOOL($NAME) IS DISABLED BY USER" >&5
851 else
852
853  LIST=$(which "$@" 2> /dev/null | grep ^/ | head -n 1)
854
855  if [ "$LIST" = '' ]
856  then
857   echo 'no'
858   echo "TOOL($NAME) NOT FOUND" >&5
859  else
860   echo $LIST
861   echo "#define $DEF "\""$LIST"\" >&3
862   echo "TOOL($NAME) IS AT $LIST" >&5
863  fi
864 fi
865}
866
867test_func_defmake () {
868 DEF="$1"
869 NAME="$2"
870 shift;
871 shift;
872 echo -n "checking for $NAME()... "
873
874 CALL="$1"
875 shift;
876
877 LIBS=''
878
879 while [ "$1" != '--' ]
880 do
881  case "$1" in
882   'c'|'-lc')
883    :; # no need to do anything
884   ;;
885   '-'*)
886    LIBS="$LIBS $1"
887   ;;
888   *)
889    LIBS="-l$1"
890   ;;
891  esac
892  shift;
893 done
894
895 shift; # skip '--'
896
897 echo "TEST FUNCTION: $NAME" >&5
898
899 {
900  while [ "$1" != '' ]
901  do
902   _h="$1";
903   shift;
904   _envname=`echo "$_h" | to_escaped`
905   eval "_t=\$libname_$_envname"
906   echo "LIB($name) DEPENDS ON $_h($_envname) with state '$_t'" >&5
907   if [ "$_t" = 'false' ]
908   then
909    echo "// not including <$_h> as it was tested as not present"
910   else
911    echo "#include <$_h>"
912   fi
913  done
914
915  echo 'int main (void) {'
916  echo " $CALL;"
917  echo ' return 0;'
918  echo '}'
919
920 } > $TF_C
921
922 echo "--- BEGIN OF CODE BLOCK ---" >&5
923 cat $TF_C >&5
924 echo "--- END OF CODE BLOCK ---" >&5
925
926 echo "FUNCTION($NAME) HAS COMPILER/LINKER OUTPUT:" >&5
927 echo "--- BEGIN OF CHILD OUTPUT BLOCK ---" >&5
928 $CCTF $LIBS >&5 2>&5;
929 R=$?
930 echo "--- END OF CHILD OUTPUT BLOCK ---" >&5
931
932 if [ "$R" = '0' ]
933 then
934  echo "#define $DEF" >&3
935  echo "FUNCTION($NAME) IS OK" >&5
936  echo yes
937 else
938  echo "FUNCTION($NAME) IS NOT OK" >&5
939  echo no
940 fi
941
942}
943
944test_version () {
945 DEF="$1"
946 NAME="$2"
947 PKGNAME="$3"
948
949 echo -n "checking for version of $NAME... "
950
951 _ver=$($PKG_CONFIG --modversion $PKGNAME 2> /dev/null)
952
953 if [ "$_ver" = '' ]
954 then
955  _ver=unknown
956 fi
957
958 echo $_ver
959
960 _ver_def=$(echo $_ver | to_escaped | to_upper)
961 echo "#define ${DEF}_$_ver_def" >&3
962
963 echo "$_ver" | if grep '^[0-9]*\.[0-9]*\.[0-9]*$' > /dev/null
964 then
965  _ver_vdef=$(echo "$_ver" | sed 's/^\([0-9]*\)\.\([0-9]*\)\.\([0-9]\)*$/_ROAR_MKVERSION(\1, \2, \3)/')
966  echo "#define ${DEF} $_ver_vdef" >&3
967 else
968  echo "#define ${DEF} 0" >&3
969 fi
970
971}
972
973test_type () {
974 DEF="$1"
975 NAME="$2"
976 INITVAL="$3"
977 DASHDASH="$4"
978 shift; shift;
979
980 if [ "$#" -ge '2' ]
981 then
982  shift; shift;
983 fi
984
985 HEADERS="stdint.h string.h unistd.h sys/types.h $*" #including headers here let
986                                                     #them get checked for presence.
987
988 [ "$INITVAL" = '' ] && INITVAL='0'
989
990 echo -n "checking for type $NAME... "
991 echo "TEST TYPE: $NAME" >&5
992
993 echo "// type test for type $NAME"  >  $TF_C # need a clean file, write something
994 for _h in $HEADERS
995 do
996  _envname=`echo "$_h" | to_escaped`
997  eval "_t=\$libname_$_envname"
998  echo "TYPE($NAME) DEPENDS ON $_h($_envname) with state '$_t'" >&5
999  if [ "$_t" = 'false' ]
1000  then
1001   echo "// not including <$_h> as it was tested as not present"  >> $TF_C
1002  else
1003   echo "#include <$_h>"  >> $TF_C
1004  fi
1005 done
1006 echo "int main (void) { $NAME _var = $INITVAL; return 0; }" >> $TF_C
1007
1008 echo "--- BEGIN OF CODE BLOCK ---" >&5
1009 cat $TF_C >&5
1010 echo "--- END OF CODE BLOCK ---" >&5
1011
1012 echo "TYPE($NAME) HAS COMPILER/LINKER OUTPUT:" >&5
1013 echo "--- BEGIN OF CHILD OUTPUT BLOCK ---" >&5
1014 $CCTF >&5 2>&5;
1015 R=$?
1016 echo "--- END OF CHILD OUTPUT BLOCK ---" >&5
1017
1018 if [ "$R" = '0' ]
1019 then
1020  echo "#define $DEF" >&3
1021  echo 'ok'
1022  echo "TYPE($NAME) IS OK" >&5
1023 else
1024  echo 'not found'
1025  echo "TYPE($NAME) NOT FOUND" >&5
1026 fi
1027}
1028
1029test_pa_type () {
1030 DEF="$1"
1031 NAME="$2"
1032 TYPE="$3"
1033 V0="$4"
1034 V1="$5"
1035 TEST="$6"
1036 shift; shift; shift; shift; shift; shift;
1037 HEADER="$*"
1038 RS='%s'
1039
1040 case "$TYPE" in
1041  'type')
1042   MSG="checking for type of $NAME()... "
1043  ;;
1044  'args:'*)
1045   MSG="checking for argument types of $NAME()... "
1046   RS=`echo "$TYPE" | cut -d: -f2`
1047  ;;
1048 esac;
1049
1050 echo -n "$MSG"
1051 echo '#include <pulse/pulseaudio.h>'  >  $TF_C
1052 for _h in $HEADERS
1053 do
1054  echo "#include <$_h>"  >> $TF_C
1055 done
1056 echo '#include <string.h>'           >> $TF_C
1057 echo 'int main (void) { return 0; }' >> $TF_C
1058 echo "$TEST"                         >> $TF_C
1059
1060 if $CCTF 2> /dev/null;
1061 then
1062  R="$V0"
1063 else
1064  R="$V1"
1065 fi
1066
1067 echo "#define $DEF $R" >&3
1068 printf "$RS\n" "$R"
1069}
1070
1071exec 3> config.h 4> Makefile.conf 5> config.log
1072
1073TARGET_CYGWIN=`echo "$SYSNAME" | if grep CYGWIN  > /dev/null; then echo true; else echo false; fi`
1074TARGET_WIN32=`echo  "$SYSNAME" | if grep MINGW32 > /dev/null; then echo true; else echo $TARGET_WIN32; fi`
1075
1076if $TARGET_WIN32
1077then
1078 CROSS_COMPILE=true
1079 RUNTIME_DETECT=true
1080 no_lib_dnet=true
1081 PROXY=false
1082 LIBAO=false
1083 XMMS=false
1084 AUDACIOUS=false
1085 WITHOUT_VIO="$WITHOUT_VIO"' pipe cmd' # hope that with buffered pipes we can remove this soon
1086 WITHOUT_DCOMP="$WITHOUT_DCOMP"' cb'
1087# [ "$ROARD_CFREQ" = '' ] && ROARD_CFREQ=20
1088fi
1089
1090if [ "$SYSNAME" = 'Darwin' ]
1091then
1092 echo "Adding $SYSNAME shared lib arguments..."
1093 SHARED="$SHARED -fno-common -dynamiclib -compatibility_version 0.1 -current_version 0.1.0"
1094 SHARED_CF="$SHARED_CF -fno-common"
1095elif [ "$SYSNAME" = 'NetBSD' ]
1096then
1097 echo "Adding $SYSNAME libpath arguments..."
1098 LDPATH="$LDPATH -L/usr/local/lib/"
1099elif [ "$SYSNAME" = 'OpenBSD' ]
1100then
1101 echo "Adding $SYSNAME search path arguments..."
1102 LDPATH="$LDPATH -L/usr/local/lib/"
1103 INCPATH="$INCPATH -I/usr/local/include/"
1104# echo "Adding $SYSNAME build arguments..."
1105# SNDIO_EMUL=false
1106elif [ "$SYSNAME" = 'FreeBSD' ]
1107then
1108 echo "Adding $SYSNAME search path arguments..."
1109 LDPATH="$LDPATH -L/usr/local/lib/"
1110 INCPATH="$INCPATH -I/usr/local/include/"
1111 [ "$DEFAULT_GRP" = '' ] && DEFAULT_GRP='wheel'
1112elif $TARGET_WIN32
1113then
1114 echo "Adding win32 build arguments..."
1115 fPIC=false
1116 SHARED_SUFFIX='.dll'
1117 COMPBIN_SUFFIX='.bat'
1118elif $TARGET_CYGWIN
1119then
1120 echo "Adding cygwin build arguments..."
1121 fPIC=false
1122 SHARED_SUFFIX='.dll'
1123 COMPBIN_SUFFIX='.bat'
1124fi
1125
1126echo -n 'checking if we cross compile... '
1127if $CROSS_COMPILE
1128then
1129 echo yes
1130
1131 echo -n "checking for exec helper... "
1132 if [ "$EXEC_HELPER" = '' ]
1133 then
1134  if $TARGET_WIN32
1135  then
1136   EXEC_HELPER=$(which wine 2> /dev/null | grep ^/ | head -n 1)
1137   if [ "$EXEC_HELPER" = '' ]
1138   then
1139    echo 'none (please install wine)'
1140   else
1141    echo "$EXEC_HELPER"
1142   fi
1143  else
1144   echo 'none (unknown)'
1145  fi
1146 else
1147  echo "$EXEC_HELPER"
1148 fi
1149
1150 echo -n "checking for sysname... "
1151 if $TARGET_CYGWIN
1152 then
1153  SYSNAME=cygwin
1154 elif $TARGET_WIN32
1155 then
1156  SYSNAME=win32
1157 else
1158  SYSNAME=unknown
1159 fi
1160 echo "$SYSNAME"
1161else
1162 echo no
1163fi
1164
1165[ "$PREFIX_BIN"  = '' ] && PREFIX_BIN="$PREFIX/bin/"
1166[ "$PREFIX_LIB"  = '' ] && PREFIX_LIB="$PREFIX/lib/"
1167[ "$PREFIX_INC"  = '' ] && PREFIX_INC="$PREFIX/include/"
1168[ "$PREFIX_MAN"  = '' ] && PREFIX_MAN="$PREFIX/share/man/"
1169[ "$PREFIX_PC"   = '' ] && PREFIX_PC="$PREFIX_LIB/pkgconfig/"
1170[ "$PREFIX_COMP_LIBS" = '' ] && PREFIX_COMP_LIBS="$PREFIX_LIB/roaraudio/complibs/"
1171[ "$PREFIX_COMP_BINS" = '' ] && PREFIX_COMP_BINS="$PREFIX_LIB/roaraudio/compbins/"
1172
1173[ "$DEFAULT_GRP" = '' ] && DEFAULT_GRP='audio'
1174
1175CCTF="$CC $CFLAGS $LDFLAGS $LDPATH $INCPATH -Iinclude/ -o $TF_E $TF_C"
1176
1177if [ "$MMCU" != '' ]
1178then
1179 CC="$CC -mmcu=$MMCU"
1180fi
1181
1182# Check for -Wextra
1183#Wextra
1184echo -n "checking if compiler supports -Wextra... "
1185echo 'int main (void) { return 0; }' > $TF_C
1186if $CCTF -Wextra 2> /dev/null;
1187then
1188 echo yes
1189 Wextra=true
1190else
1191 echo no
1192 Wextra=false
1193fi
1194
1195# now write the cc name to Makefile.conf
1196{
1197 echo "VERSION=$VERSION"
1198 echo "DEV_VENDOR=$DEV_VENDOR"
1199 echo "DEV_VENDOR_NAME=$DEV_VENDOR_NAME"
1200 echo "DEV_VENDOR_STRING=$DEV_VENDOR/$DEV_VENDOR_NAME"
1201 echo "DISTRIBUTION_VERSION_STRING=$DISTRIBUTION_VERSION_STRING"
1202 echo
1203 echo "SHARED=$SHARED"
1204 echo "SHARED_CF=$SHARED_CF"
1205 echo "SHARED_SUFFIX=$SHARED_SUFFIX"
1206 echo "COMPBIN_SUFFIX=$COMPBIN_SUFFIX"
1207 $fPIC   && echo 'fPIC=-fPIC'
1208 $Wextra && echo 'Wextra=-Wextra'
1209 echo
1210 echo "CC=$CC"
1211 echo "RANLIB=$RANLIB"
1212 echo "LDPATH=$LDPATH"
1213 echo "INCPATH=$INCPATH"
1214 echo
1215 echo "OPTI_O=-O$OPTI_O"
1216 echo "LINK_DEPS=$LINK_DEPS"
1217 echo
1218 [ "$CFLAGS"  != '' ] && echo "CFLAGS  += $CFLAGS"
1219 [ "$LDFLAGS" != '' ] && echo "LDFLAGS += $LDFLAGS"
1220 echo
1221 echo "EXEC_HELPER=$EXEC_HELPER"
1222 echo "CROSS_COMPILE=$CROSS_COMPILE"
1223 echo
1224 echo "PREFIX=$PREFIX"
1225 echo "PREFIX_BIN=$PREFIX_BIN"
1226 echo "PREFIX_LIB=$PREFIX_LIB"
1227 echo "PREFIX_INC=$PREFIX_INC"
1228 echo "PREFIX_MAN=$PREFIX_MAN"
1229 echo "PREFIX_PC=$PREFIX_PC"
1230 echo "PREFIX_COMP_LIBS=$PREFIX_COMP_LIBS"
1231 echo "PREFIX_COMP_BINS=$PREFIX_COMP_BINS"
1232 echo
1233 $COMP_LIBS      && echo "comp_libs=libroar libroardsp libroarmidi libroarlight libroareio"
1234 $COMP_ROARD     && echo "comp_roard=roard"
1235 $COMP_CLIENTS   && echo "comp_clients=roarclients"
1236 $COMP_DOC       && echo "comp_doc=doc"
1237 $COMP_COMP_BINS && echo "comp_comp_bins=compbins"
1238 echo
1239 $SNDIO_EMUL && echo "subdir_libroarsndio=libroarsndio"
1240 echo "subdir_libroaross=libroaross" # this builds an empty file in case of not supported
1241} >&4
1242
1243{
1244 cat <<'EOF'
1245//config.log:
1246
1247/*
1248 * Logfile for configure script $Revision$ of RoarAudio
1249 */
1250
1251EOF
1252 echo '/* uname: ' $(uname -a) '*/'
1253 echo '/* Date : ' $(date)  '*/'
1254 echo
1255
1256 echo
1257 echo
1258
1259 echo "ARGS(): $_CARGS"
1260
1261 for i in PATH SHELL CC RANLIB PKG_CONFIG SYSNAME \
1262          TARGET_CYGWIN TARGET_WIN32 TARGET_MICROCONTROLLER CROSS_COMPILE \
1263          RUNTIME_DETECT MINIMAL EXEC_HELPER
1264 do
1265  eval echo "BASICCONF\($i\): \$$i";
1266 done
1267
1268 echo
1269 echo
1270} >&5
1271
1272cat >&3 << EOF
1273//config.h:
1274
1275#ifndef _ROARAUDIO_CONFIG_H_
1276#define _ROARAUDIO_CONFIG_H_
1277
1278EOF
1279
1280{
1281 echo '/* uname: ' $(uname -a) '*/'
1282 echo '/* Date : ' $(date)  '*/'
1283 echo
1284 echo "#define ROAR_VERSION_STRING \"$VERSION\""
1285 grep -E '^COMMON_V_(MAJOR|MINOR|REV) *= [0-9]*$' Makefile.inc | sed 's/^COMMON_V_/#define ROAR_VERSION_/; s/=//'
1286 echo
1287 [ "$DEFAULT_RATE"        = '' ] || echo "#define ROAR_RATE_DEFAULT     $DEFAULT_RATE"
1288 [ "$DEFAULT_CHANNELS"    = '' ] || echo "#define ROAR_CHANNELS_DEFAULT $DEFAULT_CHANNELS"
1289 [ "$DEFAULT_BITS"        = '' ] || echo "#define ROAR_BITS_DEFAULT     $DEFAULT_BITS"
1290 [ "$ROAR_DRIVER_DEFAULT" = '' ] || echo "#define ROAR_DRIVER_DEFAULT   \"$ROAR_DRIVER_DEFAULT\""
1291 [ "$ROAR_DRIVER_CODEC"   = '' ] || echo "#define ROAR_DRIVER_CODEC     \"$ROAR_DRIVER_CODEC\""
1292 echo
1293 [ "$ROARD_CFREQ"         = '' ] || echo "#define ROAR_OUTPUT_CFREQ     $ROARD_CFREQ"
1294 echo "#define ROAR_VORBIS_BITS     $VORBIS_BITS"
1295 echo
1296 $MINIMAL      && echo '#define ROAR_MINIMAL'
1297 $BETA         && echo '#define ROAR_BETA'
1298 $EXPERIMENTAL && echo '#define ROAR_EXPERIMENTAL'
1299 $ALAW         && echo '#define ROAR_SUPPORT_ALAW'
1300 $ALAW_RW      && echo '#define ROAR_SUPPORT_ALAW_RW'
1301 $MULAW        && echo '#define ROAR_SUPPORT_MULAW'
1302 $MULAW_RW     && echo '#define ROAR_SUPPORT_MULAW_RW'
1303 $PROXY        && echo '#define ROAR_SUPPORT_PROXY'
1304 $PASSWORD_API && echo '#define ROAR_SUPPORT_PASSWORD_API'
1305 $SUPPORT_TRAP && echo '#define ROAR_SUPPORT_TRAP'
1306 $USE_MEMMGR   && echo '#define ROAR_USE_MEMMGR'
1307 $NO_LISTEN    || echo '#define ROAR_SUPPORT_LISTEN'
1308 $META_DATA    && echo '#define ROAR_SUPPORT_META'
1309 echo
1310
1311 $HAVE_MAIN_ARGS && echo '#define ROAR_HAVE_MAIN_ARGS'
1312
1313 echo
1314
1315 for i in $WITHOUT_CF
1316 do
1317  i=$(echo $i | to_upper);
1318  echo '#define ROAR_WITHOUT_CF_'$i
1319 done
1320
1321 for i in $WITHOUT_VIO
1322 do
1323  i=$(echo $i | to_upper);
1324  echo '#define ROAR_WITHOUT_VIO_'$i
1325 done
1326
1327 for i in $WITHOUT_DCOMP
1328 do
1329  i=$(echo $i | to_upper);
1330  echo '#define ROAR_WITHOUT_DCOMP_'$i
1331 done
1332
1333 echo
1334 $TARGET_MICROCONTROLLER && echo '#define ROAR_TARGET_MICROCONTROLLER'
1335 $TARGET_WIN32           && echo '#define ROAR_TARGET_WIN32'
1336 $TARGET_CYGWIN          && echo '#define ROAR_TARGET_CYGWIN'
1337                            echo '#define ROAR_OS_'$(echo $SYSNAME | to_escaped | to_upper)
1338 echo
1339} >&3
1340
1341#                 #define                   name         cmds...
1342test_tool_defmake ROAR_HAVE_BIN_OGG123      ogg123       ogg123
1343test_tool_defmake ROAR_HAVE_BIN_FLAC        flac         flac
1344test_tool_defmake ROAR_HAVE_BIN_TIMIDITY    TiMidity++   timidity
1345test_tool_defmake ROAR_HAVE_BIN_CDPARANOIA  cdparanoia   cdparanoia
1346test_tool_defmake ROAR_HAVE_BIN_WGET        Wget         wget
1347test_tool_defmake ROAR_HAVE_BIN_GNUPLOT     gnuplot      gnuplot
1348test_tool_defmake ROAR_HAVE_BIN_SSH         OpenSSH      ssh
1349test_tool_defmake ROAR_HAVE_BIN_PINENTRY    PIN-Entry    pinentry
1350test_tool_defmake ROAR_HAVE_BIN_SSH_ASKPASS SSH-AskPass  ssh-askpass
1351test_tool_defmake ROAR_HAVE_BIN_GZIP        Gzip         gzip
1352test_tool_defmake ROAR_HAVE_BIN_BZIP2       bzip2        bzip2
1353test_tool_defmake ROAR_HAVE_BIN_GPG         GnuPG        gpg
1354test_tool_defmake ROAR_HAVE_BIN_CHAT        chat         chat
1355test_tool_defmake ROAR_HAVE_BIN_EJECT       eject        eject
1356
1357echo >&3
1358echo >&5
1359echo >&5
1360echo >&5
1361
1362# Those tests should not be disabled as they do not reduce the lib size just
1363# break --minimal on full systems
1364OLD_MINIMAL=$MINIMAL
1365MINIMAL=false
1366# Test haders:
1367test_lib_defmake ROAR_HAVE_H_STDINT      %            stdint.h      c          -- stdint.h
1368test_lib_defmake ROAR_HAVE_H_STRING      %            string.h      c          -- string.h
1369test_lib_defmake ROAR_HAVE_H_SYS_TYPES   %            sys/types.h   c          -- sys/types.h
1370test_lib_defmake ROAR_HAVE_H_SYS_SOCKET  %            sys/socket.h  c          -- sys/types.h sys/socket.h
1371test_lib_defmake ROAR_HAVE_H_SYS_TIME    %            sys/time.h    c          -- sys/time.h
1372test_lib_defmake ROAR_HAVE_H_SYS_IOCTL   %            sys/ioctl.h   c          -- sys/ioctl.h
1373test_lib_defmake ROAR_HAVE_H_SYS_STAT    %            sys/stat.h    c          -- sys/types.h sys/stat.h
1374test_lib_defmake ROAR_HAVE_H_SYS_REBOOT  %            sys/reboot.h  c          -- sys/reboot.h
1375test_lib_defmake ROAR_HAVE_H_TIME        %            time.h        c          -- time.h
1376test_lib_defmake ROAR_HAVE_H_FCNTL       %            fcntl.h       c          -- fcntl.h
1377test_lib_defmake ROAR_HAVE_H_UNISTD      %            unistd.h      c          -- unistd.h
1378test_lib_defmake ROAR_HAVE_H_STDLIB      %            stdlib.h      c          -- stdlib.h
1379test_lib_defmake ROAR_HAVE_H_SIGNAL      %            signal.h      c          -- signal.h
1380test_lib_defmake ROAR_HAVE_H_POLL        %            poll.h        c          -- poll.h
1381test_lib_defmake ROAR_HAVE_H_MMSYSTEM    %            mmsystem.h    c          -- windows.h mmsystem.h
1382test_lib_defmake ROAR_HAVE_H_ESD         libroaresd   esd.h         c          -- esd.h
1383test_lib_defmake ROAR_HAVE_H_ARTSC       libroararts  artsc.h       c          -- kde/artsc/artsc.h
1384test_lib_defmake ROAR_HAVE_H_ICONV       %            iconv.h       c          -- iconv.h
1385test_lib_defmake ROAR_HAVE_H_NETINET_IN  %            'netinet/in.h' c         -- 'netinet/in.h'
1386test_lib_defmake ROAR_HAVE_H_LINUX_REBOOT %            linux/reboot.h c        -- linux/reboot.h
1387test_lib_defmake ROAR_HAVE_H_WINDOWS     %            windows.h     c          -- windows.h
1388test_lib_defmake ROAR_HAVE_H_WINSOCK2    %            winsock2.h    c          -- winsock2.h
1389MINIMAL=$OLD_MINIMAL
1390
1391#                #define                 subdir       name           -lxxx      -- header
1392test_lib_defmake ROAR_HAVE_LIBM          %            'MathLibrary'  m          -- math.h
1393if test_lib 'realtime Library' rt -- sys/mman.h mqueue.h semaphore.h
1394then
1395 {
1396  echo '#define ROAR_HAVE_LIBRT'
1397  echo '#define ROAR_NEED_LIBRT'
1398 } >&3
1399fi
1400
1401echo >&3
1402
1403#                #define                 subdir       name          -lxxx      -- header
1404test_lib_defmake ROAR_HAVE_ESD           %            EsounD        esd        -- esd.h
1405test_lib_defmake ROAR_HAVE_LIBAO         %            libao         ao         -- ao/ao.h ao/plugin.h
1406test_lib_defmake ROAR_HAVE_LIBRAUM       %            RAUM          raum       -- raum.h
1407test_lib_defmake ROAR_HAVE_LIBOGG        %            libogg        ogg        -- ogg/ogg.h
1408test_lib_defmake ROAR_HAVE_LIBVORBIS     %            libvorbis     vorbis     -- vorbis/codec.h
1409test_lib_defmake ROAR_HAVE_LIBVORBISFILE %            libvorbisfile vorbisfile -- vorbis/vorbisfile.h
1410test_lib_defmake ROAR_HAVE_LIBVORBISENC  %            libvorbisenc  vorbisenc  -- vorbis/vorbisenc.h
1411test_lib_defmake ROAR_HAVE_LIBSPEEX      %            libspeex      speex      -- speex/speex.h speex/speex_stereo.h
1412test_lib_defmake ROAR_HAVE_LIBSPEEXDSP   %            libspeexdsp   speexdsp   -- speex/speex.h speex/speex_echo.h
1413test_lib_defmake ROAR_HAVE_LIBCELT       %            libcelt       celt       -- celt/celt.h celt/celt_header.h
1414test_lib_defmake ROAR_HAVE_LIBCELT0      %            libcelt0      celt0      -- celt/celt.h celt/celt_header.h
1415test_lib_defmake ROAR_HAVE_LIBOGGZ       %            liboggz       oggz       -- oggz/oggz.h
1416test_lib_defmake ROAR_HAVE_LIBSNDFILE    %            libsndfile    sndfile    -- sndfile.h
1417test_lib_defmake ROAR_HAVE_LIBFISHSOUND  roarfish     libfishsound  fishsound  -- fishsound/fishsound.h
1418test_lib_defmake ROAR_HAVE_LIBFLAC       %            libFLAC       FLAC       -- FLAC/all.h
1419test_lib_defmake ROAR_HAVE_LIBSAMPLERATE %            libsamplerate samplerate -- samplerate.h
1420test_lib_defmake ROAR_HAVE_LIBSHOUT      %            libshout      shout      -- shout/shout.h
1421test_lib_defmake ROAR_HAVE_LIBPULSE      libroarpulse libpulse      pulse      -- pulse/pulseaudio.h pulse/simple.h
1422test_lib_defmake ROAR_HAVE_LIBPULSESIMPLE %           libpulse-simple pulse-simple -- pulse/simple.h
1423test_lib_defmake ROAR_HAVE_LIBY2         libroaryiff  libyiff       Y2         -- Y2/Y.h Y2/Ylib.h
1424test_lib_defmake ROAR_HAVE_LIBARTSC      %            libartsc      artsc      -- kde/artsc/artsc.h
1425test_lib_defmake ROAR_HAVE_LIBOSSAUDIO   %            libossaudio   ossaudio   -- sys/ioctl.h
1426test_lib_defmake ROAR_HAVE_LIBSNDIO      %            libsndio      sndio      -- sndio.h
1427test_lib_defmake ROAR_HAVE_LIBRSOUND     libroarrsound librsound    rsound     -- rsound.h
1428test_lib_defmake ROAR_HAVE_LIBPORTAUDIO  %            PortAudio     portaudio  -- portaudio.h
1429test_lib_defmake ROAR_HAVE_LIBPABLIO     %            PABLIO        pablio     -- pablio/pablio.h
1430test_lib_defmake ROAR_HAVE_LIBSSL        %            OpenSSL       ssl        -- openssl/bio.h openssl/evp.h
1431test_lib_defmake ROAR_HAVE_LIBSLP        %            OpenSLP       slp        -- slp.h
1432test_lib_defmake ROAR_HAVE_LIBUUID       %            libuuid       uuid       -- uuid/uuid.h
1433test_lib_defmake ROAR_HAVE_LIBDNET       %            libdnet       dnet       -- sys/socket.h netdnet/dn.h netdnet/dnetdb.h
1434test_lib_defmake ROAR_HAVE_LIBPTHREAD    %            libpthread    pthread    -- pthread.h
1435OLD_MINIMAL=$MINIMAL
1436MINIMAL=false
1437test_lib_defmake ROAR_HAVE_BSDSOCKETS    %            BSDSockets    c          -- sys/types.h sys/socket.h
1438test_lib_defmake ROAR_HAVE_UNIX          %            UNIX          c          -- sys/types.h sys/socket.h sys/un.h
1439test_lib_defmake ROAR_HAVE_IPV4          %            IPv4          c          -- sys/types.h sys/socket.h 'netinet/in.h' winsock2.h
1440MINIMAL=$OLD_MINIMAL
1441test_lib_defmake ROAR_HAVE_IPX           %            IPX           c          -- netipx/ipx.h
1442test_lib_defmake ROAR_HAVE_OSS           %            OSS           c          -- sys/ioctl.h sys/soundcard.h
1443test_lib_defmake ROAR_HAVE_OSS_BSD       %            BSDOSS        c          -- sys/ioctl.h soundcard.h
1444test_lib_defmake ROAR_HAVE_LIBWINMM      %            WinMM         winmm      -- windows.h mmsystem.h
1445test_lib_defmake ROAR_HAVE_LIBASOUND     %            ALSA          asound     -- alsa/asoundlib.h alsa/pcm_external.h alsa/control_external.h
1446test_lib_defmake ROAR_HAVE_LIBDL         %            DynLinkerLib  dl         -- dlfcn.h
1447test_lib_defmake ROAR_HAVE_LIBZ          %            zlib          z          -- zlib.h
1448test_lib_defmake ROAR_HAVE_LIBSENDFILE   %            sendfile      sendfile   -- sys/sendfile.h
1449test_lib_defmake ROAR_HAVE_LIBSOCKET     %            libsocket     socket     -- sys/socket.h
1450test_lib_defmake ROAR_HAVE_LIBWSOCK32    %            WinSockP0     wsock32    -- winsock2.h
1451test_lib_defmake ROAR_HAVE_LIBWS2_32     %            WinSockP1     ws2_32     -- winsock2.h
1452test_lib_defmake ROAR_HAVE_LIBX11        %            X11           X11        -- X11/Xlib.h X11/Xatom.h
1453test_lib_defmake ROAR_HAVE_GTK_P_2_0     %            GTK+2.0       gtk+-2.0/t -- gtk/gtk.h gdk/gdkkeysyms.h
1454test_lib_defmake ROAR_HAVE_LIBGCRYPT     %            libgcrypt     gcrypt     -- gcrypt.h
1455test_lib_defmake ROAR_HAVE_LIBJACK       %            libjack       jack/t     -- jack/jack.h
1456test_lib_defmake ROAR_HAVE_LIBDBUS       %            libdbus       dbus-1/t   -- dbus-1.0/dbus/dbus.h
1457
1458echo >&3
1459
1460test_version ROAR_HAVE_CELT_VERSION      libcelt       celt
1461test_version ROAR_HAVE_SPEEX_VERSION     libspeex      speex
1462test_version ROAR_HAVE_PULSE_VERSION     libpulse      libpulse
1463test_version ROAR_HAVE_GTK_P_2_0_VERSION GTK+2.0       gtk+-2.0
1464test_version ROAR_HAVE_FLAC_VERSION      libflac       flac
1465test_version ROAR_HAVE_PA19_VERSION      portaudio-19  portaudio-2.0
1466
1467echo >&3
1468
1469# Those tests should not be disabled as they do not reduce the lib size just
1470# break --minimal on full systems
1471
1472OLD_MINIMAL=$MINIMAL
1473MINIMAL=false
1474# Test types:
1475#         DEF                            type/name    init value               -- headers
1476test_type ROAR_HAVE_T_ID_T               id_t
1477test_type ROAR_HAVE_T_PID_T              pid_t
1478test_type ROAR_HAVE_T_UID_T              uid_t
1479test_type ROAR_HAVE_T_GID_T              gid_t
1480test_type ROAR_HAVE_T_SOCKLEN_T          socklen_t    0                        -- sys/socket.h
1481test_type ROAR_HAVE_T_MODE_T             mode_t
1482test_type ROAR_HAVE_T_OFF_T              off_t
1483test_type ROAR_HAVE_T_SSIZE_T            ssize_t
1484test_type ROAR_HAVE_T_TIME_T             time_t
1485test_type ROAR_HAVE_T_SA_FAMILY_T        sa_family_t  0                        -- sys/socket.h
1486MINIMAL=$OLD_MINIMAL
1487
1488echo >&3
1489
1490# add a better test here
1491#test_lib 'linux sendfile()'       -- sys/sendfile.h && echo '#define ROAR_HAVE_LINUX_SENDFILE' >&3
1492
1493
1494echo -n 'checking for IPv6... '
1495
1496if $MINIMAL
1497then
1498 echo "disabled by user (minimalstic build)"
1499else
1500 echo '#include <sys/socket.h>'  > $TF_C
1501 echo '#include <netinet/in.h>' >> $TF_C
1502 echo 'int main (void) { struct sockaddr_in6 in6; return 0; }' >> $TF_C
1503
1504 if $CCTF 2> /dev/null;
1505 then
1506  echo '#define ROAR_HAVE_IPV6' >&3
1507  echo yes
1508 else
1509  echo no
1510 fi
1511fi
1512
1513
1514echo -n 'checking for _exit()... '
1515
1516echo '#include <unistd.h>'    > $TF_C
1517echo 'int main (void) { _exit(0); return 0; }' >> $TF_C
1518
1519if $CCTF 2> /dev/null;
1520then
1521 echo '#define ROAR_HAVE_U_EXIT' >&3
1522 echo '#define ROAR_U_EXIT _exit' >&3
1523 echo yes
1524else
1525 echo '#define ROAR_U_EXIT exit' >&3
1526 echo no
1527fi
1528
1529#                 def                 name      call                         -- header
1530test_func_defmake ROAR_HAVE_MALLOC    malloc    'malloc(0)'                  -- stdlib.h
1531test_func_defmake ROAR_HAVE_CALLOC    calloc    'calloc(0, 0)'               -- stdlib.h
1532test_func_defmake ROAR_HAVE_REALLOC   realloc   'realloc((void*)0, 0)'       -- stdlib.h
1533test_func_defmake ROAR_HAVE_FREE      free      'free((void*)0)'             -- stdlib.h
1534test_func_defmake ROAR_HAVE_STRDUP    strdup    'strdup((void*)0)'           -- string.h
1535test_func_defmake ROAR_HAVE_STRNDUP   strndup   'strndup((void*)0)'          -- string.h
1536test_func_defmake ROAR_HAVE_STRLEN    strlen    'strlen((void*)0)'           -- string.h
1537test_func_defmake ROAR_HAVE_STRNLEN   strnlen   'strnlen((void*)0)'          -- string.h
1538test_func_defmake ROAR_HAVE_SETENV    setenv    'setenv("", "", 0)'          -- stdlib.h
1539test_func_defmake ROAR_HAVE_PUTENV    putenv    'putenv("")'                 -- stdlib.h
1540test_func_defmake ROAR_HAVE_STRTOK_R  strtok_r  'strtok_r("","",(char**)0)'  -- string.h
1541test_func_defmake ROAR_HAVE_STRLCPY   strlcpy   'strlcpy((char*)0, "", 0)'   -- string.h
1542test_func_defmake ROAR_HAVE_STRLCAT   strlcat   'strlcat((char*)0, "", 0)'   -- string.h
1543test_func_defmake ROAR_HAVE_NICE      nice      'nice(0)'                    -- unistd.h
1544test_func_defmake ROAR_HAVE_GETGID    getgid    'getgid()'                   -- sys/types.h unistd.h
1545test_func_defmake ROAR_HAVE_GETUID    getuid    'getuid()'                   -- sys/types.h unistd.h
1546test_func_defmake ROAR_HAVE_SETGID    setgid    'setgid(0)'                  -- sys/types.h unistd.h
1547test_func_defmake ROAR_HAVE_SETUID    setuid    'setuid(0)'                  -- sys/types.h unistd.h
1548test_func_defmake ROAR_HAVE_SETSID    setsid    'setsid()'                   -- sys/types.h unistd.h
1549test_func_defmake ROAR_HAVE_GETPWNAM  getpwnam  'getpwnam("")'               -- sys/types.h pwd.h
1550test_func_defmake ROAR_HAVE_GETGRNAM  getgrnam  'getgrnam("")'               -- sys/types.h grp.h
1551test_func_defmake ROAR_HAVE_GETTIMEOFDAY gettimeofday 'struct timeval tv; gettimeofday(&tv, NULL)' -- sys/time.h time.h
1552test_func_defmake ROAR_HAVE_USLEEP    usleep    'usleep(0)'                  -- sys/types.h unistd.h
1553test_func_defmake ROAR_HAVE_SLEEP     sleep     'sleep(0)'                   -- unistd.h
1554test_func_defmake ROAR_HAVE_NANOSLEEP nanosleep 'nanosleep((void*)0, (void*)0)' -- time.h
1555test_func_defmake ROAR_HAVE_ALARM     alarm     'alarm(0)'                   -- sys/types.h unistd.h
1556test_func_defmake ROAR_HAVE_TIME      time      'time((void*)0)'             -- time.h
1557test_func_defmake ROAR_HAVE_KILL      kill      'kill(0,0)'                  -- sys/types.h signal.h
1558test_func_defmake ROAR_HAVE_UNAME     uname     'uname((void*)0)'            -- sys/utsname.h
1559test_func_defmake ROAR_HAVE_GETHOSTNAME gethostname 'gethostname((void*)0, 0)' -- unistd.h
1560test_func_defmake ROAR_HAVE_SYSLOG    syslog    'syslog(0, "")'              -- syslog.h
1561test_func_defmake ROAR_HAVE_OPENLOG   openlog   'openlog("", 0, 0)'          -- syslog.h
1562test_func_defmake ROAR_HAVE_CLOSELOG  closelog  'closelog()'                 -- syslog.h
1563test_func_defmake ROAR_HAVE_FOPEN     fopen     'fopen("","")'               -- stdio.h
1564test_func_defmake ROAR_HAVE_FDOPEN    fdopen    'fdopen(0,"")'               -- stdio.h
1565test_func_defmake ROAR_HAVE_FREOPEN   freopen   'freopen("","",(void*)0)'    -- stdio.h
1566test_func_defmake ROAR_HAVE_FCLOSE    fclose    'fclose(0)'                  -- stdio.h
1567test_func_defmake ROAR_HAVE_FILENO    fileno    'fileno(0)'                  -- stdio.h
1568test_func_defmake ROAR_HAVE_FTELL     ftell     'ftell(0)'                   -- stdio.h
1569test_func_defmake ROAR_HAVE_FSEEK     fseek     'fseek(0, 0, 0)'             -- stdio.h
1570test_func_defmake ROAR_HAVE_POPEN     popen     'popen("", "")'              -- stdio.h
1571test_func_defmake ROAR_HAVE_PCLOSE    pclose    'pclose(0)'                  -- stdio.h
1572test_func_defmake ROAR_HAVE_STAT      stat      'stat((char*)0, (void*)0)'   -- sys/types.h sys/stat.h unistd.h
1573test_func_defmake ROAR_HAVE_SYSTEM    system    'system("")'                 -- stdlib.h
1574test_func_defmake ROAR_HAVE_GETSOCKNAME getsockname 'getsockname(0, 0, 0)'   -- sys/socket.h
1575test_func_defmake ROAR_HAVE_GETPEERNAME getpeername 'getpeername(0, 0, 0)'   -- sys/socket.h
1576test_func_defmake ROAR_HAVE_GETSOCKOPT getsockopt 'getsockopt(0, 0, 0, (void*)0, (void*)0)' -- sys/types.h sys/socket.h
1577test_func_defmake ROAR_HAVE_SETSOCKOPT setsockopt 'setsockopt(0, 0, 0, (void*)0, (void*)0)' -- sys/types.h sys/socket.h
1578test_func_defmake ROAR_HAVE_GETADDRINFO getaddrinfo 'getaddrinfo((void*)0, (void*)0, (void*)0, (void**)0)' -- sys/types.h sys/socket.h netdb.h
1579test_func_defmake ROAR_HAVE_RAND      rand      'rand()'                     -- stdlib.h
1580test_func_defmake ROAR_HAVE_RAND_R    rand_r    'rand_r((unsigned int*)0)'   -- stdlib.h
1581test_func_defmake ROAR_HAVE_SRAND     srand     'srand((unsigned int)0)'     -- stdlib.h
1582test_func_defmake ROAR_HAVE_FCNTL     fcntl     'fcntl(0, 0)'                -- unistd.h fcntl.h
1583test_func_defmake ROAR_HAVE_REBOOT    reboot    'reboot(LINUX_REBOOT_CMD_RESTART|LINUX_REBOOT_CMD_HALT|LINUX_REBOOT_CMD_POWER_OFF|LINUX_REBOOT_CMD_CAD_ON|LINUX_REBOOT_CMD_CAD_OFF)' -- unistd.h linux/reboot.h sys/reboot.h
1584test_func_defmake ROAR_HAVE_LINUX_SENDFILE sendfile 'sendfile(-1, -1, (void*)0, 0)' -- sys/sendfile.h
1585test_func_defmake ROAR_HAVE_GETVERSIONEX     GetVersionEx     'OSVERSIONINFO osinfo; osinfo.dwOSVersionInfoSize = sizeof(osinfo);GetVersionEx(&osinfo);'                -- windows.h
1586
1587test_func_defmake ROAR_HAVE_AO_APPEND_GLOBAL_OPTION ao_append_global_option 'ao_append_global_option("","")' ao -- ao/ao.h
1588
1589
1590echo -n 'checking for basic IO calls... '
1591
1592cat <<EOF > $TF_C
1593#include <sys/types.h>
1594#include <sys/stat.h>
1595#include <fcntl.h>
1596#include <string.h>
1597#include <unistd.h>
1598
1599int main(void) {
1600 open(NULL, 0, 0);
1601 close(0);
1602 read(0, NULL, 0);
1603 write(0, NULL, 0);
1604 lseek(0, 0, 0);
1605 return 0;
1606}
1607EOF
1608
1609if $CCTF 2> /dev/null;
1610then
1611 echo '#define ROAR_HAVE_IO_POSIX' >&3
1612 echo posix
1613else
1614 echo none
1615fi
1616
1617echo -n 'checking for basic FS calls... '
1618
1619cat <<EOF > $TF_C
1620#include <string.h>
1621#include <unistd.h>
1622
1623int main(void) {
1624 chdir(NULL);
1625 unlink(NULL);
1626 return 0;
1627}
1628EOF
1629
1630if $CCTF 2> /dev/null;
1631then
1632 echo '#define ROAR_HAVE_FS_POSIX' >&3
1633 echo posix
1634else
1635 echo none
1636fi
1637
1638
1639test_func_defmake ROAR_HAVE_CHROOT     chroot     'chroot((void*)0)'           -- unistd.h
1640test_func_defmake ROAR_HAVE_MLOCK      mlock      'mlock((void*)0, 0)'         -- sys/mman.h
1641test_func_defmake ROAR_HAVE_MUNLOCK    munlock    'munlock((void*)0, 0)'       -- sys/mman.h
1642test_func_defmake ROAR_HAVE_MLOCKALL   mlockall   'mlockall(MCL_CURRENT|MCL_FUTURE)' -- sys/mman.h
1643test_func_defmake ROAR_HAVE_MUNLOCKALL munlockall 'munlockall()'               -- sys/mman.h
1644test_func_defmake ROAR_HAVE_MMAP       mmap       'mmap((void*)0,0,0,0,0,0)'   -- sys/mman.h
1645
1646echo -n 'checking for fsync()... '
1647
1648echo '#include <unistd.h>' > $TF_C
1649echo 'int main (void) { fsync(0); return 0; }' >> $TF_C
1650
1651if $CCTF 2> /dev/null;
1652then
1653 echo '#define ROAR_HAVE_FSYNC' >&3
1654 FSYNC=true
1655 echo yes
1656else
1657 FSYNC=false
1658 echo no
1659fi
1660
1661echo -n 'checking for fdatasync()... '
1662
1663echo '#include <unistd.h>' > $TF_C
1664echo 'int main (void) { fdatasync(0); return 0; }' >> $TF_C
1665
1666if $CCTF 2> /dev/null;
1667then
1668 echo '#define ROAR_HAVE_FDATASYNC' >&3
1669 echo '#define ROAR_FDATASYNC fdatasync' >&3
1670 echo yes
1671else
1672 $FSYNC && echo '#define ROAR_FDATASYNC fsync' >&3
1673 echo no
1674fi
1675
1676
1677#test_func_defmake ROAR_HAVE_STRCASESTR strcasestr 'strcasestr("", "")'       -- string.h
1678echo -n 'checking for strcasestr()... '
1679
1680echo '#define _GNU_SOURCE' > $TF_C
1681echo '#include <string.h>' >> $TF_C
1682echo 'int main (void) { strcasestr("", ""); return 0; }' >> $TF_C
1683
1684if $CCTF 2> /dev/null;
1685then
1686 echo '#define ROAR_HAVE_STRCASESTR' >&3
1687 NEED_GNU_SOURCE=true
1688 echo yes
1689else
1690 echo no
1691fi
1692
1693echo -n 'checking for fopencookie()... '
1694
1695echo '#define _GNU_SOURCE' > $TF_C
1696echo '#include <stdio.h>' >> $TF_C
1697echo 'int main (void) { cookie_io_functions_t f; fopencookie(NULL, "", f); return 0; }' >> $TF_C
1698
1699if $CCTF 2> /dev/null;
1700then
1701 echo '#define ROAR_HAVE_FOPENCOOKIE' >&3
1702 NEED_GNU_SOURCE=true
1703 echo yes
1704else
1705 echo no
1706fi
1707
1708echo -n 'checking for funopen()... '
1709
1710echo '#define __BSD_VISIBLE 1'  > $TF_C
1711echo '#include <stdio.h>'      >> $TF_C
1712echo 'int main (void) { funopen(NULL, NULL, NULL, NULL, NULL); return 0; }' >> $TF_C
1713
1714if $CCTF 2> /dev/null;
1715then
1716 echo '#define ROAR_HAVE_FUNOPEN' >&3
1717 echo '#define ROAR_NEED_BSD_VISIBLE' >&3
1718 echo yes
1719else
1720 echo no
1721fi
1722
1723test_func_defmake ROAR_HAVE_PIPE      pipe      'pipe(NULL)'                 -- unistd.h
1724test_func_defmake ROAR_HAVE_FORK      fork      'fork()'                     -- unistd.h
1725test_func_defmake ROAR_HAVE_WAIT      wait      'wait(NULL)'                 -- string.h sys/wait.h
1726
1727echo -n 'checking for square root func... '
1728
1729if $TARGET_CYGWIN
1730then
1731 echo 'sqrt() (cygwin)'
1732elif [ "$SYSNAME" = 'FreeBSD' ]
1733then
1734 echo 'sqrt() (FreeBSD, fix your gcc)'
1735elif [ "$SYSNAME" = 'Linux' ]
1736then
1737 echo '#include <math.h>' > $TF_C
1738 echo 'int main (void) { sqrtl(0); return 0; }' >> $TF_C
1739
1740 if $CCTF -lm 2> /dev/null;
1741 then
1742  echo '#define ROAR_HAVE_SQRTL' >&3
1743  echo 'sqrtl()'
1744 else
1745  echo 'sqrt()'
1746 fi
1747else
1748 echo 'sqrt()'
1749fi
1750
1751echo -n 'checking for inline funcs... '
1752
1753echo 'inline int test (void) { return 0; }' > $TF_C
1754echo 'int main (void) { return test(); }'  >> $TF_C
1755
1756if $CCTF 2> /dev/null;
1757then
1758 echo '#define ROAR_HAVE_INLINE' >&3
1759 echo yes
1760else
1761 echo no
1762fi
1763
1764
1765echo -n 'checking for -pthread... '
1766
1767echo '#include <pthread.h>'                            > $TF_C
1768echo 'int main (void) { pthread_self(); return 0; }'  >> $TF_C
1769
1770if $CCTF -pthread 2> /dev/null;
1771then
1772 echo '#define ROAR_HAVE_CC_PTHREAD_OPTION' >&3
1773 echo 'opt_pthread=-pthread' >&4
1774 echo 'pthread=$(opt_pthread)' >&4
1775 echo yes
1776else
1777 echo 'opt_pthread=' >&4
1778 echo 'pthread=$(lib_pthread)' >&4
1779 echo no
1780fi
1781
1782
1783echo -n 'checking for broken peercred... '
1784echo '#include <sys/types.h>'      >  $TF_C
1785echo '#include <sys/socket.h>'     >> $TF_C
1786echo '#include <sys/un.h>'         >> $TF_C
1787echo 'int main (void) { struct ucred cred; return 0; }'  >> $TF_C
1788
1789if $CCTF 2> /dev/null;
1790then
1791 echo working
1792else
1793 if $CCTF -D_GNU_SOURCE 2> /dev/null;
1794 then
1795  NEED_GNU_SOURCE=true
1796  echo need to set _GNU_SOURCE
1797 else
1798  echo '#define ROAR_BROKEN_PEERCRED' >&3
1799  echo broken
1800 fi
1801fi
1802
1803
1804test_func_defmake ROAR_HAVE_GETPEEREID getpeereid 'getpeereid(0, NULL, NULL)' -- sys/types.h sys/socket.h
1805
1806echo -n 'checking for select()... '
1807cat <<EOF > $TF_C
1808#ifndef WITHOUT_SYS_SELECT_H
1809#include <sys/select.h>
1810#endif
1811#ifdef WITH_WINSOCK_H
1812#include <winsock.h>
1813#endif
1814#include <sys/time.h>
1815#include <sys/types.h>
1816#include <unistd.h>
1817
1818int main (void) {
1819 fd_set rfds;
1820 struct timeval tv;
1821
1822 FD_ZERO(&rfds);
1823 FD_SET(0, &rfds);
1824
1825 tv.tv_sec  = 0;
1826 tv.tv_usec = 0;
1827
1828 select(1, &rfds, NULL, NULL, &tv);
1829
1830 return 0;
1831}
1832EOF
1833
1834if $CCTF 2> /dev/null;
1835then
1836 echo '#define ROAR_HAVE_SELECT' >&3
1837 echo '#define ROAR_HAVE_H_SYS_SELECT' >&3
1838 echo yes, POSIX.1-2001
1839elif $CCTF -DWITHOUT_SYS_SELECT_H 2> /dev/null;
1840then
1841 echo '#define ROAR_HAVE_SELECT' >&3
1842 echo yes, old style
1843elif $CCTF -DWITHOUT_SYS_SELECT_H -DWITH_WINSOCK_H $lib_wsock32 >&5 2>&5;
1844then
1845 echo '#define ROAR_HAVE_SELECT' >&3
1846 echo yes, WinSock
1847else
1848 echo no
1849fi
1850
1851echo -n 'checking for shutdown()... '
1852cat <<EOF > $TF_C
1853#include <sys/types.h>
1854#ifndef WITHOUT_SYS_SOCKET_H
1855#include <sys/socket.h>
1856#endif
1857#ifdef WITH_WINSOCK_H
1858#include <winsock.h>
1859#endif
1860
1861int main (void) { shutdown(0, 0); return 0; }
1862EOF
1863
1864if [ "$SYSNAME" = 'SunOS' ]
1865then
1866 _l='-lsocket'
1867else
1868 _l=''
1869fi
1870
1871if $CCTF $_l 2> /dev/null;
1872then
1873 echo '#define ROAR_HAVE_SHUTDOWN'     >&3
1874 echo '#define ROAR_SHUTDOWN shutdown' >&3
1875 echo yes
1876elif $CCTF -DWITHOUT_SYS_SOCKET_H -DWITH_WINSOCK_H $lib_wsock32 2> /dev/null;
1877then
1878 echo '#define ROAR_HAVE_SHUTDOWN'     >&3
1879 echo '#define ROAR_SHUTDOWN shutdown' >&3
1880 echo yes, WinSock
1881else
1882 echo '#define ROAR_SHUTDOWN(x,y) (-1)' >&3
1883 echo no
1884fi
1885
1886echo -n 'checking for accept()... '
1887cat <<EOF > $TF_C
1888#include <sys/types.h>
1889#ifndef WITHOUT_SYS_SOCKET_H
1890#include <sys/socket.h>
1891#endif
1892#ifdef WITH_WINSOCK_H
1893#include <winsock.h>
1894#endif
1895
1896int main (void) { accept(0, 0, 0); return 0; }
1897EOF
1898
1899if [ "$SYSNAME" = 'SunOS' ]
1900then
1901 _l='-lsocket'
1902else
1903 _l=''
1904fi
1905
1906if $CCTF $_l 2> /dev/null;
1907then
1908 echo '#define ROAR_HAVE_ACCEPT'     >&3
1909 echo '#define ROAR_ACCEPT accept'   >&3
1910 echo yes
1911elif $CCTF -DWITHOUT_SYS_SOCKET_H -DWITH_WINSOCK_H $lib_wsock32 2> /dev/null;
1912then
1913 echo '#define ROAR_HAVE_ACCEPT'     >&3
1914 echo '#define ROAR_ACCEPT accept'   >&3
1915 echo yes, WinSock
1916else
1917 echo '#define ROAR_ACCEPT(x,y,z) (-1)' >&3
1918 echo no
1919fi
1920
1921test_func_defmake ROAR_HAVE_GETOBJECTBYNAME getobjectbyname 'getobjectbyname(NULL)' dnet -- stdlib.h netdnet/dn.h netdnet/dnetdb.h
1922test_func_defmake ROAR_HAVE_GETSERVBYNAME   getservbyname   'getservbyname((void*)0, (void*)0)' -- netdb.h
1923
1924
1925# --- PulseAudio tests ---
1926test_pa_type ROAR_HAVE_TYPE_PA_PATH_GET_FILENAME pa_path_get_filename type 'const char *' 'char *' 'const char *pa_path_get_filename(const char *p) { return NULL; }' pulse/simple.h
1927
1928test_pa_type ROAR_HAVE_TYPE_PA_UTF8_VALID pa_utf8_valid type 'const char *' 'char *' 'const char *pa_utf8_valid(const char *str) { return NULL; }'
1929
1930test_pa_type ROAR_HAVE_ARG_SINK_NAME_OF_PA_CONTEXT_MOVE_SINK_INPUT_BY_NAME pa_context_move_sink_input_by_name args:'pa_context *c, uint32_t idx, %s sink_name, pa_context_success_cb_t cb, void* userdata' 'const char *' 'char *' 'pa_operation* pa_context_move_sink_input_by_name(pa_context *c, uint32_t idx, const char *sink_name, pa_context_success_cb_t cb, void* userdata) { return NULL; }'
1931
1932test_pa_type ROAR_HAVE_ARG_SOURCE_NAME_OF_PA_CONTEXT_MOVE_SOURCE_OUTPUT_BY_NAME pa_context_move_source_output_by_name args:'pa_context *c, uint32_t idx, %s source_name, pa_context_success_cb_t cb, void* userdata)' 'const char *' 'char *' 'pa_operation* pa_context_move_source_output_by_name(pa_context *c, uint32_t idx, const char *source_name, pa_context_success_cb_t cb, void* userdata) { return NULL; }'
1933
1934test_pa_type ROAR_HAVE_ARG_VOLUME_OF_PA_STREAM_CONNECT_PLAYBACK pa_stream_connect_playback args:'pa_stream *s, const char *dev, const pa_buffer_attr *attr, pa_stream_flags_t flags, %s volume, pa_stream *sync_stream' 'const pa_cvolume *' 'pa_cvolume *' 'int pa_stream_connect_playback(pa_stream *s, const char *dev, const pa_buffer_attr *attr, pa_stream_flags_t flags, const pa_cvolume * volume, pa_stream *sync_stream) { return -1; }'
1935# --- End of PulseAudio tests ---
1936
1937
1938echo -n 'checking for struct rsound'\''s sample size member... '
1939
1940cat > $TF_C << EOF
1941#define RSD_EXPOSE_STRUCT
1942#include <rsound.h>
1943
1944int main (void) {
1945 rsound_t var;
1946
1947 var.samplesize = 0;
1948
1949 return 0;
1950}
1951EOF
1952if $CCTF 2> /dev/null;
1953then
1954 echo '#define ROAR_HAVE_RSOUND_SAMPLESIZE'     >&3
1955 echo '#define ROAR_HAVE_RSOUND_SAMPLESIZE_MEMBER samplesize'   >&3
1956 echo samplesize
1957else
1958 echo '#define ROAR_HAVE_RSOUND_SAMPLESIZE_MEMBER framesize'   >&3
1959 echo framesize
1960fi
1961
1962echo -n 'checking for safe 32 bit integer overflow... '
1963
1964cat > $TF_C << EOF
1965#include <stdio.h>
1966#include <stdint.h>
1967#define TYPE uint32_t
1968#define MAX  ((TYPE)4294967295U)
1969
1970int main (void) {
1971 TYPE a = MAX;
1972
1973 a += 2;
1974
1975 if ( a == 1 ) {
1976  printf("#define ROAR_HAVE_SAFE_OVERFLOW\n");
1977  return 0;
1978 }
1979
1980 return 1;
1981}
1982EOF
1983
1984if $CCTF 2> /dev/null;
1985then
1986 $EXEC_HELPER $TF_E >&3 2> /dev/null
1987 if [ "$?" = '0' ]
1988 then
1989  echo yes
1990 else
1991  echo no
1992 fi
1993else
1994 echo 'no (can not compile!, no stdint.h?)'
1995fi
1996
1997echo -n 'checking for __LP64__... '
1998if $TARGET_WIN32
1999then
2000 echo 'no need to set (win32 build)'
2001else
2002cat > $TF_C << EOF
2003#include <stdio.h>
2004
2005int main (void) {
2006#ifdef __LP64__
2007 fprintf(stderr, "set by compiler\n");
2008#else
2009 if ( sizeof(int) == sizeof(void*) ) {
2010  fprintf(stderr, "no need to set\n");
2011 } else {
2012  fprintf(stderr, "need to set\n");
2013  printf("\n#ifndef __LP64__\n#define __LP64__\n#endif\n\n");
2014 }
2015#endif
2016 return 0;
2017}
2018EOF
2019 if $CCTF 2> /dev/null;
2020 then
2021  $EXEC_HELPER $TF_E >&3
2022 else
2023  echo 'error, can not compile'
2024  exit 1
2025 fi
2026fi
2027
2028echo -n 'checking for 64 bit types... '
2029if $TARGET_WIN32
2030then
2031 echo 'int64_t, uint64_t (win32 build)'
2032 echo '#define ROAR_NATIVE_INT64  int64_t'  >&3
2033 echo '#define ROAR_NATIVE_UINT64 uint64_t' >&3
2034else
2035cat > $TF_C << EOF
2036#include <stdio.h>
2037#include <stdint.h>
2038
2039int main (void) {
2040 char * i64 = NULL, * ui64 = NULL;
2041
2042 if ( sizeof(int) == 8 ) {
2043  i64 = "int"; ui64 = "unsigned int";
2044 } else if ( sizeof(long int) == 8 ) {
2045  i64 = "long int"; ui64 = "unsigned long int";
2046 } else if ( sizeof(long long int) == 8 ) {
2047  i64 = "long long int"; ui64 = "unsigned long long int";
2048 } else if ( sizeof(int64_t) == 8 ) {
2049  i64 = "int64_t"; ui64 = "uint64_t";
2050 } else {
2051  fprintf(stderr, "none\n");
2052  return 0;
2053 }
2054
2055 fprintf(stderr, "%s, %s\n", i64, ui64);
2056 printf("#define ROAR_NATIVE_INT64 %s\n#define ROAR_NATIVE_UINT64 %s\n", i64, ui64);
2057
2058 return 0;
2059}
2060EOF
2061 if $CCTF 2> /dev/null;
2062 then
2063  $EXEC_HELPER $TF_E >&3
2064 else
2065  echo 'error, can not compile'
2066  exit 1
2067 fi
2068fi
2069
2070
2071echo -n 'checking if cp supports -v... '
2072if cp -v --help > /dev/null 2> /dev/null
2073then
2074 echo "cp_v=-v" >&4
2075 echo yes
2076else
2077 echo "cp_v=" >&4
2078 echo no
2079fi
2080
2081echo -n 'checking for cdrom device... '
2082if [ -n "$CDROM" ]
2083then
2084 if [ "$CDROM" = '(none)' ]
2085 then
2086  echo "none (disabled by user)"
2087 else
2088  if $CROSS_COMPILE
2089  then
2090   echo "$CDROM (cross compile)"
2091  elif [ -e "$CDROM" ]
2092  then
2093   echo "$CDROM (forced by user)"
2094  else
2095   echo "$CDROM (not existing, forced by user)"
2096  fi
2097  echo '#define ROAR_DEFAULT_CDROM "'"$CDROM"'"' >&3
2098  echo '#define ROAR_HAVE_CDROM' >&3
2099 fi
2100elif $CROSS_COMPILE
2101then
2102 echo 'none (cross compiling, use --cdrom to enable CDROM support)'
2103else
2104 CDROM=$(ls /dev/cdrom /dev/rcd0c 2> /dev/null | head -n 1);
2105 if [ -e "$CDROM" ]
2106 then
2107  echo "$CDROM"
2108  echo '#define ROAR_DEFAULT_CDROM "'"$CDROM"'"' >&3
2109  echo '#define ROAR_HAVE_CDROM' >&3
2110 else
2111  echo 'none'
2112  echo '#define ROAR_HAVE_CDROM' >&3
2113 fi
2114fi
2115
2116echo -n 'checking for default tty device... '
2117if [ -n "$TTY_DEV" ]
2118then
2119 if [ "$TTY_DEV" = '(none)' ]
2120 then
2121  echo "none (disabled by user)"
2122 else
2123  if $CROSS_COMPILE
2124  then
2125   echo "$TTY_DEV (cross compile)"
2126  elif [ -e "$TTY_DEV" ]
2127  then
2128   echo "$TTY_DEV (forced by user)"
2129  else
2130   echo "$TTY_DEV (not existing, forced by user)"
2131  fi
2132  echo '#define ROAR_DEFAULT_TTY "'"$TTY_DEV"'"' >&3
2133 fi
2134elif $CROSS_COMPILE
2135then
2136 echo 'none (cross compiling, use --tty to set default device)'
2137else
2138 TTY_DEV=$(ls /dev/tty 2> /dev/null | head -n 1);
2139 if [ -e "$TTY_DEV" ]
2140 then
2141  echo "$TTY_DEV"
2142  echo '#define ROAR_DEFAULT_TTY "'"$TTY_DEV"'"' >&3
2143 else
2144  echo 'none'
2145 fi
2146fi
2147
2148echo -n 'checking for OSS device... '
2149if [ -n "$OSS_DEV" ]
2150then
2151 if [ "$OSS_DEV" = '(none)' ]
2152 then
2153  echo "none (disabled by user)"
2154 else
2155  if $CROSS_COMPILE
2156  then
2157   echo "$OSS_DEV (cross compile)"
2158  elif [ -e "$OSS_DEV" ]
2159  then
2160   echo "$OSS_DEV (forced by user)"
2161  else
2162   echo "$OSS_DEV (not existing, forced by user)"
2163  fi
2164  echo '#define ROAR_DEFAULT_OSS_DEV "'"$OSS_DEV"'"' >&3
2165 fi
2166elif $CROSS_COMPILE
2167then
2168 echo 'none (cross compiling, use --oss-dev to set default device)'
2169else
2170 OSS_DEV=$(ls /dev/dsp /dev/audio 2> /dev/null | head -n 1);
2171 if [ -e "$OSS_DEV" ]
2172 then
2173  echo "$OSS_DEV"
2174  echo '#define ROAR_DEFAULT_OSS_DEV "'"$OSS_DEV"'"' >&3
2175 else
2176  echo 'none'
2177 fi
2178fi
2179
2180echo -n 'checking for OSS mixer device... '
2181if [ -n "$OSS_MIX_DEV" ]
2182then
2183 if [ "$OSS_MIX_DEV" = '(none)' ]
2184 then
2185  echo "none (disabled by user)"
2186 else
2187  if $CROSS_COMPILE
2188  then
2189   echo "$OSS_MIX_DEV (cross compile)"
2190  elif [ -e "$OSS_MIX_DEV" ]
2191  then
2192   echo "$OSS_MIX_DEV (forced by user)"
2193  else
2194   echo "$OSS_MIX_DEV (not existing, forced by user)"
2195  fi
2196  echo '#define ROAR_DEFAULT_OSS_MIX_DEV "'"$OSS_MIX_DEV"'"' >&3
2197 fi
2198elif $CROSS_COMPILE
2199then
2200 echo 'none (cross compiling, use --oss-mixer-dev to set default device)'
2201else
2202 OSS_MIX_DEV=$(ls /dev/mixer 2> /dev/null | head -n 1);
2203 if [ -e "$OSS_MIX_DEV" ]
2204 then
2205  echo "$OSS_MIX_DEV"
2206  echo '#define ROAR_DEFAULT_OSS_MIX_DEV "'"$OSS_MIX_DEV"'"' >&3
2207 else
2208  echo 'none'
2209 fi
2210fi
2211
2212echo 'checking for DECnet status file... '"$PROC_NET_DECNET"
2213echo '#define ROAR_PROC_NET_DECNET "'"$PROC_NET_DECNET"'"' >&3
2214
2215echo -n 'checking for DECnet neighbour file... '
2216if [ -n "$PROC_NET_DECNET_NEIGH" ]
2217then
2218 if [ "$PROC_NET_DECNET_NEIGH" = '(none)' ]
2219 then
2220  echo "none (disabled by user)"
2221 else
2222  if $CROSS_COMPILE
2223  then
2224   echo "$PROC_NET_DECNET_NEIGH (cross compile)"
2225  elif [ -e "$PROC_NET_DECNET_NEIGH" ]
2226  then
2227   echo "$PROC_NET_DECNET_NEIGH (forced by user)"
2228  else
2229   echo "$PROC_NET_DECNET_NEIGH (not existing, forced by user)"
2230  fi
2231  echo '#define ROAR_PROC_NET_DECNET_NEIGH "'"$PROC_NET_DECNET_NEIGH"'"' >&3
2232 fi
2233elif $CROSS_COMPILE
2234then
2235 echo 'none (cross compiling, use --proc-net-decnet-neigh to set default device)'
2236else
2237 PROC_NET_DECNET_NEIGH=$(ls /proc/net/decnet_neigh 2> /dev/null | head -n 1);
2238 if [ -e "$PROC_NET_DECNET_NEIGH" ]
2239 then
2240  echo "$PROC_NET_DECNET_NEIGH"
2241  echo '#define ROAR_PROC_NET_DECNET_NEIGH "'"$PROC_NET_DECNET_NEIGH"'"' >&3
2242 else
2243  echo 'none'
2244 fi
2245fi
2246
2247echo -n 'checking for IP neighbour (ARP) file... '
2248if [ -n "$PROC_NET_ARP" ]
2249then
2250 if [ "$PROC_NET_ARP" = '(none)' ]
2251 then
2252  echo "none (disabled by user)"
2253 else
2254  if $CROSS_COMPILE
2255  then
2256   echo "$PROC_NET_ARP (cross compile)"
2257  elif [ -e "$PROC_NET_ARP" ]
2258  then
2259   echo "$PROC_NET_ARP (forced by user)"
2260  else
2261   echo "$PROC_NET_ARP (not existing, forced by user)"
2262  fi
2263  echo '#define ROAR_PROC_NET_ARP "'"$PROC_NET_ARP"'"' >&3
2264 fi
2265elif $CROSS_COMPILE
2266then
2267 echo 'none (cross compiling, use --proc-net-arp to set default device)'
2268else
2269 PROC_NET_ARP=$(ls /proc/net/arp 2> /dev/null | head -n 1);
2270 if [ -e "$PROC_NET_ARP" ]
2271 then
2272  echo "$PROC_NET_ARP"
2273  echo '#define ROAR_PROC_NET_ARP "'"$PROC_NET_ARP"'"' >&3
2274 else
2275  echo 'none'
2276 fi
2277fi
2278
2279echo -n 'checking for default audio group... '
2280if [ "$DEFAULT_GRP" = '(none)' ]
2281then
2282 echo "none (disabled by user)"
2283else
2284 echo "$DEFAULT_GRP"
2285 echo '#define ROAR_DEFAULT_SOCKGRP "'"$DEFAULT_GRP"'"' >&3
2286fi
2287
2288echo -n 'checking for user id of root/superuser... '
2289if [ "$ROOT_UID" = '(none)' ]
2290then
2291 echo "none (disabled by user)"
2292elif [ "$ROOT_UID" = '' ]
2293then
2294 ROOT_USER='root'
2295 ROOT_UID=`id -u $ROOT_USER`
2296 if [ "$ROOT_UID" = '' ]
2297 then
2298  echo "none (please report this)"
2299 else
2300  echo "$ROOT_UID($ROOT_USER)"
2301  echo '#define ROAR_ROOT_UID '"$ROOT_UID" >&3
2302 fi
2303else
2304 echo "$ROOT_UID"
2305 echo '#define ROAR_ROOT_UID '"$ROOT_UID" >&3
2306fi
2307
2308$NEED_GNU_SOURCE && echo '#define ROAR_NEED_GNU_SOURCE' >&3
2309
2310cat >&3 << EOF
2311
2312#if defined(ROAR_HAVE_LIBCELT0) && !defined(ROAR_HAVE_LIBCELT)
2313#define ROAR_HAVE_LIBCELT
2314#endif
2315
2316#endif
2317
2318//ll
2319EOF
2320
2321echo >&5
2322echo '//ll' >&5
2323
2324echo >&4
2325echo >&4
2326
2327cd plugins
2328
2329#if $LIBAO
2330#then
2331# echo 'running libao plugin configure...'
2332#  cd ao/
2333# if [ "$AO_INST_DIR" = '' ]
2334# then
2335#  ./configure --force-have-roar --pkg-config "$PKG_CONFIG"                           && \
2336#    echo "subdir_plugins_ao=plugins/ao" >&4
2337# else
2338#  ./configure --force-have-roar --pkg-config "$PKG_CONFIG" --inst-dir "$AO_INST_DIR" && \
2339#    echo "subdir_plugins_ao=plugins/ao" >&4
2340# fi
2341# cd ..
2342#else
2343# echo "running libao plugin configure... disabled by user"
2344#fi
2345
2346if $XMMS
2347then
2348 echo 'running xmms plugin configure...'
2349 cd xmms/
2350  ./configure --force-have-roar --pkg-config "$PKG_CONFIG" --inst-dir "$XMMS_INST_DIR" && \
2351    echo "subdir_plugins_xmms=plugins/xmms" >&4
2352 cd ..
2353else
2354 echo "running xmms plugin configure... disabled by user"
2355fi
2356
2357#if $AUDACIOUS
2358#then
2359# echo 'running Audacious plugin configure...'
2360# cd audacious/
2361#  ./configure --force-have-roar --pkg-config "$PKG_CONFIG" --inst-dir "$AUDACIOUS_INST_DIR" && \
2362#    echo "subdir_plugins_audacious=plugins/audacious" >&4
2363# cd ..
2364#else
2365# echo "running Audacious plugin configure... disabled by user"
2366#fi
2367
2368cd ..
2369
2370rm -f $TF_C $TF_E
2371
2372mv config.h include/roaraudio/
2373echo 'config.h created and moved into include/roaraudio/'
2374
2375if $TARGET_CYGWIN
2376then
2377 rm -f $TF_E.exe
2378 echo 'patching Makefiles for cygwin...'
2379 find . -name Makefile -print0 | xargs -0 sed 's/\.so/.dll'/g -i
2380fi
2381
2382#ll
Note: See TracBrowser for help on using the repository browser.