source: roaraudio/configure @ 2223:cfb052005c84

Last change on this file since 2223:cfb052005c84 was 2223:cfb052005c84, checked in by phi, 15 years ago

write $EXEC_HELPER to Makefile.conf

  • Property exe set to *
File size: 34.4 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#set -x
14
15TF_C=testit.c
16TF_E=./testit
17LDPATH=''
18INCPATH=''
19
20CROSS_COMPILE=false
21
22SYSNAME='unknown'
23SHARED='-shared'
24SHARED_CF=''
25SHARED_SUFFIX='.so'
26fPIC=true
27MMCU=''
28PKG_CONFIG=false
29RUNTIME_DETECT=false
30
31NEED_GNU_SOURCE=false
32
33PREFIX='/usr/local'
34PREFIX_BIN=''
35PREFIX_LIB=''
36PREFIX_INC=''
37PREFIX_MAN=''
38PREFIX_COMP=''
39
40CDROM_IS_DEV=true
41CDROM="none"
42OSS_DEV="none"
43PROC_NET_DECNET="/proc/net/decnet"
44TTY_DEV="none"
45
46VORBIS_BITS=32
47
48FSYNC=false
49
50DEFAULT_GRP=''
51
52AO_INST_DIR=''
53XMMS_INST_DIR=''
54AUDACIOUS_INST_DIR=''
55
56SNDIO_EMUL=true
57
58LIBAO=true
59XMMS=true
60AUDACIOUS=true
61
62DEFAULT_RATE=''
63DEFAULT_CHANNELS=''
64DEFAULT_BITS=''
65
66COMP_LIBS=true
67COMP_ROARD=true
68COMP_CLIENTS=true
69COMP_DOC=true
70
71ALAW=true
72MULAW=true
73ALAW_RW=true
74MULAW_RW=true
75
76PROXY=true
77
78PASSWORD_API=true
79
80NO_LISTEN=false
81
82META_DATA=true
83
84WITHOUT_CF=''
85
86WITHOUT_VIO=''
87
88HAVE_MAIN_ARGS=true
89
90MINIMAL=false
91
92TARGET_WIN32=false
93TARGET_MICROCONTROLLER=false
94TARGET_CYGWIN=false
95
96EXEC_HELPER=''
97
98ROAR_DRIVER_DEFAULT=''
99ROAR_DRIVER_CODEC=''
100
101ROARD_CFREQ='' # cycle frequens for roard, normaly 100Hz
102
103echo -n "checking for C compiler... "
104if [ "$CC" != '' ]
105then
106 echo $CC
107else
108 CC=$(which gcc cc 2> /dev/null | grep ^/ | head -n 1)
109 if [ "$CC" = '' ]
110 then
111  echo 'none'
112  exit 1;
113 fi
114 echo $CC
115fi
116
117echo -n "checking for ranlib... "
118if [ "$RANLIB" != '' ]
119then
120 echo $RANLIB
121else
122 _guess=`echo $CC | sed 's/[gp]*cc\(-.*\)*//'`
123 RANLIB=$(which ${_guess}ranlib ranlib 2> /dev/null | grep ^/ | head -n 1)
124 if [ "$RANLIB" = '' ]
125 then
126  echo 'none'
127 fi
128 echo $RANLIB
129fi
130
131echo -n "checking for pkg-config... "
132PKG_CONFIG=$(which pkg-config false 2> /dev/null | grep ^/ | head -n 1)
133if $PKG_CONFIG --help > /dev/null 2> /dev/null
134then
135 echo $PKG_CONFIG
136else
137 echo no
138fi
139
140#Makefile.conf not yet open, write it later
141
142echo -n "checking for sysname... "
143SYSNAME=$(uname -s)
144echo "$SYSNAME"
145
146while [ "$1" != '' ]
147do
148 case "$1" in
149  '--help')
150   echo '--help                      - This Help'
151   echo
152   echo '--ldpath DIR                - Add DIR to (compile time) search list for libs'
153   echo '--incpath DIR               - Add DIR to search list for headers'
154   echo '--addpath DIR               - Add DIR/lib to lib, DIR/include to header search list'
155   echo
156   echo '--cdrom DEV                 - Set default CDRum device'
157   echo '--tty DEV                   - Set default TTY'
158   echo '--proc-net-decnet FILE      - Set DECnet file for DECnet support auto detecting'
159   echo '                              (ignore this on non-Linux)'
160   echo
161   echo '--no-LIB                    - disable library LIB'
162   echo '--runtime-detect            - do as much as posible auto detecting on runtime (for distributors)'
163   echo
164   echo '--ao-install-dir DIR        - Set install dir for libao plugin'
165   echo '--xmms-install-dir DIR      - Set install dir for XMMS plugin'
166   echo '--audacious-install-dir DIR - Set install dir for Audacious plugin'
167   echo
168   echo '--prefix DIR                - Set general prefix (default: '"$PREFIX"')'
169   echo '--prefix-bin DIR            - Set prefix for binarys (default: $PREFIX/bin)'
170   echo '--prefix-lib DIR            - Set prefix for librarys (default: $PREFIX/libs)'
171   echo '--prefix-inc DIR            - Set prefix for include files (default: $PREFIX/include)'
172   echo '--prefix-man DIR            - Set prefix for manpages (default: $PREFIX/man)'
173   echo '--prefix-comp DIR           - Set prefix for compatibility librarys (default: $PREFIX_LIB/roaraudio/complibs)'
174   echo
175   echo '--default-rate RATE         - Set default sample rate for roard and roarclients'
176   echo '--default-channels CHANNELS - Set default number of channels for roard and roarclients'
177   echo '--default-bits BITS         - Set default number of bits per sample for roard and roarclients'
178   echo '--default-driver DRIVER     - Set default driver for roard'
179   echo '--default-codec CODEC       - Set default codec used for the default driver'
180   echo
181   echo '--without-alaw              - Disable support of A-Law codec (de- and encoding)'
182   echo '--without-alaw-rw           - Disable support for writing A-Law (saves 8KB)'
183   echo '--without-mulaw             - Disable support of mu-Law codec (de- and encoding)'
184   echo '--without-mulaw-rw          - Disable support for writing mu-Law (saves 16KB)'
185   echo '--without-proxy             - Disable support for proxys'
186   echo
187   echo '--without-comp-libs         - Disable build of librarys'
188   echo '--without-comp-roard        - Disable build of roard'
189   echo '--without-comp-clients      - Disable build of clients'
190   echo '--without-comp-doc          - Disable build of documentation'
191   echo
192   echo '--without-meta-data         - Disable support for Meta Data'
193   echo
194   echo '--without-cf-cmd            - Disable support for command codecfilter'
195   echo
196   echo '--without-vio-MODULE        - Disable support for VIO module MODULE'
197   echo
198   echo '--without-password-api      - Disable build of Password API'
199   echo
200   echo '--without-listen            - Disable listening sockets in roard'
201   echo '                              This is the same as allways using --no-listen'
202   echo
203   echo '--roard-cfreq FREQ          - Sets the cycle frequency of roard in Hz.'
204   echo '--vorbis-bits BITS           - Sets bits per sample used by Vorbis code'
205   echo
206   echo '--without-libao             - Disable build of libao plugin'
207   echo '--without-xmms              - Disable build of XMMS plugin'
208   echo '--without-audacious         - Disable build of Audacious plugin'
209   echo
210   echo '--mmcu MMCU                 - Sets -mmcu compiler/linker option'
211   echo '--minimal                   - Disable all optional components'
212   echo '--cross-compile             - Enable cross compiler workarounds'
213   echo '--target-microcontroller    - Set Options for mircocontrollers without a OS'
214   echo '                              Implys --cross-compile'
215   echo '--target-win32              - Disable everything useful'
216   echo '--exec-helper HELPER        - Exec all test programms using this command (HELPER $cmd $args)'
217   echo '                              use '\''--exec-helper wine'\'' when building win32 binarys'
218   exit 0;
219  ;;
220  '--ldpath')
221   LDPATH="$LDPATH -L$2"
222   shift;
223  ;;
224  '--incpath')
225   INCPATH="$INCPATH -I$2"
226   shift;
227  ;;
228  '--addpath')
229   LDPATH="$LDPATH -L$2/lib/"
230   INCPATH="$INCPATH -I$2/include/"
231   shift;
232  ;;
233  '--cc')
234   CC="$2"
235   shift;
236  ;;
237  '--ranlib')
238   RANLIB="$2"
239   shift;
240  ;;
241  '--cdrom')
242   CDROM="$2"
243   shift;
244  ;;
245  '--tty')
246   TTY_DEV="$2"
247   shift;
248  ;;
249  '--oss-dev')
250   OSS_DEV="$2"
251   shift;
252  ;;
253  '--audio-group')
254   DEFAULT_GRP="$2"
255   shift;
256  ;;
257  '--no-'*)
258   lib=$(echo "$1" | sed 's/^--no-//')
259   eval no_lib_$lib=true
260  ;;
261  '--runtime-detect')
262   RUNTIME_DETECT=true
263  ;;
264  '--ao-install-dir')
265   AO_INST_DIR="$2"
266   shift;
267  ;;
268  '--xmms-install-dir')
269   XMMS_INST_DIR="$2"
270   shift;
271  ;;
272  '--audacious-install-dir')
273   AUDACIOUS_INST_DIR="$2"
274   shift;
275  ;;
276  '--default-rate')
277   DEFAULT_RATE="$2"
278   shift;
279  ;;
280  '--default-channels')
281   DEFAULT_CHANNELS="$2"
282   shift;
283  ;;
284  '--default-bits')
285   DEFAULT_BITS="$2"
286   shift;
287  ;;
288  '--default-driver')
289   ROAR_DRIVER_DEFAULT="$2"
290   shift;
291  ;;
292  '--default-codec')
293   ROAR_DRIVER_CODEC="$2"
294   shift;
295  ;;
296  '--without-alaw')
297   ALAW=false
298   ALAW_RW=false
299  ;;
300  '--without-alaw-rw')
301   ALAW_RW=false
302  ;;
303  '--without-mulaw')
304   MULAW=false
305   MULAW_RW=false
306  ;;
307  '--without-mulaw-rw')
308   MULAW_RW=false
309  ;;
310  '--without-proxy')
311   PROXY=false
312  ;;
313  '--without-comp-libs')
314   COMP_LIBS=false
315  ;;
316  '--without-comp-roard')
317   COMP_ROARD=false
318  ;;
319  '--without-comp-clients')
320   COMP_CLIENTS=false
321  ;;
322  '--without-comp-doc')
323   COMP_DOC=false
324  ;;
325  '--without-meta-data')
326   META_DATA=false
327  ;;
328  '--without-cf-'*)
329   WITHOUT_CF="$WITHOUT_CF"' '$(echo "$1" | cut -d- -f5)
330  ;;
331  '--without-vio-'*)
332   WITHOUT_VIO="$WITHOUT_VIO"' '$(echo "$1" | cut -d- -f5)
333  ;;
334  '--without-password-api')
335   PASSWORD_API=false
336  ;;
337  '--without-listen')
338   NO_LISTEN=true
339  ;;
340  '--roard-cfreq')
341   ROARD_CFREQ="$2"
342   shift;
343  ;;
344  '--vorbis-bits')
345   VORBIS_BITS="$2"
346   shift;
347  ;;
348  '--without-libao')
349   LIBAO=false
350   no_lib_ao=true
351  ;;
352  '--without-xmms')
353   XMMS=false
354  ;;
355  '--without-audacious')
356   AUDACIOUS=false
357  ;;
358  '--minimal')
359   MINIMAL=true
360   RUNTIME_DETECT=false
361   XMMS=false
362   AUDACIOUS=false
363   LIBAO=false
364   PROXY=false
365   MULAW=false
366   MULAW_RW=false
367   ALAW=false
368   ALAW_RW=false
369   META_DATA=false
370   PASSWORD_API=false
371   WITHOUT_VIO="$WITHOUT_VIO"' dstr cmd stdio'
372  ;;
373  '--prefix')
374   PREFIX="$2"
375   shift;
376  ;;
377  '--prefix-bin')
378   PREFIX_BIN="$2"
379   shift;
380  ;;
381  '--prefix-lib')
382   PREFIX_LIB="$2"
383   shift;
384  ;;
385  '--prefix-inc')
386   PREFIX_INC="$2"
387   shift;
388  ;;
389  '--prefix-man')
390   PREFIX_MAN="$2"
391   shift;
392  ;;
393  '--prefix-comp')
394   PREFIX_COMP="$2"
395   shift;
396  ;;
397  '--mmcu')
398   MMCU="$2"
399   shift;
400  ;;
401  '--cross-compile')
402   CROSS_COMPILE=true
403  ;;
404  '--exec-helper')
405   EXEC_HELPER="$2"
406   shift;
407  ;;
408  '--target-microcontroller')
409   TARGET_MICROCONTROLLER=true
410   CROSS_COMPILE=true
411   HAVE_MAIN_ARGS=false
412  ;;
413  '--target-win32')
414   TARGET_WIN32=true
415   CROSS_COMPILE=true
416   RUNTIME_DETECT=true
417   no_lib_dnet=true
418   PROXY=false
419   LIBAO=false
420   XMMS=false
421   AUDACIOUS=false
422   WITHOUT_VIO="$WITHOUT_VIO"' pipe cmd' # hope that with buffered pipes we can remove this soon
423  ;;
424 esac;
425
426 shift;
427done
428
429
430CCTF="false"
431
432test_lib () {
433 echo > $TF_C
434
435 name="$1"
436 echo -n "checking for $name... "
437 echo "TEST LIB: $name" >&5
438 shift;
439
440 LIBS=''
441
442 while [ "$1" != '--' ]
443 do
444  case "$1" in
445   'c'|'-lc')
446    :; # no need to do anything
447   ;;
448   '-'*)
449    LIBS="$LIBS $1"
450   ;;
451   *)
452    LIBS="-l$1"
453   ;;
454  esac
455  shift;
456 done
457
458 shift;
459
460 echo "LIB($name) IS TESTED USING LIBS: $LIBS" >&5
461
462 while [ "$1" != '' ]
463 do
464  echo "#include <$1>" >> $TF_C
465  shift;
466 done
467
468 echo 'int main (void) { return 0; }' >> $TF_C
469
470 echo "LIB($name) IS TESTED USING TEST CODE:" >&5
471 echo "--- BEGIN OF CODE BLOCK ---" >&5
472 cat $TF_C >&5
473 echo "--- END OF CODE BLOCK ---" >&5
474
475 echo "LIB($name) HAS COMPILER/LINKER OUTPUT:" >&5
476 echo "--- BEGIN OF CHILD OUTPUT BLOCK ---" >&5
477 $CCTF $LIBS >&5 2>&5;
478 R=$?
479 echo "--- END OF CHILD OUTPUT BLOCK ---" >&5
480
481 if [ "$R" = '0' ]
482 then
483  echo 'yes'
484  echo "LIB($name) WAS FOUND" >&5
485 else
486  echo 'no'
487  echo "LIB($name) NOT FOUND" >&5
488 fi
489
490 return $R
491}
492
493test_lib_defmake () {
494 def="$1"
495 subdir="$2"
496 shift
497 shift
498 name="$1"
499 lib="$2"
500 shift
501
502 echo "TEST LIB: $name" >&5
503
504 [ "$subdir" = '%' ] && subdir=''
505
506 if [ "$lib" != '--' ]
507 then
508  eval _no="\$no_lib_$lib";
509  $MINIMAL && _no='XXX'
510
511  if [ "$_no" != '' ]
512  then
513    echo "checking for $name... disabled by user"
514    echo "LIB($name) IS DISABLED BY USER" >&5
515   [ "$subdir" != '' ] && \
516    echo "subdir_$subdir=" >&4
517   echo "lib_$lib=" >&4
518   return;
519  fi
520 fi
521
522 LIBS=$($PKG_CONFIG --silence-errors --libs $lib 2> /dev/null)
523 if [ "$?" != '0' ]
524 then
525  LIBS="-l$lib"
526 fi
527
528 echo "LIB($name) HAS LIBS: $LIBS" >&5
529
530 if test_lib "$name" $LIBS "$@"
531 then
532  subdir_var='subdir_'"`echo $subdir | tr / _`"
533  echo "#define $def"            >&3
534  [ "$subdir" != '' ] && \
535   echo "$subdir_var=$subdir" >&4
536  [ "$lib" != 'c' ] && \
537   echo "lib_$lib=$LIBS" >&4
538 else
539  [ "$subdir" != '' ] && \
540   echo "subdir_$subdir=" >&4
541  [ "$lib" != 'c' ] && \
542   echo "lib_$lib=" >&4
543 fi
544 echo >&5
545 echo >&5
546}
547
548test_tool_defmake () {
549 DEF="$1"
550 NAME="$2"
551 shift;
552 shift;
553 echo -n "checking for $NAME... "
554
555 echo "TEST TOOL: $NAME" >&5
556
557 if $RUNTIME_DETECT
558 then
559  echo "$1 (runtime detect)"
560  echo "TOOL($NAME) WILL BE RUNTIME DETECTED" >&5
561  echo "#define $DEF "\""$1"\" >&3
562 elif $MINIMAL
563 then
564  echo "disabled by user (minimalstic build)"
565  echo "TOOL($NAME) IS DISABLED BY USER" >&5
566 else
567
568  LIST=$(which "$@" 2> /dev/null | grep ^/ | head -n 1)
569
570  if [ "$LIST" = '' ]
571  then
572   echo 'no'
573   echo "TOOL($NAME) NOT FOUND" >&5
574  else
575   echo $LIST
576   echo "#define $DEF "\""$LIST"\" >&3
577   echo "TOOL($NAME) IS AT $LIST" >&5
578  fi
579 fi
580}
581
582test_func_defmake () {
583 DEF="$1"
584 NAME="$2"
585 shift;
586 shift;
587 echo -n "checking for $NAME()... "
588
589 CALL="$1"
590 shift;
591 shift; # skip '--'
592
593 echo "TEST FUNCTION: $NAME" >&5
594
595 {
596  while [ "$1" != '' ]
597  do
598   echo "#include <$1>"
599   shift;
600  done
601
602  echo 'int main (void) {'
603  echo " $CALL;"
604  echo ' return 0;'
605  echo '}'
606
607 } > $TF_C
608
609 echo "--- BEGIN OF CODE BLOCK ---" >&5
610 cat $TF_C >&5
611 echo "--- END OF CODE BLOCK ---" >&5
612
613 echo "FUNCTION($NAME) HAS COMPILER/LINKER OUTPUT:" >&5
614 echo "--- BEGIN OF CHILD OUTPUT BLOCK ---" >&5
615 $CCTF >&5 2>&5;
616 R=$?
617 echo "--- END OF CHILD OUTPUT BLOCK ---" >&5
618
619 if [ "$R" = '0' ]
620 then
621  echo "#define $DEF" >&3
622  echo "FUNCTION($NAME) IS OK" >&5
623  echo yes
624 else
625  echo "FUNCTION($NAME) IS NOT OK" >&5
626  echo no
627 fi
628
629}
630
631exec 3> config.h 4> Makefile.conf 5> config.log
632
633TARGET_CYGWIN=`echo "$SYSNAME" | if grep CYGWIN > /dev/null; then echo true; else echo false; fi`
634
635if [ "$SYSNAME" = 'Darwin' ]
636then
637 echo "Adding $SYSNAME shared lib arguments..."
638 SHARED="$SHARED -fno-common -dynamiclib -compatibility_version 0.1 -current_version 0.1.0"
639 SHARED_CF="$SHARED_CF -fno-common"
640elif [ "$SYSNAME" = 'NetBSD' ]
641then
642 echo "Adding $SYSNAME libpath arguments..."
643 LDPATH="$LDPATH -L/usr/local/lib/"
644elif [ "$SYSNAME" = 'OpenBSD' ]
645then
646 echo "Adding $SYSNAME search path arguments..."
647 LDPATH="$LDPATH -L/usr/local/lib/"
648 INCPATH="$INCPATH -I/usr/local/include/"
649# echo "Adding $SYSNAME build arguments..."
650# SNDIO_EMUL=false
651elif [ "$SYSNAME" = 'FreeBSD' ]
652then
653 echo "Adding $SYSNAME search path arguments..."
654 LDPATH="$LDPATH -L/usr/local/lib/"
655 INCPATH="$INCPATH -I/usr/local/include/"
656 [ "$DEFAULT_GRP" = '' ] && DEFAULT_GRP='wheel'
657elif $TARGET_WIN32
658then
659 echo "Adding win32 build arguments..."
660 fPIC=false
661 SHARED_SUFFIX='.dll'
662elif $TARGET_CYGWIN
663then
664 echo "Adding cygwin build arguments..."
665 fPIC=false
666 SHARED_SUFFIX='.dll'
667fi
668
669echo -n 'checking if we cross compile... '
670if $CROSS_COMPILE
671then
672 echo yes
673
674 echo -n "checking for exec helper... "
675 if [ "$EXEC_HELPER" = '' ]
676 then
677  if $TARGET_WIN32
678  then
679   EXEC_HELPER=$(which wine 2> /dev/null | grep ^/ | head -n 1)
680   if [ "$EXEC_HELPER" = '' ]
681   then
682    echo 'none (please install wine)'
683   else
684    echo "$EXEC_HELPER"
685   fi
686  else
687   echo 'none (unknown)'
688  fi
689 else
690  echo "$EXEC_HELPER"
691 fi
692
693 echo -n "checking for sysname... "
694 if $TARGET_CYGWIN
695 then
696  SYSNAME=cygwin
697 elif $TARGET_WIN32
698 then
699  SYSNAME=win32
700 else
701  SYSNAME=unknown
702 fi
703 echo "$SYSNAME"
704else
705 echo no
706fi
707
708[ "$PREFIX_BIN"  = '' ] && PREFIX_BIN="$PREFIX/bin/"
709[ "$PREFIX_LIB"  = '' ] && PREFIX_LIB="$PREFIX/lib/"
710[ "$PREFIX_INC"  = '' ] && PREFIX_INC="$PREFIX/include/"
711[ "$PREFIX_MAN"  = '' ] && PREFIX_MAN="$PREFIX/share/man/"
712[ "$PREFIX_COMP" = '' ] && PREFIX_COMP="$PREFIX_LIB/roaraudio/complibs/"
713
714[ "$DEFAULT_GRP" = '' ] && DEFAULT_GRP='audio'
715
716if [ "$MMCU" != '' ]
717then
718 CC="$CC -mmcu=$MMCU"
719fi
720
721# now write the cc name to Makefile.conf
722{
723 echo "SHARED=$SHARED"
724 echo "SHARED_CF=$SHARED_CF"
725 echo "SHARED_SUFFIX=$SHARED_SUFFIX"
726 $fPIC && echo 'fPIC=-fPIC'
727 echo
728 echo "CC=$CC"
729 echo "RANLIB=$RANLIB"
730 echo "LDPATH=$LDPATH"
731 echo "INCPATH=$INCPATH"
732 echo
733 echo "EXEC_HELPER=$EXEC_HELPER"
734 echo
735 echo "PREFIX=$PREFIX"
736 echo "PREFIX_BIN=$PREFIX_BIN"
737 echo "PREFIX_LIB=$PREFIX_LIB"
738 echo "PREFIX_INC=$PREFIX_INC"
739 echo "PREFIX_MAN=$PREFIX_MAN"
740 echo "PREFIX_COMP=$PREFIX_COMP"
741 echo
742 $COMP_LIBS     && echo "comp_libs=libroar libroardsp libroarmidi libroarlight"
743 $COMP_ROARD    && echo "comp_roard=roard"
744 $COMP_CLIENTS  && echo "comp_clients=roarclients"
745 $COMP_DOC      && echo "comp_doc=doc"
746 echo
747 $SNDIO_EMUL && echo "subdir_libroarsndio=libroarsndio"
748} >&4
749
750CCTF="$CC $LDPATH $INCPATH -Iinclude/ -o $TF_E $TF_C"
751
752{
753 cat <<'EOF'
754//config.log:
755
756/*
757 * Logfile for configure script $Revision$ of RoarAudio
758 */
759
760EOF
761 echo '/* uname: ' $(uname -a) '*/'
762 echo '/* Date : ' $(date)  '*/'
763 echo
764
765 echo
766 echo
767
768 for i in CC RANLIB PKG_CONFIG SYSNAME TARGET_CYGWIN
769 do
770  eval echo "BASICCONF\($i\): \$$i";
771 done
772
773 echo
774 echo
775} >&5
776
777cat >&3 << EOF
778//config.h:
779
780#ifndef _ROARAUDIO_CONFIG_H_
781#define _ROARAUDIO_CONFIG_H_
782
783EOF
784
785{
786 echo '/* uname: ' $(uname -a) '*/'
787 echo '/* Date : ' $(date)  '*/'
788 echo
789 [ "$DEFAULT_RATE"        = '' ] || echo "#define ROAR_RATE_DEFAULT     $DEFAULT_RATE"
790 [ "$DEFAULT_CHANNELS"    = '' ] || echo "#define ROAR_CHANNELS_DEFAULT $DEFAULT_CHANNELS"
791 [ "$DEFAULT_BITS"        = '' ] || echo "#define ROAR_BITS_DEFAULT     $DEFAULT_BITS"
792 [ "$ROAR_DRIVER_DEFAULT" = '' ] || echo "#define ROAR_DRIVER_DEFAULT   \"$ROAR_DRIVER_DEFAULT\""
793 [ "$ROAR_DRIVER_CODEC"   = '' ] || echo "#define ROAR_DRIVER_CODEC     \"$ROAR_DRIVER_CODEC\""
794 echo
795 [ "$ROARD_CFREQ"         = '' ] || echo "#define ROAR_OUTPUT_CFREQ     $ROARD_CFREQ"
796 echo "#define ROAR_VORBIS_BITS     $VORBIS_BITS"
797 echo
798 $MINIMAL      && echo '#define ROAR_MINIMAL'
799 $ALAW         && echo '#define ROAR_SUPPORT_ALAW'
800 $ALAW_RW      && echo '#define ROAR_SUPPORT_ALAW_RW'
801 $MULAW        && echo '#define ROAR_SUPPORT_MULAW'
802 $MULAW_RW     && echo '#define ROAR_SUPPORT_MULAW_RW'
803 $PROXY        && echo '#define ROAR_SUPPORT_PROXY'
804 $PASSWORD_API && echo '#define ROAR_SUPPORT_PASSWORD_API'
805 $NO_LISTEN    || echo '#define ROAR_SUPPORT_LISTEN'
806 $META_DATA    && echo '#define ROAR_SUPPORT_META'
807 echo
808
809 $HAVE_MAIN_ARGS && echo '#define ROAR_HAVE_MAIN_ARGS'
810
811 echo
812
813 for i in $WITHOUT_CF
814 do
815  i=$(echo $i | tr /a-z/ /A-Z/);
816  echo '#define ROAR_WITHOUT_CF_'$i
817 done
818
819 for i in $WITHOUT_VIO
820 do
821  i=$(echo $i | tr /a-z/ /A-Z/);
822  echo '#define ROAR_WITHOUT_VIO_'$i
823 done
824
825 echo
826 $TARGET_MICROCONTROLLER && echo '#define ROAR_TARGET_MICROCONTROLLER'
827 $TARGET_WIN32           && echo '#define ROAR_TARGET_WIN32'
828                            echo '#define ROAR_OS_'$(echo $SYSNAME | tr a-z-. A-Z__)
829 echo
830} >&3
831
832#                 #define                   name         cmds...
833test_tool_defmake ROAR_HAVE_BIN_OGG123      ogg123       ogg123
834test_tool_defmake ROAR_HAVE_BIN_FLAC        flac         flac
835test_tool_defmake ROAR_HAVE_BIN_TIMIDITY    TiMidity++   timidity
836test_tool_defmake ROAR_HAVE_BIN_CDPARANOIA  cdparanoia   cdparanoia
837test_tool_defmake ROAR_HAVE_BIN_WGET        Wget         wget
838test_tool_defmake ROAR_HAVE_BIN_GNUPLOT     gnuplot      gnuplot
839test_tool_defmake ROAR_HAVE_BIN_SSH         OpenSSH      ssh
840test_tool_defmake ROAR_HAVE_BIN_PINENTRY    PIN-Entry    pinentry
841test_tool_defmake ROAR_HAVE_BIN_SSH_ASKPASS SSH-AskPass  ssh-askpass
842test_tool_defmake ROAR_HAVE_BIN_GZIP        Gzip         gzip
843test_tool_defmake ROAR_HAVE_BIN_BZIP2       bzip2        bzip2
844test_tool_defmake ROAR_HAVE_BIN_GPG         GnuPG        gpg
845test_tool_defmake ROAR_HAVE_BIN_CHAT        chat         chat
846
847echo >&3
848echo >&5
849echo >&5
850echo >&5
851
852#                #define                 subdir       name           -lxxx      -- header
853test_lib_defmake ROAR_HAVE_LIBM          %            'Math Library' m          -- math.h
854if test_lib 'realtime Library' rt -- sys/mman.h mqueue.h semaphore.h
855then
856 {
857  echo '#define ROAR_HAVE_LIBRT'
858  echo '#define ROAR_NEED_LIBRT'
859 } >&3
860fi
861
862echo >&3
863
864#                #define                 subdir       name          -lxxx      -- header
865test_lib_defmake ROAR_HAVE_ESD           libroaresd   EsounD        esd        -- esd.h
866test_lib_defmake ROAR_HAVE_LIBAO         %            libao         ao         -- ao/ao.h ao/plugin.h
867test_lib_defmake ROAR_HAVE_LIBOGG        %            libogg        ogg        -- ogg/ogg.h
868test_lib_defmake ROAR_HAVE_LIBVORBIS     %            libvorbis     vorbis     -- vorbis/codec.h
869test_lib_defmake ROAR_HAVE_LIBVORBISFILE %            libvorbisfile vorbisfile -- vorbis/vorbisfile.h
870test_lib_defmake ROAR_HAVE_LIBVORBISENC  %            libvorbisenc  vorbisenc  -- vorbis/vorbisenc.h
871test_lib_defmake ROAR_HAVE_LIBSPEEX      %            libspeex      speex      -- speex/speex.h speex/speex_stereo.h
872test_lib_defmake ROAR_HAVE_LIBSPEEXDSP   %            libspeexdsp   speexdsp   -- speex/speex.h speex/speex_stereo.h
873test_lib_defmake ROAR_HAVE_LIBCELT       %            libcelt       celt       -- celt/celt.h celt/celt_header.h
874test_lib_defmake ROAR_HAVE_LIBOGGZ       %            liboggz       oggz       -- oggz/oggz.h
875test_lib_defmake ROAR_HAVE_LIBSNDFILE    %            libsndfile    sndfile    -- sndfile.h
876test_lib_defmake ROAR_HAVE_LIBFISHSOUND  roarfish     libfishsound  fishsound  -- fishsound/fishsound.h
877test_lib_defmake ROAR_HAVE_LIBSHOUT      %            libshout      shout      -- shout/shout.h
878test_lib_defmake ROAR_HAVE_LIBPULSE      libroarpulse libpulse      pulse      -- pulse/pulseaudio.h pulse/simple.h
879test_lib_defmake ROAR_HAVE_LIBY2         libroaryiff  libyiff       Y2         -- Y2/Y.h Y2/Ylib.h
880test_lib_defmake ROAR_HAVE_LIBARTSC      libroararts  libartsc      artsc      -- kde/artsc/artsc.h
881test_lib_defmake ROAR_HAVE_LIBOSSAUDIO   %            libossaudio   ossaudio   -- sys/ioctl.h
882test_lib_defmake ROAR_HAVE_LIBSNDIO      %            libsndio      sndio      -- sndio.h
883test_lib_defmake ROAR_HAVE_LIBSSL        %            OpenSSL       ssl        -- openssl/bio.h openssl/evp.h
884test_lib_defmake ROAR_HAVE_LIBSLP        %            OpenSLP       slp        -- slp.h
885test_lib_defmake ROAR_HAVE_LIBDNET       %            libdnet       dnet       -- sys/socket.h netdnet/dn.h netdnet/dnetdb.h
886test_lib_defmake ROAR_HAVE_BSDSOCKETS    %            BSDSockets    c          -- sys/types.h sys/socket.h
887test_lib_defmake ROAR_HAVE_UNIX          %            UNIX          c          -- sys/types.h sys/socket.h sys/un.h
888test_lib_defmake ROAR_HAVE_IPX           %            IPX           c          -- netipx/ipx.h
889test_lib_defmake ROAR_HAVE_IPV4          %            IPv4          c          -- sys/types.h sys/socket.h 'netinet/in.h'
890test_lib_defmake ROAR_HAVE_OSS           %            OSS           c          -- sys/ioctl.h sys/soundcard.h
891test_lib_defmake ROAR_HAVE_OSS_BSD       %            BSDOSS        c          -- sys/ioctl.h soundcard.h
892test_lib_defmake ROAR_HAVE_LIBSENDFILE   %            sendfile      sendfile   -- sys/sendfile.h
893test_lib_defmake ROAR_HAVE_LIBSOCKET     %            libsocket     socket     -- sys/socket.h
894test_lib_defmake ROAR_HAVE_LIBWSOCK32    %            WinSockP0     wsock32    -- winsock2.h
895test_lib_defmake ROAR_HAVE_LIBWS2_32     %            WinSockP1     ws2_32     -- winsock2.h
896
897echo >&3
898
899# Those tests should not be disbaled as they do not reduce the lib size just
900# break --minimal on full systems
901OLD_MINIMAL=$MINIMAL
902MINIMAL=false
903test_lib_defmake ROAR_HAVE_H_SYS_TYPES   %            sys/types.h   c          -- sys/types.h
904test_lib_defmake ROAR_HAVE_H_FCNTL       %            fcntl.h       c          -- fcntl.h
905test_lib_defmake ROAR_HAVE_H_UNISTD      %            unistd.h      c          -- unistd.h
906test_lib_defmake ROAR_HAVE_H_POLL        %            poll.h        c          -- poll.h
907MINIMAL=$OLD_MINIMAL
908
909echo >&3
910
911# add a better test here
912test_lib 'linux sendfile()'       -- sys/sendfile.h && echo '#define ROAR_HAVE_LINUX_SENDFILE' >&3
913
914
915echo -n 'checking for IPv6... '
916
917if $MINIMAL
918then
919 echo "disabled by user (minimalstic build)"
920else
921 echo '#include <sys/socket.h>'  > $TF_C
922 echo '#include <netinet/in.h>' >> $TF_C
923 echo 'int main (void) { struct sockaddr_in6 in6; return 0; }' >> $TF_C
924
925 if $CCTF 2> /dev/null;
926 then
927  echo '#define ROAR_HAVE_IPV6' >&3
928  echo yes
929 else
930  echo no
931 fi
932fi
933
934
935echo -n 'checking for _exit()... '
936
937echo '#include <unistd.h>'    > $TF_C
938echo 'int main (void) { _exit(0); return 0; }' >> $TF_C
939
940if $CCTF 2> /dev/null;
941then
942 echo '#define ROAR_HAVE_U_EXIT' >&3
943 echo '#define ROAR_U_EXIT _exit' >&3
944 echo yes
945else
946 echo '#define ROAR_U_EXIT exit' >&3
947 echo no
948fi
949
950#                 def                 name      call                         -- header
951test_func_defmake ROAR_HAVE_SETENV    setenv    'setenv("", "", 0)'          -- stdlib.h
952test_func_defmake ROAR_HAVE_PUTENV    putenv    'putenv("")'                 -- stdlib.h
953test_func_defmake ROAR_HAVE_STRTOK_R  strtok_r  'strtok_r("","",(char**)0)'  -- string.h
954test_func_defmake ROAR_HAVE_NICE      nice      'nice(0)'                    -- unistd.h
955test_func_defmake ROAR_HAVE_GETGID    getgid    'getgid()'                   -- sys/types.h unistd.h
956test_func_defmake ROAR_HAVE_GETUID    getuid    'getuid()'                   -- sys/types.h unistd.h
957test_func_defmake ROAR_HAVE_SETGID    setgid    'setgid(0)'                  -- sys/types.h unistd.h
958test_func_defmake ROAR_HAVE_SETUID    setuid    'setuid(0)'                  -- sys/types.h unistd.h
959test_func_defmake ROAR_HAVE_SETSID    setsid    'setsid()'                   -- sys/types.h unistd.h
960test_func_defmake ROAR_HAVE_GETTIMEOFDAY gettimeofday 'struct timeval tv; gettimeofday(&tv, NULL)' -- sys/time.h time.h
961test_func_defmake ROAR_HAVE_USLEEP    usleep    'usleep(0)'                  -- sys/types.h unistd.h
962test_func_defmake ROAR_HAVE_ALARM     alarm     'alarm(0)'                   -- sys/types.h unistd.h
963test_func_defmake ROAR_HAVE_KILL      kill      'kill(0,0)'                  -- sys/types.h signal.h
964
965echo -n 'checking for basic IO calls... '
966
967cat <<EOF > $TF_C
968#include <sys/types.h>
969#include <sys/stat.h>
970#include <fcntl.h>
971#include <string.h>
972#include <unistd.h>
973
974int main(void) {
975 open(NULL, 0, 0);
976 close(0);
977 read(0, NULL, 0);
978 write(0, NULL, 0);
979 lseek(0, 0, 0);
980 return 0;
981}
982EOF
983
984if $CCTF 2> /dev/null;
985then
986 echo '#define ROAR_HAVE_IO_POSIX' >&3
987 echo posix
988else
989 echo none
990fi
991
992echo -n 'checking for basic FS calls... '
993
994cat <<EOF > $TF_C
995#include <string.h>
996#include <unistd.h>
997
998int main(void) {
999 chdir(NULL);
1000 unlink(NULL);
1001 return 0;
1002}
1003EOF
1004
1005if $CCTF 2> /dev/null;
1006then
1007 echo '#define ROAR_HAVE_FS_POSIX' >&3
1008 echo posix
1009else
1010 echo none
1011fi
1012
1013
1014test_func_defmake ROAR_HAVE_CHROOT    chroot    'chroot((void*)0)'           -- unistd.h
1015test_func_defmake ROAR_HAVE_MLOCK     mlock     'mlock((void*)0, 0)'         -- sys/mman.h
1016test_func_defmake ROAR_HAVE_MMAP      mmap      'mmap((void*)0,0,0,0,0,0)'   -- sys/mman.h
1017
1018echo -n 'checking for fsync()... '
1019
1020echo '#include <unistd.h>' > $TF_C
1021echo 'int main (void) { fsync(0); return 0; }' >> $TF_C
1022
1023if $CCTF 2> /dev/null;
1024then
1025 echo '#define ROAR_HAVE_FSYNC' >&3
1026 FSYNC=true
1027 echo yes
1028else
1029 FSYNC=false
1030 echo no
1031fi
1032
1033echo -n 'checking for fdatasync()... '
1034
1035echo '#include <unistd.h>' > $TF_C
1036echo 'int main (void) { fdatasync(0); return 0; }' >> $TF_C
1037
1038if $CCTF 2> /dev/null;
1039then
1040 echo '#define ROAR_HAVE_FDATASYNC' >&3
1041 echo '#define ROAR_FDATASYNC fdatasync' >&3
1042 echo yes
1043else
1044 $FSYNC && echo '#define ROAR_FDATASYNC fsync' >&3
1045 echo no
1046fi
1047
1048echo -n 'checking for fopencookie()... '
1049
1050echo '#define _GNU_SOURCE' > $TF_C
1051echo '#include <stdio.h>' >> $TF_C
1052echo 'int main (void) { cookie_io_functions_t f; fopencookie(NULL, "", f); return 0; }' >> $TF_C
1053
1054if $CCTF 2> /dev/null;
1055then
1056 echo '#define ROAR_HAVE_FOPENCOOKIE' >&3
1057 NEED_GNU_SOURCE=true
1058 echo yes
1059else
1060 echo no
1061fi
1062
1063echo -n 'checking for funopen()... '
1064
1065echo '#define __BSD_VISIBLE 1'  > $TF_C
1066echo '#include <stdio.h>'      >> $TF_C
1067echo 'int main (void) { funopen(NULL, NULL, NULL, NULL, NULL); return 0; }' >> $TF_C
1068
1069if $CCTF 2> /dev/null;
1070then
1071 echo '#define ROAR_HAVE_FUNOPEN' >&3
1072 echo '#define ROAR_NEED_BSD_VISIBLE' >&3
1073 echo yes
1074else
1075 echo no
1076fi
1077
1078test_func_defmake ROAR_HAVE_PIPE      pipe      'pipe(NULL)'                 -- unistd.h
1079test_func_defmake ROAR_HAVE_FORK      fork      'fork()'                     -- unistd.h
1080test_func_defmake ROAR_HAVE_WAIT      wait      'wait(NULL)'                 -- string.h sys/wait.h
1081
1082echo -n 'checking for square root func... '
1083
1084if $TARGET_CYGWIN
1085then
1086 echo 'sqrt() (cygwin)'
1087elif [ "$SYSNAME" = 'FreeBSD' ]
1088then
1089 echo 'sqrt() (FreeBSD, fix your gcc)'
1090elif [ "$SYSNAME" = 'Linux' ]
1091then
1092 echo '#include <math.h>' > $TF_C
1093 echo 'int main (void) { sqrtl(0); return 0; }' >> $TF_C
1094
1095 if $CCTF -lm 2> /dev/null;
1096 then
1097  echo '#define ROAR_HAVE_SQRTL' >&3
1098  echo 'sqrtl()'
1099 else
1100  echo 'sqrt()'
1101 fi
1102else
1103 echo 'sqrt()'
1104fi
1105
1106echo -n 'checking for inline funcs... '
1107
1108echo 'inline int test (void) { return 0; }' > $TF_C
1109echo 'int main (void) { return test(); }'  >> $TF_C
1110
1111if $CCTF 2> /dev/null;
1112then
1113 echo '#define ROAR_HAVE_INLINE' >&3
1114 echo yes
1115else
1116 echo no
1117fi
1118
1119echo -n 'checking for broken peercred... '
1120echo '#include <sys/types.h>'      >  $TF_C
1121echo '#include <sys/socket.h>'     >> $TF_C
1122echo '#include <sys/un.h>'         >> $TF_C
1123echo 'int main (void) { struct ucred cred; return 0; }'  >> $TF_C
1124
1125if $CCTF 2> /dev/null;
1126then
1127 echo working
1128else
1129 if $CCTF -D_GNU_SOURCE 2> /dev/null;
1130 then
1131  NEED_GNU_SOURCE=true
1132  echo need to set _GNU_SOURCE
1133 else
1134  echo '#define ROAR_BROKEN_PEERCRED' >&3
1135  echo broken
1136 fi
1137fi
1138
1139
1140test_func_defmake ROAR_HAVE_GETPEEREID getpeereid 'getpeereid(0, NULL, NULL)' -- sys/types.h sys/socket.h
1141
1142echo -n 'checking for select()... '
1143cat <<EOF > $TF_C
1144#ifndef NO_SYS_SELECT_H
1145#include <sys/select.h>
1146#endif
1147#include <sys/time.h>
1148#include <sys/types.h>
1149#include <unistd.h>
1150
1151int main (void) {
1152 fd_set rfds;
1153 struct timeval tv;
1154
1155 FD_ZERO(&rfds);
1156 FD_SET(0, &rfds);
1157
1158 tv.tv_sec  = 0;
1159 tv.tv_usec = 0;
1160
1161 select(1, &rfds, NULL, NULL, &tv);
1162
1163 return 0;
1164}
1165EOF
1166
1167if $CCTF 2> /dev/null;
1168then
1169 echo '#define ROAR_HAVE_SELECT' >&3
1170 echo '#define ROAR_HAVE_H_SYS_SELECT' >&3
1171 echo yes, POSIX.1-2001
1172elif $CCTF -DNO_SYS_SELECT_H 2> /dev/null;
1173then
1174 echo '#define ROAR_HAVE_SELECT' >&3
1175 echo yes, old style
1176else
1177 echo no
1178fi
1179
1180echo -n 'checking for shutdown()... '
1181echo '#include <sys/types.h>'      >  $TF_C
1182echo '#include <sys/socket.h>'     >> $TF_C
1183echo 'int main (void) { shutdown(0, 0); return 0; }'  >> $TF_C
1184
1185if [ "$SYSNAME" = 'SunOS' ]
1186then
1187 _l='-lsocket'
1188else
1189 _l=''
1190fi
1191
1192if $CCTF $_l 2> /dev/null;
1193then
1194 echo '#define ROAR_HAVE_SHUTDOWN'     >&3
1195 echo '#define ROAR_SHUTDOWN shutdown' >&3
1196 echo yes
1197else
1198 echo '#define ROAR_SHUTDOWN(x,y) (-1)' >&3
1199 echo no
1200fi
1201
1202test_func_defmake ROAR_HAVE_GETOBJECTBYNAME getobjectbyname 'getobjectbyname(NULL)' -- netdnet/dn.h netdnet/dnetdb.h
1203test_func_defmake ROAR_HAVE_GETSERVBYNAME   getservbyname   'getservbyname((void*)0, (void*)0)' -- netdb.h
1204
1205echo -n 'checking for safe 32 bit integer overflow... '
1206
1207cat > $TF_C << EOF
1208#include <stdio.h>
1209#include <stdint.h>
1210#define TYPE uint32_t
1211#define MAX  ((TYPE)4294967295U)
1212
1213int main (void) {
1214 TYPE a = MAX;
1215
1216 a += 2;
1217
1218 if ( a == 1 ) {
1219  printf("#define ROAR_HAVE_SAFE_OVERFLOW\n");
1220  return 0;
1221 }
1222
1223 return 1;
1224}
1225EOF
1226
1227if $CCTF 2> /dev/null;
1228then
1229 $EXEC_HELPER $TF_E >&3 2> /dev/null
1230 if [ "$?" = '0' ]
1231 then
1232  echo yes
1233 else
1234  echo no
1235 fi
1236else
1237 echo 'no (can not compile!, no stdint.h?)'
1238fi
1239
1240echo -n 'checking for __LP64__... '
1241if $TARGET_WIN32
1242then
1243 echo 'need to set (win32 build)'
1244else
1245cat > $TF_C << EOF
1246#include <stdio.h>
1247
1248int main (void) {
1249#ifdef __LP64__
1250 fprintf(stderr, "set by compiler\n");
1251#else
1252 if ( sizeof(int) == sizeof(void*) ) {
1253  fprintf(stderr, "no need to set\n");
1254 } else {
1255  fprintf(stderr, "need to set\n");
1256  printf("\n#ifndef __LP64__\n#define __LP64__\n#endif\n\n");
1257 }
1258#endif
1259 return 0;
1260}
1261EOF
1262 if $CCTF 2> /dev/null;
1263 then
1264  $EXEC_HELPER $TF_E >&3 2> /dev/null
1265 else
1266  echo 'error, can not compile'
1267  exit 1
1268 fi
1269fi
1270
1271echo -n 'checking for 64 bit types... '
1272if $TARGET_WIN32
1273then
1274 echo 'int64_t, uint64_t (win32 build)'
1275 echo '#define ROAR_NATIVE_INT64  int64_t'  >&3
1276 echo '#define ROAR_NATIVE_UINT64 uint64_t' >&3
1277else
1278cat > $TF_C << EOF
1279#include <stdio.h>
1280#include <stdint.h>
1281
1282int main (void) {
1283 char * i64 = NULL, * ui64 = NULL;
1284
1285 if ( sizeof(int) == 8 ) {
1286  i64 = "int"; ui64 = "unsigned int";
1287 } else if ( sizeof(long int) == 8 ) {
1288  i64 = "long int"; ui64 = "unsigned long int";
1289 } else if ( sizeof(long long int) == 8 ) {
1290  i64 = "long long int"; ui64 = "unsigned long long int";
1291 } else if ( sizeof(int64_t) == 8 ) {
1292  i64 = "int64_t"; ui64 = "uint64_t";
1293 } else {
1294  fprintf(stderr, "none\n");
1295  return 0;
1296 }
1297
1298 fprintf(stderr, "%s, %s\n", i64, ui64);
1299 printf("#define ROAR_NATIVE_INT64 %s\n#define ROAR_NATIVE_UINT64 %s\n", i64, ui64);
1300
1301 return 0;
1302}
1303EOF
1304 if $CCTF 2> /dev/null;
1305 then
1306  $EXEC_HELPER $TF_E >&3 2> /dev/null
1307 else
1308  echo 'error, can not compile'
1309  exit 1
1310 fi
1311fi
1312
1313
1314echo -n 'checking if cp supports -v... '
1315if cp -v --help > /dev/null 2> /dev/null
1316then
1317 echo "cp_v=-v" >&4
1318 echo yes
1319else
1320 echo "cp_v=" >&4
1321 echo no
1322fi
1323
1324echo -n 'checking for cdrom device... '
1325if [ -e "$CDROM" ]
1326then
1327 echo "$CDROM"
1328 echo '#define ROAR_DEFAULT_CDROM "'"$CDROM"'"' >&3
1329 echo '#define ROAR_HAVE_CDROM' >&3
1330elif $CROSS_COMPILE
1331then
1332 echo 'none (cross compiling, use --cdrom to enable CDROM support)'
1333else
1334 CDROM=$(ls /dev/cdrom /dev/rcd0c 2> /dev/null | head -n 1);
1335 if [ -e "$CDROM" ]
1336 then
1337  echo "$CDROM"
1338  echo '#define ROAR_DEFAULT_CDROM "'"$CDROM"'"' >&3
1339  echo '#define ROAR_HAVE_CDROM' >&3
1340 else
1341  echo 'none'
1342  echo '#define ROAR_HAVE_CDROM' >&3
1343 fi
1344fi
1345
1346echo -n 'checking for default tty device... '
1347if [ -e "$TTY_DEV" ]
1348then
1349 echo "$TTY_DEV"
1350 echo '#define ROAR_DEFAULT_TTY "'"$TTY_DEV"'"' >&3
1351else
1352 TTY_DEV=$(ls /dev/tty 2> /dev/null | head -n 1);
1353 if [ -e "$TTY_DEV" ]
1354 then
1355  echo "$TTY_DEV"
1356  echo '#define ROAR_DEFAULT_TTY "'"$TTY_DEV"'"' >&3
1357 else
1358  echo 'none'
1359 fi
1360fi
1361
1362echo -n 'checking for OSS device... '
1363if [ -e "$OSS_DEV" ]
1364then
1365 echo "$OSS_DEV"
1366 echo '#define ROAR_DEFAULT_OSS_DEV "'"$OSS_DEV"'"' >&3
1367else
1368 OSS_DEV=$(ls /dev/dsp /dev/audio 2> /dev/null | head -n 1);
1369 if [ -e "$OSS_DEV" ]
1370 then
1371  echo "$OSS_DEV"
1372  echo '#define ROAR_DEFAULT_OSS_DEV "'"$OSS_DEV"'"' >&3
1373 else
1374  echo 'none'
1375 fi
1376fi
1377
1378echo 'checking for decnet status file... '"$PROC_NET_DECNET"
1379echo '#define ROAR_PROC_NET_DECNET "'"$PROC_NET_DECNET"'"' >&3
1380
1381
1382echo 'checking for default audio group... '"$DEFAULT_GRP"
1383echo '#define ROAR_DEFAULT_SOCKGRP "'"$DEFAULT_GRP"'"' >&3
1384
1385
1386$NEED_GNU_SOURCE && echo '#define ROAR_NEED_GNU_SOURCE' >&3
1387
1388cat >&3 << EOF
1389
1390#endif
1391
1392//ll
1393EOF
1394
1395echo >&5
1396echo '//ll' >&5
1397
1398echo >&4
1399echo >&4
1400
1401cd plugins
1402
1403if $LIBAO
1404then
1405 echo 'running libao plugin configure...'
1406  cd ao/
1407 if [ "$AO_INST_DIR" = '' ]
1408 then
1409  ./configure --force-have-roar --pkg-config "$PKG_CONFIG"                           && \
1410    echo "subdir_plugins_ao=plugins/ao" >&4
1411 else
1412  ./configure --force-have-roar --pkg-config "$PKG_CONFIG" --inst-dir "$AO_INST_DIR" && \
1413    echo "subdir_plugins_ao=plugins/ao" >&4
1414 fi
1415 cd ..
1416else
1417 echo "running libao plugin configure... disabled by user"
1418fi
1419
1420if $XMMS
1421then
1422 echo 'running xmms plugin configure...'
1423 cd xmms/
1424  ./configure --force-have-roar --pkg-config "$PKG_CONFIG" --inst-dir "$XMMS_INST_DIR" && \
1425    echo "subdir_plugins_xmms=plugins/xmms" >&4
1426 cd ..
1427else
1428 echo "running xmms plugin configure... disabled by user"
1429fi
1430
1431if $AUDACIOUS
1432then
1433 echo 'running Audacious plugin configure...'
1434 cd audacious/
1435  ./configure --force-have-roar --pkg-config "$PKG_CONFIG" --inst-dir "$AUDACIOUS_INST_DIR" && \
1436    echo "subdir_plugins_audacious=plugins/audacious" >&4
1437 cd ..
1438else
1439 echo "running Audacious plugin configure... disabled by user"
1440fi
1441
1442cd ..
1443
1444rm -f $TF_C $TF_E
1445
1446mv config.h include/roaraudio/
1447echo 'config.h created and moved into include/roaraudio/'
1448
1449if $TARGET_CYGWIN
1450then
1451 rm -f $TF_E.exe
1452 echo 'patching Makefiles for cygwin...'
1453 find . -name Makefile -print0 | xargs -0 sed 's/\.so/.dll'/g -i
1454fi
1455
1456#ll
Note: See TracBrowser for help on using the repository browser.