configure.in
上传用户:weiliju62
上传日期:2007-01-06
资源大小:619k
文件大小:6k
源码类别:

SCSI/ASPI

开发平台:

MultiPlatform

  1. dnl Process this file with autoconf to produce a configure script.
  2. AC_REVISION($Revision: 1.9 $)dnl
  3. cdrdao_version=1.1.3
  4. AC_INIT(cdrdao.lsm)
  5. AC_CONFIG_HEADER(config.h)
  6. AC_CONFIG_SUBDIRS(paranoia)
  7. AC_CANONICAL_HOST
  8. AC_ARG_WITH(pcctsbin,[  --with-pcctsbin=dir     set directory of PCCTS parser generator executables],pcctsbin=$withval,pcctsbin=default)
  9. AC_ARG_WITH(pcctsinc,[  --with-pcctsinc=dir     set directory of PCCTS parser generator includes],pcctsinc=$withval,pcctsinc=default)
  10. AC_ARG_WITH(linux-qnx-sched,[  --with-linux-qnx-sched  enable QNX real time scheduling for Linux],AC_DEFINE(LINUX_QNX_SCHEDULING))
  11. AC_ARG_WITH(posix-threads,[  --with-posix-threads    use Posix threads for ring buffer (default: on)],use_pthreads=$withval,use_pthreads=default)
  12. AC_ARG_WITH(scglib,[  --with-scglib           use Joerg Schillings SCSI library (default: on)],use_scglib=$withval,use_scglib=default)
  13. AC_ARG_WITH(scglib-inc,[  --with-scglib-inc=dir   set directory for SCSI library include files],scglib_inc=$withval,scglib_inc=default)
  14. AC_ARG_WITH(scglib-lib,[  --with-scglib-lib=dir   set directory that contains the SCSI library],scglib_lib=$withval,scglib_lib=default)
  15. dnl Checks for programs.
  16. AC_PROG_CC
  17. AC_PROG_CXX
  18. AC_PROG_CPP
  19. AC_PROG_INSTALL
  20. AC_PROG_RANLIB
  21. AC_PROG_MAKE_SET
  22. dnl Checks for header files.
  23. AC_HEADER_STDC
  24. AC_HEADER_SYS_WAIT
  25. AC_CHECK_HEADERS(fcntl.h malloc.h unistd.h sys/mman.h)
  26. dnl Checks for typedefs, structures, and compiler characteristics.
  27. AC_C_CONST
  28. AC_TYPE_SIGNAL
  29. AC_CHECK_SIZEOF(short)
  30. AC_CHECK_SIZEOF(int)
  31. case 2 in
  32. $ac_cv_sizeof_short) 
  33.                 AC_DEFINE(size16,short)
  34. SIZE16=TRUE;;
  35. $ac_cv_sizeof_int)
  36.                 AC_DEFINE(size16,int)
  37. SIZE16=TRUE;;
  38. esac
  39. if test -z "$SIZE16"; then
  40. AC_MSG_ERROR(No 16 bit type found on this platform!)
  41. fi
  42. dnl Checks for library functions.
  43. AC_CHECK_FUNCS(strerror)
  44. AC_CHECK_FUNCS(mlockall munlockall)
  45. AC_CHECK_FUNCS(seteuid setegid getpagesize)
  46. AC_CHECK_FUNCS(usleep)
  47. AC_CHECK_FUNC(sched_getparam,AC_DEFINE(HAVE_SCHED_GETPARAM),
  48.   AC_CHECK_LIB(posix4,sched_getparam,[use_libposix4=yes;AC_DEFINE(HAVE_SCHED_GETPARAM)]))
  49. AC_CHECK_FUNC(sched_get_priority_max,AC_DEFINE(HAVE_SCHED_GET_PRIORITY_MAX),
  50.   AC_CHECK_LIB(posix4,sched_get_priority_max,[use_libposix4=yes;AC_DEFINE(HAVE_SCHED_GET_PRIORITY_MAX)]))
  51. AC_CHECK_FUNC(sched_setscheduler,AC_DEFINE(HAVE_SCHED_SETSCHEDULER),
  52.   AC_CHECK_LIB(posix4,sched_setscheduler,[use_libposix4=yes;AC_DEFINE(HAVE_SCHED_SETSCHEDULER)]))
  53. dnl Check if libposix4 must be linked
  54. if test "$use_libposix4" = yes; then
  55.   extra_libs="$extra_libs -lposix4"
  56. fi
  57. dnl check if Posix threads should be used
  58. if test "$use_pthreads" = default; then
  59.   use_pthreads=yes
  60. fi
  61. if test "$use_pthreads" = yes; then
  62.   AC_CHECK_LIB(pthread,pthread_create,have_pthread=yes,have_pthread=no)
  63.   AC_CHECK_LIB(pthread32,pthread_create,have_pthread32=yes,have_pthread32=no)
  64.   AC_CHECK_LIB(c_r,pthread_create,have_c_r=yes,have_c_r=no)
  65.   if test "$have_pthread" = yes; then
  66.     AC_DEFINE(USE_POSIX_THREADS)
  67.     thread_libs="-lpthread"
  68.     thread_test_lib="pthread"
  69.   elif test "$have_pthread32" = yes; then
  70.     AC_DEFINE(USE_POSIX_THREADS)
  71.     thread_libs="-lpthread32"
  72.     thread_test_lib="pthread32"
  73.   elif test "$have_c_r" = yes; then
  74.     AC_DEFINE(USE_POSIX_THREADS)
  75.     thread_libs="-lc_r"
  76.     thread_test_lib="c_r"
  77.   else
  78.     use_pthreads=no
  79.   fi
  80.   if test "$use_pthreads" = yes; then
  81.     AC_CHECK_LIB($thread_test_lib,pthread_sigmask,AC_DEFINE(HAVE_PTHREAD_SIGMASK))
  82.     AC_CHECK_LIB($thread_test_lib,pthread_attr_setschedpolicy,AC_DEFINE(HAVE_PTHREAD_ATTR_SETSCHEDPOLICY))
  83.     AC_CHECK_LIB($thread_test_lib,pthread_attr_setschedparam,AC_DEFINE(HAVE_PTHREAD_ATTR_SETSCHEDPARAM))
  84.     AC_CHECK_LIB($thread_test_lib,pthread_getschedparam,AC_DEFINE(HAVE_PTHREAD_GETSCHEDPARAM))
  85.     AC_CHECK_LIB($thread_test_lib,pthread_setschedparam,AC_DEFINE(HAVE_PTHREAD_SETSCHEDPARAM))
  86.   fi
  87. fi  
  88. if test "$use_pthreads" = yes; then
  89.   mydefs="-D_THREAD_SAFE -D_REENTRANT $mydefs"
  90. fi
  91. dnl Checks for pccts parser generator
  92. if test "$pcctsbin" = default; then
  93.   pcctsbin=/usr/local/bin
  94. fi
  95. if test "$pcctsinc" = default; then
  96.   pcctsinc=/usr/local/include/pccts
  97. fi
  98. AC_CHECK_PROG(HAVE_ANTLR,antlr,yes,no,$pcctsbin)
  99. AC_CHECK_PROG(HAVE_DLG,dlg,yes,no,$pcctsbin)
  100. if test $HAVE_ANTLR != "yes" -o $HAVE_DLG != "yes" ; then
  101.   AC_MSG_ERROR([No PCCTS installation detected.])
  102. fi
  103. AC_PATH_GTKMM(1.0.0, xdao=xdao, [echo Disabled building of xcdrdao.])
  104. dnl Determine source for scsi interface class
  105. if test "$use_scglib" = default; then
  106.   use_scglib=yes
  107. fi
  108. if test "$use_scglib" = yes; then
  109.   AC_DEFINE(USE_SCGLIB)
  110.   if test "$scglib_inc" = default -o "$scglib_lib" = default; then
  111.     scsilib_dir=scsilib
  112.     scsilib_incl='-I$(srcdir)/../scsilib/export -I$(srcdir)/../scsilib/export/libschily'
  113.     scsilib_libs="-L../scsilib/export"
  114.   else
  115.     scsilib_dir=""
  116.     scsilib_incl="-I$scglib_inc"
  117.     scsilib_libs="-L$scglib_lib"
  118.   fi
  119.   
  120.   scsilib_libs="$scsilib_libs -lscg -lschily"
  121.   scsi_if_src=ScsiIf-lib.cc
  122.   
  123.   case "$host" in
  124.     *-freebsd3* | *-freebsd4*)
  125.        scsilib_libs="$scsilib_libs -lcam"
  126.        ;;
  127.   esac
  128. else
  129.   scsilib_dir=""
  130.   scsilib_incl=""
  131.   scsilib_libs=""
  132.   case "$host" in
  133.     *-linux-*)
  134.        scsi_if_src="ScsiIf-linux.cc sg_err.cc"
  135.        ;;
  136.     
  137.     *-freebsd3* | *-freebsd4*)
  138.        scsi_if_src="ScsiIf-freebsd-cam.cc"
  139.        scsilib_libs="-lcam"
  140.        ;;
  141.     *-pc-cygwin32)
  142.    scsi_if_src="ScsiIf-win.cc"
  143.    ;;
  144.     *)
  145.        AC_MSG_ERROR([Unsupported operating system: $host_os]) 
  146.        ;;
  147.     esac
  148. fi
  149. dnl Selection of buffer code
  150. case "$host" in
  151.   *)
  152.      dao_src=dao.cc
  153.      ;;
  154. esac
  155. dnl Additional operating system dependent selections
  156. case "$host" in
  157.   *-freebsd*)
  158.       if test "$use_pthreads" = yes; then
  159. mydefs="-pthread $mydefs"
  160. LDFLAGS="-pthread $LDFLAGS"
  161. dnl -lc_r is automatically done by the linker
  162. thread_libs=""
  163.       fi
  164.       ;;
  165. esac
  166. dnl Sound device selection for xcdrdao
  167. case "$host" in
  168.   *-linux-*)
  169.      sound_if_src=SoundIF-linux.cc
  170.      ;;
  171.   *-solaris*)
  172.       sound_if_src=SoundIF-solaris.cc
  173.       ;;
  174.   *)
  175.      sound_if_src=SoundIF-none.cc
  176.      ;;
  177. esac
  178. AC_SUBST(scsi_if_src)
  179. AC_SUBST(cdrdao_version)
  180. AC_SUBST(xdao)
  181. AC_SUBST(scsilib_dir)
  182. AC_SUBST(scsilib_incl)
  183. AC_SUBST(scsilib_libs)
  184. AC_SUBST(extra_libs)
  185. AC_SUBST(pcctsbin)
  186. AC_SUBST(pcctsinc)
  187. AC_SUBST(dao_src)
  188. AC_SUBST(sound_if_src)
  189. AC_SUBST(thread_libs)
  190. AC_SUBST(mydefs)
  191. AC_OUTPUT(edc_ecc/Makefile trackdb/Makefile dao/Makefile xdao/Makefile Makefile)