[Ocfs2-tools-commits] manish commits r747 - in trunk: . ocfs2console/blkid

svn-commits at oss.oracle.com svn-commits at oss.oracle.com
Sun Mar 27 17:17:46 CST 2005


Author: manish
Date: 2005-03-27 17:17:44 -0600 (Sun, 27 Mar 2005)
New Revision: 747

Added:
   trunk/blkid.m4
Removed:
   trunk/ocfs2console/blkid/blkid_types.h.in
Modified:
   trunk/aclocal.m4
   trunk/configure.in
   trunk/ocfs2console/blkid/Makefile
Log:
Move the blkid checks into its own m4 file, and be smarter about generating
blkid_types.h


Modified: trunk/aclocal.m4
===================================================================
--- trunk/aclocal.m4	2005-03-27 22:51:34 UTC (rev 746)
+++ trunk/aclocal.m4	2005-03-27 23:17:44 UTC (rev 747)
@@ -3,3 +3,4 @@
 m4_include([runlog.m4])
 m4_include([python.m4])
 m4_include([pythondev.m4])
+m4_include([blkid.m4])

Added: trunk/blkid.m4
===================================================================
--- trunk/blkid.m4	2005-03-27 22:51:34 UTC (rev 746)
+++ trunk/blkid.m4	2005-03-27 23:17:44 UTC (rev 747)
@@ -0,0 +1,97 @@
+dnl Support for libblkid included in our tree for ocfs2console
+
+AC_DEFUN([OCFS2_BLKID], [
+  HAVE_BLKID=
+  PKG_CHECK_MODULES(BLKID, blkid >= 1.36, HAVE_BLKID=yes,
+    [AC_MSG_WARN([blkid >= 1.36 not found, using internal version])])
+  AC_SUBST(HAVE_BLKID)
+
+  if test "x$HAVE_BLKID" != "xyes"; then
+    AC_CHECK_LIB(uuid, uuid_unparse, :,
+      [AC_MSG_ERROR([could not find uuid library])])
+
+    AC_CHECK_SIZEOF(short)
+    AC_CHECK_SIZEOF(int)
+    AC_CHECK_SIZEOF(long)
+    AC_CHECK_SIZEOF(long long)
+
+    AC_CONFIG_COMMANDS([ocfs2console/blkid/blkid_types.h], [
+      outfile=ocfs2console/blkid/blkid_types.h-tmp
+      cat > $outfile <<_______EOF
+/* 
+ * If linux/types.h is already been included, assume it has defined
+ * everything we need.  (cross fingers)  Other header files may have 
+ * also defined the types that we need.
+ */
+#if (!defined(_LINUX_TYPES_H) && !defined(_BLKID_TYPES_H) && \\
+	!defined(_EXT2_TYPES_H))
+#define _BLKID_TYPES_H
+
+typedef unsigned char __u8;
+typedef signed char __s8;
+
+#if ($ocfs2_SIZEOF_INT == 8)
+typedef int		__s64;
+typedef unsigned int	__u64;
+#else
+#if ($ocfs2_SIZEOF_LONG == 8)
+typedef long		__s64;
+typedef unsigned long	__u64;
+#else
+#if ($ocfs2_SIZEOF_LONG_LONG == 8)
+#if defined(__GNUC__)
+typedef __signed__ long long 	__s64;
+#else
+typedef signed long long 	__s64;
+#endif /* __GNUC__ */
+typedef unsigned long long	__u64;
+#endif /* SIZEOF_LONG_LONG == 8 */
+#endif /* SIZEOF_LONG == 8 */
+#endif /* SIZEOF_INT == 8 */
+
+#if ($ocfs2_SIZEOF_INT == 2)
+typedef	int		__s16;
+typedef	unsigned int	__u16;
+#else
+#if ($ocfs2_SIZEOF_SHORT == 2)
+typedef	short		__s16;
+typedef	unsigned short	__u16;
+#else
+  ?==error: undefined 16 bit type
+#endif /* SIZEOF_SHORT == 2 */
+#endif /* SIZEOF_INT == 2 */
+
+#if ($ocfs2_SIZEOF_INT == 4)
+typedef	int		__s32;
+typedef	unsigned int	__u32;
+#else
+#if ($ocfs2_SIZEOF_LONG == 4)
+typedef	long		__s32;
+typedef	unsigned long	__u32;
+#else
+#if ($ocfs2_SIZEOF_SHORT == 4)
+typedef	short		__s32;
+typedef	unsigned short	__u32;
+#else
+ ?== error: undefined 32 bit type
+#endif /* SIZEOF_SHORT == 4 */
+#endif /* SIZEOF_LONG == 4 */
+#endif /* SIZEOF_INT == 4 */
+
+#endif /* _*_TYPES_H */
+_______EOF
+
+      if cmp -s $outfile ocfs2console/blkid/blkid_types.h; then
+        AC_MSG_NOTICE([ocfs2console/blkid/blkid_types.h is unchanged])
+        rm -f $outfile
+      else
+        mv $outfile ocfs2console/blkid/blkid_types.h
+      fi
+    ],[
+      ocfs2_SIZEOF_SHORT=$ac_cv_sizeof_short
+      ocfs2_SIZEOF_INT=$ac_cv_sizeof_int
+      ocfs2_SIZEOF_LONG=$ac_cv_sizeof_long
+      ocfs2_SIZEOF_LONG_LONG=$ac_cv_sizeof_long_long
+    ])
+  fi
+])

Modified: trunk/configure.in
===================================================================
--- trunk/configure.in	2005-03-27 22:51:34 UTC (rev 746)
+++ trunk/configure.in	2005-03-27 23:17:44 UTC (rev 747)
@@ -126,33 +126,7 @@
     if test "x$have_pythondev" = "xyes"; then
       if $PYTHON -c 'import pygtk' >/dev/null 2>&1; then
         BUILD_OCFS2CONSOLE=yes
-
-        HAVE_BLKID=
-        PKG_CHECK_MODULES(BLKID, blkid >= 1.36, HAVE_BLKID=yes,
-          [AC_MSG_WARN([blkid >= 1.36 not found, using internal version])])
-        AC_SUBST(HAVE_BLKID)
-
-        if test "x$HAVE_BLKID" != "xyes"; then
-          AC_CHECK_LIB(uuid, uuid_unparse, :,
-            [AC_MSG_ERROR([could not find uuid library])])
-
-          AC_CHECK_SIZEOF(short)
-          AC_CHECK_SIZEOF(int)
-          AC_CHECK_SIZEOF(long)
-          AC_CHECK_SIZEOF(long long)
-
-          SIZEOF_SHORT=$ac_cv_sizeof_short
-          SIZEOF_INT=$ac_cv_sizeof_int
-          SIZEOF_LONG=$ac_cv_sizeof_long
-          SIZEOF_LONG_LONG=$ac_cv_sizeof_long_long
-
-          AC_SUBST(SIZEOF_SHORT)
-          AC_SUBST(SIZEOF_INT)
-          AC_SUBST(SIZEOF_LONG)
-          AC_SUBST(SIZEOF_LONG_LONG)
-
-          AC_CONFIG_FILES(ocfs2console/blkid/blkid_types.h)
-        fi
+        OCFS2_BLKID
       else
         AC_MSG_WARN([could not find PyGTK, ocfs2console will not be built])
       fi 

Modified: trunk/ocfs2console/blkid/Makefile
===================================================================
--- trunk/ocfs2console/blkid/Makefile	2005-03-27 22:51:34 UTC (rev 746)
+++ trunk/ocfs2console/blkid/Makefile	2005-03-27 23:17:44 UTC (rev 747)
@@ -35,20 +35,13 @@
 	list.h		\
 	probe.h
 
-HFILES_GEN = blkid_types.h
-
 OBJS = $(subst .c,.o,$(CFILES))
 
-$(OBJS): $(HFILES_GEN)
-
-blkid_types.h: blkid_types.h.in
-	cd $(TOPDIR) && ./config.status
-
 libblkid-internal.a: $(OBJS)
 	rm -f $@
 	$(AR) r $@ $^
 	$(RANLIB) $@
 
-DIST_FILES = $(CFILES) $(HFILES) blkid_types.h.in ChangeLog
+DIST_FILES = $(CFILES) $(HFILES) ChangeLog
 
 include $(TOPDIR)/Postamble.make

Deleted: trunk/ocfs2console/blkid/blkid_types.h.in
===================================================================
--- trunk/ocfs2console/blkid/blkid_types.h.in	2005-03-27 22:51:34 UTC (rev 746)
+++ trunk/ocfs2console/blkid/blkid_types.h.in	2005-03-27 23:17:44 UTC (rev 747)
@@ -1,61 +0,0 @@
-/* 
- * If linux/types.h is already been included, assume it has defined
- * everything we need.  (cross fingers)  Other header files may have 
- * also defined the types that we need.
- */
-#if (!defined(_LINUX_TYPES_H) && !defined(_BLKID_TYPES_H) && \
-	!defined(_EXT2_TYPES_H))
-#define _BLKID_TYPES_H
-
-typedef unsigned char __u8;
-typedef signed char __s8;
-
-#if (@SIZEOF_INT@ == 8)
-typedef int		__s64;
-typedef unsigned int	__u64;
-#else
-#if (@SIZEOF_LONG@ == 8)
-typedef long		__s64;
-typedef unsigned long	__u64;
-#else
-#if (@SIZEOF_LONG_LONG@ == 8)
-#if defined(__GNUC__)
-typedef __signed__ long long 	__s64;
-#else
-typedef signed long long 	__s64;
-#endif /* __GNUC__ */
-typedef unsigned long long	__u64;
-#endif /* SIZEOF_LONG_LONG == 8 */
-#endif /* SIZEOF_LONG == 8 */
-#endif /* SIZEOF_INT == 8 */
-
-#if (@SIZEOF_INT@ == 2)
-typedef	int		__s16;
-typedef	unsigned int	__u16;
-#else
-#if (@SIZEOF_SHORT@ == 2)
-typedef	short		__s16;
-typedef	unsigned short	__u16;
-#else
-  ?==error: undefined 16 bit type
-#endif /* SIZEOF_SHORT == 2 */
-#endif /* SIZEOF_INT == 2 */
-
-#if (@SIZEOF_INT@ == 4)
-typedef	int		__s32;
-typedef	unsigned int	__u32;
-#else
-#if (@SIZEOF_LONG@ == 4)
-typedef	long		__s32;
-typedef	unsigned long	__u32;
-#else
-#if (@SIZEOF_SHORT@ == 4)
-typedef	short		__s32;
-typedef	unsigned short	__u32;
-#else
- ?== error: undefined 32 bit type
-#endif /* SIZEOF_SHORT == 4 */
-#endif /* SIZEOF_LONG == 4 */
-#endif /* SIZEOF_INT == 4 */
-
-#endif /* _*_TYPES_H */



More information about the Ocfs2-tools-commits mailing list