"Fossies" - the Fresh Open Source Software Archive

Member "libcdio-2.1.0/configure.ac" (17 Apr 2019, 25532 Bytes) of package /linux/privat/libcdio-2.1.0.tar.bz2:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) C and C++ source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file. See also the latest Fossies "Diffs" side-by-side code changes report for "configure.ac": 2.0.0_vs_2.1.0.

    1 dnl Copyright (C) 2003-2008, 2010, 2011-2014, 2018, 2019
    2 dnl Rocky Bernstein <rocky@gnu.org>
    3 dnl
    4 dnl This program is free software: you can redistribute it and/or modify
    5 dnl it under the terms of the GNU General Public License as published by
    6 dnl the Free Software Foundation, either version 3 of the License, or
    7 dnl (at your option) any later version.
    8 dnl
    9 dnl This program is distributed in the hope that it will be useful,
   10 dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
   11 dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   12 dnl GNU General Public License for more details.
   13 dnl
   14 dnl You should have received a copy of the GNU General Public License
   15 dnl along with this program.  If not, see <http://www.gnu.org/licenses/>.
   16 
   17 define(RELEASE_NUM, 2.1.0)
   18 define(CDIO_VERSION_STR, $1)
   19 
   20 AC_PREREQ(2.61)
   21 
   22 AC_INIT([libcdio], [CDIO_VERSION_STR(RELEASE_NUM)], [https://savannah.gnu.org/bugs/?group=libcdio])
   23 AC_CONFIG_SRCDIR(src/cd-info.c)
   24 AM_INIT_AUTOMAKE([foreign subdir-objects])
   25 
   26 AC_CANONICAL_HOST
   27 AC_CONFIG_HEADERS(config.h)
   28 AC_CONFIG_MACRO_DIR([m4])
   29 
   30 # Enable silent build rules by default (Automake v1.11 or later).
   31 # Disable by either passing --disable-silent-rules to configure or passing V=1 to make
   32 m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])],
   33          [AC_SUBST([AM_DEFAULT_VERBOSITY], [1])])
   34 
   35 # FIXME: write a m4 macro to convert x.y.zjunk to x*10000 + y*100 + z
   36 # LIBCDIO_VERSION_NUM=`echo RELEASE_NUM | cut -d . -f 1 | tr -d a-z`
   37 LIBCDIO_VERSION_NUM=20100
   38 AC_SUBST(LIBCDIO_VERSION_NUM)
   39 
   40 AM_MISSING_PROG(HELP2MAN, help2man, $missing_dir)
   41 AM_MAINTAINER_MODE
   42 
   43 AM_SANITY_CHECK
   44 
   45 AC_ARG_WITH(cd-drive,
   46     AC_HELP_STRING([--without-cd-drive], [don't build program cd-drive (default with)]),
   47 enable_cd_drive="${withval}", enable_cd_drive=yes)
   48 
   49 AC_ARG_WITH(cd-info,
   50     AC_HELP_STRING([--without-cd-info], [don't build program cd-info (default with)]),
   51 enable_cd_info="${withval}", enable_cd_info=yes)
   52 
   53 AC_ARG_WITH(cdda-player,
   54     AC_HELP_STRING([--without-cdda-player], [don't build program cdda-player (default with)]),
   55 enable_cdda_player="${withval}", enable_cdda_player=yes)
   56 
   57 AC_ARG_WITH(cd-read,
   58     AC_HELP_STRING([--without-cd-read], [don't build program cd-read (default with)]),
   59 enable_cd_read="${withval}", enable_cd_read=yes)
   60 
   61 AC_ARG_WITH(iso-info,
   62     AC_HELP_STRING([--without-iso-info], [don't build program iso-info (default with)]),
   63 enable_iso_info="${withval}", enable_iso_info=yes)
   64 
   65 AC_ARG_WITH(iso-read,
   66     AC_HELP_STRING([--without-iso-read], [don't build program iso-read (default with)]),
   67 enable_iso_read="${withval}", enable_iso_read=yes)
   68 
   69 AC_ARG_WITH(versioned-libs,
   70     AC_HELP_STRING([--without-versioned-libs], [build versioned library symbols (default enabled if you have GNU ld)]),
   71 enable_versioned_libs="${withval}", enable_versioned_libs=yes)
   72 
   73 AC_ARG_ENABLE([cxx],
   74     AC_HELP_STRING([--disable-cxx], [Disable C++ bindings (default enabled)]))
   75 AM_CONDITIONAL([ENABLE_CXX_BINDINGS], [test "x$enable_cxx" != "xno"])
   76 
   77 AC_ARG_ENABLE(cpp-progs,
   78     AC_HELP_STRING([--enable-cpp-progs], [make C++ example programs (default enabled)]))
   79 AM_CONDITIONAL(ENABLE_CPP, test "x$enable_cpp_progs" = "xyes")
   80 
   81 AC_ARG_ENABLE(example-progs,
   82     AC_HELP_STRING([--disable-example-progs], [Don't build libcdio sample programs]))
   83 
   84 AM_CONDITIONAL(BUILD_EXAMPLES, test "x$enable_example_progs" != "xno")
   85 
   86 dnl We use C
   87 AC_PROG_CC
   88 
   89 if test "x$enable_cxx" != "xno" ; then
   90   AC_PROG_CXX
   91 else
   92   am__fastdepCXX_TRUE='#'
   93   am__fastdepCXX_FALSE=
   94 fi
   95 
   96 dnl For iso_read test
   97 AC_CHECK_PROGS(ISO_MAKING_COMMAND, genisoimage mkisofs)
   98 
   99 dnl Checks for programs.
  100 
  101 cd_drivers='cdrdao, BIN/CUE, NRG'
  102 
  103 WARN_CFLAGS=''
  104 if test "x$GCC" != "xyes"; then
  105   AC_MSG_WARN([
  106   *** non GNU CC compiler detected.
  107   *** This package has not been tested very well with non GNU compilers
  108   *** you should try to use 'gcc' for compiling this package.])
  109 else
  110   CHECK_CFLAGS="
  111     -Wall
  112     -Wbad-function-cast
  113     -Wcast-align
  114     -Wchar-subscripts
  115     -Wdeclaration-after-statement
  116     -Wdisabled-optimization
  117     -Wendif-labels
  118     -Winline
  119     -Wmissing-declarations
  120     -Wmissing-prototypes
  121     -Wnested-externs
  122     -Wno-sign-compare
  123     -Wpointer-arith
  124     -Wshadow
  125     -Wstrict-prototypes
  126     -Wundef
  127     -Wunused
  128     -Wwrite-strings
  129 "
  130   for OPT in $CHECK_CFLAGS; do
  131     SAVE_CFLAGS="$CFLAGS"
  132     CFLAGS="$CFLAGS $OPT"
  133     AC_MSG_CHECKING([whether $CC understands $OPT])
  134     AC_TRY_COMPILE([], [], has_option=yes, has_option=no,)
  135     CFLAGS="$SAVE_CFLAGS"
  136     AC_MSG_RESULT($has_option)
  137     if test "x$has_option" = "xyes"; then
  138         WARN_CFLAGS="$WARN_CFLAGS $OPT"
  139     fi
  140     unset has_option
  141     unset SAVE_CFLAGS
  142   done
  143 fi
  144 CFLAGS="$CFLAGS $WARN_CFLAGS"
  145 
  146 # We use Perl for documentation and regression tests
  147 AC_PATH_PROG(PERL, perl, false)
  148 AC_SUBST(PERL)
  149 AM_CONDITIONAL(HAVE_PERL, test "x$PERL" != "xfalse")
  150 
  151 # We use a diff in regression testing
  152 AC_PATH_PROG(DIFF, diff, no)
  153 DIFF_OPTS=
  154 
  155 if test "x$DIFF" = "xno"; then
  156    AC_PATH_PROG(DIFF, cmp, no)
  157 else
  158   # Try for GNU diff options.
  159   # MSDOG output uses \r\n rather than \n in tests
  160   for diff_opt in -w --unified ; do
  161     if $DIFF $diff_opt ./configure ./configure > /dev/null 2>&1; then
  162       AC_MSG_RESULT([adding $diff_opt to diff in regression tests])
  163       DIFF_OPTS="$DIFF_OPTS $diff_opt"
  164     fi
  165   done
  166 fi
  167 AC_SUBST(DIFF)
  168 AC_SUBST(DIFF_OPTS)
  169 AC_SUBST(RM)
  170 
  171 dnl check for large file support
  172 AC_SYS_LARGEFILE
  173 
  174 dnl we need to define _FILE_OFFSET_BITS or _LARGE_FILES on the compiler command
  175 dnl line because otherwise the system headers risk being included before
  176 dnl problems
  177 if test "x$ac_cv_sys_largefiles" = "xyes"; then
  178     if test "x$ac_cv_sys_file_offset_bits" = "x64"; then
  179         LIBCDIO_LARGEFILE_FLAGS="-D_FILE_OFFSET_BITS=64 -D_LARGE_FILES"
  180     else
  181         LIBCDIO_LARGEFILE_FLAGS="-D_LARGE_FILES"
  182     fi
  183     if test "x$ac_cv_sys_largefile_source" != "xno"; then
  184         LIBCDIO_LARGEFILE_FLAGS="$LIBDDIO_LARGEFILE_FLAGS -D_LARGEFILE_SOURCE=$ac_cv_sys_largefile_source"
  185     fi
  186     CPPFLAGS="$CPPFLAGS $LIBCDIO_LARGEFILE_FLAGS"
  187 fi
  188 
  189 AC_DEFINE(LIBCDIO_CONFIG_H, 1,
  190   [Is set when libcdio's config.h has been included. Applications wishing to sue their own config.h values (such as set by the application's configure script can define this before including any of libcdio's headers.])
  191 
  192 dnl headers
  193 
  194 AC_HEADER_STDC
  195 AC_CHECK_HEADERS(alloca.h errno.h fcntl.h glob.h limits.h pwd.h stdbool.h)
  196 AC_CHECK_HEADERS(stdarg.h stdbool.h stdio.h sys/cdio.h sys/param.h \
  197          sys/time.h sys/timeb.h sys/utsname.h)
  198 AC_STRUCT_TIMEZONE
  199 
  200 ## FreeBSD 4 has getopt in unistd.h. So we include that before
  201 ## getopt.h
  202 AC_CHECK_HEADERS(unistd.h getopt.h)
  203 
  204 AC_SUBST(SBPCD_H)
  205 AC_SUBST(UCDROM_H)
  206 AC_SUBST(TYPESIZES)
  207 
  208 ## Check compiler-related things
  209 AC_C_BIGENDIAN
  210 AC_C_CONST
  211 AC_C_INLINE
  212 
  213 ## ISOC99_PRAGMA
  214 AC_MSG_CHECKING([whether $CC supports ISOC99 _Pragma()])
  215 AC_TRY_COMPILE([],[_Pragma("pack(1)")], [
  216   ISOC99_PRAGMA=yes
  217   AC_DEFINE(HAVE_ISOC99_PRAGMA, [], [Supports ISO _Pragma() macro])
  218 ],ISOC99_PRAGMA=no)
  219 AC_MSG_RESULT($ISOC99_PRAGMA)
  220 
  221 ## Check for Windows header files
  222 AC_CHECK_HEADERS([ntddcdrm.h ddk/ntddcdrm.h \
  223                   ntddscsi.h ddk/ntddscsi.h ddk/scsi.h],
  224 [], [], [AC_INCLUDES_DEFAULT
  225 #include <windows.h>
  226 ])
  227 
  228 ##
  229 ## Check for S_ISSOCK() and S_ISLNK() macros
  230 ##
  231 AC_MSG_CHECKING(for S_ISLNK() macro)
  232 AC_LINK_IFELSE([AC_LANG_PROGRAM([
  233 #ifdef HAVE_SYS_STAT_H
  234 # include <sys/stat.h>
  235 #endif
  236 ],[return S_ISLNK(0);])],
  237 [ AC_MSG_RESULT(yes); AC_DEFINE(HAVE_S_ISLNK, [], [Define this <sys/stat.h> defines S_ISLNK()]) ],
  238 [ AC_MSG_RESULT(no) ])
  239 
  240 AC_MSG_CHECKING([for S_ISSOCK() macro])
  241 AC_LINK_IFELSE([AC_LANG_PROGRAM([
  242 #ifdef HAVE_SYS_STAT_H
  243 # include <sys/stat.h>
  244 #endif
  245 ],[return S_ISSOCK(0);])],
  246 [ AC_MSG_RESULT(yes); AC_DEFINE(HAVE_S_ISSOCK, [], [Define this <sys/stat.h> defines S_ISSOCK()]) ],
  247 [ AC_MSG_RESULT(no) ])
  248 
  249 AC_MSG_CHECKING([for struct timespec])
  250 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([
  251 #ifdef HAVE_SYS_TIME_H
  252 #include <sys/time.h>
  253 #endif
  254 ],[struct timespec ts;])],
  255 [ AC_MSG_RESULT(yes); AC_DEFINE(HAVE_STRUCT_TIMESPEC, [], [Define this if you have struct timespec]) ],
  256 [ AC_MSG_RESULT(no) ])
  257 
  258 dnl empty_array_size
  259 AC_MSG_CHECKING([how to create empty arrays])
  260 
  261 empty_array_size="xxxx"
  262 AC_TRY_COMPILE([],[struct { int foo; int bar[]; } doo;], empty_array_size="")
  263 
  264 if test "x$empty_array_size" = "xxxx"; then
  265  AC_TRY_COMPILE([],[struct { int foo; int bar[0]; } doo;], empty_array_size="0")
  266 fi
  267 
  268 if test "x$empty_array_size" = "xxxx"; then
  269   AC_MSG_ERROR([compiler is unable to creaty empty arrays])
  270 else
  271   AC_DEFINE_UNQUOTED(EMPTY_ARRAY_SIZE, $empty_array_size,
  272     [what to put between the brackets for empty arrays])
  273   changequote(`,')
  274   msg="[${empty_array_size}]"
  275   changequote([,])
  276   AC_MSG_RESULT($msg)
  277 fi
  278 
  279 dnl Enable the creation of shared libraries under Win32.
  280 AC_LIBTOOL_WIN32_DLL
  281 
  282 dnl AM_PROG_LIBTOOL tests whether we have GNU ld
  283 dnl this must come before checking --with-versioned-libs
  284 dnl which requires GNU ld.
  285 AM_PROG_LIBTOOL
  286 
  287 dnl system
  288 
  289 # FIXME:
  290 # I believe some OS's require -lm, but I don't recall for what function
  291 # When we find it, put it in below instead of "cos".
  292 AC_CHECK_LIB(m, cos, [LIBS="$LIBS -lm"; COS_LIB="-lm"])
  293 AC_SUBST(COS_LIB)
  294 
  295 # Do we have GNU ld? If we don't, we can't build versioned symbols.
  296 if test "x$with_gnu_ld" != "xyes"; then
  297    AC_MSG_WARN([I don't see GNU ld. I'm going to assume --without-versioned-libs])
  298    enable_versioned_libs='no'
  299 fi
  300 # We also need GNU make to build versioned symbols.
  301 if test "x$enable_versioned_libs" = "xyes"; then
  302   if test -n "$MAKE" ; then
  303     $MAKE --version 2>/dev/null >/dev/null
  304     if test "$?" -ne 0 ; then
  305        AC_MSG_ERROR(Either set MAKE variable to GNU make or use
  306    --without-versioned-libs option)
  307     fi
  308   else
  309     make --version 2>/dev/null >/dev/null
  310     if test "$?" -ne 0 ; then
  311        AC_MSG_ERROR(Either set MAKE variable to GNU make or use
  312    --without-versioned-libs option)
  313     fi
  314   fi
  315 fi
  316 
  317 AM_CONDITIONAL(CYGWIN, test "x$CYGWIN" = "xyes")
  318 AM_CONDITIONAL(BUILD_CD_DRIVE, test "x$enable_cd_drive" = "xyes")
  319 AM_CONDITIONAL(BUILD_CDINFO, test "x$enable_cd_info" = "xyes")
  320 AM_CONDITIONAL(BUILD_CD_READ, test "x$enable_cd_read" = "xyes")
  321 AM_CONDITIONAL(BUILD_ISO_INFO, test "x$enable_iso_info" = "xyes")
  322 AM_CONDITIONAL(BUILD_ISO_READ, test "x$enable_iso_read" = "xyes")
  323 AM_CONDITIONAL(BUILD_CDINFO_LINUX, test "x$enable_cd_info_linux" = "xyes")
  324 AM_CONDITIONAL(BUILD_CDIOTEST, test "x$enable_cdiotest" = "xyes")
  325 AM_CONDITIONAL(BUILD_VERSIONED_LIBS, test "x$enable_versioned_libs" = "xyes")
  326 AM_CONDITIONAL(DISABLE_CPP, test "x$disable_cpp" = "xyes")
  327 
  328 dnl Checks for header files.
  329 
  330 LIBCDIO_CDDA_LIBS='$(top_builddir)/lib/cdda_interface/libcdio_cdda.la'
  331 LIBCDIO_CFLAGS='-I$(top_srcdir)/lib/driver -I$(top_builddir)/include -I$(top_srcdir)/include/'
  332 LIBCDIO_LIBS='$(top_builddir)/lib/driver/libcdio.la'
  333 LIBCDIO_DEPS="$LIBCDIO_LIBS"
  334 LIBCDIOPP_LIBS='$(top_builddir)/lib/cdio++/libcdio++.la'
  335 LIBISO9660PP_LIBS='$(top_builddir)/lib/cdio++/libiso9660++.la'
  336 LIBISO9660_CFLAGS='-I$(top_srcdir)/lib/iso9660/'
  337 LIBISO9660_LIBS='$(top_builddir)/lib/iso9660/libiso9660.la'
  338 LIBUDF_CFLAGS='-I$(top_srcdir)/lib/udf/'
  339 LIBUDF_LIBS='$(top_builddir)/lib/udf/libudf.la'
  340 AC_SUBST(LIBCDIO_CDDA_LIBS)
  341 AC_SUBST(LIBISO9660PP_LIBS)
  342 AC_SUBST(LIBCDIO_LIBS)
  343 AC_SUBST(LIBCDIOPP_LIBS)
  344 AC_SUBST(LIBCDIO_DEPS)
  345 AC_SUBST(LIBISO9660_LIBS)
  346 AC_SUBST(LIBUDF_LIBS)
  347 
  348 AC_MSG_CHECKING([Checking what sed uses for extended regular expressions])
  349 test -n "$SED" || SED=$ac_path_SED
  350 SED_EXTENDED_RE_FLAG='-r'
  351 result=$(echo 'define' | $SED -r -e 's/^define/foo/' 2>/dev/null)
  352 if [[ $? -ne 0 ]] ; then
  353     result=$(echo 'define' | $SED -E -e 's/^define/foo/' 2>/dev/null)
  354     if [[ $? -eq 0 ]] ; then
  355         SED_EXTENDED_RE_FLAG='-E'
  356     else
  357         AC_MSG_WARN([Don't have SED that understand extended RE's. Some minor compilation issues may fail.])
  358         SED_EXTENDED_RE_FLAG=''
  359     fi
  360 fi
  361 AC_MSG_RESULT($SED_EXTENDED_RE_FLAG)
  362 AC_SUBST(SED_EXTENDED_RE_FLAG)
  363 
  364 dnl Libtool flag for strict linkage
  365 LT_NO_UNDEFINED=
  366 
  367 dnl regression tests need native-style absolute paths.
  368 dnl native_abs_top_srcdir is used here.
  369 case $srcdir in
  370   .)  # We are building in place.
  371    native_abs_top_srcdir=$ac_pwd ;;
  372   [\\/]* | ?:[\\/]* )  # Absolute name.
  373     native_abs_top_srcdir=$srcdir ;;
  374   *) # Relative name.
  375     native_abs_top_srcdir=$ac_pwd/$srcdir ;;
  376 esac
  377 AC_SUBST(native_abs_top_srcdir)
  378 
  379 case $host_os in
  380      aix*)
  381        ## Don't use AIX driver until starts to really work
  382        ## cd_drivers="${cd_drivers}, AIX"
  383        ## AC_DEFINE([HAVE_AIX_CDROM], [1],
  384        ##     [Define 1 if you have AIX CD-ROM support])
  385        ;;
  386      darwin[[6-9]].*|darwin[[1-9]][[0-9]].*)
  387        AC_CHECK_HEADERS(IOKit/IOKitLib.h CoreFoundation/CFBase.h,
  388                         [have_iokit_h="yes"])
  389        if test "x$have_iokit_h" = "xyes" ; then
  390          AC_DEFINE([HAVE_DARWIN_CDROM], [1],
  391           [Define 1 if you have Darwin OS X-type CD-ROM support])
  392      DARWIN_PKG_LIB_HACK="-Wl,-framework,CoreFoundation -Wl,-framework,IOKit"
  393 
  394      dnl Prior to Mac OS X 10.4 (Tiger), DiskArbitration was a private framework.
  395      dnl It's now public, and it's needed to do cd/dvd unmount/eject.
  396      AC_MSG_CHECKING([for DiskArbitration framework])
  397      ac_save_LIBS="$LIBS" LIBS="$LIBS -framework CoreFoundation -framework DiskArbitration"
  398      AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <DiskArbitration/DiskArbitration.h>]], [[]])],
  399           [have_diskarbitration_framework=yes], [have_diskarbitration_framework=no])
  400      LIBS="$ac_save_LIBS"
  401      AC_MSG_RESULT([$have_diskarbitration_framework])
  402      if test "x$have_diskarbitration_framework" = "xyes"; then
  403          AC_DEFINE([HAVE_DISKARBITRATION], 1, [Define 1 if you have the Apple DiskArbitration framework])
  404          DARWIN_PKG_LIB_HACK="$DARWIN_PKG_LIB_HACK -Wl,-framework,DiskArbitration"
  405      fi
  406 
  407      AC_SUBST(DARWIN_PKG_LIB_HACK)
  408      LIBCDIO_LIBS="$LIBCDIO_LIBS $DARWIN_PKG_LIB_HACK"
  409          cd_drivers="${cd_drivers}, Darwin"
  410        fi
  411      ;;
  412      linux*|uclinux)
  413         AC_CHECK_HEADERS(linux/version.h linux/major.h)
  414         AC_CHECK_HEADERS(linux/cdrom.h, [have_linux_cdrom_h="yes"])
  415     if test "x$have_linux_cdrom_h" = "xyes"; then
  416        AC_TRY_COMPILE(,[
  417 #include <linux/cdrom.h>
  418 struct cdrom_generic_command test;
  419 int has_timeout=sizeof(test.timeout);],
  420             [AC_DEFINE([HAVE_LINUX_CDROM_TIMEOUT], [1],
  421                    [Define 1 if timeout is in cdrom_generic_command struct])])
  422        AC_DEFINE([HAVE_LINUX_CDROM], [1],
  423                      [Define 1 if you have Linux-type CD-ROM support])
  424        cd_drivers="${cd_drivers}, GNU/Linux"
  425     fi
  426     ;;
  427      bsdi*)
  428         AC_CHECK_HEADERS(dvd.h, [have_bsdi_dvd_h="yes"])
  429     if test "x$have_bsdi_dvd_h" = "xyes" ; then
  430           AC_DEFINE([HAVE_BSDI_CDROM], [1],
  431                     [Define 1 if you have BSDI-type CD-ROM support])
  432      LIBS="$LIBS -ldvd -lcdrom"
  433          LIBCDIO_LIBS="$LIBCDIO_LIBS  -lcdrom"
  434       cd_drivers="${cd_drivers}, BSDI"
  435     fi
  436     ;;
  437      sunos*|sun*|solaris*)
  438         AC_DEFINE([HAVE_SOLARIS_CDROM], [1],
  439                   [Define 1 if you have Solaris CD-ROM support])
  440       cd_drivers="${cd_drivers}, Solaris"
  441     ;;
  442      cygwin*)
  443     AC_DEFINE([CYGWIN], [1],
  444                   [Define 1 if you are compiling using cygwin])
  445         AC_DEFINE([HAVE_WIN32_CDROM], [1],
  446                   [Define 1 if you have MinGW CD-ROM support])
  447     LIBS="$LIBS -lwinmm"
  448     LT_NO_UNDEFINED="-no-undefined"
  449     cd_drivers="${cd_drivers}, MinGW"
  450         AC_DEFINE([NEED_TIMEZONEVAR], [1],
  451                   [Define 1 if you need timezone defined to get timzone
  452            defined as a variable. In cygwin it is a function too])
  453     ;;
  454      mingw*)
  455         AC_MSG_CHECKING(for MinGW-w64 headers)
  456         AC_COMPILE_IFELSE([AC_LANG_PROGRAM([
  457 #include <stdio.h>
  458 #if !defined(__MINGW64_VERSION_MAJOR)
  459 # error not mingw-w64 headers
  460 #endif])],
  461           [ AC_MSG_RESULT(yes)
  462             MINGW_W64_HEADERS=yes
  463             AC_DEFINE(MINGW_W64_HEADERS, [], [Define this if mingw-w64 headers are used]) ],
  464           [ AC_MSG_RESULT(no)
  465             MINGW_W64_HEADERS=no
  466           ])
  467         # regression tests need native-style absolute paths.
  468         # $native_srcdir is used here.
  469     if test "$cross_compiling" != yes; then
  470       native_abs_top_srcdir=$(cd $srcdir; /bin/bash.exe -c 'builtin pwd -W')
  471     fi
  472 
  473     AC_CHECK_HEADERS(windows.h)
  474     AC_DEFINE([MINGW32], [1],
  475                   [Define 1 if you are compiling using MinGW])
  476     MINGW32=1
  477     AC_DEFINE([HAVE_WIN32_CDROM], [1],
  478                   [Define 1 if you have MinGW CD-ROM support])
  479     LIBS="$LIBS -lwinmm"
  480     LT_NO_UNDEFINED="-no-undefined"
  481     cd_drivers="${cd_drivers}, MinGW "
  482     ## Cross-platform LFS support in MinGW requires an override of off_t
  483     if test "x$enable_largefile" != "xno"; then
  484       AC_MSG_RESULT([enabling support for large files (_FILE_OFFSET_BITS=64)])
  485           if test "x$MINGW_W64_HEADERS" = "xyes"
  486           then
  487         LIBCDIO_CFLAGS+=' -D_FILE_OFFSET_BITS=64 '
  488         LIBISO9660_CFLAGS+=' -D_FILE_OFFSET_BITS=64 '
  489           else
  490         LIBCDIO_CFLAGS+=' -D_FILE_OFFSET_BITS=64 -D_OFF_T_DEFINED -D_OFF_T_ -D_off_t=off64_t -Doff_t=off64_t'
  491         LIBISO9660_CFLAGS+=' -D_FILE_OFFSET_BITS=64 -D_OFF_T_DEFINED -D_OFF_T_ -D_off_t=off64_t -Doff_t=off64_t'
  492           fi
  493     fi
  494     joliet_supported="yes"
  495     if test "x$enable_cdda_player" = "xyes"; then
  496       AC_MSG_RESULT([disabling cdda_player (not supported on this platform)])
  497     fi
  498     enable_cdda_player="no"
  499     ;;
  500      freebsd[[4-9]].*|freebsd[[1-9]][[0-9]].*|dragonfly*|kfreebsd*)
  501         AC_DEFINE([HAVE_FREEBSD_CDROM], [1],
  502                   [Define 1 if you have FreeBSD CD-ROM support])
  503     LIBS="$LIBS -lcam"
  504     cd_drivers="${cd_drivers}, FreeBSD "
  505     ;;
  506      netbsd*|openbsd*)
  507         AC_DEFINE([HAVE_NETBSD_CDROM], [1],
  508                   [Define 1 if you have NetBSD CD-ROM support])
  509     # LIBS="$LIBS -lcam"
  510     cd_drivers="${cd_drivers}, NetBSD "
  511     enable_cdda_player="no"
  512     ;;
  513      os2*)
  514        AC_DEFINE([HAVE_OS2_CDROM], [1],
  515                   [Define 1 if you have OS/2 CD-ROM support])
  516        LT_NO_UNDEFINED="-no-undefined"
  517        LDFLAGS="$LDFLAGS -Zbin-files"
  518        cd_drivers="${cd_drivers}, OS2 "
  519        ;;
  520      *)
  521     AC_MSG_WARN([Don't have OS CD-reading support for ${host_os}...])
  522     AC_MSG_WARN([Will use generic support.])
  523     ;;
  524 esac
  525 
  526 AC_SUBST(LIBCDIO_CFLAGS)
  527 AC_SUBST(LIBISO9660_CFLAGS)
  528 AC_SUBST(LT_NO_UNDEFINED)
  529 
  530 AC_MSG_CHECKING(extern long timezone variable)
  531 AC_LINK_IFELSE([AC_LANG_SOURCE([[
  532 #ifdef NEED_TIMEZONEVAR
  533 #define timezonevar 1
  534 #endif
  535 
  536 #include <time.h>
  537 extern long timezone;
  538 int main(int argc, char **argv) {
  539   long test_timezone = timezone;
  540   return 0;
  541 }
  542 ]])
  543 ], [AC_MSG_RESULT(yes);
  544    AC_DEFINE([HAVE_TIMEZONE_VAR], 1,
  545     [Define if you have an extern long timenzone variable.])],
  546    [AC_MSG_RESULT(no)])
  547 dnl
  548 
  549 AC_SUBST(LINUX_CDROM_TIMEOUT)
  550 AC_SUBST(DARWIN_PKG_LIB_HACK)
  551 AC_SUBST(HAVE_BSDI_CDROM)
  552 AC_SUBST(HAVE_DARWIN_CDROM)
  553 AC_SUBST(HAVE_FREEBSD_CDROM)
  554 AC_SUBST(HAVE_LINUX_CDROM)
  555 AC_SUBST(HAVE_SOLARIS_CDROM)
  556 AC_SUBST(HAVE_WIN32_CDROM)
  557 AC_SUBST(HAVE_OS2_CDROM)
  558 
  559 LIBCDIO_SOURCE_PATH="`pwd`"
  560 AC_DEFINE_UNQUOTED(LIBCDIO_SOURCE_PATH, "$LIBCDIO_SOURCE_PATH",
  561     [Full path to libcdio top_sourcedir.])
  562 AC_SUBST(LIBCDIO_SOURCE_PATH)
  563 
  564 AC_CHECK_FUNCS( [chdir drand48 fseeko fseeko64 ftruncate geteuid getgid \
  565          getuid getpwuid gettimeofday lseek64 lstat memcpy memset mkstemp rand \
  566          seteuid setegid snprintf setenv strndup unsetenv tzset sleep \
  567          _stati64 usleep vsnprintf readlink realpath gmtime_r localtime_r] )
  568 
  569 # check for timegm() support
  570 AC_CHECK_FUNC(timegm, AC_DEFINE(HAVE_TIMEGM,1,
  571               [Define 1 if timegm is available]))
  572 
  573 AC_CHECK_MEMBER([struct tm.tm_gmtoff],
  574                 [AC_DEFINE(HAVE_TM_GMTOFF, 1,
  575                         [Define if struct tm has the tm_gmtoff member.])],
  576                  ,
  577                  [#include <time.h>])
  578 
  579 if test "x$ac_cv_member_struct_tm_tm_gmtoff" = "xyes"; then
  580   AC_MSG_CHECKING([whether time.h defines daylight and timezone variables])
  581   AC_COMPILE_IFELSE([AC_LANG_PROGRAM([
  582 #include <time.h>
  583 ],[return (timezone != 0) + daylight;])],
  584   [AC_DEFINE(HAVE_DAYLIGHT, 1,
  585    [Define if time.h defines extern long timezone and int daylight vars.])
  586    has_daylight=yes
  587    ],[has_daylight=no])
  588   AC_MSG_RESULT($has_daylight)
  589 
  590   AC_MSG_CHECKING([whether time.h defines tzname variable])
  591   AC_COMPILE_IFELSE([AC_LANG_PROGRAM([
  592 #include <time.h>
  593 ],[return (tzname != NULL);])],
  594   [AC_DEFINE(HAVE_TZNAME, 1,
  595    [Define if time.h defines extern extern char *tzname[2] variable])
  596    has_tzname=yes
  597    ],[has_tzname=no])
  598    AC_MSG_RESULT($has_tzname)
  599 fi
  600 
  601 AM_ICONV
  602 if test "x$am_cv_func_iconv" = "xno"; then
  603    AC_MSG_ERROR([iconv is needed])
  604 fi
  605 
  606 AC_ARG_ENABLE(joliet,
  607     AS_HELP_STRING([--disable-joliet], [don't include Joliet extension support (default enabled)]),
  608     [enable_joliet=$enableval],
  609     [enable_joliet=yes])
  610 
  611 AM_LANGINFO_CODESET
  612 if test "x${enable_joliet}" != "xno"; then
  613   joliet_supported="yes"
  614   if test "x$joliet_supported" = "xyes"; then
  615      AC_DEFINE(HAVE_JOLIET, [1],
  616      [Define 1 if you want ISO-9660 Joliet extension support.
  617      On most platforms, this requires libiconv to be installed.])
  618      HAVE_JOLIET=1
  619   else
  620      AC_MSG_ERROR([You must have iconv installed.])
  621   fi
  622 fi
  623 AC_SUBST(HAVE_JOLIET)
  624 
  625 AC_ARG_ENABLE(rock,
  626     AC_HELP_STRING([--enable-rock], [include Rock-Ridge extension support (default enabled)]),
  627     enable_rock=$enableval, enable_rock=yes)
  628 if test "x${enable_rock}" != "xno"; then
  629    AC_DEFINE(HAVE_ROCK, [1],
  630    [Define 1 if you want ISO-9660 Rock-Ridge extension support.])
  631    HAVE_ROCK=1
  632 fi
  633 AC_SUBST(HAVE_ROCK)
  634 AC_SUBST(MINGW32)
  635 AM_CONDITIONAL(ENABLE_ROCK, test "x$enable_rock" = "xyes")
  636 
  637 AC_ARG_ENABLE(cddb,
  638     AC_HELP_STRING([--enable-cddb], [include CDDB lookups in cd_info (default enabled)]),
  639     enable_cddb=$enableval, enable_cddb=check)
  640 if test "x$enable_cddb" != "xno"; then
  641    PKG_CHECK_MODULES(CDDB, libcddb >= 1.0.1, [
  642     HAVE_CDDB=yes
  643     AC_DEFINE(HAVE_CDDB, [], [Define this if you have libcddb installed])
  644     ],
  645     [AC_MSG_WARN([new enough libcddb not found. CDDB access disabled. Get libcddb from http://libcddb.sourceforge.net])
  646     HAVE_CDDB=no])
  647     AC_CHECK_LIB(socket, connect)
  648     AC_CHECK_FUNC(gethostbyname, , AC_CHECK_LIB(nsl, gethostbyname))
  649 fi
  650 
  651 
  652 AC_SUBST(CDDB_LIBS)
  653 
  654 # We have to disable cdda_player unless we have either ncurses.h or
  655 # curses.h
  656 have_ncurses_h='no'
  657 if test "x$enable_cdda_player" = "xyes"; then
  658     enable_cdda_player='no'
  659     AC_CHECK_HEADERS(ncurses.h,
  660            [enable_cdda_player='yes'; have_ncurses_h='yes'],
  661            [AC_CHECK_HEADERS(curses.h,
  662                             [enable_cdda_player='yes'],
  663                     [AC_CHECK_HEADERS(ncurses/ncurses.h,
  664                                       enable_cdda_player='yes')
  665                               ])])
  666 fi
  667 
  668 if test "x$enable_cdda_player" = "xyes"; then
  669   PKG_CHECK_MODULES(CDDA_PLAYER, ncurses,
  670                     [AC_DEFINE(HAVE_KEYPAD, [1], [Define this if your libcurses has keypad])],
  671                     [AC_CHECK_LIB(curses, keypad,
  672                                   [CDDA_PLAYER_LIBS="-lcurses"],
  673                                   [AC_MSG_WARN([Will not build cdda-player - did not find libncurses or libcurses])
  674                                     enable_cdda_player=no])])
  675 fi
  676 
  677 AM_CONDITIONAL(BUILD_CDDA_PLAYER, test "x$enable_cdda_player" = "xyes")
  678 AC_SUBST(CDDA_PLAYER_LIBS)
  679 
  680 AC_ARG_ENABLE(vcd_info,
  681     AC_HELP_STRING([--enable-vcd-info], [include Video CD Info from libvcd]),
  682         enable_vcd_info=${enableval},
  683         enable_vcd_info=no)
  684 if test "x$enable_vcd_info" = "xyes"; then
  685   PKG_CHECK_MODULES(VCDINFO, libvcdinfo >= 0.7.21,
  686   [AC_DEFINE([HAVE_VCDINFO],1,
  687   [Define this if you have libvcdinfo installed])],
  688   [AC_MSG_WARN(a new enough libvcdinfo not found.
  689 VCD info display in cd-info disabled.
  690 libvcdinfo is part of vcdimager. Get it from http://vcdimager.org)
  691    enable_vcd_info=no])
  692 fi
  693 
  694 AC_SUBST(VCDINFO_LIBS)
  695 AC_SUBST(VCDINFO_CFLAGS)
  696 
  697 dnl
  698 dnl Newest automake workaround - needed for multi-language manual pages
  699 dnl
  700 AC_SUBST(mkdir_p, "${MKDIR_P}")
  701 
  702 AC_CONFIG_COMMANDS([checks],
  703            [chmod +x test/check_cue.sh; chmod +x test/check_nrg.sh
  704            ])
  705 
  706 dnl
  707 dnl Output configuration files
  708 dnl
  709 ## AC_CONFIG_FILES([  po/Makefile.in\
  710 AC_CONFIG_FILES([
  711        Makefile \
  712        example/Makefile \
  713        include/Makefile \
  714        include/cdio/Makefile \
  715        include/cdio++/Makefile \
  716        include/cdio/version.h \
  717        doc/doxygen/Doxyfile \
  718        doc/Makefile \
  719        lib/Makefile \
  720        lib/driver/Makefile \
  721        lib/iso9660/Makefile \
  722        lib/udf/Makefile \
  723        libcdio.pc \
  724        libiso9660.pc \
  725        libudf.pc \
  726        package/libcdio.spec \
  727        src/Makefile \
  728        test/check_common_fn \
  729        test/data/Makefile \
  730        test/driver/Makefile \
  731        test/Makefile \
  732        ])
  733 
  734 if test "x$enable_cxx" != "xno" ; then
  735    AC_CONFIG_FILES([
  736       example/C++/Makefile \
  737       example/C++/OO/Makefile \
  738       lib/cdio++/Makefile \
  739       libcdio++.pc \
  740       libiso9660++.pc \
  741    ])
  742 fi
  743 
  744 # AC_CONFIG_FILES([po/Makefile])
  745 AC_CONFIG_FILES([test/check_cue.sh], [chmod +x test/check_cue.sh])
  746 AC_CONFIG_FILES([test/check_iso.sh], [chmod +x test/check_iso.sh])
  747 AC_CONFIG_FILES([test/check_nrg.sh], [chmod +x test/check_nrg.sh])
  748 AC_CONFIG_FILES([test/check_udf.sh], [chmod +x test/check_udf.sh])
  749 AC_CONFIG_FILES([test/check_iso_read.sh], [chmod +x test/check_iso_read.sh])
  750 AC_OUTPUT
  751 
  752 AC_MSG_NOTICE([
  753 Using CD-ROM drivers : $cd_drivers
  754 Building cd-info     : $(test "x$enable_cd_info" = "xyes" && echo yes || echo no)
  755 Building cd-read     : $(test "x$enable_cd_read" = "xyes" && echo yes || echo no)
  756 Building cdda-player : $(test "x$enable_cdda_player" = "xyes" && echo yes || echo no)
  757 Building iso-info    : $(test "x$enable_iso_info" = "xyes" && echo yes || echo no)
  758 Building iso-read    : $(test "x$enable_iso_read" = "xyes" && echo yes || echo no)
  759 Building C++ programs: $(test "x$enable_cxx" != "xno" && echo yes || echo no)])