- AC_DEFINE([optarg], [rpl_optarg],
- [Define to rpl_optarg if the replacement variable should be used.])
- AC_DEFINE([optind], [rpl_optind],
- [Define to rpl_optind if the replacement variable should be used.])
- AC_DEFINE([opterr], [rpl_opterr],
- [Define to rpl_opterr if the replacement variable should be used.])
- AC_DEFINE([optopt], [rpl_optopt],
- [Define to rpl_optopt if the replacement variable should be used.])
- AC_DEFINE([getopt], [rpl_getopt],
- [Define to rpl_getopt if the replacement function should be used.])
- AC_DEFINE([getopt_long], [rpl_getopt_long],
- [Define to rpl_getopt_long if the replacement function should be used.])
- AC_DEFINE([getopt_long_only], [rpl_getopt_long_only],
- [Define to rpl_getopt_long_only if the replacement function should be used.])
+ gl_GETOPT_SUBSTITUTE_HEADER
+ gl_PREREQ_GETOPT
+])
+
+AC_DEFUN([gl_GETOPT_SUBSTITUTE_HEADER],
+[
+ GETOPT_H=getopt.h
+ AC_DEFINE([__GETOPT_PREFIX], [[rpl_]],
+ [Define to rpl_ if the getopt replacement functions and variables
+ should be used.])