Diff for /embedaddon/istgt/configure.in between versions 1.1.1.1 and 1.1.1.2

version 1.1.1.1, 2012/02/21 16:42:02 version 1.1.1.2, 2012/10/09 09:13:23
Line 1 Line 1
 #                                               -*- Autoconf -*-  #                                               -*- Autoconf -*-
 # Process this file with autoconf to produce a configure script.  # Process this file with autoconf to produce a configure script.
   
AC_PREREQ(2.62)AC_PREREQ([2.62])
AC_INIT(istgt, 0.4)AC_INIT([istgt], [0.5])
 AC_CONFIG_SRCDIR([src/istgt.c])  AC_CONFIG_SRCDIR([src/istgt.c])
 AC_CONFIG_HEADERS([src/config.h])  AC_CONFIG_HEADERS([src/config.h])
   
 # Checks for programs.  # Checks for programs.
AC_PROG_CCAC_PROG_CC([clang gcc cc])
 AC_PROG_INSTALL  AC_PROG_INSTALL
 AC_PROG_RANLIB  AC_PROG_RANLIB
 AC_PROG_SED  AC_PROG_SED
   AC_PROG_MKDIR_P
   
   # clagn with -O3
   if test "$CC" = "clang" && test "$ac_test_CFLAGS" != "set"; then
     CFLAGS="-g -O3"
   fi
   
   # host OS related
   vboxinc="/usr/local/src/virtualbox/*/include"
   vboxlib="/usr/local/lib/virtualbox"
   AC_SUBST([rctemplate], [""])
   AC_SUBST([rcdir], ['${prefix}/etc/rc.d'])
   AC_CANONICAL_HOST
   case "$host_os" in
   *linux*)
           tmp="/usr/src/virtualbox/*/include"
           if test -d "`echo $tmp`"; then
               vboxinc=$tmp
           fi
           vboxlib="/usr/lib/virtualbox"
           AC_SUBST([rctemplate], ["istgt_linux.sh.in"])
           AC_SUBST([rcdir], ['/etc/init.d'])
           AC_DEFINE([_GNU_SOURCE], 1, [Define if linux host])
           ;;
   *netbsd*)
           AC_SUBST([rctemplate], ["istgt_netbsd.sh.in"])
           AC_SUBST([rcdir], ['/etc/rc.d'])
           ;;
   *freebsd*)
           tmp="/usr/ports/emulators/virtualbox-ose/work/*/include"
           if test -d "`echo $tmp`"; then
               vboxinc=$tmp
           else
               tmp="/usr/ports/emulators/virtualbox-ose-legacy/work/*/include"
               if test -d "`echo $tmp`"; then
                   vboxinc=$tmp
               fi
           fi
           vboxlib="/usr/local/lib/virtualbox"
           AC_SUBST([rctemplate], ["istgt.sh.in"])
           AC_SUBST([rcdir], ['${prefix}/etc/rc.d'])
           if test "$mandir" = '${datarootdir}/man'; then
               AC_SUBST([mandir], ['${prefix}/man'])
           fi
           ;;
   esac
   
 # Checks for libraries.  # Checks for libraries.
 AC_CHECK_LIB([pthread], [pthread_create])  AC_CHECK_LIB([pthread], [pthread_create])
 AC_CHECK_LIB([crypto], [MD5_Update])  AC_CHECK_LIB([crypto], [MD5_Update])
Line 51  AC_CHECK_HEADERS([pthread_np.h], [], [], Line 97  AC_CHECK_HEADERS([pthread_np.h], [], [],
 ])  ])
 AC_CHECK_FUNCS([strlcpy arc4random srandomdev pthread_yield sched_yield])  AC_CHECK_FUNCS([strlcpy arc4random srandomdev pthread_yield sched_yield])
 AC_CHECK_FUNCS([pthread_set_name_np setproctitle])  AC_CHECK_FUNCS([pthread_set_name_np setproctitle])
AC_SUBST(MKDEP)AC_SUBST([MKDEP])
AC_PATH_PROG(MKDEP, "mkdep")AC_PATH_PROG([MKDEP], ["mkdep"])
 #if test -z "$MKDEP"; then  #if test -z "$MKDEP"; then
#   AC_PATH_PROG(MKDEP, "makedepend")#   AC_PATH_PROG([MKDEP], ["makedepend"])
 #fi  #fi
   
 # paths  # paths
Line 63  mediadir="/var/istgt" Line 109  mediadir="/var/istgt"
 if test "$prefix" != "NONE"; then  if test "$prefix" != "NONE"; then
   configdir="$prefix/etc/istgt"    configdir="$prefix/etc/istgt"
 fi  fi
AC_ARG_WITH(configdir,AC_ARG_WITH([configdir],
[  --with-configdir=DIR (default $ac_default_prefix/etc/istgt)],  AS_HELP_STRING([--with-configdir=DIR], [(default PREFIX/etc/istgt)]),
   [case $withval in    [case $withval in
     yes|no)      yes|no)
         ;;          ;;
Line 72  AC_ARG_WITH(configdir, Line 118  AC_ARG_WITH(configdir,
         configdir="$withval"          configdir="$withval"
         ;;          ;;
   esac])    esac])
AC_SUBST(configdir)AC_SUBST([configdir])
AC_ARG_WITH(mediadir,AC_ARG_WITH([mediadir],
[  --with-mediadir=DIR (default /var/istgt)],  AS_HELP_STRING([--with-mediadir=DIR], [(default /var/istgt)]),
   [case $withval in    [case $withval in
     yes|no)      yes|no)
         ;;          ;;
Line 82  AC_ARG_WITH(mediadir, Line 128  AC_ARG_WITH(mediadir,
         mediadir="$withval"          mediadir="$withval"
         ;;          ;;
   esac])    esac])
AC_SUBST(mediadir)AC_SUBST([mediadir])
   
   # startup script directory
   AC_ARG_WITH([rcdir],
     AS_HELP_STRING([--with-rcdir=DIR], [(default PREFIX/etc/rc.d)]),
     [case $withval in
       yes|no)
           ;;
       *)
           rcdir="$withval"
           ;;
     esac])
   AC_SUBST([rcdir])
   
 # test for -Wall  # test for -Wall
 saved_CFLAGS="$CFLAGS"  saved_CFLAGS="$CFLAGS"
 AC_MSG_CHECKING([whether the C compiler accepts -Wall])  AC_MSG_CHECKING([whether the C compiler accepts -Wall])
Line 93  AC_TRY_COMPILE(,, Line 151  AC_TRY_COMPILE(,,
   AC_MSG_RESULT(no))    AC_MSG_RESULT(no))
 CFLAGS="$saved_CFLAGS"  CFLAGS="$saved_CFLAGS"
   
   # test for -Wextra
   saved_CFLAGS="$CFLAGS"
   AC_MSG_CHECKING([whether the C compiler accepts -Wextra])
   CFLAGS="$CFLAGS -Wextra"
   AC_TRY_COMPILE(,,
     AC_MSG_RESULT(yes); saved_CFLAGS="$CFLAGS",
     AC_MSG_RESULT(no))
   CFLAGS="$saved_CFLAGS"
   
 # check enable features  # check enable features
 AC_MSG_CHECKING([whether to use debug mode])  AC_MSG_CHECKING([whether to use debug mode])
AC_ARG_ENABLE(debug,AC_ARG_ENABLE([debug],
  [  --enable-debug          enable debug(logging) ],  AS_HELP_STRING([--enable-debug], [enable debug(logging)]),
  AC_MSG_RESULT(yes); AC_DEFINE(DEBUG, 1, [Define if enable debug]),  AC_MSG_RESULT(yes); AC_DEFINE([DEBUG], 1, [Define if enable debug]),
   AC_MSG_RESULT(no))    AC_MSG_RESULT(no))
AC_SUBST(DEBUG)AC_SUBST([DEBUG])
   
   AC_MSG_CHECKING([whether to use symlink device])
   AC_ARG_ENABLE([symlink-device],
     AS_HELP_STRING([--enable-symlink-device], [allow symlink device]),
     AC_MSG_RESULT(yes); AC_DEFINE([ALLOW_SYMLINK_DEVICE], 1, [Define if enable symlink-device]),
     AC_MSG_RESULT(no))
   AC_SUBST([ALLOW_SYMLINK_DEVICE])
   
 AC_MSG_CHECKING([which syslog facility to use])  AC_MSG_CHECKING([which syslog facility to use])
AC_ARG_WITH(logfacility,AC_ARG_WITH([logfacility],
  [  --with-logfacility   syslog facility to log with (default "local7")],  AS_HELP_STRING([--with-logfacility], [syslog facility to log with (default "local7")]),
   [case $with_logfacility in    [case $with_logfacility in
     daemon|auth|authpriv|local0|local1|local2|local3|local4|local5|local6|local7)      daemon|auth|authpriv|local0|local1|local2|local3|local4|local5|local6|local7)
         logfacility=$with_logfacility          logfacility=$with_logfacility
Line 112  AC_ARG_WITH(logfacility, Line 186  AC_ARG_WITH(logfacility,
         ;;          ;;
   esac],    esac],
   [logfacility="local7"])    [logfacility="local7"])
AC_DEFINE_UNQUOTED(DEFAULT_LOG_FACILITY, "$logfacility", [syslog facility])AC_DEFINE_UNQUOTED([DEFAULT_LOG_FACILITY], ["$logfacility"], [syslog facility])
 AC_MSG_RESULT("$logfacility")  AC_MSG_RESULT("$logfacility")
   
 AC_MSG_CHECKING([which syslog priority to use])  AC_MSG_CHECKING([which syslog priority to use])
AC_ARG_WITH(logpriority,AC_ARG_WITH([logpriority],
  [  --with-logpriority   syslog priority to log with (default "info")],  AS_HELP_STRING([--with-logpriority], [syslog priority to log with (default "info")]),
   [case $with_logpriority in    [case $with_logpriority in
     emerg|alert|crit|err|warning|notice|info|debug)      emerg|alert|crit|err|warning|notice|info|debug)
         logpriority=$with_logpriority          logpriority=$with_logpriority
Line 126  AC_ARG_WITH(logpriority, Line 200  AC_ARG_WITH(logpriority,
         ;;          ;;
   esac],    esac],
   [logpriority="info"])    [logpriority="info"])
AC_DEFINE_UNQUOTED(DEFAULT_LOG_PRIORITY, "$logpriority", [syslog priority])AC_DEFINE_UNQUOTED([DEFAULT_LOG_PRIORITY], ["$logpriority"], [syslog priority])
 AC_MSG_RESULT("$logpriority")  AC_MSG_RESULT("$logpriority")
   
 #AC_MSG_CHECKING([whether to use asynchronous io])  #AC_MSG_CHECKING([whether to use asynchronous io])
#AC_ARG_WITH(aio,#AC_ARG_WITH([aio],
#  [  --with-aio           use aio (default "no")],#  AS_HELP_STRING([--with-aio], [use aio (default "no")]),
 #  [case $with_aio in  #  [case $with_aio in
 #    yes)  #    yes)
#        AC_DEFINE(USE_AIO, 1, [use aio])#        AC_DEFINE([USE_AIO], 1, [use aio])
 #        AC_MSG_RESULT(yes)  #        AC_MSG_RESULT(yes)
 #        ;;  #        ;;
 #    *)  #    *)
Line 142  AC_MSG_RESULT("$logpriority") Line 216  AC_MSG_RESULT("$logpriority")
 #        ;;  #        ;;
 #  esac],  #  esac],
 #  AC_MSG_RESULT(no))  #  AC_MSG_RESULT(no))
#AC_SUBST(USE_AIO)#AC_SUBST([USE_AIO])
   
   # vbox support
   vbox="no"
   AC_MSG_CHECKING([VirtualBox Virtual Disk support])
   AC_ARG_WITH([vbox],
     AS_HELP_STRING([--with-vbox=INC], [VirtualBox include]),
     [case $with_vbox in
        no)
            AC_MSG_RESULT([no])
            ;;
        yes|*)
            AC_MSG_RESULT([yes])
            vbox="yes"
            if test "$with_vbox" != "yes"; then
                vboxinc="$with_vbox"
            fi
            ;;
      esac],
     [AC_MSG_RESULT([no])])
   AC_ARG_WITH([vboxlib],
     AS_HELP_STRING([--with-vboxlib=LIB], [VirtualBox lib]),
     [case $with_vboxlib in
        no)
            ;;
        yes|*)
            vbox="yes"
            if test "$with_vboxlib" != "yes"; then
                vboxlib="$with_vboxlib"
            fi
            ;;
      esac],
     [])
   # vbox support yes?
   if test "$vbox" = "yes"; then
       vboxinc=`echo $vboxinc`
       vboxlib=`echo $vboxlib`
       if test ! -d "$vboxinc"; then
           AC_MSG_ERROR([not directory: $vboxinc])
       fi
       if test ! -d "$vboxlib"; then
           AC_MSG_ERROR([not directory: $vboxlib])
       fi
       CPPFLAGS="$CPPFLAGS -I$vboxinc"
       LDFLAGS="$LDFLAGS -Wl,-rpath,$vboxlib"
       LIBS="$LIBS $vboxlib/VBoxDDU.so $vboxlib/VBoxRT.so"
       AC_DEFINE([USE_VBOXVD], 1, [Use vbox virtual disk support])
       # define vbox include version
       changequote(<<, >>)
       vbox_major=`$SED -e '/^VBOX_VERSION_MAJOR[  ]*=/!d' -e 's/.*=[^0-9]*\([0-9]*\).*/\1/' $vboxinc/../Config.kmk`
       vbox_minor=`$SED -e '/^VBOX_VERSION_MINOR[  ]*=/!d' -e 's/.*=[^0-9]*\([0-9]*\).*/\1/' $vboxinc/../Config.kmk`
       vbox_build=`$SED -e '/^VBOX_VERSION_BUILD[  ]*=/!d' -e 's/.*=[^0-9]*\([0-9]*\).*/\1/' $vboxinc/../Config.kmk`
       changequote([, ])
       AC_DEFINE_UNQUOTED([ISTGT_VBOXINC_VERSION_MAJOR], [$vbox_major], [VBox include major])
       AC_DEFINE_UNQUOTED([ISTGT_VBOXINC_VERSION_MINOR], [$vbox_minor], [VBox include minor])
       AC_DEFINE_UNQUOTED([ISTGT_VBOXINC_VERSION_BUILD], [$vbox_build], [VBox include build])
   fi
   
   # check for PTHREAD_MUTEX_ADAPTIVE_NP
   AC_MSG_CHECKING([for PTHREAD_MUTEX_ADAPTIVE_NP])
   AC_TRY_COMPILE([
   #include <pthread.h>
   ],
   [
           return (PTHREAD_MUTEX_ADAPTIVE_NP);
   ],
   [AC_MSG_RESULT([yes])
   AC_DEFINE([HAVE_PTHREAD_MUTEX_ADAPTIVE_NP], [1], [Define 1 if you have the value.])],
   [AC_MSG_RESULT([no])]
   )
   
 AC_CHECK_HEADERS([sys/types.h])  AC_CHECK_HEADERS([sys/types.h])
 AC_CHECK_HEADERS([machine/atomic.h], [], [],  AC_CHECK_HEADERS([machine/atomic.h], [], [],
 [#if HAVE_SYS_TYPES_H  [#if HAVE_SYS_TYPES_H
Line 162  AC_CHECK_HEADERS([sys/atomic.h]) Line 305  AC_CHECK_HEADERS([sys/atomic.h])
   
 atomic="no"  atomic="no"
 AC_MSG_CHECKING([for atomic operations])  AC_MSG_CHECKING([for atomic operations])
AC_TRY_LINK([#if HAVE_SYS_TYPES_HAC_TRY_LINK([
 #if HAVE_SYS_TYPES_H
 #include <sys/types.h>  #include <sys/types.h>
 #endif  #endif
 #include <machine/atomic.h>  #include <machine/atomic.h>
Line 172  AC_TRY_LINK([#if HAVE_SYS_TYPES_H Line 316  AC_TRY_LINK([#if HAVE_SYS_TYPES_H
         atomic_store_rel_int(&x, 1);          atomic_store_rel_int(&x, 1);
         y = atomic_load_acq_int(&x);          y = atomic_load_acq_int(&x);
 ],  ],
[AC_DEFINE(USE_ATOMIC, [1], [Use atomic])[AC_DEFINE([USE_ATOMIC], [1], [Use atomic])
AC_DEFINE(HAVE_ATOMIC_STORE_REL_INT, [1], [Define 1 if you have the function.])AC_DEFINE([HAVE_ATOMIC_STORE_REL_INT], [1], [Define 1 if you have the function.])
AC_DEFINE(HAVE_ATOMIC_LOAD_ACQ_INT, [1], [Define 1 if you have the function.])AC_DEFINE([HAVE_ATOMIC_LOAD_ACQ_INT], [1], [Define 1 if you have the function.])
 atomic="yes"]  atomic="yes"]
 )  )
 if test $atomic = "no"; then  if test $atomic = "no"; then
Line 189  AC_TRY_LINK([ Line 333  AC_TRY_LINK([
         atomic_swap_uint(&x, 1);          atomic_swap_uint(&x, 1);
         y = atomic_or_uint_nv(&x, 0);          y = atomic_or_uint_nv(&x, 0);
 ],  ],
[AC_DEFINE(USE_ATOMIC, [1], [Use atomic])[AC_DEFINE([USE_ATOMIC], [1], [Use atomic])
AC_DEFINE(HAVE_ATOMIC_SWAP_UINT, [1], [Define 1 if you have the function.])AC_DEFINE([HAVE_ATOMIC_SWAP_UINT], [1], [Define 1 if you have the function.])
AC_DEFINE(HAVE_ATOMIC_OR_UINT_NV, [1], [Define 1 if you have the function.])AC_DEFINE([HAVE_ATOMIC_OR_UINT_NV], [1], [Define 1 if you have the function.])
 atomic="yes"]  atomic="yes"]
 )  )
 fi  fi
Line 204  AC_TRY_LINK([ Line 348  AC_TRY_LINK([
 [  [
         membar_producer();          membar_producer();
 ],  ],
[AC_DEFINE(HAVE_MEMBAR_PRODUCER, [1], [Define 1 if you have the function.])][AC_DEFINE([HAVE_MEMBAR_PRODUCER], [1], [Define 1 if you have the function.])]
 )  )
 AC_MSG_RESULT($atomic)  AC_MSG_RESULT($atomic)
   
   # for gcc builtin
   #AC_CHECK_FUNCS([__sync_fetch_and_add __sync_val_compare_and_swap])
   #AC_CHECK_FUNCS([__sync_synchronize])
   
   gcc_atomic="no"
   AC_MSG_CHECKING([for gcc builtin atomic operations])
   AC_TRY_LINK([
   #if HAVE_SYS_TYPES_H
   #include <sys/types.h>
   #endif
   ],
   [
           unsigned int x, y;
           y = __sync_fetch_and_add(&x, 0);
           __sync_val_compare_and_swap(&x, y, 2);
   ],
   [AC_DEFINE([USE_GCC_ATOMIC], [1], [Use gcc builtin atomic])
   AC_DEFINE([HAVE_GCC_ATOMIC_FETCH_AND_ADD_UINT], [1], [Define 1 if you have the function.])
   AC_DEFINE([HAVE_GCC_ATOMIC_VAL_COMPARE_AND_SWAP_UINT], [1], [Define 1 if you have the function.])
   gcc_atomic="yes"]
   )
   AC_TRY_LINK([
   #if HAVE_SYS_TYPES_H
   #include <sys/types.h>
   #endif
   ],
   [
           __sync_synchronize();
   ],
   [AC_DEFINE([HAVE_GCC_ATOMIC_SYNCHRONIZE], [1], [Define 1 if you have the function.])]
   )
   AC_MSG_RESULT($gcc_atomic)
   
 AC_CONFIG_FILES([Makefile src/Makefile etc/Makefile doc/Makefile])  AC_CONFIG_FILES([Makefile src/Makefile etc/Makefile doc/Makefile])
 AC_CONFIG_FILES([src/build.h])  AC_CONFIG_FILES([src/build.h])

Removed from v.1.1.1.1  
changed lines
  Added in v.1.1.1.2


FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>