--- configure.orig	Mon Oct  7 03:53:55 2002
+++ configure	Sat Oct 12 18:06:18 2002
@@ -309,7 +309,7 @@
 # include <unistd.h>
 #endif"
 
-ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA PACKAGE VERSION ACLOCAL AUTOCONF AUTOMAKE AUTOHEADER MAKEINFO AMTAR install_sh STRIP ac_ct_STRIP INSTALL_STRIP_PROGRAM AWK SET_MAKE build build_cpu build_vendor build_os host host_cpu host_vendor host_os CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT DEPDIR am__include am__quote AMDEP_TRUE AMDEP_FALSE AMDEPBACKSLASH CCDEPMODE CXX CXXFLAGS ac_ct_CXX CXXDEPMODE CPP RANLIB ac_ct_RANLIB AR EGREP antlr_path dlg_path LAME_CFLAGS LAME_LIBS PKG_CONFIG GTKMM2_CFLAGS GTKMM2_LIBS LIBGUIMM2_CFLAGS LIBGUIMM2_LIBS scsi_if_src en_xdao en_toc2mp3 en_toc2cue en_cue2toc en_cdrdao scsilib_dir scsilib_incl scsilib_libs pccts_target pcctsinc dao_src sound_if_obj thread_libs mydefs COND_XDAO_TRUE COND_XDAO_FALSE COND_TOC2MP3_TRUE COND_TOC2MP3_FALSE COND_SCSILIB_TRUE COND_SCSILIB_FALSE LIBOBJS LTLIBOBJS'
+ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA PACKAGE VERSION ACLOCAL AUTOCONF AUTOMAKE AUTOHEADER MAKEINFO AMTAR install_sh STRIP ac_ct_STRIP INSTALL_STRIP_PROGRAM AWK SET_MAKE build build_cpu build_vendor build_os host host_cpu host_vendor host_os CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT DEPDIR am__include am__quote AMDEP_TRUE AMDEP_FALSE AMDEPBACKSLASH CCDEPMODE CXX CXXFLAGS ac_ct_CXX CXXDEPMODE CPP RANLIB ac_ct_RANLIB AR EGREP antlr_path dlg_path LAME_CFLAGS LAME_LIBS PKG_CONFIG GTKMM2_CFLAGS GTKMM2_LIBS LIBGUIMM2_CFLAGS LIBGUIMM2_LIBS scsi_if_src en_xdao en_toc2mp3 en_toc2cue en_cue2toc en_cdrdao scsilib_dir scsilib_incl scsilib_libs pcctsinc dao_src sound_if_obj thread_libs mydefs COND_XDAO_TRUE COND_XDAO_FALSE COND_TOC2MP3_TRUE COND_TOC2MP3_FALSE COND_SCSILIB_TRUE COND_SCSILIB_FALSE COND_PCCTS_TRUE COND_PCCTS_FALSE LIBOBJS LTLIBOBJS'
 ac_subst_files=''
 
 # Initialize some variables set by options.
@@ -873,6 +873,7 @@
   --with-scglib           use Joerg Schillings SCSI library (default: on)
   --with-scglib-inc=dir   set directory for SCSI library include files
   --with-scglib-lib=dir   set directory that contains the SCSI library
+  --without-xdao          disable building of gcdmaster
   --without-lame          disable building of toc2mp3
   --with-lame-lib=dir     set directory containing libmp3lame
   --with-lame-include=dir set directory containing lame include files
@@ -1806,6 +1807,14 @@
   scglib_lib=default
 fi;
 
+# Check whether --with-xdao or --without-xdao was given.
+if test "${with_xdao+set}" = set; then
+  withval="$with_xdao"
+  xdao=$withval
+else
+  xdao=default
+fi;
+
 
 ac_ext=c
 ac_cpp='$CPP $CPPFLAGS'
@@ -8016,15 +8025,13 @@
 fi
 
 
+en_pccts="no"
 if test "$pcctsbin" = default; then
   antlr_path='$(srcdir)/../pccts/bin/antlr'
   dlg_path='$(srcdir)/../pccts/bin/dlg'
 
 
-
-
-  pccts_target="pccts"
-
+  en_pccts="yes"
 else
   # Extract the first word of "antlr", so it can be a program name with args.
 set dummy antlr; ac_word=$2
@@ -8107,25 +8114,166 @@
 fi
 
 
-  if test $antlr_path = "no"; then
-    { { echo "$as_me:$LINENO: error: PCCTS: antlr not found in path." >&5
-echo "$as_me: error: PCCTS: antlr not found in path." >&2;}
-   { (exit 1); exit 1; }; }
+  if test $antlr_path = "no" || test $dlg_path = "no"; then
+    { echo "$as_me:$LINENO: WARNING: PCCTS: antlr or dlg not found in path, using own." >&5
+echo "$as_me: WARNING: PCCTS: antlr or dlg not found in path, using own." >&2;}
+    antlr_path='$(srcdir)/../pccts/bin/antlr'
+    dlg_path='$(srcdir)/../pccts/bin/dlg'
+    en_pccts="yes"
   fi
+fi
 
-  if test $dlg_path = "no" ; then
-    { { echo "$as_me:$LINENO: error: PCCTS: dlg not found in path." >&5
-echo "$as_me: error: PCCTS: dlg not found in path." >&2;}
-   { (exit 1); exit 1; }; }
+
+if test "$pcctsinc" = default; then
+  pcctsinc='$(srcdir)/../pccts/h'
+  antlr_path='$(srcdir)/../pccts/bin/antlr'
+  dlg_path='$(srcdir)/../pccts/bin/dlg'
+  en_pccts="yes"
+else
+  ac_save_CPPFLAGS="$CPPFLAGS"
+  CPPFLAGS="$CPPFLAGS -I$pcctsinc"
+  if test "${ac_cv_header_pcctscfg_h+set}" = set; then
+  echo "$as_me:$LINENO: checking for pcctscfg.h" >&5
+echo $ECHO_N "checking for pcctscfg.h... $ECHO_C" >&6
+if test "${ac_cv_header_pcctscfg_h+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+fi
+echo "$as_me:$LINENO: result: $ac_cv_header_pcctscfg_h" >&5
+echo "${ECHO_T}$ac_cv_header_pcctscfg_h" >&6
+else
+  # Is the header compilable?
+echo "$as_me:$LINENO: checking pcctscfg.h usability" >&5
+echo $ECHO_N "checking pcctscfg.h usability... $ECHO_C" >&6
+cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+$ac_includes_default
+#include <pcctscfg.h>
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_header_compiler=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_header_compiler=no
+fi
+rm -f conftest.$ac_objext conftest.$ac_ext
+echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+echo "${ECHO_T}$ac_header_compiler" >&6
+
+# Is the header present?
+echo "$as_me:$LINENO: checking pcctscfg.h presence" >&5
+echo $ECHO_N "checking pcctscfg.h presence... $ECHO_C" >&6
+cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <pcctscfg.h>
+_ACEOF
+if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
+  (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } >/dev/null; then
+  if test -s conftest.err; then
+    ac_cpp_err=$ac_c_preproc_warn_flag
+  else
+    ac_cpp_err=
   fi
+else
+  ac_cpp_err=yes
+fi
+if test -z "$ac_cpp_err"; then
+  ac_header_preproc=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+  ac_header_preproc=no
+fi
+rm -f conftest.err conftest.$ac_ext
+echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+echo "${ECHO_T}$ac_header_preproc" >&6
+
+# So?  What about this header?
+case $ac_header_compiler:$ac_header_preproc in
+  yes:no )
+    { echo "$as_me:$LINENO: WARNING: pcctscfg.h: accepted by the compiler, rejected by the preprocessor!" >&5
+echo "$as_me: WARNING: pcctscfg.h: accepted by the compiler, rejected by the preprocessor!" >&2;}
+    { echo "$as_me:$LINENO: WARNING: pcctscfg.h: proceeding with the preprocessor's result" >&5
+echo "$as_me: WARNING: pcctscfg.h: proceeding with the preprocessor's result" >&2;}
+    (
+      cat <<\_ASBOX
+## ------------------------------------ ##
+## Report this to bug-autoconf@gnu.org. ##
+## ------------------------------------ ##
+_ASBOX
+    ) |
+      sed "s/^/$as_me: WARNING:     /" >&2
+    ;;
+  no:yes )
+    { echo "$as_me:$LINENO: WARNING: pcctscfg.h: present but cannot be compiled" >&5
+echo "$as_me: WARNING: pcctscfg.h: present but cannot be compiled" >&2;}
+    { echo "$as_me:$LINENO: WARNING: pcctscfg.h: check for missing prerequisite headers?" >&5
+echo "$as_me: WARNING: pcctscfg.h: check for missing prerequisite headers?" >&2;}
+    { echo "$as_me:$LINENO: WARNING: pcctscfg.h: proceeding with the preprocessor's result" >&5
+echo "$as_me: WARNING: pcctscfg.h: proceeding with the preprocessor's result" >&2;}
+    (
+      cat <<\_ASBOX
+## ------------------------------------ ##
+## Report this to bug-autoconf@gnu.org. ##
+## ------------------------------------ ##
+_ASBOX
+    ) |
+      sed "s/^/$as_me: WARNING:     /" >&2
+    ;;
+esac
+echo "$as_me:$LINENO: checking for pcctscfg.h" >&5
+echo $ECHO_N "checking for pcctscfg.h... $ECHO_C" >&6
+if test "${ac_cv_header_pcctscfg_h+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_cv_header_pcctscfg_h=$ac_header_preproc
+fi
+echo "$as_me:$LINENO: result: $ac_cv_header_pcctscfg_h" >&5
+echo "${ECHO_T}$ac_cv_header_pcctscfg_h" >&6
 
-  pccts_target=""
+fi
+if test $ac_cv_header_pcctscfg_h = yes; then
+  :
+else
 
+    { echo "$as_me:$LINENO: WARNING: PCCTS: headers not found in path, using own." >&5
+echo "$as_me: WARNING: PCCTS: headers not found in path, using own." >&2;}
+    pcctsinc='$(srcdir)/../pccts/h'
+    antlr_path='$(srcdir)/../pccts/bin/antlr'
+    en_pccts="yes"
 fi
 
 
-if test "$pcctsinc" = default; then
-  pcctsinc='$(srcdir)/../pccts/h'
+  CPPFLAGS="$ac_save_CPPFLAGS"
 fi
 
 utiltools="toc2cue cue2toc"
@@ -8316,8 +8464,9 @@
 
 
 
-en_xdao=yes
-en_scsilib=yes
+en_xdao=no
+if test "$xdao" = default; then
+  en_xdao=yes
 
   succeeded=no
 
@@ -8510,7 +8659,9 @@
      en_xdao=no
   fi
 
+fi
 
+en_scsilib=yes
 if test "$use_scglib" = default; then
   use_scglib=yes
 fi
@@ -8542,7 +8693,10 @@
   scsi_if_src=ScsiIf-lib.cc
 
   case "$host" in
-    *-freebsd3* | *-freebsd4*)
+    *-freebsd2*)
+			       scsilib_libs="$scsilib_libs"
+			       ;;
+    *-freebsd[3456]*)
 			       scsilib_libs="$scsilib_libs -lcam"
 			       ;;
   esac
@@ -8558,7 +8712,7 @@
 	       scsi_if_src="ScsiIf-linux.cc sg_err.cc"
 	       ;;
 
-    *-freebsd3* | *-freebsd4*)
+    *-freebsd[3456]*)
 			       scsi_if_src="ScsiIf-freebsd-cam.cc"
 			       scsilib_libs="-lcam"
 			       ;;
@@ -8584,7 +8738,6 @@
 case "$host" in
   *-freebsd*)
 	      if test "$use_pthreads" = yes; then
-		mydefs="-pthread $mydefs"
 		LDFLAGS="-pthread $LDFLAGS"
 		thread_libs=""
 	      fi
@@ -8601,7 +8754,7 @@
 esac
 
 case "$host" in
-  *-linux-*)
+  *-linux-* | *-freebsd[456]*)
 	     sound_if_obj=SoundIF-linux.o
 	     ;;
 
@@ -8642,6 +8795,7 @@
 
 
 
+
 if test "$en_xdao" = yes; then
   COND_XDAO_TRUE=
   COND_XDAO_FALSE='#'
@@ -8671,6 +8825,16 @@
 fi
 
 
+
+if test "$en_pccts" = yes; then
+  COND_PCCTS_TRUE=
+  COND_PCCTS_FALSE='#'
+else
+  COND_PCCTS_TRUE='#'
+  COND_PCCTS_FALSE=
+fi
+
+
                                                                                           ac_config_files="$ac_config_files trackdb/Makefile dao/Makefile utils/Makefile xdao/Makefile xdao/stock/Makefile paranoia/Makefile Makefile specs/cdrdao.rh9.spec specs/cdrdao.fedora1.spec"
 
 
@@ -8793,6 +8957,13 @@
 Usually this means the macro was only invoked conditionally." >&2;}
    { (exit 1); exit 1; }; }
 fi
+if test -z "${COND_PCCTS_TRUE}" && test -z "${COND_PCCTS_FALSE}"; then
+  { { echo "$as_me:$LINENO: error: conditional \"COND_PCCTS\" was never defined.
+Usually this means the macro was only invoked conditionally." >&5
+echo "$as_me: error: conditional \"COND_PCCTS\" was never defined.
+Usually this means the macro was only invoked conditionally." >&2;}
+   { (exit 1); exit 1; }; }
+fi
 
 : ${CONFIG_STATUS=./config.status}
 ac_clean_files_save=$ac_clean_files
@@ -9398,7 +9569,6 @@
 s,@scsilib_dir@,$scsilib_dir,;t t
 s,@scsilib_incl@,$scsilib_incl,;t t
 s,@scsilib_libs@,$scsilib_libs,;t t
-s,@pccts_target@,$pccts_target,;t t
 s,@pcctsinc@,$pcctsinc,;t t
 s,@dao_src@,$dao_src,;t t
 s,@sound_if_obj@,$sound_if_obj,;t t
@@ -9410,6 +9580,8 @@
 s,@COND_TOC2MP3_FALSE@,$COND_TOC2MP3_FALSE,;t t
 s,@COND_SCSILIB_TRUE@,$COND_SCSILIB_TRUE,;t t
 s,@COND_SCSILIB_FALSE@,$COND_SCSILIB_FALSE,;t t
+s,@COND_PCCTS_TRUE@,$COND_PCCTS_TRUE,;t t
+s,@COND_PCCTS_FALSE@,$COND_PCCTS_FALSE,;t t
 s,@LIBOBJS@,$LIBOBJS,;t t
 s,@LTLIBOBJS@,$LTLIBOBJS,;t t
 CEOF
@@ -10029,6 +10201,7 @@
 echo
 echo "------------------------------------------------------"
 echo "  Building scsilib   : $en_scsilib"
+echo "  Building pccts     : $en_pccts"
 echo "  Building cdrdao    : $en_cdrdao"
 echo "  Building toc2cue   : $en_toc2cue"
 echo "  Building cue2toc   : $en_cue2toc"
