Fabio Gonzalez avatar Fabio Gonzalez committed 86b6afe Draft

symlinks done

Comments (0)

Files changed (3)

 Suggestion:
-Rename cfdisk to gcfdisk and make cfdisk a symlink to it. Add a
-configure option to remove legacy symlinks, so GNU fdisk and
-util-linux counterparts can coexist on one system. This will make it
-possible for GNU/Linux distributions and Live CDs to include GNU
-fdisk, while leaving util-linux tools included.
 
 - resolve multiple invocations of AC_CANONICAL_HOST in configure
 - weed out discrepancies between Linux fdisk and this program
 AM_CONDITIONAL(MAKE_TESTS, test x$have_check = xtrue)
 AM_CONDITIONAL(MAKE_CFDISK, test x$have_curses = xtrue)
 
+AC_ARG_ENABLE(symlinks, AS_HELP_STRING([--disable-symlinks],[Do not make symbolic links]),
+   [case "${enableval}" in
+     yes) symlinks=true ;;
+     no)  symlinks=false ;;
+     *) AC_MSG_ERROR(bad value ${enableval} for --enable-symlinks) ;;
+   esac],
+   [symlinks=true])
+
 dnl Check how to create the {g,l}fdisk links
 AC_MSG_CHECKING([how to create links])
-rm -f test00 test01
-touch test00
-ln -s test00 test01 || :
-SYMLINK=""
-SYMLINKFROM="fdisk"
-if test -L test01; then
-	SYMLINK="ln -sf"
+if ${symlinks}; then
+    rm -f test00 test01
+    touch test00
+    ln -s test00 test01 || :
+    SYMLINK=""
+    SYMLINKFROM="fdisk"
+    if test -L test01; then
+        SYMLINK="ln -sf"
+    else
+        SYMLINKFROM="${sbindir}/fdisk"
+        rm -f test01
+        ln test00 test01 || :
+        if test -e test01; then
+            SYMLINK="ln"
+        else
+            SYMLINK="cp"
+        fi
+    fi
 else
-	SYMLINKFROM="${sbindir}/fdisk"
-	rm -f test01
-	ln test00 test01 || :
-	if test -e test01; then
-		SYMLINK="ln"
-	else
-		SYMLINK="cp"
-	fi
+#That was the way I found to not do anything
+    SYMLINK="echo"
+    END_SYMLINK="> /dev/null"
 fi
-AC_MSG_RESULT($SYMLINK)
+AC_MSG_RESULT("$SYMLINK <files> $END_SYMLINK")
 AC_SUBST(SYMLINK)
 AC_SUBST(SYMLINKFROM)
+AC_SUBST(END_SYMLINK)
 rm -f test00 test01
 
 AC_ARG_WITH([gnu-ext], AS_HELP_STRING([--with-gnu-ext],[Enable GNU extensions]),
 endif
 
 install-exec-local: 
-	@SYMLINK@ $(DESTDIR)/$(sbindir)/gfdisk $(DESTDIR)/$(sbindir)/fdisk
-	@SYMLINK@ $(DESTDIR)/$(sbindir)/gcfdisk $(DESTDIR)/$(sbindir)/cfdisk
+	@SYMLINK@ $(DESTDIR)/$(sbindir)/gfdisk $(DESTDIR)/$(sbindir)/fdisk @END_SYMLINK@
+	@SYMLINK@ $(DESTDIR)/$(sbindir)/gcfdisk $(DESTDIR)/$(sbindir)/cfdisk @END_SYMLINK@
 
 install-exec-am: install-sbinPROGRAMS install-exec-local
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 ProjectModifiedEvent.java.
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.