source: roaraudio/configure @ 5803:073311b042e8

Last change on this file since 5803:073311b042e8 was 5803:073311b042e8, checked in by phi, 9 years ago

Removed unused checks in configure. Improves build speed slightly.

  • Property exe set to *
File size: 52.2 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_LIB     \"$PREFIX_LIB\""
541 echo "#define ROAR_PREFIX_INC     \"$PREFIX_INC\""
542 echo "#define ROAR_PREFIX_MAN     \"$PREFIX_MAN\""
543 echo "#define ROAR_PREFIX_PC      \"$PREFIX_PC\""
544 echo "#define ROAR_PREFIX_CKPORT  \"$PREFIX_CKPORT\""
545 echo "#define ROAR_PREFIX_COMP_LIBS \"$PREFIX_COMP_LIBS\""
546 echo "#define ROAR_PREFIX_COMP_BINS \"$PREFIX_COMP_BINS\""
547 echo "#define ROAR_PREFIX_PLUGINS \"$PREFIX_PLUGINS\""
548 echo "#define ROAR_PREFIX_BUILDSYSTEM \"$PREFIX_BUILDSYSTEM\""
549 echo
550 $MINIMAL      && echo '#define ROAR_MINIMAL'
551 $BETA         && echo '#define ROAR_BETA'
552 $EXPERIMENTAL && echo '#define ROAR_EXPERIMENTAL'
553 $ALAW         && echo '#define ROAR_SUPPORT_ALAW'
554 $ALAW_RW      && echo '#define ROAR_SUPPORT_ALAW_RW'
555 $MULAW        && echo '#define ROAR_SUPPORT_MULAW'
556 $MULAW_RW     && echo '#define ROAR_SUPPORT_MULAW_RW'
557 $PROXY        && echo '#define ROAR_SUPPORT_PROXY'
558 $PASSWORD_API && echo '#define ROAR_SUPPORT_PASSWORD_API'
559 $SUPPORT_TRAP && echo '#define ROAR_SUPPORT_TRAP'
560 $USE_MEMMGR   && echo '#define ROAR_USE_MEMMGR'
561 $NO_LISTEN    || echo '#define ROAR_SUPPORT_LISTEN'
562 $META_DATA    && echo '#define ROAR_SUPPORT_META'
563 echo
564
565 $HAVE_MAIN_ARGS && echo '#define ROAR_HAVE_MAIN_ARGS'
566
567 echo
568
569 for i in $WITHOUT_CF
570 do
571  i=$(echo $i | to_upper);
572  echo '#define ROAR_WITHOUT_CF_'$i
573 done
574
575 for i in $WITHOUT_VIO
576 do
577  i=$(echo $i | to_upper);
578  echo '#define ROAR_WITHOUT_VIO_'$i
579 done
580
581 for i in $WITHOUT_DCOMP
582 do
583  i=$(echo $i | to_upper);
584  echo '#define ROAR_WITHOUT_DCOMP_'$i
585 done
586
587 echo
588 $TARGET_MICROCONTROLLER && echo '#define ROAR_TARGET_MICROCONTROLLER'
589 $TARGET_WIN32           && echo '#define ROAR_TARGET_WIN32'
590 $TARGET_CYGWIN          && echo '#define ROAR_TARGET_CYGWIN'
591                            echo '#define ROAR_OS_'$(echo $SYSNAME | to_escaped | to_upper)
592 echo
593} >&3
594
595# test binary format.
596test_bin_format
597test_linkdeps
598
599#                 #define                   name         cmds...
600test_tool_defmake ROAR_HAVE_BIN_OGG123      ogg123       ogg123
601test_tool_defmake ROAR_HAVE_BIN_FLAC        flac         flac
602test_tool_defmake ROAR_HAVE_BIN_TIMIDITY    TiMidity++   timidity
603test_tool_defmake ROAR_HAVE_BIN_CDPARANOIA  cdparanoia   cdparanoia
604test_tool_defmake ROAR_HAVE_BIN_GNUPLOT     gnuplot      gnuplot
605test_tool_defmake ROAR_HAVE_BIN_SSH         OpenSSH      ssh
606test_tool_defmake ROAR_HAVE_BIN_PINENTRY    PIN-Entry    pinentry
607test_tool_defmake ROAR_HAVE_BIN_SSH_ASKPASS SSH-AskPass  ssh-askpass
608test_tool_defmake ROAR_HAVE_BIN_GTK_LED_ASKPASS GTK-LED-AskPass gtk-led-askpass
609test_tool_defmake ROAR_HAVE_BIN_X11_SSH_ASKPASS X11-SSH-AskPass x11-ssh-askpass
610test_tool_defmake ROAR_HAVE_BIN_GNOME_SSH_ASKPASS GNOME-SSH-AskPass gnome-ssh-askpass
611test_tool_defmake ROAR_HAVE_BIN_GPG         GnuPG        gpg
612test_tool_defmake ROAR_HAVE_BIN_EJECT       eject        eject
613
614echo >&3
615echo >&5
616echo >&5
617echo >&5
618
619# Those tests should not be disabled as they do not reduce the lib size just
620# break --minimal on full systems
621OLD_MINIMAL=$MINIMAL
622MINIMAL=false
623# Test haders:
624test_lib_defmake ROAR_HAVE_H_STDINT      %            stdint.h      c          -- stdint.h
625test_lib_defmake ROAR_HAVE_H_STRING      %            string.h      c          -- string.h
626test_lib_defmake ROAR_HAVE_H_SYS_TYPES   %            sys/types.h   c          -- sys/types.h
627test_lib_defmake ROAR_HAVE_H_SYS_SOCKET  %            sys/socket.h  c          -- sys/types.h sys/socket.h
628test_lib_defmake ROAR_HAVE_H_SYS_TIME    %            sys/time.h    c          -- sys/time.h
629test_lib_defmake ROAR_HAVE_H_SYS_IOCTL   %            sys/ioctl.h   c          -- sys/ioctl.h
630test_lib_defmake ROAR_HAVE_H_SYS_STAT    %            sys/stat.h    c          -- sys/types.h sys/stat.h
631test_lib_defmake ROAR_HAVE_H_SYS_REBOOT  %            sys/reboot.h  c          -- sys/reboot.h
632test_lib_defmake ROAR_HAVE_H_TIME        %            time.h        c          -- time.h
633test_lib_defmake ROAR_HAVE_H_FCNTL       %            fcntl.h       c          -- fcntl.h
634test_lib_defmake ROAR_HAVE_H_UNISTD      %            unistd.h      c          -- unistd.h
635test_lib_defmake ROAR_HAVE_H_DIRENT      %            dirent.h      c          -- dirent.h
636test_lib_defmake ROAR_HAVE_H_STDLIB      %            stdlib.h      c          -- stdlib.h
637test_lib_defmake ROAR_HAVE_H_SIGNAL      %            signal.h      c          -- signal.h
638test_lib_defmake ROAR_HAVE_H_POLL        %            poll.h        c          -- poll.h
639test_lib_defmake ROAR_HAVE_H_MMSYSTEM    %            mmsystem.h    c          -- windows.h mmsystem.h
640test_lib_defmake ROAR_HAVE_H_ESD         libroaresd   esd.h         c          -- esd.h
641test_lib_defmake ROAR_HAVE_H_ARTSC       libroararts  artsc.h       c          -- kde/artsc/artsc.h
642test_lib_defmake ROAR_HAVE_H_ICONV       %            iconv.h       c          -- iconv.h
643test_lib_defmake ROAR_HAVE_H_NETINET_IN  %            'netinet/in.h' c         -- 'netinet/in.h'
644test_lib_defmake ROAR_HAVE_H_LINUX_REBOOT %            linux/reboot.h c        -- linux/reboot.h
645test_lib_defmake ROAR_HAVE_H_WINDOWS     %            windows.h     c          -- windows.h
646test_lib_defmake ROAR_HAVE_H_WINSOCK     %            winsock.h     c          -- winsock.h
647test_lib_defmake ROAR_HAVE_H_WINSOCK2    %            winsock2.h    c          -- winsock2.h
648MINIMAL=$OLD_MINIMAL
649
650#Those headers are checked with minimal mode as it is set by the user:
651test_lib_defmake ROAR_HAVE_H_DLFCN       %            dlfcn.h       c          -- dlfcn.h
652
653#                #define                 subdir       name           -lxxx      -- header
654test_lib_defmake ROAR_HAVE_LIBM          %            'MathLibrary'  m          -- math.h
655rt=''
656libname_rt=false
657if test_lib 'realtime Library' rt -- sys/mman.h mqueue.h semaphore.h
658then
659 {
660  echo '#define ROAR_HAVE_LIBRT'
661  echo '#define ROAR_NEED_LIBRT'
662  libname_rt=true
663  rt=rt
664 } >&3
665fi
666
667echo >&3
668
669#                #define                 subdir       name          -lxxx      -- header
670test_lib_defmake ROAR_HAVE_ESD           %            EsounD        esd        -- esd.h
671test_lib_defmake ROAR_HAVE_LIBAO         %            libao         ao         -- ao/ao.h ao/plugin.h
672test_lib_defmake ROAR_HAVE_LIBRAUM       %            RAUM          raum       -- raum.h
673test_lib_defmake ROAR_HAVE_LIBOGG        %            libogg        ogg        -- ogg/ogg.h
674test_lib_defmake ROAR_HAVE_LIBVORBIS     %            libvorbis     vorbis     -- vorbis/codec.h
675test_lib_defmake ROAR_HAVE_LIBVORBISFILE %            libvorbisfile vorbisfile -- vorbis/vorbisfile.h
676test_lib_defmake ROAR_HAVE_LIBVORBISENC  %            libvorbisenc  vorbisenc  -- vorbis/vorbisenc.h
677test_lib_defmake ROAR_HAVE_LIBSPEEX      %            libspeex      speex      -- speex/speex.h speex/speex_stereo.h
678test_lib_defmake ROAR_HAVE_LIBSPEEXDSP   %            libspeexdsp   speexdsp   -- speex/speex.h speex/speex_echo.h
679test_lib_defmake ROAR_HAVE_LIBCELT       %            libcelt       celt       -- celt/celt.h celt/celt_header.h
680test_lib_defmake ROAR_HAVE_LIBCELT0      %            libcelt0      celt0      -- celt/celt.h celt/celt_header.h
681test_lib_defmake ROAR_HAVE_LIBOGGZ       %            liboggz       oggz       -- oggz/oggz.h
682test_lib_defmake ROAR_HAVE_LIBSNDFILE    %            libsndfile    sndfile    -- sndfile.h
683test_lib_defmake ROAR_HAVE_LIBFISHSOUND  roarfish     libfishsound  fishsound  -- fishsound/fishsound.h
684test_lib_defmake ROAR_HAVE_LIBFLAC       %            libFLAC       FLAC       -- FLAC/all.h
685test_lib_defmake ROAR_HAVE_LIBSAMPLERATE %            libsamplerate samplerate -- samplerate.h
686test_lib_defmake ROAR_HAVE_LIBSHOUT      %            libshout      shout      -- shout/shout.h
687test_lib_defmake ROAR_HAVE_LIBPULSE      libroarpulse libpulse      pulse      -- pulse/pulseaudio.h pulse/simple.h
688test_lib_defmake ROAR_HAVE_LIBPULSESIMPLE %           libpulse-simple pulse-simple -- pulse/simple.h
689test_lib_defmake ROAR_HAVE_LIBY2         libroaryiff  libyiff       Y2         -- Y2/Y.h Y2/Ylib.h
690test_lib_defmake ROAR_HAVE_LIBARTSC      %            libartsc      artsc      -- kde/artsc/artsc.h
691test_lib_defmake ROAR_HAVE_LIBOSSAUDIO   %            libossaudio   ossaudio   -- sys/ioctl.h
692test_lib_defmake ROAR_HAVE_LIBSNDIO      %            libsndio      sndio      -- sndio.h
693test_lib_defmake ROAR_HAVE_LIBRSOUND     libroarrsound librsound    rsound     -- rsound.h
694test_lib_defmake ROAR_HAVE_LIBPORTAUDIO  %            PortAudio     portaudio  -- portaudio.h
695test_lib_defmake ROAR_HAVE_LIBPABLIO     %            PABLIO        pablio     -- pablio/pablio.h
696test_lib_defmake ROAR_HAVE_LIBSSL        %            OpenSSL       ssl        -- openssl/bio.h openssl/evp.h
697test_lib_defmake ROAR_HAVE_LIBSLP        %            OpenSLP       slp        -- slp.h
698test_lib_defmake ROAR_HAVE_LIBDNET       %            libdnet       dnet       -- sys/socket.h netdnet/dn.h netdnet/dnetdb.h
699OLD_MINIMAL=$MINIMAL
700MINIMAL=false
701test_lib_defmake ROAR_HAVE_BSDSOCKETS    %            BSDSockets    c          -- sys/types.h sys/socket.h
702test_lib_defmake ROAR_HAVE_UNIX          %            UNIX          c          -- sys/types.h sys/socket.h sys/un.h
703test_lib_defmake ROAR_HAVE_IPV4          %            IPv4          c          -- sys/types.h sys/socket.h 'netinet/in.h' winsock2.h
704MINIMAL=$OLD_MINIMAL
705test_lib_defmake ROAR_HAVE_IPX           %            IPX           c          -- netipx/ipx.h
706test_lib_defmake ROAR_HAVE_OSS           %            OSS           c          -- sys/ioctl.h sys/soundcard.h
707test_lib_defmake ROAR_HAVE_OSS_BSD       %            BSDOSS        c          -- sys/ioctl.h soundcard.h
708test_lib_defmake ROAR_HAVE_LIBWINMM      %            WinMM         winmm      -- windows.h mmsystem.h
709test_lib_defmake ROAR_HAVE_LIBASOUND     %            ALSA          asound     -- alsa/asoundlib.h alsa/pcm_external.h alsa/control_external.h
710test_lib_defmake ROAR_HAVE_LIBDL         %            DynLinkerLib  dl         -- dlfcn.h
711test_lib_defmake ROAR_HAVE_LIBZ          %            zlib          z          -- zlib.h
712test_lib_defmake ROAR_HAVE_LIBSENDFILE   %            sendfile      sendfile   -- sys/sendfile.h
713test_lib_defmake ROAR_HAVE_LIBSOCKET     %            libsocket     socket     -- sys/socket.h
714test_lib_defmake ROAR_HAVE_LIBX11        %            X11           X11        -- X11/Xlib.h X11/Xatom.h
715test_lib_defmake ROAR_HAVE_GTK_P_2_0     %            GTK+2.0       gtk+-2.0/t -- gtk/gtk.h gdk/gdkkeysyms.h
716test_lib_defmake ROAR_HAVE_LIBGCRYPT     %            libgcrypt     gcrypt     -- gcrypt.h
717test_lib_defmake ROAR_HAVE_LIBJACK       %            libjack       jack/t     -- jack/jack.h
718test_lib_defmake ROAR_HAVE_LIBUSTE       %            libuste       uste       -- uste.h
719test_netlibs
720
721echo >&3
722
723test_version ROAR_HAVE_CELT_VERSION      libcelt       celt
724test_version ROAR_HAVE_SPEEX_VERSION     libspeex      speex
725test_version ROAR_HAVE_PULSE_VERSION     libpulse      libpulse
726test_version ROAR_HAVE_GTK_P_2_0_VERSION GTK+2.0       gtk+-2.0
727test_version ROAR_HAVE_FLAC_VERSION      libflac       flac
728test_version ROAR_HAVE_PA19_VERSION      portaudio-19  portaudio-2.0
729
730echo >&3
731
732# Those tests should not be disabled as they do not reduce the lib size just
733# break --minimal on full systems
734
735OLD_MINIMAL=$MINIMAL
736MINIMAL=false
737# Test types:
738#         DEF                            type/name    init value               -- headers
739test_type ROAR_HAVE_T_ID_T               id_t
740test_type ROAR_HAVE_T_PID_T              pid_t
741test_type ROAR_HAVE_T_UID_T              uid_t
742test_type ROAR_HAVE_T_GID_T              gid_t
743test_type ROAR_HAVE_T_SOCKLEN_T          socklen_t    0                        -- sys/socket.h
744test_type ROAR_HAVE_T_MODE_T             mode_t
745test_type ROAR_HAVE_T_OFF_T              off_t
746test_type ROAR_HAVE_T_SSIZE_T            ssize_t
747test_type ROAR_HAVE_T_TIME_T             time_t
748test_type ROAR_HAVE_T_SA_FAMILY_T        sa_family_t  0                        -- sys/socket.h
749MINIMAL=$OLD_MINIMAL
750
751echo >&3
752
753# add a better test here
754#test_lib 'linux sendfile()'       -- sys/sendfile.h && echo '#define ROAR_HAVE_LINUX_SENDFILE' >&3
755
756
757echo -n 'checking for IPv6... '
758
759if $MINIMAL
760then
761 echo "disabled by user (minimalstic build)"
762else
763 echo '#include <sys/socket.h>'  > $TF_C
764 echo '#include <netinet/in.h>' >> $TF_C
765 echo 'int main (void) { struct sockaddr_in6 in6; return 0; }' >> $TF_C
766
767 if $CCTF 2> /dev/null;
768 then
769  echo '#define ROAR_HAVE_IPV6' >&3
770  echo yes
771 else
772  echo no
773 fi
774fi
775
776
777echo -n 'checking for _exit()... '
778
779echo '#include <unistd.h>'    > $TF_C
780echo 'int main (void) { _exit(0); return 0; }' >> $TF_C
781
782if $CCTF 2> /dev/null;
783then
784 echo '#define ROAR_HAVE_U_EXIT' >&3
785 echo '#define ROAR_U_EXIT _exit' >&3
786 echo yes
787else
788 echo '#define ROAR_U_EXIT exit' >&3
789 echo no
790fi
791
792#                 def                 name      call                         -- header
793test_func_defmake ROAR_HAVE_MALLOC    malloc    'malloc(0)'                  -- stdlib.h
794test_func_defmake ROAR_HAVE_CALLOC    calloc    'calloc(0, 0)'               -- stdlib.h
795test_func_defmake ROAR_HAVE_REALLOC   realloc   'realloc((void*)0, 0)'       -- stdlib.h
796test_func_defmake ROAR_HAVE_FREE      free      'free((void*)0)'             -- stdlib.h
797test_func_defmake ROAR_HAVE_STRDUP    strdup    'strdup((void*)0)'           -- string.h
798test_func_defmake ROAR_HAVE_STRNDUP   strndup   'strndup((void*)0)'          -- string.h
799test_func_defmake ROAR_HAVE_STRLEN    strlen    'strlen((void*)0)'           -- string.h
800test_func_defmake ROAR_HAVE_STRNLEN   strnlen   'strnlen((void*)0)'          -- string.h
801test_func_defmake ROAR_HAVE_SETENV    setenv    'setenv("", "", 0)'          -- stdlib.h
802test_func_defmake ROAR_HAVE_PUTENV    putenv    'putenv("")'                 -- stdlib.h
803test_func_defmake ROAR_HAVE_STRTOK_R  strtok_r  'strtok_r("","",(char**)0)'  -- string.h
804test_func_defmake ROAR_HAVE_STRLCPY   strlcpy   'strlcpy((char*)0, "", 0)'   -- string.h
805test_func_defmake ROAR_HAVE_STRLCAT   strlcat   'strlcat((char*)0, "", 0)'   -- string.h
806test_func_defmake ROAR_HAVE_QSORT     qsort     'qsort((void*)0, 0, 0, (int(*)(const void *, const void *))0)' -- stdlib.h
807test_func_defmake ROAR_HAVE_NICE      nice      'nice(0)'                    -- unistd.h
808test_func_defmake ROAR_HAVE_GETHOSTID gethostid 'gethostid()'                -- unistd.h
809test_func_defmake ROAR_HAVE_GETGID    getgid    'getgid()'                   -- sys/types.h unistd.h
810test_func_defmake ROAR_HAVE_GETUID    getuid    'getuid()'                   -- sys/types.h unistd.h
811test_func_defmake ROAR_HAVE_SETGID    setgid    'setgid(0)'                  -- sys/types.h unistd.h
812test_func_defmake ROAR_HAVE_SETUID    setuid    'setuid(0)'                  -- sys/types.h unistd.h
813test_func_defmake ROAR_HAVE_SETSID    setsid    'setsid()'                   -- sys/types.h unistd.h
814test_func_defmake ROAR_HAVE_GETPWNAM  getpwnam  'getpwnam("")'               -- sys/types.h pwd.h
815test_func_defmake ROAR_HAVE_GETGRNAM  getgrnam  'getgrnam("")'               -- sys/types.h grp.h
816test_func_defmake ROAR_HAVE_GETTIMEOFDAY gettimeofday 'struct timeval tv; gettimeofday(&tv, NULL)' -- sys/time.h time.h
817test_func_defmake ROAR_HAVE_USLEEP    usleep    'usleep(0)'                  -- sys/types.h unistd.h
818test_func_defmake ROAR_HAVE_SLEEP     sleep     'sleep(0)'                   -- unistd.h
819test_func_defmake ROAR_HAVE_NANOSLEEP nanosleep 'nanosleep((void*)0, (void*)0)' -- time.h
820test_func_defmake ROAR_HAVE_ALARM     alarm     'alarm(0)'                   -- sys/types.h unistd.h
821test_func_defmake ROAR_HAVE_TIME      time      'time((void*)0)'             -- time.h
822test_func_defmake ROAR_HAVE_CTIME     ctime     'ctime((void*)0)'            -- time.h
823test_func_defmake ROAR_HAVE_CTIME_R   ctime_r   'ctime_r((void*)0,(char*)0)' -- time.h
824test_func_defmake ROAR_HAVE_KILL      kill      'kill(0,0)'                  -- sys/types.h signal.h
825test_func_defmake ROAR_HAVE_UNAME     uname     'uname((void*)0)'            -- sys/utsname.h
826test_func_defmake ROAR_HAVE_GETHOSTNAME gethostname 'gethostname((void*)0, 0)' -- unistd.h
827test_func_defmake ROAR_HAVE_SYSLOG    syslog    'syslog(0, "")'              -- syslog.h
828test_func_defmake ROAR_HAVE_OPENLOG   openlog   'openlog("", 0, 0)'          -- syslog.h
829test_func_defmake ROAR_HAVE_CLOSELOG  closelog  'closelog()'                 -- syslog.h
830test_func_defmake ROAR_HAVE_FOPEN     fopen     'fopen("","")'               -- stdio.h
831test_func_defmake ROAR_HAVE_FDOPEN    fdopen    'fdopen(0,"")'               -- stdio.h
832test_func_defmake ROAR_HAVE_FREOPEN   freopen   'freopen("","",(void*)0)'    -- stdio.h
833test_func_defmake ROAR_HAVE_FCLOSE    fclose    'fclose(0)'                  -- stdio.h
834test_func_defmake ROAR_HAVE_FILENO    fileno    'fileno(0)'                  -- stdio.h
835test_func_defmake ROAR_HAVE_FTELL     ftell     'ftell(0)'                   -- stdio.h
836test_func_defmake ROAR_HAVE_FSEEK     fseek     'fseek(0, 0, 0)'             -- stdio.h
837test_func_defmake ROAR_HAVE_POPEN     popen     'popen("", "")'              -- stdio.h
838test_func_defmake ROAR_HAVE_PCLOSE    pclose    'pclose(0)'                  -- stdio.h
839test_func_defmake ROAR_HAVE_STAT      stat      'stat((char*)0, (void*)0)'   -- sys/types.h sys/stat.h unistd.h
840test_func_defmake ROAR_HAVE_SYSTEM    system    'system("")'                 -- stdlib.h
841test_func_defmake ROAR_HAVE_GETSOCKNAME getsockname 'getsockname(0, 0, 0)'   $lib_wsock32 -- sys/socket.h winsock.h
842test_func_defmake ROAR_HAVE_GETPEERNAME getpeername 'getpeername(0, 0, 0)'   $lib_wsock32 -- sys/socket.h winsock.h
843test_func_defmake ROAR_HAVE_GETSOCKOPT getsockopt 'getsockopt(0, 0, 0, (void*)0, (void*)0)' -- sys/types.h sys/socket.h
844test_func_defmake ROAR_HAVE_SETSOCKOPT setsockopt 'setsockopt(0, 0, 0, (void*)0, (void*)0)' -- sys/types.h sys/socket.h
845test_func_defmake ROAR_HAVE_GETADDRINFO getaddrinfo 'getaddrinfo((void*)0, (void*)0, (void*)0, (void**)0)' -- sys/types.h sys/socket.h netdb.h
846test_func_defmake ROAR_HAVE_RAND      rand      'rand()'                     -- stdlib.h
847test_func_defmake ROAR_HAVE_RAND_R    rand_r    'rand_r((unsigned int*)0)'   -- stdlib.h
848test_func_defmake ROAR_HAVE_SRAND     srand     'srand((unsigned int)0)'     -- stdlib.h
849test_func_defmake ROAR_HAVE_FCNTL     fcntl     'fcntl(0, 0)'                -- unistd.h fcntl.h
850test_func_defmake ROAR_HAVE_POSIX_OPENPT posix_openpt 'posix_openpt(0)'      -- stdlib.h fcntl.h
851test_func_defmake ROAR_HAVE_GRANTPT   grantpt   'grantpt(0)'                 -- stdlib.h
852test_func_defmake ROAR_HAVE_UNLOCKPT  unlockpt  'unlockpt(0)'                -- stdlib.h
853test_func_defmake ROAR_HAVE_TCGETATTR tcgetattr 'tcgetattr(0, (struct termios *)0)' -- termios.h unistd.h
854test_func_defmake ROAR_HAVE_TCSETATTR tcsetattr 'tcsetattr(0, TCSANOW, (struct termios *)0)' -- termios.h unistd.h
855test_func_defmake ROAR_HAVE_CFMAKERAW cfmakeraw 'cfmakeraw((struct termios *)0)' -- termios.h unistd.h
856test_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
857test_func_defmake ROAR_HAVE_LINUX_SENDFILE sendfile 'sendfile(-1, -1, (void*)0, 0)' -- sys/sendfile.h
858test_func_defmake ROAR_HAVE_GETVERSIONEX     GetVersionEx     'OSVERSIONINFO osinfo; osinfo.dwOSVersionInfoSize = sizeof(osinfo);GetVersionEx(&osinfo);'                -- windows.h
859
860test_func_defmake ROAR_HAVE_AO_APPEND_GLOBAL_OPTION ao_append_global_option 'ao_append_global_option("","")' ao -- ao/ao.h
861
862test_func_defmake ROAR_HAVE_DLADDR    dladdr    'dladdr((void*)0, (Dl_info*)0)' dl -- dlfcn.h
863echo "STATE: funcname_dladdr=$funcname_dladdr" >&5
864
865if [ "$funcname_dladdr" = 'false' ]
866then
867 infotext='retested with _GNU_SOURCE'
868 _old="$NEED_GNU_SOURCE"
869 NEED_GNU_SOURCE=true
870 test_func_defmake ROAR_HAVE_DLADDR    dladdr    'dladdr((void*)0, (Dl_info*)0)' dl -- dlfcn.h
871 [ "$funcname_dladdr" = 'false' ] && NEED_GNU_SOURCE="$_old"
872 infotext=''
873fi
874
875test_func_defmake ROAR_HAVE_CLOCK_GETRES  clock_getres  'struct timespec ts; clock_getres((clockid_t)0, &ts)'  -- time.h
876test_func_defmake ROAR_HAVE_CLOCK_GETTIME clock_gettime 'struct timespec ts; clock_gettime((clockid_t)0, &ts)' -- time.h
877test_func_defmake ROAR_HAVE_CLOCK_SETTIME clock_settime 'struct timespec ts; clock_settime((clockid_t)0, &ts)' -- time.h
878
879echo "STATE: funcname_clock_getres=$funcname_clock_getres" >&5
880echo "STATE: libname_rt=$libname_rt" >&5
881
882if [ "$funcname_clock_getres" = 'false' ]
883then
884 if $libname_rt
885 then
886  infotext='retested using realtime library'
887  test_func_defmake ROAR_HAVERT_CLOCK_GETRES  clock_getres  'struct timespec ts; clock_getres((clockid_t)0, &ts)'  $rt -- time.h
888  test_func_defmake ROAR_HAVERT_CLOCK_GETTIME clock_gettime 'struct timespec ts; clock_gettime((clockid_t)0, &ts)' $rt -- time.h
889  test_func_defmake ROAR_HAVERT_CLOCK_SETTIME clock_settime 'struct timespec ts; clock_settime((clockid_t)0, &ts)' $rt -- time.h
890  infotext=''
891  if $funcname_clock_getres
892  then
893   echo "clock_rt=-l$rt" >&4
894  fi
895 fi
896fi
897
898test_const_defmake ROAR_HAVE_CONST_CLOCK_REALTIME CLOCK_REALTIME clockid_t CLOCK_REALTIME -- time.h
899test_const_defmake ROAR_HAVE_CONST_CLOCK_MONOTONIC CLOCK_MONOTONIC clockid_t CLOCK_MONOTONIC -- time.h
900test_const_defmake ROAR_HAVE_CONST_CLOCK_PROCESS_CPUTIME_ID CLOCK_PROCESS_CPUTIME_ID clockid_t CLOCK_PROCESS_CPUTIME_ID -- time.h
901test_const_defmake ROAR_HAVE_CONST_CLOCK_THREAD_CPUTIME_ID CLOCK_THREAD_CPUTIME_ID clockid_t CLOCK_THREAD_CPUTIME_ID -- time.h
902test_const_defmake ROAR_HAVE_CONST_M_PI_2 M_PI_2 double M_PI_2 -- math.h
903
904
905test_var_defmake   ROAR_HAVE_VAR_H_ERRNO h_errno int h_errno -- netdb.h
906
907echo -n 'checking for basic IO calls... '
908
909cat <<EOF > $TF_C
910#include <sys/types.h>
911#include <sys/stat.h>
912#include <fcntl.h>
913#include <string.h>
914#include <unistd.h>
915
916int main(void) {
917 open(NULL, 0, 0);
918 close(0);
919 read(0, NULL, 0);
920 write(0, NULL, 0);
921 lseek(0, 0, 0);
922 return 0;
923}
924EOF
925
926if $CCTF 2> /dev/null;
927then
928 echo '#define ROAR_HAVE_IO_POSIX' >&3
929 echo posix
930else
931 echo none
932fi
933
934echo -n 'checking for basic FS calls... '
935
936cat <<EOF > $TF_C
937#include <string.h>
938#include <unistd.h>
939
940int main(void) {
941 chdir(NULL);
942 unlink(NULL);
943 return 0;
944}
945EOF
946
947if $CCTF 2> /dev/null;
948then
949 echo '#define ROAR_HAVE_FS_POSIX' >&3
950 echo posix
951else
952 echo none
953fi
954
955
956test_func_defmake ROAR_HAVE_CHROOT     chroot     'chroot((void*)0)'           -- unistd.h
957test_func_defmake ROAR_HAVE_MLOCK      mlock      'mlock((void*)0, 0)'         -- sys/mman.h
958test_func_defmake ROAR_HAVE_MUNLOCK    munlock    'munlock((void*)0, 0)'       -- sys/mman.h
959test_func_defmake ROAR_HAVE_MLOCKALL   mlockall   'mlockall(MCL_CURRENT|MCL_FUTURE)' -- sys/mman.h
960test_func_defmake ROAR_HAVE_MUNLOCKALL munlockall 'munlockall()'               -- sys/mman.h
961test_func_defmake ROAR_HAVE_MMAP       mmap       'mmap((void*)0,0,0,0,0,0)'   -- sys/mman.h
962
963echo -n 'checking for fsync()... '
964
965echo '#include <unistd.h>' > $TF_C
966echo 'int main (void) { fsync(0); return 0; }' >> $TF_C
967
968if $CCTF 2> /dev/null;
969then
970 echo '#define ROAR_HAVE_FSYNC' >&3
971 FSYNC=true
972 echo yes
973else
974 FSYNC=false
975 echo no
976fi
977
978echo -n 'checking for fdatasync()... '
979
980echo '#include <unistd.h>' > $TF_C
981echo 'int main (void) { fdatasync(0); return 0; }' >> $TF_C
982
983if $CCTF 2> /dev/null;
984then
985 echo '#define ROAR_HAVE_FDATASYNC' >&3
986 echo '#define ROAR_FDATASYNC fdatasync' >&3
987 echo yes
988else
989 $FSYNC && echo '#define ROAR_FDATASYNC fsync' >&3
990 echo no
991fi
992
993
994#test_func_defmake ROAR_HAVE_STRCASESTR strcasestr 'strcasestr("", "")'       -- string.h
995echo -n 'checking for strcasestr()... '
996
997echo '#define _GNU_SOURCE' > $TF_C
998echo '#include <string.h>' >> $TF_C
999echo 'int main (void) { strcasestr("", ""); return 0; }' >> $TF_C
1000
1001if $CCTF 2> /dev/null;
1002then
1003 echo '#define ROAR_HAVE_STRCASESTR' >&3
1004 NEED_GNU_SOURCE=true
1005 echo yes
1006else
1007 echo no
1008fi
1009
1010echo -n 'checking for fopencookie()... '
1011
1012echo '#define _GNU_SOURCE' > $TF_C
1013echo '#include <stdio.h>' >> $TF_C
1014echo 'int main (void) { cookie_io_functions_t f; fopencookie(NULL, "", f); return 0; }' >> $TF_C
1015
1016if $CCTF 2> /dev/null;
1017then
1018 echo '#define ROAR_HAVE_FOPENCOOKIE' >&3
1019 NEED_GNU_SOURCE=true
1020 echo yes
1021else
1022 echo no
1023fi
1024
1025echo -n 'checking for funopen()... '
1026
1027echo '#define __BSD_VISIBLE 1'  > $TF_C
1028echo '#include <stdio.h>'      >> $TF_C
1029echo 'int main (void) { funopen(NULL, NULL, NULL, NULL, NULL); return 0; }' >> $TF_C
1030
1031if $CCTF 2> /dev/null;
1032then
1033 echo '#define ROAR_HAVE_FUNOPEN' >&3
1034 echo '#define ROAR_NEED_BSD_VISIBLE' >&3
1035 echo yes
1036else
1037 echo no
1038fi
1039
1040test_func_defmake ROAR_HAVE_PIPE      pipe      'pipe(NULL)'                 -- unistd.h
1041test_func_defmake ROAR_HAVE_FORK      fork      'fork()'                     -- unistd.h
1042test_func_defmake ROAR_HAVE_WAIT      wait      'wait(NULL)'                 -- string.h sys/wait.h
1043test_func_defmake ROAR_HAVE_SINF      sinf      'sinf(0.)'                 m -- math.h
1044
1045echo -n 'checking for square root func... '
1046
1047if $TARGET_CYGWIN
1048then
1049 echo 'sqrt() (cygwin)'
1050elif [ "$SYSNAME" = 'FreeBSD' ]
1051then
1052 echo 'sqrt() (FreeBSD, fix your gcc)'
1053elif [ "$SYSNAME" = 'Linux' ]
1054then
1055 echo '#include <math.h>' > $TF_C
1056 echo 'int main (void) { sqrtl(0); return 0; }' >> $TF_C
1057
1058 if $CCTF -lm 2> /dev/null;
1059 then
1060  echo '#define ROAR_HAVE_SQRTL' >&3
1061  echo 'sqrtl()'
1062 else
1063  echo 'sqrt()'
1064 fi
1065else
1066 echo 'sqrt()'
1067fi
1068
1069echo -n 'checking for inline funcs... '
1070
1071echo 'inline int test (void) { return 0; }' > $TF_C
1072echo 'int main (void) { return test(); }'  >> $TF_C
1073
1074if $CCTF 2> /dev/null;
1075then
1076 echo '#define ROAR_HAVE_INLINE' >&3
1077 echo yes
1078else
1079 echo no
1080fi
1081
1082
1083test_pthread
1084
1085
1086echo -n 'checking for broken peercred... '
1087echo '#include <sys/types.h>'      >  $TF_C
1088echo '#include <sys/socket.h>'     >> $TF_C
1089echo '#include <sys/un.h>'         >> $TF_C
1090echo 'int main (void) { struct ucred cred; return 0; }'  >> $TF_C
1091
1092if $CCTF 2> /dev/null;
1093then
1094 echo working
1095else
1096 if $CCTF -D_GNU_SOURCE 2> /dev/null;
1097 then
1098  NEED_GNU_SOURCE=true
1099  echo need to set _GNU_SOURCE
1100 else
1101  echo '#define ROAR_BROKEN_PEERCRED' >&3
1102  echo broken
1103 fi
1104fi
1105
1106
1107test_func_defmake ROAR_HAVE_GETPEEREID getpeereid 'getpeereid(0, NULL, NULL)' -- sys/types.h sys/socket.h
1108
1109echo -n 'checking for select()... '
1110cat <<EOF > $TF_C
1111#ifndef WITHOUT_SYS_SELECT_H
1112#include <sys/select.h>
1113#endif
1114#ifdef WITH_WINSOCK_H
1115#include <winsock.h>
1116#endif
1117#include <sys/time.h>
1118#include <sys/types.h>
1119#include <unistd.h>
1120
1121int main (void) {
1122 fd_set rfds;
1123 struct timeval tv;
1124
1125 FD_ZERO(&rfds);
1126 FD_SET(0, &rfds);
1127
1128 tv.tv_sec  = 0;
1129 tv.tv_usec = 0;
1130
1131 select(1, &rfds, NULL, NULL, &tv);
1132
1133 return 0;
1134}
1135EOF
1136
1137if $CCTF 2> /dev/null;
1138then
1139 echo '#define ROAR_HAVE_SELECT' >&3
1140 echo '#define ROAR_HAVE_H_SYS_SELECT' >&3
1141 echo yes, POSIX.1-2001
1142elif $CCTF -DWITHOUT_SYS_SELECT_H 2> /dev/null;
1143then
1144 echo '#define ROAR_HAVE_SELECT' >&3
1145 echo yes, old style
1146elif $CCTF -DWITHOUT_SYS_SELECT_H -DWITH_WINSOCK_H $lib_wsock32 >&5 2>&5;
1147then
1148 echo '#define ROAR_HAVE_SELECT' >&3
1149 echo yes, WinSock
1150else
1151 echo no
1152fi
1153
1154echo -n 'checking for shutdown()... '
1155cat <<EOF > $TF_C
1156#include <sys/types.h>
1157#ifndef WITHOUT_SYS_SOCKET_H
1158#include <sys/socket.h>
1159#endif
1160#ifdef WITH_WINSOCK_H
1161#include <winsock.h>
1162#endif
1163
1164int main (void) { shutdown(0, 0); return 0; }
1165EOF
1166
1167if [ "$SYSNAME" = 'SunOS' ]
1168then
1169 _l='-lsocket'
1170else
1171 _l=''
1172fi
1173
1174if $CCTF $_l 2> /dev/null;
1175then
1176 echo '#define ROAR_HAVE_SHUTDOWN'     >&3
1177 echo '#define ROAR_SHUTDOWN shutdown' >&3
1178 echo yes
1179elif $CCTF -DWITHOUT_SYS_SOCKET_H -DWITH_WINSOCK_H $lib_wsock32 2> /dev/null;
1180then
1181 echo '#define ROAR_HAVE_SHUTDOWN'     >&3
1182 echo '#define ROAR_SHUTDOWN shutdown' >&3
1183 echo yes, WinSock
1184else
1185 echo '#define ROAR_SHUTDOWN(x,y) (-1)' >&3
1186 echo no
1187fi
1188
1189echo -n 'checking for accept()... '
1190cat <<EOF > $TF_C
1191#include <sys/types.h>
1192#ifndef WITHOUT_SYS_SOCKET_H
1193#include <sys/socket.h>
1194#endif
1195#ifdef WITH_WINSOCK_H
1196#include <winsock.h>
1197#endif
1198
1199int main (void) { accept(0, 0, 0); return 0; }
1200EOF
1201
1202if [ "$SYSNAME" = 'SunOS' ]
1203then
1204 _l='-lsocket'
1205else
1206 _l=''
1207fi
1208
1209if $CCTF $_l 2> /dev/null;
1210then
1211 echo '#define ROAR_HAVE_ACCEPT'     >&3
1212 echo '#define ROAR_ACCEPT accept'   >&3
1213 echo yes
1214elif $CCTF -DWITHOUT_SYS_SOCKET_H -DWITH_WINSOCK_H $lib_wsock32 2> /dev/null;
1215then
1216 echo '#define ROAR_HAVE_ACCEPT'     >&3
1217 echo '#define ROAR_ACCEPT accept'   >&3
1218 echo yes, WinSock
1219else
1220 echo '#define ROAR_ACCEPT(x,y,z) (-1)' >&3
1221 echo no
1222fi
1223
1224test_func_defmake ROAR_HAVE_GETOBJECTBYNAME getobjectbyname 'getobjectbyname(NULL)' dnet -- stdlib.h netdnet/dn.h netdnet/dnetdb.h
1225test_func_defmake ROAR_HAVE_GETSERVBYNAME   getservbyname   'getservbyname((void*)0, (void*)0)' -- netdb.h
1226
1227
1228# --- PulseAudio tests ---
1229test_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
1230
1231test_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; }'
1232
1233test_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; }'
1234
1235test_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; }'
1236
1237test_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; }'
1238# --- End of PulseAudio tests ---
1239
1240
1241echo -n 'checking for struct rsound'\''s sample size member... '
1242
1243cat > $TF_C << EOF
1244#define RSD_EXPOSE_STRUCT
1245#include <rsound.h>
1246
1247int main (void) {
1248 rsound_t var;
1249
1250 var.samplesize = 0;
1251
1252 return 0;
1253}
1254EOF
1255if $CCTF 2> /dev/null;
1256then
1257 echo '#define ROAR_HAVE_RSOUND_SAMPLESIZE'     >&3
1258 echo '#define ROAR_HAVE_RSOUND_SAMPLESIZE_MEMBER samplesize'   >&3
1259 echo samplesize
1260else
1261 echo '#define ROAR_HAVE_RSOUND_SAMPLESIZE_MEMBER framesize'   >&3
1262 echo framesize
1263fi
1264
1265echo -n 'checking for safe 32 bit integer overflow... '
1266
1267cat > $TF_C << EOF
1268#include <stdio.h>
1269#include <stdint.h>
1270#define TYPE uint32_t
1271#define MAX  ((TYPE)4294967295U)
1272
1273int main (void) {
1274 TYPE a = MAX;
1275
1276 a += 2;
1277
1278 if ( a == 1 ) {
1279  printf("#define ROAR_HAVE_SAFE_OVERFLOW\n");
1280  return 0;
1281 }
1282
1283 return 1;
1284}
1285EOF
1286
1287if $CCTF 2> /dev/null;
1288then
1289 $EXEC_HELPER $TF_E >&3 2> /dev/null
1290 if [ "$?" = '0' ]
1291 then
1292  echo yes
1293 else
1294  echo no
1295 fi
1296else
1297 echo 'no (can not compile!, no stdint.h?)'
1298fi
1299
1300echo -n 'checking for __LP64__... '
1301if $TARGET_WIN32
1302then
1303 echo 'no need to set (win32 build)'
1304else
1305cat > $TF_C << EOF
1306#include <stdio.h>
1307
1308int main (void) {
1309#ifdef __LP64__
1310 fprintf(stderr, "set by compiler\n");
1311#else
1312 if ( sizeof(int) == sizeof(void*) ) {
1313  fprintf(stderr, "no need to set\n");
1314 } else {
1315  fprintf(stderr, "need to set\n");
1316  printf("\n#ifndef __LP64__\n#define __LP64__\n#endif\n\n");
1317 }
1318#endif
1319 return 0;
1320}
1321EOF
1322 if $CCTF 2> /dev/null;
1323 then
1324  $EXEC_HELPER $TF_E >&3
1325 else
1326  echo 'error, can not compile'
1327  exit 1
1328 fi
1329fi
1330
1331echo -n 'checking for 64 bit types... '
1332if $TARGET_WIN32
1333then
1334 echo 'int64_t, uint64_t (win32 build)'
1335 echo '#define ROAR_NATIVE_INT64  int64_t'  >&3
1336 echo '#define ROAR_NATIVE_UINT64 uint64_t' >&3
1337else
1338cat > $TF_C << EOF
1339#include <stdio.h>
1340#include <stdint.h>
1341
1342int main (void) {
1343 char * i64 = NULL, * ui64 = NULL;
1344
1345 if ( sizeof(int) == 8 ) {
1346  i64 = "int"; ui64 = "unsigned int";
1347 } else if ( sizeof(long int) == 8 ) {
1348  i64 = "long int"; ui64 = "unsigned long int";
1349 } else if ( sizeof(long long int) == 8 ) {
1350  i64 = "long long int"; ui64 = "unsigned long long int";
1351 } else if ( sizeof(int64_t) == 8 ) {
1352  i64 = "int64_t"; ui64 = "uint64_t";
1353 } else {
1354  fprintf(stderr, "none\n");
1355  return 0;
1356 }
1357
1358 fprintf(stderr, "%s, %s\n", i64, ui64);
1359 printf("#define ROAR_NATIVE_INT64 %s\n#define ROAR_NATIVE_UINT64 %s\n", i64, ui64);
1360
1361 return 0;
1362}
1363EOF
1364 if $CCTF 2> /dev/null;
1365 then
1366  $EXEC_HELPER $TF_E >&3
1367 else
1368  echo 'error, can not compile'
1369  exit 1
1370 fi
1371fi
1372
1373test_cp_v
1374
1375echo -n 'checking for cdrom device... '
1376if [ -n "$CDROM" ]
1377then
1378 if [ "$CDROM" = '(none)' ]
1379 then
1380  echo "none (disabled by user)"
1381 else
1382  if $CROSS_COMPILE
1383  then
1384   echo "$CDROM (cross compile)"
1385  elif [ -e "$CDROM" ]
1386  then
1387   echo "$CDROM (forced by user)"
1388  else
1389   echo "$CDROM (not existing, forced by user)"
1390  fi
1391  echo '#define ROAR_DEFAULT_CDROM "'"$CDROM"'"' >&3
1392  echo '#define ROAR_HAVE_CDROM' >&3
1393 fi
1394elif $CROSS_COMPILE
1395then
1396 echo 'none (cross compiling, use --cdrom to enable CDROM support)'
1397else
1398 CDROM=$(ls /dev/cdrom /dev/rcd0c 2> /dev/null | head -n 1);
1399 if [ -e "$CDROM" ]
1400 then
1401  echo "$CDROM"
1402  echo '#define ROAR_DEFAULT_CDROM "'"$CDROM"'"' >&3
1403  echo '#define ROAR_HAVE_CDROM' >&3
1404 else
1405  echo 'none'
1406  echo '#define ROAR_HAVE_CDROM' >&3
1407 fi
1408fi
1409
1410echo -n 'checking for default tty device... '
1411if [ -n "$TTY_DEV" ]
1412then
1413 if [ "$TTY_DEV" = '(none)' ]
1414 then
1415  echo "none (disabled by user)"
1416 else
1417  if $CROSS_COMPILE
1418  then
1419   echo "$TTY_DEV (cross compile)"
1420  elif [ -e "$TTY_DEV" ]
1421  then
1422   echo "$TTY_DEV (forced by user)"
1423  else
1424   echo "$TTY_DEV (not existing, forced by user)"
1425  fi
1426  echo '#define ROAR_DEFAULT_TTY "'"$TTY_DEV"'"' >&3
1427 fi
1428elif $CROSS_COMPILE
1429then
1430 echo 'none (cross compiling, use --tty to set default device)'
1431else
1432 TTY_DEV=$(ls /dev/tty 2> /dev/null | head -n 1);
1433 if [ -e "$TTY_DEV" ]
1434 then
1435  echo "$TTY_DEV"
1436  echo '#define ROAR_DEFAULT_TTY "'"$TTY_DEV"'"' >&3
1437 else
1438  echo 'none'
1439 fi
1440fi
1441
1442echo -n 'checking for OSS device... '
1443if [ -n "$OSS_DEV" ]
1444then
1445 if [ "$OSS_DEV" = '(none)' ]
1446 then
1447  echo "none (disabled by user)"
1448 else
1449  if $CROSS_COMPILE
1450  then
1451   echo "$OSS_DEV (cross compile)"
1452  elif [ -e "$OSS_DEV" ]
1453  then
1454   echo "$OSS_DEV (forced by user)"
1455  else
1456   echo "$OSS_DEV (not existing, forced by user)"
1457  fi
1458  echo '#define ROAR_DEFAULT_OSS_DEV "'"$OSS_DEV"'"' >&3
1459 fi
1460elif $CROSS_COMPILE
1461then
1462 echo 'none (cross compiling, use --oss-dev to set default device)'
1463else
1464 OSS_DEV=$(ls /dev/dsp /dev/audio 2> /dev/null | head -n 1);
1465 if [ -e "$OSS_DEV" ]
1466 then
1467  echo "$OSS_DEV"
1468  echo '#define ROAR_DEFAULT_OSS_DEV "'"$OSS_DEV"'"' >&3
1469 else
1470  echo 'none'
1471 fi
1472fi
1473
1474echo -n 'checking for OSS mixer device... '
1475if [ -n "$OSS_MIX_DEV" ]
1476then
1477 if [ "$OSS_MIX_DEV" = '(none)' ]
1478 then
1479  echo "none (disabled by user)"
1480 else
1481  if $CROSS_COMPILE
1482  then
1483   echo "$OSS_MIX_DEV (cross compile)"
1484  elif [ -e "$OSS_MIX_DEV" ]
1485  then
1486   echo "$OSS_MIX_DEV (forced by user)"
1487  else
1488   echo "$OSS_MIX_DEV (not existing, forced by user)"
1489  fi
1490  echo '#define ROAR_DEFAULT_OSS_MIX_DEV "'"$OSS_MIX_DEV"'"' >&3
1491 fi
1492elif $CROSS_COMPILE
1493then
1494 echo 'none (cross compiling, use --oss-mixer-dev to set default device)'
1495else
1496 OSS_MIX_DEV=$(ls /dev/mixer 2> /dev/null | head -n 1);
1497 if [ -e "$OSS_MIX_DEV" ]
1498 then
1499  echo "$OSS_MIX_DEV"
1500  echo '#define ROAR_DEFAULT_OSS_MIX_DEV "'"$OSS_MIX_DEV"'"' >&3
1501 else
1502  echo 'none'
1503 fi
1504fi
1505
1506echo 'checking for DECnet status file... '"$PROC_NET_DECNET"
1507echo '#define ROAR_PROC_NET_DECNET "'"$PROC_NET_DECNET"'"' >&3
1508
1509echo -n 'checking for DECnet neighbour file... '
1510if [ -n "$PROC_NET_DECNET_NEIGH" ]
1511then
1512 if [ "$PROC_NET_DECNET_NEIGH" = '(none)' ]
1513 then
1514  echo "none (disabled by user)"
1515 else
1516  if $CROSS_COMPILE
1517  then
1518   echo "$PROC_NET_DECNET_NEIGH (cross compile)"
1519  elif [ -e "$PROC_NET_DECNET_NEIGH" ]
1520  then
1521   echo "$PROC_NET_DECNET_NEIGH (forced by user)"
1522  else
1523   echo "$PROC_NET_DECNET_NEIGH (not existing, forced by user)"
1524  fi
1525  echo '#define ROAR_PROC_NET_DECNET_NEIGH "'"$PROC_NET_DECNET_NEIGH"'"' >&3
1526 fi
1527elif $CROSS_COMPILE
1528then
1529 echo 'none (cross compiling, use --proc-net-decnet-neigh to set default device)'
1530else
1531 PROC_NET_DECNET_NEIGH=$(ls /proc/net/decnet_neigh 2> /dev/null | head -n 1);
1532 if [ -e "$PROC_NET_DECNET_NEIGH" ]
1533 then
1534  echo "$PROC_NET_DECNET_NEIGH"
1535  echo '#define ROAR_PROC_NET_DECNET_NEIGH "'"$PROC_NET_DECNET_NEIGH"'"' >&3
1536 else
1537  echo 'none'
1538 fi
1539fi
1540
1541echo -n 'checking for IP neighbour (ARP) file... '
1542if [ -n "$PROC_NET_ARP" ]
1543then
1544 if [ "$PROC_NET_ARP" = '(none)' ]
1545 then
1546  echo "none (disabled by user)"
1547 else
1548  if $CROSS_COMPILE
1549  then
1550   echo "$PROC_NET_ARP (cross compile)"
1551  elif [ -e "$PROC_NET_ARP" ]
1552  then
1553   echo "$PROC_NET_ARP (forced by user)"
1554  else
1555   echo "$PROC_NET_ARP (not existing, forced by user)"
1556  fi
1557  echo '#define ROAR_PROC_NET_ARP "'"$PROC_NET_ARP"'"' >&3
1558 fi
1559elif $CROSS_COMPILE
1560then
1561 echo 'none (cross compiling, use --proc-net-arp to set default device)'
1562else
1563 PROC_NET_ARP=$(ls /proc/net/arp 2> /dev/null | head -n 1);
1564 if [ -e "$PROC_NET_ARP" ]
1565 then
1566  echo "$PROC_NET_ARP"
1567  echo '#define ROAR_PROC_NET_ARP "'"$PROC_NET_ARP"'"' >&3
1568 else
1569  echo 'none'
1570 fi
1571fi
1572
1573echo -n 'checking for default audio group... '
1574if [ "$DEFAULT_GRP" = '(none)' ]
1575then
1576 echo "none (disabled by user)"
1577else
1578 echo "$DEFAULT_GRP"
1579 echo '#define ROAR_DEFAULT_SOCKGRP "'"$DEFAULT_GRP"'"' >&3
1580fi
1581
1582echo -n 'checking for user id of root/superuser... '
1583if [ "$ROOT_UID" = '(none)' ]
1584then
1585 echo "none (disabled by user)"
1586elif [ "$ROOT_UID" = '' ]
1587then
1588 ROOT_USER='root'
1589 ROOT_UID=`id -u $ROOT_USER`
1590 if [ "$ROOT_UID" = '' ]
1591 then
1592  echo "none (please report this)"
1593 else
1594  echo "$ROOT_UID($ROOT_USER)"
1595  echo '#define ROAR_ROOT_UID '"$ROOT_UID" >&3
1596 fi
1597else
1598 echo "$ROOT_UID"
1599 echo '#define ROAR_ROOT_UID '"$ROOT_UID" >&3
1600fi
1601
1602$NEED_GNU_SOURCE && echo '#define ROAR_NEED_GNU_SOURCE' >&3
1603
1604cat >&3 << EOF
1605
1606#if defined(ROAR_HAVE_LIBCELT0) && !defined(ROAR_HAVE_LIBCELT)
1607#define ROAR_HAVE_LIBCELT
1608#endif
1609EOF
1610
1611cd plugins
1612
1613#if $LIBAO
1614#then
1615# echo 'running libao plugin configure...'
1616#  cd ao/
1617# if [ "$AO_INST_DIR" = '' ]
1618# then
1619#  ./configure --force-have-roar --pkg-config "$PKG_CONFIG"                           && \
1620#    echo "subdir_plugins_ao=plugins/ao" >&4
1621# else
1622#  ./configure --force-have-roar --pkg-config "$PKG_CONFIG" --inst-dir "$AO_INST_DIR" && \
1623#    echo "subdir_plugins_ao=plugins/ao" >&4
1624# fi
1625# cd ..
1626#else
1627# echo "running libao plugin configure... disabled by user"
1628#fi
1629
1630if $XMMS
1631then
1632 echo 'running xmms plugin configure...'
1633 cd xmms/
1634  ./configure --force-have-roar --pkg-config "$PKG_CONFIG" --inst-dir "$XMMS_INST_DIR" && \
1635    echo "subdir_plugins_xmms=plugins/xmms" >&4
1636 cd ..
1637else
1638 echo "running xmms plugin configure... disabled by user"
1639fi
1640
1641#if $AUDACIOUS
1642#then
1643# echo 'running Audacious plugin configure...'
1644# cd audacious/
1645#  ./configure --force-have-roar --pkg-config "$PKG_CONFIG" --inst-dir "$AUDACIOUS_INST_DIR" && \
1646#    echo "subdir_plugins_audacious=plugins/audacious" >&4
1647# cd ..
1648#else
1649# echo "running Audacious plugin configure... disabled by user"
1650#fi
1651
1652if $COMP_PLUGINS
1653then
1654 # Do not build roard plugins on win32 as they use upwards binding (-rdynamic).
1655 # This mode of binding is not supported by PE.
1656 $TARGET_WIN32 || echo "subdir_plugins_roard=plugins/roard" >&4
1657 echo "subdir_plugins_universal=plugins/universal" >&4
1658fi
1659
1660cd ..
1661
1662cleanup_ccft
1663
1664write_footer_makefileconf
1665write_footer_configlog
1666write_footer_configh
1667
1668mv config.h include/roaraudio/
1669echo 'config.h created and moved into include/roaraudio/'
1670
1671#ll
Note: See TracBrowser for help on using the repository browser.