]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
build-sys: rename fdisk -> fdisks/, convert to module
authorKarel Zak <kzak@redhat.com>
Fri, 1 Jun 2012 14:15:29 +0000 (16:15 +0200)
committerKarel Zak <kzak@redhat.com>
Tue, 26 Jun 2012 18:50:53 +0000 (20:50 +0200)
Signed-off-by: Karel Zak <kzak@redhat.com>
30 files changed:
Makefile.am
configure.ac
fdisk/Makefile.am [deleted file]
fdisks/.gitignore [moved from fdisk/.gitignore with 100% similarity]
fdisks/Makemodule.am [new file with mode: 0644]
fdisks/cfdisk.8 [moved from fdisk/cfdisk.8 with 100% similarity]
fdisks/cfdisk.c [moved from fdisk/cfdisk.c with 100% similarity]
fdisks/common.h [moved from fdisk/common.h with 100% similarity]
fdisks/fdisk.8 [moved from fdisk/fdisk.8 with 100% similarity]
fdisks/fdisk.c [moved from fdisk/fdisk.c with 100% similarity]
fdisks/fdisk.h [moved from fdisk/fdisk.h with 100% similarity]
fdisks/fdiskaixlabel.c [moved from fdisk/fdiskaixlabel.c with 98% similarity]
fdisks/fdiskaixlabel.h [moved from fdisk/fdiskaixlabel.h with 100% similarity]
fdisks/fdiskbsdlabel.c [moved from fdisk/fdiskbsdlabel.c with 99% similarity]
fdisks/fdiskbsdlabel.h [moved from fdisk/fdiskbsdlabel.h with 99% similarity]
fdisks/fdiskdoslabel.c [moved from fdisk/fdiskdoslabel.c with 100% similarity]
fdisks/fdiskdoslabel.h [moved from fdisk/fdiskdoslabel.h with 100% similarity]
fdisks/fdiskmaclabel.c [moved from fdisk/fdiskmaclabel.c with 99% similarity]
fdisks/fdiskmaclabel.h [moved from fdisk/fdiskmaclabel.h with 99% similarity]
fdisks/fdisksgilabel.c [moved from fdisk/fdisksgilabel.c with 99% similarity]
fdisks/fdisksgilabel.h [moved from fdisk/fdisksgilabel.h with 100% similarity]
fdisks/fdisksunlabel.c [moved from fdisk/fdisksunlabel.c with 99% similarity]
fdisks/fdisksunlabel.h [moved from fdisk/fdisksunlabel.h with 100% similarity]
fdisks/gpt.c [moved from fdisk/gpt.c with 100% similarity]
fdisks/gpt.h [moved from fdisk/gpt.h with 99% similarity]
fdisks/i386_sys_types.c [moved from fdisk/i386_sys_types.c with 100% similarity]
fdisks/partname.c [moved from fdisk/partname.c with 99% similarity]
fdisks/sfdisk.8 [moved from fdisk/sfdisk.8 with 100% similarity]
fdisks/sfdisk.c [moved from fdisk/sfdisk.c with 100% similarity]
fdisks/utils.c [moved from fdisk/utils.c with 100% similarity]

index 56a7a65063f3fb354b08fdf39297c6173f313490..d3171a0e3be4e30ea2155cad96712ff23f73b884 100644 (file)
@@ -28,7 +28,6 @@ MAN_DIRS = man/ru
 
 SUBDIRS = \
        $(MAN_DIRS) \
-       fdisk \
        po
 
 RCS_FIND_IGNORE = \( -name SCCS -o -name BitKeeper -o -name .svn -o \
@@ -58,6 +57,7 @@ include mount-deprecated/Makemodule.am
 include sys-utils/Makemodule.am
 include misc-utils/Makemodule.am
 include disk-utils/Makemodule.am
+include fdisks/Makemodule.am
 
 include tests/Makemodule.am
 
index 6e6399f366c8137d9db4bc6b4ac8a538e5248147..af7aca615b0710386588d1f2694008d7ed40d1bb 100644 (file)
@@ -610,27 +610,32 @@ AC_ARG_WITH([slang],
   AS_HELP_STRING([--with-slang], [compile cfdisk with slang]),
   [], with_slang=no
 )
-
-have_tinfo=no
-AC_CHECK_LIB(tinfo, tgetent, [have_tinfo=yes])
-AM_CONDITIONAL(HAVE_TINFO, test "x$have_tinfo" = xyes)
-
-use_slang=no
+have_slang=no
 if test "x$with_slang" = xyes; then
   AC_CHECK_HEADERS([slang.h slang/slang.h])
   AC_CHECK_HEADERS([slcurses.h slang/slcurses.h],
-                  [use_slang=yes], [], [
+                  [have_slang=yes], [], [
 #ifdef HAVE_SLANG_H
 #include <slang.h>
 #elif defined(HAVE_SLANG_SLANG_H)
 #include <slang/slang.h>
 #endif
 ])
-  if test "x$use_slang" = xno; then
+  if test "x$have_slang" = xno; then
     AC_MSG_ERROR([slang selected but slcurses.h not found])
   fi
 fi
-AM_CONDITIONAL(USE_SLANG, test "x$use_slang" = xyes)
+AM_CONDITIONAL(HAVE_SLANG, test "x$have_slang" = xyes)
+
+
+if test "x$have_slang" = xyes -o "x$have_ncurses" = xyes; then
+  AM_CONDITIONAL(BUILD_CFDISK, true)
+fi
+
+
+have_tinfo=no
+AC_CHECK_LIB(tinfo, tgetent, [have_tinfo=yes])
+AM_CONDITIONAL(HAVE_TINFO, test "x$have_tinfo" = xyes)
 
 
 AC_ARG_WITH([utempter],
@@ -1290,7 +1295,6 @@ AC_CONFIG_HEADERS(config.h)
 
 AC_CONFIG_FILES([
 Makefile
-fdisk/Makefile
 libblkid/blkid.pc
 libblkid/docs/Makefile
 libblkid/docs/version.xml
diff --git a/fdisk/Makefile.am b/fdisk/Makefile.am
deleted file mode 100644 (file)
index e9be841..0000000
+++ /dev/null
@@ -1,94 +0,0 @@
-include $(top_srcdir)/config/include-Makefile.am
-
-fdisk_common = \
-       common.h \
-       gpt.c \
-       gpt.h \
-       i386_sys_types.c \
-       $(top_srcdir)/lib/blkdev.c \
-       $(top_srcdir)/lib/mbsalign.c \
-       $(top_srcdir)/lib/strutils.c \
-       $(top_srcdir)/lib/randutils.c \
-       $(top_srcdir)/lib/wholedisk.c
-
-if LINUX
-fdisk_common += $(top_srcdir)/lib/linux_version.c
-endif
-
-if !ARCH_M68K
-
-sbin_PROGRAMS = fdisk
-dist_man_MANS = fdisk.8
-fdisk_SOURCES = \
-       utils.c \
-       fdisk.c \
-       fdisk.h \
-       fdiskaixlabel.c \
-       fdiskaixlabel.h \
-       fdiskbsdlabel.c \
-       fdiskbsdlabel.h \
-       fdiskmaclabel.c \
-       fdiskmaclabel.h \
-       fdisksgilabel.c \
-       fdisksgilabel.h \
-       fdisksunlabel.c \
-       fdisksunlabel.h \
-       fdiskdoslabel.c \
-       fdiskdoslabel.h \
-       partname.c \
-       $(fdisk_common) \
-       $(top_srcdir)/lib/canonicalize.c
-
-cflags_blkid = $(AM_CFLAGS)
-ldadd_blkid =
-
-if BUILD_LIBBLKID
-ldadd_blkid += $(ul_libblkid_la)
-cflags_blkid += -I$(ul_libblkid_incdir)
-endif
-
-if HAVE_STATIC_FDISK
-sbin_PROGRAMS += fdisk.static
-fdisk_static_SOURCES = $(fdisk_SOURCES)
-fdisk_static_LDFLAGS = -all-static
-fdisk_static_CFLAGS = $(cflags_blkid)
-fdisk_static_LDADD = $(ldadd_blkid)
-endif
-
-fdisk_CFLAGS = $(cflags_blkid)
-fdisk_LDADD = $(ldadd_blkid)
-
-if !ARCH_SPARC
-
-sbin_PROGRAMS += sfdisk
-dist_man_MANS += sfdisk.8
-sfdisk_SOURCES = \
-       partname.c \
-       sfdisk.c \
-       $(fdisk_common) \
-       $(top_srcdir)/lib/canonicalize.c
-
-if HAVE_STATIC_SFDISK
-sbin_PROGRAMS += sfdisk.static
-sfdisk_static_SOURCES = $(sfdisk_SOURCES)
-sfdisk_static_LDFLAGS = -all-static
-endif
-
-if USE_SLANG
-sbin_PROGRAMS += cfdisk
-dist_man_MANS += cfdisk.8
-cfdisk_SOURCES = cfdisk.c $(fdisk_common)
-cfdisk_CFLAGS = $(cflags_blkid)
-cfdisk_LDADD = -lslang $(ldadd_blkid)
-else
-if HAVE_NCURSES
-sbin_PROGRAMS += cfdisk
-dist_man_MANS += cfdisk.8
-cfdisk_SOURCES = cfdisk.c $(fdisk_common)
-cfdisk_CFLAGS = $(cflags_blkid)
-cfdisk_LDADD = @NCURSES_LIBS@ $(ldadd_blkid)
-endif
-endif
-
-endif # !ARCH_SPARC
-endif # !ARCH_M68K
similarity index 100%
rename from fdisk/.gitignore
rename to fdisks/.gitignore
diff --git a/fdisks/Makemodule.am b/fdisks/Makemodule.am
new file mode 100644 (file)
index 0000000..ac176fe
--- /dev/null
@@ -0,0 +1,94 @@
+
+fdisk_common_sources = \
+       fdisks/common.h \
+       fdisks/gpt.c \
+       fdisks/gpt.h \
+       fdisks/i386_sys_types.c \
+       lib/blkdev.c \
+       lib/mbsalign.c \
+       lib/strutils.c \
+       lib/randutils.c \
+       lib/wholedisk.c
+
+if LINUX
+fdisk_common_sources += lib/linux_version.c
+endif
+
+if !ARCH_M68K
+
+sbin_PROGRAMS += fdisk
+dist_man_MANS += fdisks/fdisk.8
+fdisk_SOURCES = \
+       fdisks/utils.c \
+       fdisks/fdisk.c \
+       fdisks/fdisk.h \
+       fdisks/fdiskaixlabel.c \
+       fdisks/fdiskaixlabel.h \
+       fdisks/fdiskbsdlabel.c \
+       fdisks/fdiskbsdlabel.h \
+       fdisks/fdiskmaclabel.c \
+       fdisks/fdiskmaclabel.h \
+       fdisks/fdisksgilabel.c \
+       fdisks/fdisksgilabel.h \
+       fdisks/fdisksunlabel.c \
+       fdisks/fdisksunlabel.h \
+       fdisks/fdiskdoslabel.c \
+       fdisks/fdiskdoslabel.h \
+       fdisks/partname.c \
+       $(fdisk_common_sources) \
+       lib/canonicalize.c
+
+if BUILD_LIBBLKID
+fdisk_CFLAGS = -I$(ul_libblkid_incdir)
+fdisk_LDADD = libblkid.la
+endif
+
+if HAVE_STATIC_FDISK
+sbin_PROGRAMS += fdisk.static
+fdisk_static_SOURCES = $(fdisk_SOURCES)
+fdisk_static_LDFLAGS = -all-static
+fdisk_static_CFLAGS = $(fdisk_CFLAGS)
+fdisk_static_LDADD = $(fdisk_LDADD)
+endif
+
+
+if !ARCH_SPARC
+
+sbin_PROGRAMS += sfdisk
+dist_man_MANS += fdisks/sfdisk.8
+sfdisk_SOURCES = \
+       fdisks/partname.c \
+       fdisks/sfdisk.c \
+       $(fdisk_common_sources) \
+       lib/canonicalize.c
+
+if HAVE_STATIC_SFDISK
+sbin_PROGRAMS += sfdisk.static
+sfdisk_static_SOURCES = $(sfdisk_SOURCES)
+sfdisk_static_LDFLAGS = -all-static
+endif
+
+
+if BUILD_CFDISK
+sbin_PROGRAMS += cfdisk
+dist_man_MANS += fdisks/cfdisk.8
+cfdisk_SOURCES = fdisks/cfdisk.c $(fdisk_common_sources)
+cfdisk_CFLAGS =
+cfdisk_LDADD =
+
+if BUILD_LIBBLKID
+cfdisk_CFLAGS += -I$(ul_libblkid_incdir)
+cfdisk_LDADD += libblkid.la
+endif
+
+if HAVE_SLANG
+cfdisk_LDADD += -lslang
+else
+if HAVE_NCURSES
+cfdisk_LDADD += @NCURSES_LIBS@
+endif
+endif
+endif # BUILD_CFDISK
+
+endif # !ARCH_SPARC
+endif # !ARCH_M68K
similarity index 100%
rename from fdisk/cfdisk.8
rename to fdisks/cfdisk.8
similarity index 100%
rename from fdisk/cfdisk.c
rename to fdisks/cfdisk.c
similarity index 100%
rename from fdisk/common.h
rename to fdisks/common.h
similarity index 100%
rename from fdisk/fdisk.8
rename to fdisks/fdisk.8
similarity index 100%
rename from fdisk/fdisk.c
rename to fdisks/fdisk.c
similarity index 100%
rename from fdisk/fdisk.h
rename to fdisks/fdisk.h
similarity index 98%
rename from fdisk/fdiskaixlabel.c
rename to fdisks/fdiskaixlabel.c
index fb36489e11597ed4034c6e32bc362c763e49b563..438647ba8ddf41a3ade60e08ad921ec7263c3573 100644 (file)
@@ -1,7 +1,7 @@
 /*
   Changes:
   Sat Mar 20 09:51:38 EST 1999 Arnaldo Carvalho de Melo <acme@conectiva.com.br>
-       Internationalization
+       Internationalization
 */
 #include <stdio.h>              /* stderr */
 #include <string.h>             /* strstr */
similarity index 100%
rename from fdisk/fdiskaixlabel.h
rename to fdisks/fdiskaixlabel.h
similarity index 99%
rename from fdisk/fdiskbsdlabel.c
rename to fdisks/fdiskbsdlabel.c
index 71efd33f673784342059b72a5fdf51ee3debaa45..53c8ad512a1017dc31c551ac24386b73e987ff2f 100644 (file)
@@ -2,10 +2,10 @@
    NetBSD disklabel editor for Linux fdisk
    Written by Bernhard Fastenrath (fasten@informatik.uni-bonn.de)
    with code from the NetBSD disklabel command:
-  
+
    Copyright (c) 1987, 1988 Regents of the University of California.
    All rights reserved.
-  
+
    Redistribution and use in source and binary forms, with or without
    modification, are permitted provided that the following conditions
    are met:
       documentation and/or other materials provided with the distribution.
    3. All advertising materials mentioning features or use of this software
       must display the following acknowledgement:
-       This product includes software developed by the University of
-       California, Berkeley and its contributors.
+       This product includes software developed by the University of
+       California, Berkeley and its contributors.
    4. Neither the name of the University nor the names of its contributors
       may be used to endorse or promote products derived from this software
       without specific prior written permission.
-  
+
    THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
    ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
    IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
@@ -364,13 +364,13 @@ xbsd_print_disklabel (struct fdisk_context *cxt, int show_all) {
          fprintf(f, "    %5ld %5ld %5.5s ",
                  (long) pp->p_fsize, (long) pp->p_fsize * pp->p_frag, "");
          break;
-         
+
        case BSD_FS_BSDFFS:
          fprintf(f, "    %5ld %5ld %5d ",
                  (long) pp->p_fsize, (long) pp->p_fsize * pp->p_frag,
                  pp->p_cpg);
          break;
-         
+
        default:
          fprintf(f, "%22.22s", "");
          break;
@@ -435,7 +435,7 @@ edit_int (int def, char *mesg)
   }
   while (!isdigit (*line_ptr));
   return atoi (line_ptr);
-} 
+}
 
 static void
 xbsd_edit_disklabel (void)
@@ -624,7 +624,7 @@ static unsigned short
 xbsd_dkcksum (struct xbsd_disklabel *lp) {
        unsigned short *start, *end;
        unsigned short sum = 0;
-  
+
        start = (unsigned short *) lp;
        end = (unsigned short *) &lp->d_partitions[lp->d_npartitions];
        while (start < end)
@@ -693,7 +693,7 @@ xbsd_initlabel (struct fdisk_context *cxt, struct partition *p, struct xbsd_disk
                                                   the whole disk */
        pp -> p_offset = 0;
        pp -> p_size   = d -> d_secperunit;
-       pp -> p_fstype = BSD_FS_UNUSED;  
+       pp -> p_fstype = BSD_FS_UNUSED;
 #endif
 
        return 1;
@@ -730,7 +730,7 @@ xbsd_readlabel (struct fdisk_context *cxt, struct partition *p, struct xbsd_disk
        for (t = d -> d_npartitions; t < BSD_MAXPARTITIONS; t++) {
                d -> d_partitions[t].p_size   = 0;
                d -> d_partitions[t].p_offset = 0;
-               d -> d_partitions[t].p_fstype = BSD_FS_UNUSED;  
+               d -> d_partitions[t].p_fstype = BSD_FS_UNUSED;
        }
 
        if (d -> d_npartitions > BSD_MAXPARTITIONS)
@@ -837,7 +837,7 @@ alpha_bootblock_checksum (char *boot)
 {
   u_int64_t *dp, sum;
   int i;
-  
+
   dp = (u_int64_t *)boot;
   sum = 0;
   for (i = 0; i < 63; i++)
similarity index 99%
rename from fdisk/fdiskbsdlabel.h
rename to fdisks/fdiskbsdlabel.h
index 79f2913489cc8b3dfca9c98816fbfec7fe30eb81..3a198fefccd40d0905bed7d6d8818cb41c021f44 100644 (file)
@@ -69,7 +69,7 @@ struct xbsd_disklabel {
        int16_t d_type;                 /* drive type */
        int16_t d_subtype;              /* controller/d_type specific */
        char    d_typename[16];         /* type name, e.g. "eagle" */
-       char    d_packname[16];                 /* pack identifier */ 
+       char    d_packname[16];                 /* pack identifier */
                        /* disk geometry: */
        uint32_t        d_secsize;              /* # of bytes per sector */
        uint32_t        d_nsectors;             /* # of data sectors per track */
similarity index 100%
rename from fdisk/fdiskdoslabel.c
rename to fdisks/fdiskdoslabel.c
similarity index 100%
rename from fdisk/fdiskdoslabel.h
rename to fdisks/fdiskdoslabel.h
similarity index 99%
rename from fdisk/fdiskmaclabel.c
rename to fdisks/fdiskmaclabel.c
index 96fc7121e868f1b65cf023d5a22b04ed2cbad964..561189a898e3a10c45acc03f0993fdf065de1677 100644 (file)
@@ -80,4 +80,3 @@ IS_MAC:
     mac_nolabel(cxt);          /* %% */
     return 1;
 }
-
similarity index 99%
rename from fdisk/fdiskmaclabel.h
rename to fdisks/fdiskmaclabel.h
index 4873dcdf03764e0eec17f388884daaea1c5539e0..8d9430af5c700fa445e63502fb478c77eb5d2bdd 100644 (file)
@@ -36,4 +36,3 @@ extern void   mac_nolabel(struct fdisk_context *cxt);
 extern int     check_mac_label(struct fdisk_context *cxt);
 
 #endif /* FDISK_MAC_LABEL_H */
-
similarity index 99%
rename from fdisk/fdisksgilabel.c
rename to fdisks/fdisksgilabel.c
index c9033cb41f7f427506f6d0b92beab1ae49075d26..09b3ca5f61b5c50ac8daf54a33d60fe3005210a0 100644 (file)
@@ -202,7 +202,7 @@ sgi_list_table(struct fdisk_context *cxt, int xtra) {
 /* flags */               (sgi_get_bootpartition(cxt) == i) ? "boot" : "    ",
 /* start */               (long) scround(start),
 /* end */                 (long) scround(start+len)-1,
-/* no odd flag on end */  (long) len, 
+/* no odd flag on end */  (long) len,
 /* type id */             sgi_get_sysid(cxt, i),
 /* type name */           (type = partition_type(sgi_get_sysid(cxt, i)))
                                ? type : _("Unknown"));
@@ -334,7 +334,7 @@ void
 sgi_write_table(struct fdisk_context *cxt) {
        sgilabel->csum = 0;
        sgilabel->csum = SSWAP32(two_s_complement_32bit_sum(
-               (unsigned int*)sgilabel, 
+               (unsigned int*)sgilabel,
                sizeof(*sgilabel)));
        assert(two_s_complement_32bit_sum(
                (unsigned int*)sgilabel, sizeof(*sgilabel)) == 0);
@@ -705,8 +705,8 @@ sgi_add_partition(struct fdisk_context *cxt, int n, int sys)
        last = read_int(cxt, scround(first), scround(last)-1, scround(last)-1,
                        scround(first), mesg)+1;
        if (display_in_cyl_units)
-               last *= units_per_sector;                                     
-       /*else                                                             
+               last *= units_per_sector;
+       /*else
                last = last; * align to cylinder if You know how ... */
        if ((sys == SGI_VOLUME) && (first != 0 || last != sgi_get_lastblock(cxt)))
                printf(_("It is highly recommended that eleventh partition\n"
similarity index 100%
rename from fdisk/fdisksgilabel.h
rename to fdisks/fdisksgilabel.h
similarity index 99%
rename from fdisk/fdisksunlabel.c
rename to fdisks/fdisksunlabel.c
index 65cbf8f168e9b648adc9cd0f0e2c21b4395fb067..985a976e5fd5036e34997c7e837f7f533db4051e 100644 (file)
@@ -344,8 +344,8 @@ void verify_sun(struct fdisk_context *cxt)
          (int (*)(const void *,const void *)) verify_sun_cmp);
 
     if (array[0] == -1) {
-       printf(_("No partitions defined\n"));
-       return;
+       printf(_("No partitions defined\n"));
+       return;
     }
     stop = cxt->geom.cylinders * cxt->geom.heads * cxt->geom.sectors;
     if (starts[array[0]])
@@ -367,7 +367,7 @@ void add_sun_partition(struct fdisk_context *cxt, int n, int sys)
        struct sun_tag_flag *tag = &sunlabel->part_tags[n];
        uint32_t start, stop, stop2;
        int whole_disk = 0;
-               
+
        char mesg[256];
        int i;
        unsigned int first, last;
@@ -377,8 +377,9 @@ void add_sun_partition(struct fdisk_context *cxt, int n, int sys)
                        "it before re-adding it.\n"), n + 1);
                return;
        }
-       
+
        fetch_sun(cxt, starts, lens, &start, &stop);
+
        if (stop <= start) {
                if (n == 2)
                        whole_disk = 1;
similarity index 100%
rename from fdisk/fdisksunlabel.h
rename to fdisks/fdisksunlabel.h
similarity index 100%
rename from fdisk/gpt.c
rename to fdisks/gpt.c
similarity index 99%
rename from fdisk/gpt.h
rename to fdisks/gpt.h
index e57c24a3311cfbf3db22e645a8677f44cf8104d2..2ac21c436b8125b5f6607e62ca4d1e68f152920e 100644 (file)
@@ -5,4 +5,3 @@ extern int gpt_probe_signature_fd(int fd);
 extern int gpt_probe_signature_devname(char *devname);
 
 #endif /* FDISK_GPT_H */
-
similarity index 99%
rename from fdisk/partname.c
rename to fdisks/partname.c
index d2782dca1cdfb35e7383864feb05e62c6e7d9997..1671e19205694b54c478fb8ebd6ad3c2114c1589 100644 (file)
@@ -46,4 +46,3 @@ partname(char *dev, int pno, int lth) {
        }
        return bufp;
 }
-
similarity index 100%
rename from fdisk/sfdisk.8
rename to fdisks/sfdisk.8
similarity index 100%
rename from fdisk/sfdisk.c
rename to fdisks/sfdisk.c
similarity index 100%
rename from fdisk/utils.c
rename to fdisks/utils.c