Anonymous avatar Anonymous committed 83c7886

cpp conditionals for compiling without GNU extensions (Robert Millan).

Comments (0)

Files changed (2)

 rm -f test00 test01
+AC_ARG_WITH([gnu-ext], AS_HELP_STRING([--with-gnu-ext],[Enable GNU extensions]),
+   AC_DEFINE([GNU_EXT], [1], [Define to 1 if you enable GNU extensions]))
 AC_CONFIG_FILES([Makefile src/Makefile doc/Makefile tests/Makefile po/])
 	{"list",        N_("list partition table(s)")},
 	{"raw-print",	N_("show the raw data in the partition table(s)")},
 	{"size",	N_("show partition size")},
+#ifdef GNU_EXT
 	{"linux-fdisk", N_("enable Linux fdisk compatibility mode")},
 	{"gnu-fdisk",   N_("disable Linux fdisk compatibility mode")},
 	{"interactive",	N_("where necessary, prompts for user intervention")},
 	{"script",	N_("never prompts for user intervention")},
 	{"sector-units",N_("use sectors instead of cylinder as a default unit")},
+#ifdef GNU_EXT
 int fdisk_compatibility_mode = 0;
+#define fdisk_compatibility_mode 1
 int fdisk_opt_script_mode;
 int fdisk_list_table = 0;
 int fdisk_print_raw = 0;
 			case 'i': fdisk_opt_script_mode = 0; break;
 			case 'p': fdisk_opt_script_mode = 1; break;
+#ifdef GNU_EXT
 			case 'G': fdisk_compatibility_mode = 0; break;
 			case 'L': fdisk_compatibility_mode = 1; break;
 			case 's': fdisk_part_size = optarg; break;
 			case 't': print_partition_types(); break;
 			case 'u': ped_unit_set_default(PED_UNIT_SECTOR);
+#ifdef GNU_EXT
 	/* See whether we should enable Linux fdisk compatibility mode */
 	if (argv[0]) {
 		char *program_name = strrchr(argv[0], '/');
 		fdisk_compatibility_mode = 0;
 	dev = _init (&argc, &argv);
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.