$(MAN_DIRS) \
        disk-utils \
        fdisk \
-       getopt \
        po \
        tests
 
 
 Makefile
 disk-utils/Makefile
 fdisk/Makefile
-getopt/Makefile
 libblkid/blkid.pc
 libblkid/docs/Makefile
 libblkid/docs/version.xml
 
+++ /dev/null
-The getopt is explicitly licensed under GNU General Public License,
-version 2 terms.
-
-The complete text of the license is available at the
-Documentation/licenses/COPYING.GPLv2 file.
 
+++ /dev/null
-include $(top_srcdir)/config/include-Makefile.am
-
-usrbin_exec_PROGRAMS = getopt
-dist_man_MANS = getopt.1
-
-exampledir = $(datadir)/getopt/
-dist_example_SCRIPTS = getopt-parse.bash getopt-parse.tcsh
 
 dist_man_MANS += misc-utils/rename.1
 rename_SOURCES = misc-utils/rename.c
 endif
+
+usrbin_exec_PROGRAMS += getopt
+dist_man_MANS += misc-utils/getopt.1
+getopt_SOURCES = misc-utils/getopt.c
+getoptexampledir = $(datadir)/getopt/
+dist_getoptexample_SCRIPTS = \
+       misc-utils/getopt-parse.bash \
+       misc-utils/getopt-parse.tcsh
 
 # --> `another arg'
 # --> `wow!*\?'
 
-# Note that we use `"$@"' to let each command-line parameter expand to a 
+# Note that we use `"$@"' to let each command-line parameter expand to a
 # separate word. The quotes around `$@' are essential!
 # We need TEMP as the `eval set --' would nuke the return value of getopt.
 TEMP=`getopt -o ab:c:: --long a-long,b-long:,c-long:: \
        case "$1" in
                -a|--a-long) echo "Option a" ; shift ;;
                -b|--b-long) echo "Option b, argument \`$2'" ; shift 2 ;;
-               -c|--c-long) 
+               -c|--c-long)
                        # c has an optional argument. As we are in quoted mode,
                        # an empty parameter will be generated if its optional
                        # argument is not found.
 
 # each element of argv becomes a separate argument for getopt. The braces
 # are needed because the result is also a list.
 set temp=(`getopt -s tcsh -o ab:c:: --long a-long,b-long:,c-long:: -- $argv:q`)
-if ($? != 0) then 
+if ($? != 0) then
   echo "Terminating..." >/dev/stderr
   exit 1
 endif
        switch($1:q)
        case -a:
        case --a-long:
-               echo "Option a" ; shift 
+               echo "Option a" ; shift
                breaksw;
        case -b:
        case --b-long:
 
  *  51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
  */
 
-/* 
+/*
  * Version 1.0-b4: Tue Sep 23 1997. First public release.
- * Version 1.0: Wed Nov 19 1997. 
+ * Version 1.0: Wed Nov 19 1997.
  *   Bumped up the version number to 1.0
  *   Fixed minor typo (CSH instead of TCSH)
  * Version 1.0.1: Tue Jun 3 1998
  * Version 1.0.6: Tue Jun 27 2000
  *   No important changes
  * Version 1.1.0: Tue Jun 30 2000
- *   Added NLS support (partly written by Arkadiusz Mi<B6>kiewicz 
+ *   Added NLS support (partly written by Arkadiusz Mi<B6>kiewicz
  *     <misiek@pld.org.pl>)
  * Version 1.1.4: Mon Nov 7 2005
  *   Fixed a few type's in the manpage
 #include "nls.h"
 #include "xalloc.h"
 
-/* NON_OPT is the code that is returned when a non-option is found in '+' 
+/* NON_OPT is the code that is returned when a non-option is found in '+'
  * mode */
 #define NON_OPT 1
 /* LONG_OPT is the code that is returned when a long option is found. */
        return BUFFER;
 }
 
-/* 
+/*
  * Generate the output. argv[0] is the program name (used for reporting errors).
  * argv[1..] contains the options to be parsed. argc must be the number of
  * elements in argv (ie. 1 if there are no options, only the program name),
 }
 
 
-/* 
+/*
  * Register several long options. options is a string of long options,
  * separated by commas or whitespace. This nukes options!
  */
                default:
                        parse_error(_("internal error, contact the author."));
                }
-       
+
        if (!optstr) {
                if (optind >= argc)
                        parse_error(_("missing optstring argument"));