configure.in
changeset 294 d2d48e10f370
parent 292 eadc0746dfaf
child 295 54ad1d2f1325
     1.1 --- a/configure.in	Tue Mar 05 23:19:37 2002 +0000
     1.2 +++ b/configure.in	Wed Mar 06 05:20:11 2002 +0000
     1.3 @@ -324,12 +324,26 @@
     1.4  [  --enable-esd            support the Enlightened Sound Daemon [default=yes]],
     1.5                    , enable_esd=yes)
     1.6      if test x$enable_audio = xyes -a x$enable_esd = xyes; then
     1.7 -        AM_PATH_ESD(0.2.8, [
     1.8 -            CFLAGS="$CFLAGS -DESD_SUPPORT $ESD_CFLAGS"
     1.9 -            SYSTEM_LIBS="$SYSTEM_LIBS $ESD_LIBS"
    1.10 +	use_esd=no
    1.11 +        AM_PATH_ESD(0.2.8, use_esd=yes)
    1.12 +	if test x$use_esd = xyes; then
    1.13 +            AC_ARG_ENABLE(esd-shared,
    1.14 +[  --enable-esd-shared     dynamically load ESD support [default=yes]],
    1.15 +                          , enable_esd_shared=yes)
    1.16 +            esd_lib_spec=`echo $ESD_LIBS | sed 's/.*-L\([[^ ]]*\).*/\1\/libesd.so.*/'`
    1.17 +	    esd_lib=`ls $esd_lib_spec | head -1 | sed 's/.*\/\(.*\)/\1/'`
    1.18 +	    echo "-- $esd_lib_spec -> $esd_lib"
    1.19 +            if test x$enable_dlopen = xyes && \
    1.20 +               test x$enable_esd_shared = xyes && test x$esd_lib != x; then
    1.21 +                CFLAGS="$CFLAGS -DESD_SUPPORT -DESD_DYNAMIC=\$(esd_lib) $ESD_CFLAGS"
    1.22 +		AC_SUBST(esd_lib)
    1.23 +            else
    1.24 +                CFLAGS="$CFLAGS -DESD_SUPPORT $ESD_CFLAGS"
    1.25 +                SYSTEM_LIBS="$SYSTEM_LIBS $ESD_LIBS"
    1.26 +            fi
    1.27              AUDIO_SUBDIRS="$AUDIO_SUBDIRS esd"
    1.28              AUDIO_DRIVERS="$AUDIO_DRIVERS esd/libaudio_esd.la"
    1.29 -        ])
    1.30 +        fi
    1.31      fi
    1.32  }
    1.33  
    1.34 @@ -359,8 +373,20 @@
    1.35              CFLAGS="$save_CFLAGS"
    1.36              AC_MSG_RESULT($audio_arts)
    1.37              if test x$audio_arts = xyes; then
    1.38 -                CFLAGS="$CFLAGS -DARTSC_SUPPORT $ARTSC_CFLAGS"
    1.39 -                SYSTEM_LIBS="$SYSTEM_LIBS $ARTSC_LIBS"
    1.40 +                AC_ARG_ENABLE(arts-shared,
    1.41 +[  --enable-arts-shared     dynamically load ESD support [default=yes]],
    1.42 +                              , enable_arts_shared=yes)
    1.43 +                arts_lib_spec=`echo $ARTSC_LIBS | sed 's/.*-L\([[^ ]]*\).*/\1\/libarts.so.*/'`
    1.44 +	        arts_lib=`ls $arts_lib_spec | head -1 | sed 's/.*\/\(.*\)/\1/'`
    1.45 +	        echo "-- $arts_lib_spec -> $arts_lib"
    1.46 +                if test x$enable_dlopen = xyes && \
    1.47 +                   test x$enable_arts_shared = xyes && test x$arts_lib != x; then
    1.48 +                    CFLAGS="$CFLAGS -DARTSC_SUPPORT -DARTSC_DYNAMIC=\$(arts_lib) $ARTSC_CFLAGS"
    1.49 +		    AC_SUBST(arts_lib)
    1.50 +                else
    1.51 +                    CFLAGS="$CFLAGS -DARTSC_SUPPORT $ARTSC_CFLAGS"
    1.52 +                    SYSTEM_LIBS="$SYSTEM_LIBS $ARTSC_LIBS"
    1.53 +                fi
    1.54                  AUDIO_SUBDIRS="$AUDIO_SUBDIRS arts"
    1.55                  AUDIO_DRIVERS="$AUDIO_DRIVERS arts/libaudio_arts.la"
    1.56              fi
    1.57 @@ -1353,11 +1379,36 @@
    1.58      VIDEO_DRIVERS="$VIDEO_DRIVERS quartz/libvideo_quartz.la"
    1.59  }
    1.60  
    1.61 +dnl Check for the dlfcn.h interface for dynamically loading objects
    1.62 +CheckDLOPEN()
    1.63 +{
    1.64 +    AC_ARG_ENABLE(dlopen,
    1.65 +[  --enable-dlopen         use dlopen for shared object loading [default=yes]],
    1.66 +                  , enable_dlopen=yes)
    1.67 +    if test x$enable_dlopen = xyes; then
    1.68 +        AC_MSG_CHECKING(for dlopen)
    1.69 +        use_dlopen=no
    1.70 +        AC_TRY_COMPILE([
    1.71 +         #include <dlfcn.h>
    1.72 +        ],[
    1.73 +        ],[
    1.74 +        use_dlopen=yes
    1.75 +        ])
    1.76 +        AC_MSG_RESULT($use_dlopen)
    1.77 +
    1.78 +        if test x$use_dlopen = xyes; then
    1.79 +            CFLAGS="$CFLAGS -DUSE_DLOPEN"
    1.80 +            SYSTEM_LIBS="$SYSTEM_LIBS -ldl"
    1.81 +        fi
    1.82 +    fi
    1.83 +}
    1.84 +
    1.85  case "$target" in
    1.86      *-*-linux*)
    1.87          ARCH=linux
    1.88          CheckDummyVideo
    1.89          CheckDiskAudio
    1.90 +	CheckDLOPEN
    1.91          CheckNASM
    1.92          CheckOSS
    1.93          CheckALSA
    1.94 @@ -1429,6 +1480,7 @@
    1.95          ARCH=bsdi
    1.96          CheckDummyVideo
    1.97          CheckDiskAudio
    1.98 +	CheckDLOPEN
    1.99          CheckNASM
   1.100          CheckOSS
   1.101          CheckARTSC
   1.102 @@ -1480,6 +1532,7 @@
   1.103          ARCH=freebsd
   1.104          CheckDummyVideo
   1.105          CheckDiskAudio
   1.106 +	CheckDLOPEN
   1.107          CheckVGL
   1.108          CheckNASM
   1.109          CheckOSS
   1.110 @@ -1535,6 +1588,7 @@
   1.111          ARCH=netbsd
   1.112          CheckDummyVideo
   1.113          CheckDiskAudio
   1.114 +	CheckDLOPEN
   1.115          CheckNASM
   1.116          CheckOSS
   1.117          CheckARTSC
   1.118 @@ -1588,6 +1642,7 @@
   1.119          ARCH=openbsd
   1.120          CheckDummyVideo
   1.121          CheckDiskAudio
   1.122 +	CheckDLOPEN
   1.123          CheckOPENBSDAUDIO
   1.124          CheckNASM
   1.125          CheckOSS
   1.126 @@ -1647,6 +1702,7 @@
   1.127          ARCH=sysv5
   1.128          CheckDummyVideo
   1.129          CheckDiskAudio
   1.130 +	CheckDLOPEN
   1.131          CheckNASM
   1.132          CheckOSS
   1.133          CheckARTSC
   1.134 @@ -1696,6 +1752,7 @@
   1.135          CFLAGS="$CFLAGS -D__ELF__" # Fix for nasm on Solaris x86
   1.136          CheckDummyVideo
   1.137          CheckDiskAudio
   1.138 +	CheckDLOPEN
   1.139          CheckNASM
   1.140          CheckOSS
   1.141          CheckARTSC
   1.142 @@ -1744,6 +1801,7 @@
   1.143          ARCH=irix
   1.144          CheckDummyVideo
   1.145          CheckDiskAudio
   1.146 +	CheckDLOPEN
   1.147          CheckDMEDIA
   1.148          CheckESD
   1.149          CheckNAS
   1.150 @@ -1806,6 +1864,7 @@
   1.151          ARCH=hpux
   1.152          CheckDummyVideo
   1.153          CheckDiskAudio
   1.154 +	CheckDLOPEN
   1.155          CheckOSS
   1.156          CheckNAS
   1.157          CheckX11
   1.158 @@ -1853,6 +1912,7 @@
   1.159          ARCH=aix
   1.160          CheckDummyVideo
   1.161          CheckDiskAudio
   1.162 +	CheckDLOPEN
   1.163          CheckOSS
   1.164          CheckNAS
   1.165          CheckX11
   1.166 @@ -1898,6 +1958,7 @@
   1.167          ARCH=osf
   1.168          CheckDummyVideo
   1.169          CheckDiskAudio
   1.170 +	CheckDLOPEN
   1.171          CheckNAS
   1.172          CheckX11
   1.173          CheckGGI
   1.174 @@ -1944,6 +2005,7 @@
   1.175          ARCH=qnx
   1.176          CheckDummyVideo
   1.177          CheckDiskAudio
   1.178 +	CheckDLOPEN
   1.179          CheckNAS
   1.180          CheckPHOTON
   1.181          CheckX11