source: roaraudio/configure @ 5810:d44ff4605fa5

Last change on this file since 5810:d44ff4605fa5 was 5810:d44ff4605fa5, checked in by phi, 9 years ago

added a lot paths to our path config (roar_libroar_get_path())

  • Property exe set to *
File size: 52.9 KB
Line 
1#!/bin/sh
2
3CWD="`pwd`"
4ROAR_BUILDSYSTEM_DIR="$CWD/build-system"
5ROAR_BUILDSYSTEM_DEFPREFIX="ROAR_"
6
7. "$ROAR_BUILDSYSTEM_DIR/configure.all"
8
9PATH="$PATH":/sbin:/usr/sbin:/usr/local/sbin:/usr/pkg/sbin # Ensure superuser paths
10PATH="$PATH":/usr/lib/ssh:/usr/lib/openssh                 # Ensure SSH paths
11
12#set -x
13
14# IDs officaly assigned
15DEV_VENDOR=0
16DEV_VENDOR_NAME='RoarAudio'
17#--------
18
19COMPBIN_SUFFIX='.r'
20RUNTIME_DETECT=false
21
22PREFIX_COMP_LIBS=''
23PREFIX_COMP_BINS=''
24PREFIX_PLUGINS=''
25PREFIX_BUILDSYSTEM=''
26
27CDROM_IS_DEV=true
28CDROM=""
29OSS_DEV=""
30OSS_MIX_DEV=""
31PROC_NET_DECNET="/proc/net/decnet"
32PROC_NET_DECNET_NEIGH=""
33PROC_NET_ARP=""
34TTY_DEV=""
35
36VORBIS_BITS=32
37
38FSYNC=false
39
40DEFAULT_GRP=''
41
42AO_INST_DIR=''
43XMMS_INST_DIR=''
44AUDACIOUS_INST_DIR=''
45
46SNDIO_EMUL=true
47
48LIBAO=true
49XMMS=true
50AUDACIOUS=true
51
52DEFAULT_RATE=''
53DEFAULT_CHANNELS=''
54DEFAULT_BITS=''
55
56COMP_LIBS=true
57COMP_ROARD=true
58COMP_CLIENTS=true
59COMP_DOC=true
60COMP_COMP_BINS=true
61COMP_PLUGINS=true
62
63ALAW=true
64MULAW=true
65ALAW_RW=true
66MULAW_RW=true
67
68PROXY=true
69
70PASSWORD_API=true
71
72NO_LISTEN=false
73
74META_DATA=true
75
76SUPPORT_TRAP=false
77
78USE_MEMMGR=false
79
80WITHOUT_CF='cmd'
81
82WITHOUT_VIO=''
83
84WITHOUT_DCOMP=''
85
86ROAR_DRIVER_DEFAULT=''
87ROAR_DRIVER_CODEC=''
88
89ROARD_BITS=''  # Bits per sample used by roard.
90ROARD_CFREQ='' # cycle frequens for roard, normally 100Hz
91
92# Libs which are per default disabled:
93no_lib_ssl=true
94no_lib_gcrypt=true
95
96test_pkgversion
97test_buildstamp
98test_cc
99test_ranlib
100test_pkgconfig
101test_sysname
102
103#Makefile.conf not yet open, write it later
104
105while [ "$1" != '' ]
106do
107 parse_option "$@"
108 shift $SHIFT_COUNT
109 $HANDLED && continue;
110
111 case "$1" in
112  '--help')
113   write_help
114   echo 'OPTIONS:'
115   echo
116   echo '--help                      - This Help'
117   echo
118   echo '--cdrom DEV                 - Set default CDRum device'
119   echo '--tty DEV                   - Set default TTY'
120   echo '--oss-dev DEV               - Set default OSS device'
121   echo '--oss-mixer-dev DEV         - Set default OSS mixer device'
122   echo '--proc-net-decnet FILE      - Set DECnet file for DECnet support auto detecting'
123   echo '                              (ignore this on non-Linux)'
124   echo '--proc-net-decnet-neigh FILE'
125   echo '                            - Set file for DECnet neighbour table'
126   echo '--proc-net-arp FILE         - Set file for IP neighbour (ARP) table'
127   echo '--audio-group GROUP         - Sets group of audio permitted users'
128   echo
129   echo '--runtime-detect            - do as much as posible auto detecting on runtime (for distributors)'
130   echo
131   echo '--ao-install-dir DIR        - Set install dir for libao plugin'
132   echo '--xmms-install-dir DIR      - Set install dir for XMMS plugin'
133   echo '--audacious-install-dir DIR - Set install dir for Audacious plugin'
134   echo
135   echo '--prefix-comp-libs DIR      - Set prefix for compatibility libraries (default: $PREFIX_LIB/roaraudio/complibs)'
136   echo '--prefix-comp-bins DIR      - Set prefix for compatibility binaries  (default: $PREFIX_LIB/roaraudio/compbins)'
137   echo '--prefix-plugins DIR        - Set prefix for plugin search path (default: $PREFIX_LIB/roaraudio/plugins)'
138   echo '--prefix-buildsystem DIR    - Set prefix for plugin search path (default: $PREFIX_LIB/roaraudio/build-system)'
139   echo
140   echo '--default-rate RATE         - Set default sample rate for roard and roarclients'
141   echo '--default-channels CHANNELS - Set default number of channels for roard and roarclients'
142   echo '--default-bits BITS         - Set default number of bits per sample for roarclients'
143   echo '--default-driver DRIVER     - Set default driver for roard'
144   echo '--default-codec CODEC       - Set default codec used for the default driver'
145   echo
146   echo '--without-alaw              - Disable support of A-Law codec (de- and encoding)'
147   echo '--without-alaw-rw           - Disable support for writing A-Law (saves 8KB)'
148   echo '--without-mulaw             - Disable support of mu-Law codec (de- and encoding)'
149   echo '--without-mulaw-rw          - Disable support for writing mu-Law (saves 16KB)'
150   echo '--without-proxy             - Disable support for proxies'
151   echo
152   echo '--without-comp-libs         - Disable build of libraries'
153   echo '--without-comp-roard        - Disable build of roard'
154   echo '--without-comp-clients      - Disable build of clients'
155   echo '--without-comp-doc          - Disable build of documentation'
156   echo '--without-comp-comp-bins    - Disable build of compatibility binaries'
157   echo
158   echo '--without-dcomp-COMP        - Disable build of roard'\''s component COMP'
159   echo
160   echo '--without-meta-data         - Disable support for Meta Data'
161   echo
162   echo '--without-cf-cmd            - Disable support for command codecfilter'
163   echo
164   echo '--without-vio-MODULE        - Disable support for VIO module MODULE'
165   echo
166   echo '--without-password-api      - Disable build of Password API'
167   echo '--with-trap-api             - Build with Trap support'
168   echo
169   echo '--with-memory-api           - Use internal memory API (memmgr)'
170   echo '--without-memory-api        - Do not use internal memory API (memmgr)'
171   echo
172   echo '--without-listen            - Disable listening sockets in roard'
173   echo '                              This is the same as allways using --no-listen'
174   echo
175   echo '--roard-cfreq FREQ          - Sets the cycle frequency of roard in Hz'
176   echo '--roard-bits  BITS          - Sets the number of bits per sample used by roard'
177   echo '--vorbis-bits BITS          - Sets bits per sample used by Vorbis code'
178   echo
179#   echo '--without-libao             - Disable build of libao plugin'
180   echo '--without-xmms              - Disable build of XMMS plugin'
181#   echo '--without-audacious         - Disable build of Audacious plugin'
182   echo
183   echo '--minimal                   - Disable all optional components'
184   echo '--cross-compile             - Enable cross compiler workarounds'
185   echo '--target-microcontroller    - Set Options for mircocontrollers without a OS'
186   echo '                              Implys --cross-compile'
187   echo
188   echo
189   echo 'LIBRARY NAMES (to be used with --no-* and --maybe-*):'
190   echo
191   grep '^test_lib_defmake ROAR_' configure | awk '{print $5 == "c" ? $4 : $5}' | grep -v '\.h'\''*$' | \
192    cut -d/ -f1 | sort | uniq | grep -v ^c$ | \
193    while read lib
194    do
195     envlib=`echo "$lib" | to_escaped`
196     eval _no="\$no_lib_$envlib";
197     if [ "$_no" != '' ]
198     then
199      echo -n "$lib (disabled) "
200     else
201      echo -n "$lib "
202     fi
203    done
204   echo '' # print \n
205   exit 0;
206  ;;
207  '--cdrom')
208   CDROM="$2"
209   shift;
210  ;;
211  '--tty')
212   TTY_DEV="$2"
213   shift;
214  ;;
215  '--oss-dev')
216   OSS_DEV="$2"
217   shift;
218  ;;
219  '--oss-mixer-dev')
220   OSS_MIX_DEV="$2"
221   shift;
222  ;;
223  '--proc-net-decnet')
224   PROC_NET_DECNET="$2"
225   shift;
226  ;;
227  '--proc-net-decnet-neigh')
228   PROC_NET_DECNET_NEIGH="$2"
229   shift;
230  ;;
231  '--proc-net-arp')
232   PROC_NET_ARP="$2"
233   shift;
234  ;;
235  '--audio-group')
236   DEFAULT_GRP="$2"
237   shift;
238  ;;
239  '--runtime-detect')
240   RUNTIME_DETECT=true
241  ;;
242  '--ao-install-dir')
243   AO_INST_DIR="$2"
244   shift;
245  ;;
246  '--xmms-install-dir')
247   XMMS_INST_DIR="$2"
248   shift;
249  ;;
250  '--audacious-install-dir')
251   AUDACIOUS_INST_DIR="$2"
252   shift;
253  ;;
254  '--default-rate')
255   DEFAULT_RATE="$2"
256   shift;
257  ;;
258  '--default-channels')
259   DEFAULT_CHANNELS="$2"
260   shift;
261  ;;
262  '--default-bits')
263   DEFAULT_BITS="$2"
264   shift;
265  ;;
266  '--default-driver')
267   ROAR_DRIVER_DEFAULT="$2"
268   shift;
269  ;;
270  '--default-codec')
271   ROAR_DRIVER_CODEC="$2"
272   shift;
273  ;;
274  '--without-alaw')
275   ALAW=false
276   ALAW_RW=false
277  ;;
278  '--without-alaw-rw')
279   ALAW_RW=false
280  ;;
281  '--without-mulaw')
282   MULAW=false
283   MULAW_RW=false
284  ;;
285  '--without-mulaw-rw')
286   MULAW_RW=false
287  ;;
288  '--without-proxy')
289   PROXY=false
290  ;;
291  '--without-comp-libs')
292   COMP_LIBS=false
293  ;;
294  '--without-comp-roard')
295   COMP_ROARD=false
296  ;;
297  '--without-comp-clients')
298   COMP_CLIENTS=false
299  ;;
300  '--without-comp-doc')
301   COMP_DOC=false
302  ;;
303  '--without-comp-comp-bins')
304   COMP_COMP_BINS=false
305  ;;
306  '--without-comp-plugins')
307   COMP_PLUGINS=false
308  ;;
309  '--without-meta-data')
310   META_DATA=false
311  ;;
312  '--without-cf-'*)
313   WITHOUT_CF="$WITHOUT_CF"' '$(echo "$1" | cut -d- -f5)
314  ;;
315  '--without-vio-'*)
316   WITHOUT_VIO="$WITHOUT_VIO"' '$(echo "$1" | cut -d- -f5)
317  ;;
318  '--without-dcomp-'*)
319   WITHOUT_DCOMP="$WITHOUT_DCOMP"' '$(echo "$1" | cut -d- -f5)
320  ;;
321  '--without-password-api')
322   PASSWORD_API=false
323  ;;
324  '--with-trap-api')
325   SUPPORT_TRAP=true
326  ;;
327  '--with-memory-api'|'--use-memory-api')
328   USE_MEMMGR=true
329  ;;
330  '--without-memory-api')
331   USE_MEMMGR=false
332  ;;
333  '--without-listen')
334   NO_LISTEN=true
335  ;;
336  '--roard-cfreq')
337   ROARD_CFREQ="$2"
338   shift;
339  ;;
340  '--roard-bits')
341   ROARD_BITS="$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   SUPPORT_TRAP=false
372   USE_MEMMGR=false
373   WITHOUT_VIO="$WITHOUT_VIO"' cmd stdio'
374   WITHOUT_CF="$WITHOUT_CF"' wave cmd cf au'
375   WITHOUT_DCOMP="$WITHOUT_DCOMP"' sources ssynth cb midi light raw rdtcs cdriver emul_esd emul_simple emul_rsound emul_rplay emul_gopher mixer'
376  ;;
377  # we should remove --prefix-comp soon
378  '--prefix-comp'|'--prefix-comp-libs')
379   PREFIX_COMP_LIBS="$2"
380   shift;
381  ;;
382  '--prefix-comp-bins')
383   PREFIX_COMP_BINS="$2"
384   shift;
385  ;;
386  '--prefix-plugins')
387   PREFIX_PLUGINS="$2"
388   shift;
389  ;;
390  '--prefix-buildsystem')
391   PREFIX_BUILDSYSTEM="$2"
392   shift;
393  ;;
394####################################
395# autof* options block:
396  '--prefix-comp-libs='*)
397   PREFIX_COMP_LIBS=$(echo "$1" | cut -d= -f2)
398  ;;
399  '--prefix-comp-bins='*)
400   PREFIX_COMP_BINS=$(echo "$1" | cut -d= -f2)
401  ;;
402  '--prefix-plugins='*)
403   PREFIX_PLUGINS=$(echo "$1" | cut -d= -f2)
404  ;;
405  '--prefix-buildsystem='*)
406   PREFIX_BUILDSYSTEM=$(echo "$1" | cut -d= -f2)
407  ;;
408####################################
409  '--cross-compile')
410   CROSS_COMPILE=true
411   RUNTIME_DETECT=true
412  ;;
413  '--target-microcontroller')
414   TARGET_MICROCONTROLLER=true
415   CROSS_COMPILE=true
416   RUNTIME_DETECT=true
417   HAVE_MAIN_ARGS=false
418   XMMS=false
419   AUDACIOUS=false
420   LIBAO=false
421   WITHOUT_VIO="$WITHOUT_VIO"' cmd'
422  ;;
423 esac;
424
425 shift;
426done
427
428[ "$no_lib_yiff" != '' ] && no_lib_y2=true
429
430if $BETA
431then
432 :
433else
434 WITHOUT_DCOMP="$WITHOUT_DCOMP"' rdtcs'
435 no_lib_gcrypt=true
436 no_lib_jack=true
437 no_lib_dbus_1=true
438 no_lib_flac=true
439fi
440
441if $EXPERIMENTAL
442then
443 :
444else
445 : # Add list of experimental things here.
446fi
447
448open_configure_files
449update_target
450
451if $TARGET_WIN32
452then
453 CROSS_COMPILE=true
454 RUNTIME_DETECT=true
455 no_lib_dnet=true
456 PROXY=false
457 LIBAO=false
458 XMMS=false
459 AUDACIOUS=false
460 WITHOUT_VIO="$WITHOUT_VIO"' pipe cmd' # hope that with buffered pipes we can remove this soon
461 WITHOUT_DCOMP="$WITHOUT_DCOMP"' cb'
462# [ "$ROARD_CFREQ" = '' ] && ROARD_CFREQ=20
463fi
464
465if [ "$SYSNAME" = 'FreeBSD' ]
466then
467 echo "Adding $SYSNAME search path arguments..."
468 [ "$DEFAULT_GRP" = '' ] && DEFAULT_GRP='wheel'
469elif $TARGET_WIN32
470then
471 echo "Adding win32 build arguments..."
472 COMPBIN_SUFFIX='.bat'
473elif $TARGET_CYGWIN
474then
475 echo "Adding cygwin build arguments..."
476 COMPBIN_SUFFIX='.bat'
477fi
478
479test_crosscompile
480
481update_prefixes
482[ "$PREFIX_COMP_LIBS"   = '' ] && PREFIX_COMP_LIBS="$PREFIX_LIB/roaraudio/complibs/"
483[ "$PREFIX_COMP_BINS"   = '' ] && PREFIX_COMP_BINS="$PREFIX_LIB/roaraudio/compbins/"
484[ "$PREFIX_PLUGINS"     = '' ] && PREFIX_PLUGINS="$PREFIX_LIB/roaraudio/plugins/"
485[ "$PREFIX_BUILDSYSTEM" = '' ] && PREFIX_BUILDSYSTEM="$PREFIX_LIB/roaraudio/build-system/"
486
487[ "$DEFAULT_GRP" = '' ] && DEFAULT_GRP='audio'
488
489update_ccft
490update_cc
491
492test_wextra
493
494# now write the cc name to Makefile.conf
495write_header_makefileconf
496{
497 echo "DEV_VENDOR=$DEV_VENDOR"
498 echo "DEV_VENDOR_NAME=$DEV_VENDOR_NAME"
499 echo "DEV_VENDOR_STRING=$DEV_VENDOR/$DEV_VENDOR_NAME"
500 echo
501 echo "COMPBIN_SUFFIX=$COMPBIN_SUFFIX"
502 echo
503 echo "PREFIX_COMP_LIBS=$PREFIX_COMP_LIBS"
504 echo "PREFIX_COMP_BINS=$PREFIX_COMP_BINS"
505 echo "PREFIX_PLUGINS=$PREFIX_PLUGINS"
506 echo "PREFIX_BUILDSYSTEM=$PREFIX_BUILDSYSTEM"
507 echo
508 $COMP_LIBS      && echo "comp_libs=libroar libroardsp libroarmidi libroarlight libroareio"
509 $COMP_ROARD     && echo "comp_roard=roard"
510 $COMP_CLIENTS   && echo "comp_clients=roarclients"
511 $COMP_DOC       && echo "comp_doc=doc"
512 $COMP_COMP_BINS && echo "comp_comp_bins=compbins"
513 echo
514 $SNDIO_EMUL && echo "subdir_libroarsndio=libroarsndio"
515 echo "subdir_libroaross=libroaross" # this builds an empty file in case of not supported
516} >&4
517
518write_header_configlog RUNTIME_DETECT
519write_header_configh _ROARAUDIO_CONFIG_H_
520
521{
522 echo "#define ROAR_VERSION_STRING \"$VERSION\""
523 grep -E '^COMMON_V_(MAJOR|MINOR|REV) *= [0-9]*$' Makefile.inc | sed 's/^COMMON_V_/#define ROAR_VERSION_/; s/=//'
524 echo "#define ROAR_BUILD_STAMP    \"$BUILD_STAMP\""
525 echo
526 [ "$DEFAULT_RATE"        = '' ] || echo "#define ROAR_RATE_DEFAULT     $DEFAULT_RATE"
527 [ "$DEFAULT_CHANNELS"    = '' ] || echo "#define ROAR_CHANNELS_DEFAULT $DEFAULT_CHANNELS"
528 [ "$DEFAULT_BITS"        = '' ] || echo "#define ROAR_BITS_DEFAULT     $DEFAULT_BITS"
529 [ "$ROAR_DRIVER_DEFAULT" = '' ] || echo "#define ROAR_DRIVER_DEFAULT   \"$ROAR_DRIVER_DEFAULT\""
530 [ "$ROAR_DRIVER_CODEC"   = '' ] || echo "#define ROAR_DRIVER_CODEC     \"$ROAR_DRIVER_CODEC\""
531 echo
532 [ "$ROARD_CFREQ"         = '' ] || echo "#define ROAR_OUTPUT_CFREQ     $ROARD_CFREQ"
533 [ "$ROARD_BITS"          = '' ] || echo "#define ROAR_ROARD_BITS       $ROARD_BITS"
534 echo "#define ROAR_VORBIS_BITS      $VORBIS_BITS"
535 echo
536 echo "#define ROAR_SHARED_SUFFIX \"$SHARED_SUFFIX\""
537 echo
538 echo "#define ROAR_PREFIX         \"$PREFIX\""
539 echo "#define ROAR_PREFIX_BIN     \"$PREFIX_BIN\""
540 echo "#define ROAR_PREFIX_SBIN    \"$PREFIX_SBIN\""
541 echo "#define ROAR_PREFIX_LIB     \"$PREFIX_LIB\""
542 echo "#define ROAR_PREFIX_INC     \"$PREFIX_INC\""
543 echo "#define ROAR_PREFIX_MAN     \"$PREFIX_MAN\""
544 echo "#define ROAR_PREFIX_PC      \"$PREFIX_PC\""
545 echo "#define ROAR_PREFIX_CKPORT  \"$PREFIX_CKPORT\""
546 echo "#define ROAR_PREFIX_SYSCONF \"$PREFIX_SYSCONF\""
547 echo "#define ROAR_PREFIX_DEV     \"$PREFIX_DEV\""
548 echo "#define ROAR_PREFIX_DOC     \"$PREFIX_DOC\""
549 echo "#define ROAR_PREFIX_TMP     \"$PREFIX_TMP\""
550 echo "#define ROAR_PREFIX_VAR     \"$PREFIX_VAR\""
551 echo "#define ROAR_PREFIX_CACHE   \"$PREFIX_CACHE\""
552 echo "#define ROAR_PREFIX_DATA    \"$PREFIX_DATA\""
553 echo "#define ROAR_PREFIX_LOCK    \"$PREFIX_LOCK\""
554 echo "#define ROAR_PREFIX_LOG     \"$PREFIX_LOG\""
555 echo "#define ROAR_PREFIX_MAIL    \"$PREFIX_MAIL\""
556 echo "#define ROAR_PREFIX_RUN     \"$PREFIX_RUN\""
557 echo "#define ROAR_PREFIX_SPOOL   \"$PREFIX_SPOOL\""
558 echo "#define ROAR_PREFIX_COMP_LIBS \"$PREFIX_COMP_LIBS\""
559 echo "#define ROAR_PREFIX_COMP_BINS \"$PREFIX_COMP_BINS\""
560 echo "#define ROAR_PREFIX_PLUGINS \"$PREFIX_PLUGINS\""
561 echo "#define ROAR_PREFIX_BUILDSYSTEM \"$PREFIX_BUILDSYSTEM\""
562 echo
563 $MINIMAL      && echo '#define ROAR_MINIMAL'
564 $BETA         && echo '#define ROAR_BETA'
565 $EXPERIMENTAL && echo '#define ROAR_EXPERIMENTAL'
566 $ALAW         && echo '#define ROAR_SUPPORT_ALAW'
567 $ALAW_RW      && echo '#define ROAR_SUPPORT_ALAW_RW'
568 $MULAW        && echo '#define ROAR_SUPPORT_MULAW'
569 $MULAW_RW     && echo '#define ROAR_SUPPORT_MULAW_RW'
570 $PROXY        && echo '#define ROAR_SUPPORT_PROXY'
571 $PASSWORD_API && echo '#define ROAR_SUPPORT_PASSWORD_API'
572 $SUPPORT_TRAP && echo '#define ROAR_SUPPORT_TRAP'
573 $USE_MEMMGR   && echo '#define ROAR_USE_MEMMGR'
574 $NO_LISTEN    || echo '#define ROAR_SUPPORT_LISTEN'
575 $META_DATA    && echo '#define ROAR_SUPPORT_META'
576 echo
577
578 $HAVE_MAIN_ARGS && echo '#define ROAR_HAVE_MAIN_ARGS'
579
580 echo
581
582 for i in $WITHOUT_CF
583 do
584  i=$(echo $i | to_upper);
585  echo '#define ROAR_WITHOUT_CF_'$i
586 done
587
588 for i in $WITHOUT_VIO
589 do
590  i=$(echo $i | to_upper);
591  echo '#define ROAR_WITHOUT_VIO_'$i
592 done
593
594 for i in $WITHOUT_DCOMP
595 do
596  i=$(echo $i | to_upper);
597  echo '#define ROAR_WITHOUT_DCOMP_'$i
598 done
599
600 echo
601 $TARGET_MICROCONTROLLER && echo '#define ROAR_TARGET_MICROCONTROLLER'
602 $TARGET_WIN32           && echo '#define ROAR_TARGET_WIN32'
603 $TARGET_CYGWIN          && echo '#define ROAR_TARGET_CYGWIN'
604                            echo '#define ROAR_OS_'$(echo $SYSNAME | to_escaped | to_upper)
605 echo
606} >&3
607
608# test binary format.
609test_bin_format
610test_linkdeps
611
612#                 #define                   name         cmds...
613test_tool_defmake ROAR_HAVE_BIN_OGG123      ogg123       ogg123
614test_tool_defmake ROAR_HAVE_BIN_FLAC        flac         flac
615test_tool_defmake ROAR_HAVE_BIN_TIMIDITY    TiMidity++   timidity
616test_tool_defmake ROAR_HAVE_BIN_CDPARANOIA  cdparanoia   cdparanoia
617test_tool_defmake ROAR_HAVE_BIN_GNUPLOT     gnuplot      gnuplot
618test_tool_defmake ROAR_HAVE_BIN_SSH         OpenSSH      ssh
619test_tool_defmake ROAR_HAVE_BIN_PINENTRY    PIN-Entry    pinentry
620test_tool_defmake ROAR_HAVE_BIN_SSH_ASKPASS SSH-AskPass  ssh-askpass
621test_tool_defmake ROAR_HAVE_BIN_GTK_LED_ASKPASS GTK-LED-AskPass gtk-led-askpass
622test_tool_defmake ROAR_HAVE_BIN_X11_SSH_ASKPASS X11-SSH-AskPass x11-ssh-askpass
623test_tool_defmake ROAR_HAVE_BIN_GNOME_SSH_ASKPASS GNOME-SSH-AskPass gnome-ssh-askpass
624test_tool_defmake ROAR_HAVE_BIN_GPG         GnuPG        gpg
625test_tool_defmake ROAR_HAVE_BIN_EJECT       eject        eject
626
627echo >&3
628echo >&5
629echo >&5
630echo >&5
631
632# Those tests should not be disabled as they do not reduce the lib size just
633# break --minimal on full systems
634OLD_MINIMAL=$MINIMAL
635MINIMAL=false
636# Test haders:
637test_lib_defmake ROAR_HAVE_H_STDINT      %            stdint.h      c          -- stdint.h
638test_lib_defmake ROAR_HAVE_H_STRING      %            string.h      c          -- string.h
639test_lib_defmake ROAR_HAVE_H_SYS_TYPES   %            sys/types.h   c          -- sys/types.h
640test_lib_defmake ROAR_HAVE_H_SYS_SOCKET  %            sys/socket.h  c          -- sys/types.h sys/socket.h
641test_lib_defmake ROAR_HAVE_H_SYS_TIME    %            sys/time.h    c          -- sys/time.h
642test_lib_defmake ROAR_HAVE_H_SYS_IOCTL   %            sys/ioctl.h   c          -- sys/ioctl.h
643test_lib_defmake ROAR_HAVE_H_SYS_STAT    %            sys/stat.h    c          -- sys/types.h sys/stat.h
644test_lib_defmake ROAR_HAVE_H_SYS_REBOOT  %            sys/reboot.h  c          -- sys/reboot.h
645test_lib_defmake ROAR_HAVE_H_TIME        %            time.h        c          -- time.h
646test_lib_defmake ROAR_HAVE_H_FCNTL       %            fcntl.h       c          -- fcntl.h
647test_lib_defmake ROAR_HAVE_H_UNISTD      %            unistd.h      c          -- unistd.h
648test_lib_defmake ROAR_HAVE_H_DIRENT      %            dirent.h      c          -- dirent.h
649test_lib_defmake ROAR_HAVE_H_STDLIB      %            stdlib.h      c          -- stdlib.h
650test_lib_defmake ROAR_HAVE_H_SIGNAL      %            signal.h      c          -- signal.h
651test_lib_defmake ROAR_HAVE_H_POLL        %            poll.h        c          -- poll.h
652test_lib_defmake ROAR_HAVE_H_MMSYSTEM    %            mmsystem.h    c          -- windows.h mmsystem.h
653test_lib_defmake ROAR_HAVE_H_ESD         libroaresd   esd.h         c          -- esd.h
654test_lib_defmake ROAR_HAVE_H_ARTSC       libroararts  artsc.h       c          -- kde/artsc/artsc.h
655test_lib_defmake ROAR_HAVE_H_ICONV       %            iconv.h       c          -- iconv.h
656test_lib_defmake ROAR_HAVE_H_NETINET_IN  %            'netinet/in.h' c         -- 'netinet/in.h'
657test_lib_defmake ROAR_HAVE_H_LINUX_REBOOT %            linux/reboot.h c        -- linux/reboot.h
658test_lib_defmake ROAR_HAVE_H_WINDOWS     %            windows.h     c          -- windows.h
659test_lib_defmake ROAR_HAVE_H_WINSOCK     %            winsock.h     c          -- winsock.h
660test_lib_defmake ROAR_HAVE_H_WINSOCK2    %            winsock2.h    c          -- winsock2.h
661MINIMAL=$OLD_MINIMAL
662
663#Those headers are checked with minimal mode as it is set by the user:
664test_lib_defmake ROAR_HAVE_H_DLFCN       %            dlfcn.h       c          -- dlfcn.h
665
666#                #define                 subdir       name           -lxxx      -- header
667test_lib_defmake ROAR_HAVE_LIBM          %            'MathLibrary'  m          -- math.h
668rt=''
669libname_rt=false
670if test_lib 'realtime Library' rt -- sys/mman.h mqueue.h semaphore.h
671then
672 {
673  echo '#define ROAR_HAVE_LIBRT'
674  echo '#define ROAR_NEED_LIBRT'
675  libname_rt=true
676  rt=rt
677 } >&3
678fi
679
680echo >&3
681
682#                #define                 subdir       name          -lxxx      -- header
683test_lib_defmake ROAR_HAVE_ESD           %            EsounD        esd        -- esd.h
684test_lib_defmake ROAR_HAVE_LIBAO         %            libao         ao         -- ao/ao.h ao/plugin.h
685test_lib_defmake ROAR_HAVE_LIBRAUM       %            RAUM          raum       -- raum.h
686test_lib_defmake ROAR_HAVE_LIBOGG        %            libogg        ogg        -- ogg/ogg.h
687test_lib_defmake ROAR_HAVE_LIBVORBIS     %            libvorbis     vorbis     -- vorbis/codec.h
688test_lib_defmake ROAR_HAVE_LIBVORBISFILE %            libvorbisfile vorbisfile -- vorbis/vorbisfile.h
689test_lib_defmake ROAR_HAVE_LIBVORBISENC  %            libvorbisenc  vorbisenc  -- vorbis/vorbisenc.h
690test_lib_defmake ROAR_HAVE_LIBSPEEX      %            libspeex      speex      -- speex/speex.h speex/speex_stereo.h
691test_lib_defmake ROAR_HAVE_LIBSPEEXDSP   %            libspeexdsp   speexdsp   -- speex/speex.h speex/speex_echo.h
692test_lib_defmake ROAR_HAVE_LIBCELT       %            libcelt       celt       -- celt/celt.h celt/celt_header.h
693test_lib_defmake ROAR_HAVE_LIBCELT0      %            libcelt0      celt0      -- celt/celt.h celt/celt_header.h
694test_lib_defmake ROAR_HAVE_LIBOGGZ       %            liboggz       oggz       -- oggz/oggz.h
695test_lib_defmake ROAR_HAVE_LIBSNDFILE    %            libsndfile    sndfile    -- sndfile.h
696test_lib_defmake ROAR_HAVE_LIBFISHSOUND  roarfish     libfishsound  fishsound  -- fishsound/fishsound.h
697test_lib_defmake ROAR_HAVE_LIBFLAC       %            libFLAC       FLAC       -- FLAC/all.h
698test_lib_defmake ROAR_HAVE_LIBSAMPLERATE %            libsamplerate samplerate -- samplerate.h
699test_lib_defmake ROAR_HAVE_LIBSHOUT      %            libshout      shout      -- shout/shout.h
700test_lib_defmake ROAR_HAVE_LIBPULSE      libroarpulse libpulse      pulse      -- pulse/pulseaudio.h pulse/simple.h
701test_lib_defmake ROAR_HAVE_LIBPULSESIMPLE %           libpulse-simple pulse-simple -- pulse/simple.h
702test_lib_defmake ROAR_HAVE_LIBY2         libroaryiff  libyiff       Y2         -- Y2/Y.h Y2/Ylib.h
703test_lib_defmake ROAR_HAVE_LIBARTSC      %            libartsc      artsc      -- kde/artsc/artsc.h
704test_lib_defmake ROAR_HAVE_LIBOSSAUDIO   %            libossaudio   ossaudio   -- sys/ioctl.h
705test_lib_defmake ROAR_HAVE_LIBSNDIO      %            libsndio      sndio      -- sndio.h
706test_lib_defmake ROAR_HAVE_LIBRSOUND     libroarrsound librsound    rsound     -- rsound.h
707test_lib_defmake ROAR_HAVE_LIBPORTAUDIO  %            PortAudio     portaudio  -- portaudio.h
708test_lib_defmake ROAR_HAVE_LIBPABLIO     %            PABLIO        pablio     -- pablio/pablio.h
709test_lib_defmake ROAR_HAVE_LIBSSL        %            OpenSSL       ssl        -- openssl/bio.h openssl/evp.h
710test_lib_defmake ROAR_HAVE_LIBSLP        %            OpenSLP       slp        -- slp.h
711test_lib_defmake ROAR_HAVE_LIBDNET       %            libdnet       dnet       -- sys/socket.h netdnet/dn.h netdnet/dnetdb.h
712OLD_MINIMAL=$MINIMAL
713MINIMAL=false
714test_lib_defmake ROAR_HAVE_BSDSOCKETS    %            BSDSockets    c          -- sys/types.h sys/socket.h
715test_lib_defmake ROAR_HAVE_UNIX          %            UNIX          c          -- sys/types.h sys/socket.h sys/un.h
716test_lib_defmake ROAR_HAVE_IPV4          %            IPv4          c          -- sys/types.h sys/socket.h 'netinet/in.h' winsock2.h
717MINIMAL=$OLD_MINIMAL
718test_lib_defmake ROAR_HAVE_IPX           %            IPX           c          -- netipx/ipx.h
719test_lib_defmake ROAR_HAVE_OSS           %            OSS           c          -- sys/ioctl.h sys/soundcard.h
720test_lib_defmake ROAR_HAVE_OSS_BSD       %            BSDOSS        c          -- sys/ioctl.h soundcard.h
721test_lib_defmake ROAR_HAVE_LIBWINMM      %            WinMM         winmm      -- windows.h mmsystem.h
722test_lib_defmake ROAR_HAVE_LIBASOUND     %            ALSA          asound     -- alsa/asoundlib.h alsa/pcm_external.h alsa/control_external.h
723test_lib_defmake ROAR_HAVE_LIBDL         %            DynLinkerLib  dl         -- dlfcn.h
724test_lib_defmake ROAR_HAVE_LIBZ          %            zlib          z          -- zlib.h
725test_lib_defmake ROAR_HAVE_LIBSENDFILE   %            sendfile      sendfile   -- sys/sendfile.h
726test_lib_defmake ROAR_HAVE_LIBSOCKET     %            libsocket     socket     -- sys/socket.h
727test_lib_defmake ROAR_HAVE_LIBX11        %            X11           X11        -- X11/Xlib.h X11/Xatom.h
728test_lib_defmake ROAR_HAVE_GTK_P_2_0     %            GTK+2.0       gtk+-2.0/t -- gtk/gtk.h gdk/gdkkeysyms.h
729test_lib_defmake ROAR_HAVE_LIBGCRYPT     %            libgcrypt     gcrypt     -- gcrypt.h
730test_lib_defmake ROAR_HAVE_LIBJACK       %            libjack       jack/t     -- jack/jack.h
731test_lib_defmake ROAR_HAVE_LIBUSTE       %            libuste       uste       -- uste.h
732test_netlibs
733
734echo >&3
735
736test_version ROAR_HAVE_CELT_VERSION      libcelt       celt
737test_version ROAR_HAVE_SPEEX_VERSION     libspeex      speex
738test_version ROAR_HAVE_PULSE_VERSION     libpulse      libpulse
739test_version ROAR_HAVE_GTK_P_2_0_VERSION GTK+2.0       gtk+-2.0
740test_version ROAR_HAVE_FLAC_VERSION      libflac       flac
741test_version ROAR_HAVE_PA19_VERSION      portaudio-19  portaudio-2.0
742
743echo >&3
744
745# Those tests should not be disabled as they do not reduce the lib size just
746# break --minimal on full systems
747
748OLD_MINIMAL=$MINIMAL
749MINIMAL=false
750# Test types:
751#         DEF                            type/name    init value               -- headers
752test_type ROAR_HAVE_T_ID_T               id_t
753test_type ROAR_HAVE_T_PID_T              pid_t
754test_type ROAR_HAVE_T_UID_T              uid_t
755test_type ROAR_HAVE_T_GID_T              gid_t
756test_type ROAR_HAVE_T_SOCKLEN_T          socklen_t    0                        -- sys/socket.h
757test_type ROAR_HAVE_T_MODE_T             mode_t
758test_type ROAR_HAVE_T_OFF_T              off_t
759test_type ROAR_HAVE_T_SSIZE_T            ssize_t
760test_type ROAR_HAVE_T_TIME_T             time_t
761test_type ROAR_HAVE_T_SA_FAMILY_T        sa_family_t  0                        -- sys/socket.h
762MINIMAL=$OLD_MINIMAL
763
764echo >&3
765
766# add a better test here
767#test_lib 'linux sendfile()'       -- sys/sendfile.h && echo '#define ROAR_HAVE_LINUX_SENDFILE' >&3
768
769
770echo -n 'checking for IPv6... '
771
772if $MINIMAL
773then
774 echo "disabled by user (minimalstic build)"
775else
776 echo '#include <sys/socket.h>'  > $TF_C
777 echo '#include <netinet/in.h>' >> $TF_C
778 echo 'int main (void) { struct sockaddr_in6 in6; return 0; }' >> $TF_C
779
780 if $CCTF 2> /dev/null;
781 then
782  echo '#define ROAR_HAVE_IPV6' >&3
783  echo yes
784 else
785  echo no
786 fi
787fi
788
789
790echo -n 'checking for _exit()... '
791
792echo '#include <unistd.h>'    > $TF_C
793echo 'int main (void) { _exit(0); return 0; }' >> $TF_C
794
795if $CCTF 2> /dev/null;
796then
797 echo '#define ROAR_HAVE_U_EXIT' >&3
798 echo '#define ROAR_U_EXIT _exit' >&3
799 echo yes
800else
801 echo '#define ROAR_U_EXIT exit' >&3
802 echo no
803fi
804
805#                 def                 name      call                         -- header
806test_func_defmake ROAR_HAVE_MALLOC    malloc    'malloc(0)'                  -- stdlib.h
807test_func_defmake ROAR_HAVE_CALLOC    calloc    'calloc(0, 0)'               -- stdlib.h
808test_func_defmake ROAR_HAVE_REALLOC   realloc   'realloc((void*)0, 0)'       -- stdlib.h
809test_func_defmake ROAR_HAVE_FREE      free      'free((void*)0)'             -- stdlib.h
810test_func_defmake ROAR_HAVE_STRDUP    strdup    'strdup((void*)0)'           -- string.h
811test_func_defmake ROAR_HAVE_STRNDUP   strndup   'strndup((void*)0)'          -- string.h
812test_func_defmake ROAR_HAVE_STRLEN    strlen    'strlen((void*)0)'           -- string.h
813test_func_defmake ROAR_HAVE_STRNLEN   strnlen   'strnlen((void*)0)'          -- string.h
814test_func_defmake ROAR_HAVE_SETENV    setenv    'setenv("", "", 0)'          -- stdlib.h
815test_func_defmake ROAR_HAVE_PUTENV    putenv    'putenv("")'                 -- stdlib.h
816test_func_defmake ROAR_HAVE_STRTOK_R  strtok_r  'strtok_r("","",(char**)0)'  -- string.h
817test_func_defmake ROAR_HAVE_STRLCPY   strlcpy   'strlcpy((char*)0, "", 0)'   -- string.h
818test_func_defmake ROAR_HAVE_STRLCAT   strlcat   'strlcat((char*)0, "", 0)'   -- string.h
819test_func_defmake ROAR_HAVE_QSORT     qsort     'qsort((void*)0, 0, 0, (int(*)(const void *, const void *))0)' -- stdlib.h
820test_func_defmake ROAR_HAVE_NICE      nice      'nice(0)'                    -- unistd.h
821test_func_defmake ROAR_HAVE_GETHOSTID gethostid 'gethostid()'                -- unistd.h
822test_func_defmake ROAR_HAVE_GETGID    getgid    'getgid()'                   -- sys/types.h unistd.h
823test_func_defmake ROAR_HAVE_GETUID    getuid    'getuid()'                   -- sys/types.h unistd.h
824test_func_defmake ROAR_HAVE_SETGID    setgid    'setgid(0)'                  -- sys/types.h unistd.h
825test_func_defmake ROAR_HAVE_SETUID    setuid    'setuid(0)'                  -- sys/types.h unistd.h
826test_func_defmake ROAR_HAVE_SETSID    setsid    'setsid()'                   -- sys/types.h unistd.h
827test_func_defmake ROAR_HAVE_GETPWNAM  getpwnam  'getpwnam("")'               -- sys/types.h pwd.h
828test_func_defmake ROAR_HAVE_GETGRNAM  getgrnam  'getgrnam("")'               -- sys/types.h grp.h
829test_func_defmake ROAR_HAVE_GETTIMEOFDAY gettimeofday 'struct timeval tv; gettimeofday(&tv, NULL)' -- sys/time.h time.h
830test_func_defmake ROAR_HAVE_USLEEP    usleep    'usleep(0)'                  -- sys/types.h unistd.h
831test_func_defmake ROAR_HAVE_SLEEP     sleep     'sleep(0)'                   -- unistd.h
832test_func_defmake ROAR_HAVE_NANOSLEEP nanosleep 'nanosleep((void*)0, (void*)0)' -- time.h
833test_func_defmake ROAR_HAVE_ALARM     alarm     'alarm(0)'                   -- sys/types.h unistd.h
834test_func_defmake ROAR_HAVE_TIME      time      'time((void*)0)'             -- time.h
835test_func_defmake ROAR_HAVE_CTIME     ctime     'ctime((void*)0)'            -- time.h
836test_func_defmake ROAR_HAVE_CTIME_R   ctime_r   'ctime_r((void*)0,(char*)0)' -- time.h
837test_func_defmake ROAR_HAVE_KILL      kill      'kill(0,0)'                  -- sys/types.h signal.h
838test_func_defmake ROAR_HAVE_UNAME     uname     'uname((void*)0)'            -- sys/utsname.h
839test_func_defmake ROAR_HAVE_GETHOSTNAME gethostname 'gethostname((void*)0, 0)' -- unistd.h
840test_func_defmake ROAR_HAVE_SYSLOG    syslog    'syslog(0, "")'              -- syslog.h
841test_func_defmake ROAR_HAVE_OPENLOG   openlog   'openlog("", 0, 0)'          -- syslog.h
842test_func_defmake ROAR_HAVE_CLOSELOG  closelog  'closelog()'                 -- syslog.h
843test_func_defmake ROAR_HAVE_FOPEN     fopen     'fopen("","")'               -- stdio.h
844test_func_defmake ROAR_HAVE_FDOPEN    fdopen    'fdopen(0,"")'               -- stdio.h
845test_func_defmake ROAR_HAVE_FREOPEN   freopen   'freopen("","",(void*)0)'    -- stdio.h
846test_func_defmake ROAR_HAVE_FCLOSE    fclose    'fclose(0)'                  -- stdio.h
847test_func_defmake ROAR_HAVE_FILENO    fileno    'fileno(0)'                  -- stdio.h
848test_func_defmake ROAR_HAVE_FTELL     ftell     'ftell(0)'                   -- stdio.h
849test_func_defmake ROAR_HAVE_FSEEK     fseek     'fseek(0, 0, 0)'             -- stdio.h
850test_func_defmake ROAR_HAVE_POPEN     popen     'popen("", "")'              -- stdio.h
851test_func_defmake ROAR_HAVE_PCLOSE    pclose    'pclose(0)'                  -- stdio.h
852test_func_defmake ROAR_HAVE_STAT      stat      'stat((char*)0, (void*)0)'   -- sys/types.h sys/stat.h unistd.h
853test_func_defmake ROAR_HAVE_SYSTEM    system    'system("")'                 -- stdlib.h
854test_func_defmake ROAR_HAVE_GETSOCKNAME getsockname 'getsockname(0, 0, 0)'   $lib_wsock32 -- sys/socket.h winsock.h
855test_func_defmake ROAR_HAVE_GETPEERNAME getpeername 'getpeername(0, 0, 0)'   $lib_wsock32 -- sys/socket.h winsock.h
856test_func_defmake ROAR_HAVE_GETSOCKOPT getsockopt 'getsockopt(0, 0, 0, (void*)0, (void*)0)' -- sys/types.h sys/socket.h
857test_func_defmake ROAR_HAVE_SETSOCKOPT setsockopt 'setsockopt(0, 0, 0, (void*)0, (void*)0)' -- sys/types.h sys/socket.h
858test_func_defmake ROAR_HAVE_GETADDRINFO getaddrinfo 'getaddrinfo((void*)0, (void*)0, (void*)0, (void**)0)' -- sys/types.h sys/socket.h netdb.h
859test_func_defmake ROAR_HAVE_RAND      rand      'rand()'                     -- stdlib.h
860test_func_defmake ROAR_HAVE_RAND_R    rand_r    'rand_r((unsigned int*)0)'   -- stdlib.h
861test_func_defmake ROAR_HAVE_SRAND     srand     'srand((unsigned int)0)'     -- stdlib.h
862test_func_defmake ROAR_HAVE_FCNTL     fcntl     'fcntl(0, 0)'                -- unistd.h fcntl.h
863test_func_defmake ROAR_HAVE_POSIX_OPENPT posix_openpt 'posix_openpt(0)'      -- stdlib.h fcntl.h
864test_func_defmake ROAR_HAVE_GRANTPT   grantpt   'grantpt(0)'                 -- stdlib.h
865test_func_defmake ROAR_HAVE_UNLOCKPT  unlockpt  'unlockpt(0)'                -- stdlib.h
866test_func_defmake ROAR_HAVE_TCGETATTR tcgetattr 'tcgetattr(0, (struct termios *)0)' -- termios.h unistd.h
867test_func_defmake ROAR_HAVE_TCSETATTR tcsetattr 'tcsetattr(0, TCSANOW, (struct termios *)0)' -- termios.h unistd.h
868test_func_defmake ROAR_HAVE_CFMAKERAW cfmakeraw 'cfmakeraw((struct termios *)0)' -- termios.h unistd.h
869test_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
870test_func_defmake ROAR_HAVE_LINUX_SENDFILE sendfile 'sendfile(-1, -1, (void*)0, 0)' -- sys/sendfile.h
871test_func_defmake ROAR_HAVE_GETVERSIONEX     GetVersionEx     'OSVERSIONINFO osinfo; osinfo.dwOSVersionInfoSize = sizeof(osinfo);GetVersionEx(&osinfo);'                -- windows.h
872
873test_func_defmake ROAR_HAVE_AO_APPEND_GLOBAL_OPTION ao_append_global_option 'ao_append_global_option("","")' ao -- ao/ao.h
874
875test_func_defmake ROAR_HAVE_DLADDR    dladdr    'dladdr((void*)0, (Dl_info*)0)' dl -- dlfcn.h
876echo "STATE: funcname_dladdr=$funcname_dladdr" >&5
877
878if [ "$funcname_dladdr" = 'false' ]
879then
880 infotext='retested with _GNU_SOURCE'
881 _old="$NEED_GNU_SOURCE"
882 NEED_GNU_SOURCE=true
883 test_func_defmake ROAR_HAVE_DLADDR    dladdr    'dladdr((void*)0, (Dl_info*)0)' dl -- dlfcn.h
884 [ "$funcname_dladdr" = 'false' ] && NEED_GNU_SOURCE="$_old"
885 infotext=''
886fi
887
888test_func_defmake ROAR_HAVE_CLOCK_GETRES  clock_getres  'struct timespec ts; clock_getres((clockid_t)0, &ts)'  -- time.h
889test_func_defmake ROAR_HAVE_CLOCK_GETTIME clock_gettime 'struct timespec ts; clock_gettime((clockid_t)0, &ts)' -- time.h
890test_func_defmake ROAR_HAVE_CLOCK_SETTIME clock_settime 'struct timespec ts; clock_settime((clockid_t)0, &ts)' -- time.h
891
892echo "STATE: funcname_clock_getres=$funcname_clock_getres" >&5
893echo "STATE: libname_rt=$libname_rt" >&5
894
895if [ "$funcname_clock_getres" = 'false' ]
896then
897 if $libname_rt
898 then
899  infotext='retested using realtime library'
900  test_func_defmake ROAR_HAVERT_CLOCK_GETRES  clock_getres  'struct timespec ts; clock_getres((clockid_t)0, &ts)'  $rt -- time.h
901  test_func_defmake ROAR_HAVERT_CLOCK_GETTIME clock_gettime 'struct timespec ts; clock_gettime((clockid_t)0, &ts)' $rt -- time.h
902  test_func_defmake ROAR_HAVERT_CLOCK_SETTIME clock_settime 'struct timespec ts; clock_settime((clockid_t)0, &ts)' $rt -- time.h
903  infotext=''
904  if $funcname_clock_getres
905  then
906   echo "clock_rt=-l$rt" >&4
907  fi
908 fi
909fi
910
911test_const_defmake ROAR_HAVE_CONST_CLOCK_REALTIME CLOCK_REALTIME clockid_t CLOCK_REALTIME -- time.h
912test_const_defmake ROAR_HAVE_CONST_CLOCK_MONOTONIC CLOCK_MONOTONIC clockid_t CLOCK_MONOTONIC -- time.h
913test_const_defmake ROAR_HAVE_CONST_CLOCK_PROCESS_CPUTIME_ID CLOCK_PROCESS_CPUTIME_ID clockid_t CLOCK_PROCESS_CPUTIME_ID -- time.h
914test_const_defmake ROAR_HAVE_CONST_CLOCK_THREAD_CPUTIME_ID CLOCK_THREAD_CPUTIME_ID clockid_t CLOCK_THREAD_CPUTIME_ID -- time.h
915test_const_defmake ROAR_HAVE_CONST_M_PI_2 M_PI_2 double M_PI_2 -- math.h
916
917
918test_var_defmake   ROAR_HAVE_VAR_H_ERRNO h_errno int h_errno -- netdb.h
919
920echo -n 'checking for basic IO calls... '
921
922cat <<EOF > $TF_C
923#include <sys/types.h>
924#include <sys/stat.h>
925#include <fcntl.h>
926#include <string.h>
927#include <unistd.h>
928
929int main(void) {
930 open(NULL, 0, 0);
931 close(0);
932 read(0, NULL, 0);
933 write(0, NULL, 0);
934 lseek(0, 0, 0);
935 return 0;
936}
937EOF
938
939if $CCTF 2> /dev/null;
940then
941 echo '#define ROAR_HAVE_IO_POSIX' >&3
942 echo posix
943else
944 echo none
945fi
946
947echo -n 'checking for basic FS calls... '
948
949cat <<EOF > $TF_C
950#include <string.h>
951#include <unistd.h>
952
953int main(void) {
954 chdir(NULL);
955 unlink(NULL);
956 return 0;
957}
958EOF
959
960if $CCTF 2> /dev/null;
961then
962 echo '#define ROAR_HAVE_FS_POSIX' >&3
963 echo posix
964else
965 echo none
966fi
967
968
969test_func_defmake ROAR_HAVE_CHROOT     chroot     'chroot((void*)0)'           -- unistd.h
970test_func_defmake ROAR_HAVE_MLOCK      mlock      'mlock((void*)0, 0)'         -- sys/mman.h
971test_func_defmake ROAR_HAVE_MUNLOCK    munlock    'munlock((void*)0, 0)'       -- sys/mman.h
972test_func_defmake ROAR_HAVE_MLOCKALL   mlockall   'mlockall(MCL_CURRENT|MCL_FUTURE)' -- sys/mman.h
973test_func_defmake ROAR_HAVE_MUNLOCKALL munlockall 'munlockall()'               -- sys/mman.h
974test_func_defmake ROAR_HAVE_MMAP       mmap       'mmap((void*)0,0,0,0,0,0)'   -- sys/mman.h
975
976echo -n 'checking for fsync()... '
977
978echo '#include <unistd.h>' > $TF_C
979echo 'int main (void) { fsync(0); return 0; }' >> $TF_C
980
981if $CCTF 2> /dev/null;
982then
983 echo '#define ROAR_HAVE_FSYNC' >&3
984 FSYNC=true
985 echo yes
986else
987 FSYNC=false
988 echo no
989fi
990
991echo -n 'checking for fdatasync()... '
992
993echo '#include <unistd.h>' > $TF_C
994echo 'int main (void) { fdatasync(0); return 0; }' >> $TF_C
995
996if $CCTF 2> /dev/null;
997then
998 echo '#define ROAR_HAVE_FDATASYNC' >&3
999 echo '#define ROAR_FDATASYNC fdatasync' >&3
1000 echo yes
1001else
1002 $FSYNC && echo '#define ROAR_FDATASYNC fsync' >&3
1003 echo no
1004fi
1005
1006
1007#test_func_defmake ROAR_HAVE_STRCASESTR strcasestr 'strcasestr("", "")'       -- string.h
1008echo -n 'checking for strcasestr()... '
1009
1010echo '#define _GNU_SOURCE' > $TF_C
1011echo '#include <string.h>' >> $TF_C
1012echo 'int main (void) { strcasestr("", ""); return 0; }' >> $TF_C
1013
1014if $CCTF 2> /dev/null;
1015then
1016 echo '#define ROAR_HAVE_STRCASESTR' >&3
1017 NEED_GNU_SOURCE=true
1018 echo yes
1019else
1020 echo no
1021fi
1022
1023echo -n 'checking for fopencookie()... '
1024
1025echo '#define _GNU_SOURCE' > $TF_C
1026echo '#include <stdio.h>' >> $TF_C
1027echo 'int main (void) { cookie_io_functions_t f; fopencookie(NULL, "", f); return 0; }' >> $TF_C
1028
1029if $CCTF 2> /dev/null;
1030then
1031 echo '#define ROAR_HAVE_FOPENCOOKIE' >&3
1032 NEED_GNU_SOURCE=true
1033 echo yes
1034else
1035 echo no
1036fi
1037
1038echo -n 'checking for funopen()... '
1039
1040echo '#define __BSD_VISIBLE 1'  > $TF_C
1041echo '#include <stdio.h>'      >> $TF_C
1042echo 'int main (void) { funopen(NULL, NULL, NULL, NULL, NULL); return 0; }' >> $TF_C
1043
1044if $CCTF 2> /dev/null;
1045then
1046 echo '#define ROAR_HAVE_FUNOPEN' >&3
1047 echo '#define ROAR_NEED_BSD_VISIBLE' >&3
1048 echo yes
1049else
1050 echo no
1051fi
1052
1053test_func_defmake ROAR_HAVE_PIPE      pipe      'pipe(NULL)'                 -- unistd.h
1054test_func_defmake ROAR_HAVE_FORK      fork      'fork()'                     -- unistd.h
1055test_func_defmake ROAR_HAVE_WAIT      wait      'wait(NULL)'                 -- string.h sys/wait.h
1056test_func_defmake ROAR_HAVE_SINF      sinf      'sinf(0.)'                 m -- math.h
1057
1058echo -n 'checking for square root func... '
1059
1060if $TARGET_CYGWIN
1061then
1062 echo 'sqrt() (cygwin)'
1063elif [ "$SYSNAME" = 'FreeBSD' ]
1064then
1065 echo 'sqrt() (FreeBSD, fix your gcc)'
1066elif [ "$SYSNAME" = 'Linux' ]
1067then
1068 echo '#include <math.h>' > $TF_C
1069 echo 'int main (void) { sqrtl(0); return 0; }' >> $TF_C
1070
1071 if $CCTF -lm 2> /dev/null;
1072 then
1073  echo '#define ROAR_HAVE_SQRTL' >&3
1074  echo 'sqrtl()'
1075 else
1076  echo 'sqrt()'
1077 fi
1078else
1079 echo 'sqrt()'
1080fi
1081
1082echo -n 'checking for inline funcs... '
1083
1084echo 'inline int test (void) { return 0; }' > $TF_C
1085echo 'int main (void) { return test(); }'  >> $TF_C
1086
1087if $CCTF 2> /dev/null;
1088then
1089 echo '#define ROAR_HAVE_INLINE' >&3
1090 echo yes
1091else
1092 echo no
1093fi
1094
1095
1096test_pthread
1097
1098
1099echo -n 'checking for broken peercred... '
1100echo '#include <sys/types.h>'      >  $TF_C
1101echo '#include <sys/socket.h>'     >> $TF_C
1102echo '#include <sys/un.h>'         >> $TF_C
1103echo 'int main (void) { struct ucred cred; return 0; }'  >> $TF_C
1104
1105if $CCTF 2> /dev/null;
1106then
1107 echo working
1108else
1109 if $CCTF -D_GNU_SOURCE 2> /dev/null;
1110 then
1111  NEED_GNU_SOURCE=true
1112  echo need to set _GNU_SOURCE
1113 else
1114  echo '#define ROAR_BROKEN_PEERCRED' >&3
1115  echo broken
1116 fi
1117fi
1118
1119
1120test_func_defmake ROAR_HAVE_GETPEEREID getpeereid 'getpeereid(0, NULL, NULL)' -- sys/types.h sys/socket.h
1121
1122echo -n 'checking for select()... '
1123cat <<EOF > $TF_C
1124#ifndef WITHOUT_SYS_SELECT_H
1125#include <sys/select.h>
1126#endif
1127#ifdef WITH_WINSOCK_H
1128#include <winsock.h>
1129#endif
1130#include <sys/time.h>
1131#include <sys/types.h>
1132#include <unistd.h>
1133
1134int main (void) {
1135 fd_set rfds;
1136 struct timeval tv;
1137
1138 FD_ZERO(&rfds);
1139 FD_SET(0, &rfds);
1140
1141 tv.tv_sec  = 0;
1142 tv.tv_usec = 0;
1143
1144 select(1, &rfds, NULL, NULL, &tv);
1145
1146 return 0;
1147}
1148EOF
1149
1150if $CCTF 2> /dev/null;
1151then
1152 echo '#define ROAR_HAVE_SELECT' >&3
1153 echo '#define ROAR_HAVE_H_SYS_SELECT' >&3
1154 echo yes, POSIX.1-2001
1155elif $CCTF -DWITHOUT_SYS_SELECT_H 2> /dev/null;
1156then
1157 echo '#define ROAR_HAVE_SELECT' >&3
1158 echo yes, old style
1159elif $CCTF -DWITHOUT_SYS_SELECT_H -DWITH_WINSOCK_H $lib_wsock32 >&5 2>&5;
1160then
1161 echo '#define ROAR_HAVE_SELECT' >&3
1162 echo yes, WinSock
1163else
1164 echo no
1165fi
1166
1167echo -n 'checking for shutdown()... '
1168cat <<EOF > $TF_C
1169#include <sys/types.h>
1170#ifndef WITHOUT_SYS_SOCKET_H
1171#include <sys/socket.h>
1172#endif
1173#ifdef WITH_WINSOCK_H
1174#include <winsock.h>
1175#endif
1176
1177int main (void) { shutdown(0, 0); return 0; }
1178EOF
1179
1180if [ "$SYSNAME" = 'SunOS' ]
1181then
1182 _l='-lsocket'
1183else
1184 _l=''
1185fi
1186
1187if $CCTF $_l 2> /dev/null;
1188then
1189 echo '#define ROAR_HAVE_SHUTDOWN'     >&3
1190 echo '#define ROAR_SHUTDOWN shutdown' >&3
1191 echo yes
1192elif $CCTF -DWITHOUT_SYS_SOCKET_H -DWITH_WINSOCK_H $lib_wsock32 2> /dev/null;
1193then
1194 echo '#define ROAR_HAVE_SHUTDOWN'     >&3
1195 echo '#define ROAR_SHUTDOWN shutdown' >&3
1196 echo yes, WinSock
1197else
1198 echo '#define ROAR_SHUTDOWN(x,y) (-1)' >&3
1199 echo no
1200fi
1201
1202echo -n 'checking for accept()... '
1203cat <<EOF > $TF_C
1204#include <sys/types.h>
1205#ifndef WITHOUT_SYS_SOCKET_H
1206#include <sys/socket.h>
1207#endif
1208#ifdef WITH_WINSOCK_H
1209#include <winsock.h>
1210#endif
1211
1212int main (void) { accept(0, 0, 0); return 0; }
1213EOF
1214
1215if [ "$SYSNAME" = 'SunOS' ]
1216then
1217 _l='-lsocket'
1218else
1219 _l=''
1220fi
1221
1222if $CCTF $_l 2> /dev/null;
1223then
1224 echo '#define ROAR_HAVE_ACCEPT'     >&3
1225 echo '#define ROAR_ACCEPT accept'   >&3
1226 echo yes
1227elif $CCTF -DWITHOUT_SYS_SOCKET_H -DWITH_WINSOCK_H $lib_wsock32 2> /dev/null;
1228then
1229 echo '#define ROAR_HAVE_ACCEPT'     >&3
1230 echo '#define ROAR_ACCEPT accept'   >&3
1231 echo yes, WinSock
1232else
1233 echo '#define ROAR_ACCEPT(x,y,z) (-1)' >&3
1234 echo no
1235fi
1236
1237test_func_defmake ROAR_HAVE_GETOBJECTBYNAME getobjectbyname 'getobjectbyname(NULL)' dnet -- stdlib.h netdnet/dn.h netdnet/dnetdb.h
1238test_func_defmake ROAR_HAVE_GETSERVBYNAME   getservbyname   'getservbyname((void*)0, (void*)0)' -- netdb.h
1239
1240
1241# --- PulseAudio tests ---
1242test_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
1243
1244test_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; }'
1245
1246test_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; }'
1247
1248test_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; }'
1249
1250test_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; }'
1251# --- End of PulseAudio tests ---
1252
1253
1254echo -n 'checking for struct rsound'\''s sample size member... '
1255
1256cat > $TF_C << EOF
1257#define RSD_EXPOSE_STRUCT
1258#include <rsound.h>
1259
1260int main (void) {
1261 rsound_t var;
1262
1263 var.samplesize = 0;
1264
1265 return 0;
1266}
1267EOF
1268if $CCTF 2> /dev/null;
1269then
1270 echo '#define ROAR_HAVE_RSOUND_SAMPLESIZE'     >&3
1271 echo '#define ROAR_HAVE_RSOUND_SAMPLESIZE_MEMBER samplesize'   >&3
1272 echo samplesize
1273else
1274 echo '#define ROAR_HAVE_RSOUND_SAMPLESIZE_MEMBER framesize'   >&3
1275 echo framesize
1276fi
1277
1278echo -n 'checking for safe 32 bit integer overflow... '
1279
1280cat > $TF_C << EOF
1281#include <stdio.h>
1282#include <stdint.h>
1283#define TYPE uint32_t
1284#define MAX  ((TYPE)4294967295U)
1285
1286int main (void) {
1287 TYPE a = MAX;
1288
1289 a += 2;
1290
1291 if ( a == 1 ) {
1292  printf("#define ROAR_HAVE_SAFE_OVERFLOW\n");
1293  return 0;
1294 }
1295
1296 return 1;
1297}
1298EOF
1299
1300if $CCTF 2> /dev/null;
1301then
1302 $EXEC_HELPER $TF_E >&3 2> /dev/null
1303 if [ "$?" = '0' ]
1304 then
1305  echo yes
1306 else
1307  echo no
1308 fi
1309else
1310 echo 'no (can not compile!, no stdint.h?)'
1311fi
1312
1313echo -n 'checking for __LP64__... '
1314if $TARGET_WIN32
1315then
1316 echo 'no need to set (win32 build)'
1317else
1318cat > $TF_C << EOF
1319#include <stdio.h>
1320
1321int main (void) {
1322#ifdef __LP64__
1323 fprintf(stderr, "set by compiler\n");
1324#else
1325 if ( sizeof(int) == sizeof(void*) ) {
1326  fprintf(stderr, "no need to set\n");
1327 } else {
1328  fprintf(stderr, "need to set\n");
1329  printf("\n#ifndef __LP64__\n#define __LP64__\n#endif\n\n");
1330 }
1331#endif
1332 return 0;
1333}
1334EOF
1335 if $CCTF 2> /dev/null;
1336 then
1337  $EXEC_HELPER $TF_E >&3
1338 else
1339  echo 'error, can not compile'
1340  exit 1
1341 fi
1342fi
1343
1344echo -n 'checking for 64 bit types... '
1345if $TARGET_WIN32
1346then
1347 echo 'int64_t, uint64_t (win32 build)'
1348 echo '#define ROAR_NATIVE_INT64  int64_t'  >&3
1349 echo '#define ROAR_NATIVE_UINT64 uint64_t' >&3
1350else
1351cat > $TF_C << EOF
1352#include <stdio.h>
1353#include <stdint.h>
1354
1355int main (void) {
1356 char * i64 = NULL, * ui64 = NULL;
1357
1358 if ( sizeof(int) == 8 ) {
1359  i64 = "int"; ui64 = "unsigned int";
1360 } else if ( sizeof(long int) == 8 ) {
1361  i64 = "long int"; ui64 = "unsigned long int";
1362 } else if ( sizeof(long long int) == 8 ) {
1363  i64 = "long long int"; ui64 = "unsigned long long int";
1364 } else if ( sizeof(int64_t) == 8 ) {
1365  i64 = "int64_t"; ui64 = "uint64_t";
1366 } else {
1367  fprintf(stderr, "none\n");
1368  return 0;
1369 }
1370
1371 fprintf(stderr, "%s, %s\n", i64, ui64);
1372 printf("#define ROAR_NATIVE_INT64 %s\n#define ROAR_NATIVE_UINT64 %s\n", i64, ui64);
1373
1374 return 0;
1375}
1376EOF
1377 if $CCTF 2> /dev/null;
1378 then
1379  $EXEC_HELPER $TF_E >&3
1380 else
1381  echo 'error, can not compile'
1382  exit 1
1383 fi
1384fi
1385
1386test_cp_v
1387
1388echo -n 'checking for cdrom device... '
1389if [ -n "$CDROM" ]
1390then
1391 if [ "$CDROM" = '(none)' ]
1392 then
1393  echo "none (disabled by user)"
1394 else
1395  if $CROSS_COMPILE
1396  then
1397   echo "$CDROM (cross compile)"
1398  elif [ -e "$CDROM" ]
1399  then
1400   echo "$CDROM (forced by user)"
1401  else
1402   echo "$CDROM (not existing, forced by user)"
1403  fi
1404  echo '#define ROAR_DEFAULT_CDROM "'"$CDROM"'"' >&3
1405  echo '#define ROAR_HAVE_CDROM' >&3
1406 fi
1407elif $CROSS_COMPILE
1408then
1409 echo 'none (cross compiling, use --cdrom to enable CDROM support)'
1410else
1411 CDROM=$(ls /dev/cdrom /dev/rcd0c 2> /dev/null | head -n 1);
1412 if [ -e "$CDROM" ]
1413 then
1414  echo "$CDROM"
1415  echo '#define ROAR_DEFAULT_CDROM "'"$CDROM"'"' >&3
1416  echo '#define ROAR_HAVE_CDROM' >&3
1417 else
1418  echo 'none'
1419  echo '#define ROAR_HAVE_CDROM' >&3
1420 fi
1421fi
1422
1423echo -n 'checking for default tty device... '
1424if [ -n "$TTY_DEV" ]
1425then
1426 if [ "$TTY_DEV" = '(none)' ]
1427 then
1428  echo "none (disabled by user)"
1429 else
1430  if $CROSS_COMPILE
1431  then
1432   echo "$TTY_DEV (cross compile)"
1433  elif [ -e "$TTY_DEV" ]
1434  then
1435   echo "$TTY_DEV (forced by user)"
1436  else
1437   echo "$TTY_DEV (not existing, forced by user)"
1438  fi
1439  echo '#define ROAR_DEFAULT_TTY "'"$TTY_DEV"'"' >&3
1440 fi
1441elif $CROSS_COMPILE
1442then
1443 echo 'none (cross compiling, use --tty to set default device)'
1444else
1445 TTY_DEV=$(ls /dev/tty 2> /dev/null | head -n 1);
1446 if [ -e "$TTY_DEV" ]
1447 then
1448  echo "$TTY_DEV"
1449  echo '#define ROAR_DEFAULT_TTY "'"$TTY_DEV"'"' >&3
1450 else
1451  echo 'none'
1452 fi
1453fi
1454
1455echo -n 'checking for OSS device... '
1456if [ -n "$OSS_DEV" ]
1457then
1458 if [ "$OSS_DEV" = '(none)' ]
1459 then
1460  echo "none (disabled by user)"
1461 else
1462  if $CROSS_COMPILE
1463  then
1464   echo "$OSS_DEV (cross compile)"
1465  elif [ -e "$OSS_DEV" ]
1466  then
1467   echo "$OSS_DEV (forced by user)"
1468  else
1469   echo "$OSS_DEV (not existing, forced by user)"
1470  fi
1471  echo '#define ROAR_DEFAULT_OSS_DEV "'"$OSS_DEV"'"' >&3
1472 fi
1473elif $CROSS_COMPILE
1474then
1475 echo 'none (cross compiling, use --oss-dev to set default device)'
1476else
1477 OSS_DEV=$(ls /dev/dsp /dev/audio 2> /dev/null | head -n 1);
1478 if [ -e "$OSS_DEV" ]
1479 then
1480  echo "$OSS_DEV"
1481  echo '#define ROAR_DEFAULT_OSS_DEV "'"$OSS_DEV"'"' >&3
1482 else
1483  echo 'none'
1484 fi
1485fi
1486
1487echo -n 'checking for OSS mixer device... '
1488if [ -n "$OSS_MIX_DEV" ]
1489then
1490 if [ "$OSS_MIX_DEV" = '(none)' ]
1491 then
1492  echo "none (disabled by user)"
1493 else
1494  if $CROSS_COMPILE
1495  then
1496   echo "$OSS_MIX_DEV (cross compile)"
1497  elif [ -e "$OSS_MIX_DEV" ]
1498  then
1499   echo "$OSS_MIX_DEV (forced by user)"
1500  else
1501   echo "$OSS_MIX_DEV (not existing, forced by user)"
1502  fi
1503  echo '#define ROAR_DEFAULT_OSS_MIX_DEV "'"$OSS_MIX_DEV"'"' >&3
1504 fi
1505elif $CROSS_COMPILE
1506then
1507 echo 'none (cross compiling, use --oss-mixer-dev to set default device)'
1508else
1509 OSS_MIX_DEV=$(ls /dev/mixer 2> /dev/null | head -n 1);
1510 if [ -e "$OSS_MIX_DEV" ]
1511 then
1512  echo "$OSS_MIX_DEV"
1513  echo '#define ROAR_DEFAULT_OSS_MIX_DEV "'"$OSS_MIX_DEV"'"' >&3
1514 else
1515  echo 'none'
1516 fi
1517fi
1518
1519echo 'checking for DECnet status file... '"$PROC_NET_DECNET"
1520echo '#define ROAR_PROC_NET_DECNET "'"$PROC_NET_DECNET"'"' >&3
1521
1522echo -n 'checking for DECnet neighbour file... '
1523if [ -n "$PROC_NET_DECNET_NEIGH" ]
1524then
1525 if [ "$PROC_NET_DECNET_NEIGH" = '(none)' ]
1526 then
1527  echo "none (disabled by user)"
1528 else
1529  if $CROSS_COMPILE
1530  then
1531   echo "$PROC_NET_DECNET_NEIGH (cross compile)"
1532  elif [ -e "$PROC_NET_DECNET_NEIGH" ]
1533  then
1534   echo "$PROC_NET_DECNET_NEIGH (forced by user)"
1535  else
1536   echo "$PROC_NET_DECNET_NEIGH (not existing, forced by user)"
1537  fi
1538  echo '#define ROAR_PROC_NET_DECNET_NEIGH "'"$PROC_NET_DECNET_NEIGH"'"' >&3
1539 fi
1540elif $CROSS_COMPILE
1541then
1542 echo 'none (cross compiling, use --proc-net-decnet-neigh to set default device)'
1543else
1544 PROC_NET_DECNET_NEIGH=$(ls /proc/net/decnet_neigh 2> /dev/null | head -n 1);
1545 if [ -e "$PROC_NET_DECNET_NEIGH" ]
1546 then
1547  echo "$PROC_NET_DECNET_NEIGH"
1548  echo '#define ROAR_PROC_NET_DECNET_NEIGH "'"$PROC_NET_DECNET_NEIGH"'"' >&3
1549 else
1550  echo 'none'
1551 fi
1552fi
1553
1554echo -n 'checking for IP neighbour (ARP) file... '
1555if [ -n "$PROC_NET_ARP" ]
1556then
1557 if [ "$PROC_NET_ARP" = '(none)' ]
1558 then
1559  echo "none (disabled by user)"
1560 else
1561  if $CROSS_COMPILE
1562  then
1563   echo "$PROC_NET_ARP (cross compile)"
1564  elif [ -e "$PROC_NET_ARP" ]
1565  then
1566   echo "$PROC_NET_ARP (forced by user)"
1567  else
1568   echo "$PROC_NET_ARP (not existing, forced by user)"
1569  fi
1570  echo '#define ROAR_PROC_NET_ARP "'"$PROC_NET_ARP"'"' >&3
1571 fi
1572elif $CROSS_COMPILE
1573then
1574 echo 'none (cross compiling, use --proc-net-arp to set default device)'
1575else
1576 PROC_NET_ARP=$(ls /proc/net/arp 2> /dev/null | head -n 1);
1577 if [ -e "$PROC_NET_ARP" ]
1578 then
1579  echo "$PROC_NET_ARP"
1580  echo '#define ROAR_PROC_NET_ARP "'"$PROC_NET_ARP"'"' >&3
1581 else
1582  echo 'none'
1583 fi
1584fi
1585
1586echo -n 'checking for default audio group... '
1587if [ "$DEFAULT_GRP" = '(none)' ]
1588then
1589 echo "none (disabled by user)"
1590else
1591 echo "$DEFAULT_GRP"
1592 echo '#define ROAR_DEFAULT_SOCKGRP "'"$DEFAULT_GRP"'"' >&3
1593fi
1594
1595echo -n 'checking for user id of root/superuser... '
1596if [ "$ROOT_UID" = '(none)' ]
1597then
1598 echo "none (disabled by user)"
1599elif [ "$ROOT_UID" = '' ]
1600then
1601 ROOT_USER='root'
1602 ROOT_UID=`id -u $ROOT_USER`
1603 if [ "$ROOT_UID" = '' ]
1604 then
1605  echo "none (please report this)"
1606 else
1607  echo "$ROOT_UID($ROOT_USER)"
1608  echo '#define ROAR_ROOT_UID '"$ROOT_UID" >&3
1609 fi
1610else
1611 echo "$ROOT_UID"
1612 echo '#define ROAR_ROOT_UID '"$ROOT_UID" >&3
1613fi
1614
1615$NEED_GNU_SOURCE && echo '#define ROAR_NEED_GNU_SOURCE' >&3
1616
1617cat >&3 << EOF
1618
1619#if defined(ROAR_HAVE_LIBCELT0) && !defined(ROAR_HAVE_LIBCELT)
1620#define ROAR_HAVE_LIBCELT
1621#endif
1622EOF
1623
1624cd plugins
1625
1626#if $LIBAO
1627#then
1628# echo 'running libao plugin configure...'
1629#  cd ao/
1630# if [ "$AO_INST_DIR" = '' ]
1631# then
1632#  ./configure --force-have-roar --pkg-config "$PKG_CONFIG"                           && \
1633#    echo "subdir_plugins_ao=plugins/ao" >&4
1634# else
1635#  ./configure --force-have-roar --pkg-config "$PKG_CONFIG" --inst-dir "$AO_INST_DIR" && \
1636#    echo "subdir_plugins_ao=plugins/ao" >&4
1637# fi
1638# cd ..
1639#else
1640# echo "running libao plugin configure... disabled by user"
1641#fi
1642
1643if $XMMS
1644then
1645 echo 'running xmms plugin configure...'
1646 cd xmms/
1647  ./configure --force-have-roar --pkg-config "$PKG_CONFIG" --inst-dir "$XMMS_INST_DIR" && \
1648    echo "subdir_plugins_xmms=plugins/xmms" >&4
1649 cd ..
1650else
1651 echo "running xmms plugin configure... disabled by user"
1652fi
1653
1654#if $AUDACIOUS
1655#then
1656# echo 'running Audacious plugin configure...'
1657# cd audacious/
1658#  ./configure --force-have-roar --pkg-config "$PKG_CONFIG" --inst-dir "$AUDACIOUS_INST_DIR" && \
1659#    echo "subdir_plugins_audacious=plugins/audacious" >&4
1660# cd ..
1661#else
1662# echo "running Audacious plugin configure... disabled by user"
1663#fi
1664
1665if $COMP_PLUGINS
1666then
1667 # Do not build roard plugins on win32 as they use upwards binding (-rdynamic).
1668 # This mode of binding is not supported by PE.
1669 $TARGET_WIN32 || echo "subdir_plugins_roard=plugins/roard" >&4
1670 echo "subdir_plugins_universal=plugins/universal" >&4
1671fi
1672
1673cd ..
1674
1675cleanup_ccft
1676
1677write_footer_makefileconf
1678write_footer_configlog
1679write_footer_configh
1680
1681mv config.h include/roaraudio/
1682echo 'config.h created and moved into include/roaraudio/'
1683
1684#ll
Note: See TracBrowser for help on using the repository browser.