]> git.sur5r.net Git - bacula/bacula/commitdiff
Attempt to autoconfig ioctl_req_t
authorKern Sibbald <kern@sibbald.com>
Sat, 26 Dec 2009 13:50:29 +0000 (14:50 +0100)
committerKern Sibbald <kern@sibbald.com>
Sat, 26 Dec 2009 13:50:29 +0000 (14:50 +0100)
bacula/autoconf/config.h.in
bacula/autoconf/configure.in
bacula/configure
bacula/src/baconfig.h

index 632f9c04f3f4ab1ea9e5f6cb6d33d451e86553c7..754a44d9c99585ffafa99207779a365fdd7b3517 100644 (file)
    declares uintmax_t. */
 #undef HAVE_INTTYPES_H_WITH_UINTMAX
 
+/* Set if ioctl request is unsigned long int */
+#undef HAVE_IOCTL_ULINT_REQUEST
+
 /* Whether to enable IPv6 support */
 #undef HAVE_IPV6
 
 /* Define to 1 if you have the `snprintf' function. */
 #undef HAVE_SNPRINTF
 
+/* Set if socklen_t exists */
+#undef HAVE_SOCKLEN_T
+
 /* Define to 1 if you have the <stdarg.h> header file. */
 #undef HAVE_STDARG_H
 
index 8a91a312ebf0698cbbe0ea43c7af511f990dd1db..3147036165c32594950ea8c4c87c550d6bef90b0 100644 (file)
@@ -1859,7 +1859,31 @@ AC_CACHE_CHECK(for socklen_t, ba_cv_header_socklen_t,
        )
    ]
 )
-test $ba_cv_header_socklen_t = yes && AC_DEFINE(HAVE_SOCKLEN_T)
+test $ba_cv_header_socklen_t = yes && AC_DEFINE(HAVE_SOCKLEN_T, 1, [Set if socklen_t exists])
+
+dnl --------------------------------------------------------------------------
+dnl Check for ioctl request type
+dnl --------------------------------------------------------------------------
+AC_CACHE_CHECK(for ioctl_req_t, ba_cv_header_ioctl_req_t,
+   [
+       AC_TRY_COMPILE(
+         [
+             #include <sys/types.h>
+             #include <sys/ioctl.h>
+         ], [
+             unsigned long int req;
+             int fd;
+             ioctl(fd, req);
+         ], [
+            ba_cv_header_ioctl_req_t=yes
+         ], [
+            ba_cv_header_ioct_req_t_t=no
+         ]
+       )
+   ]
+)
+test $ba_cv_header_ioctl_req_t = yes && AC_DEFINE(HAVE_IOCTL_ULINT_REQUEST, 1, [Set if ioctl request is unsigned long int])
+
 
 dnl --------------------------------------------------------------------------
 dnl Check for bigendian
index b9c4dceff4cadca33087258fc63ee7cb646e236a..65d7dd1f954eae8865a5c8c596b19c6947d0ff52 100755 (executable)
@@ -32468,11 +32468,83 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
 { echo "$as_me:$LINENO: result: $ba_cv_header_socklen_t" >&5
 echo "${ECHO_T}$ba_cv_header_socklen_t" >&6; }
-test $ba_cv_header_socklen_t = yes && cat >>confdefs.h <<\_ACEOF
+test $ba_cv_header_socklen_t = yes &&
+cat >>confdefs.h <<\_ACEOF
 #define HAVE_SOCKLEN_T 1
 _ACEOF
 
 
+{ echo "$as_me:$LINENO: checking for ioctl_req_t" >&5
+echo $ECHO_N "checking for ioctl_req_t... $ECHO_C" >&6; }
+if test "${ba_cv_header_ioctl_req_t+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+
+       cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+             #include <sys/types.h>
+             #include <sys/ioctl.h>
+
+int
+main ()
+{
+
+             unsigned long int req;
+             int fd;
+             ioctl(fd, req);
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 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); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+
+            ba_cv_header_ioctl_req_t=yes
+
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+
+            ba_cv_header_ioct_req_t_t=no
+
+
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+
+fi
+{ echo "$as_me:$LINENO: result: $ba_cv_header_ioctl_req_t" >&5
+echo "${ECHO_T}$ba_cv_header_ioctl_req_t" >&6; }
+test $ba_cv_header_ioctl_req_t = yes &&
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_IOCTL_ULINT_REQUEST 1
+_ACEOF
+
+
+
 { echo "$as_me:$LINENO: checking for bigendian" >&5
 echo $ECHO_N "checking for bigendian... $ECHO_C" >&6; }
 if test "${ba_cv_bigendian+set}" = set; then
index f725630312001e136454406582a73cbd2cd0dad5..e93c98c920b171f5c6b8e5dbe84a5e8023d9364b 100644 (file)
 #define ETIME ETIMEDOUT
 #endif
 
-#define ioctl_req_t long unsigned int
+#ifdef HAVE_IOCTL_ULINT_REQUEST
+#define ioctl_req_t unsigned long int
+#else
+#define ioctl_req_t int
+#endif
 
 #ifdef PROTOTYPES
 # define __PROTO(p)     p
@@ -643,16 +647,9 @@ int  m_msg(const char *file, int line, POOLMEM *&pool_buf, const char *fmt, ...)
 /* take this 'shortcut' */
 #define fseeko fseek
 #define ftello ftell
-#undef  ioctl_req_t
-#define ioctl_req_t int
 #endif
 
 
-#ifdef HAVE_OSF1_OS
-#undef  ioctl_req_t
-#define ioctl_req_t int
-#endif
-
 #ifdef HAVE_SUN_OS
    /*
     * On Solaris 2.5, threads are not timesliced by default, so we need to
@@ -662,8 +659,6 @@ int  m_msg(const char *file, int line, POOLMEM *&pool_buf, const char *fmt, ...)
 #define set_thread_concurrency(x)  thr_setconcurrency(x)
 extern int thr_setconcurrency(int);
 #define SunOS 1
-#undef  ioctl_req_t
-#define ioctl_req_t int
 
 #else
 
@@ -717,17 +712,13 @@ extern int h_errno;
  */
 extern "C" int getdomainname(char *name, int namelen);
 extern "C" int setdomainname(char *name, int namelen);
-#undef  ioctl_req_t
-#define ioctl_req_t int
 #endif /* HAVE_HPUX_OS */
 
 
 #ifdef HAVE_OSF1_OS
 extern "C" int fchdir(int filedes);
 extern "C" long gethostid(void);
-extern "C" int mknod ( const char *path, int mode, dev_t device );
-#undef  ioctl_req_t
-#define ioctl_req_t int
+extern "C" int mknod(const char *path, int mode, dev_t device );
 #endif