Fix handling of build-time grub-bin2h and grub-mkfont when doing
full Canadian cross. Tested with build=x86_64, host=arm, target=ppc-ieee1275.
This commit is contained in:
parent
816719c8d4
commit
7c9d0c39af
9 changed files with 143 additions and 149 deletions
69
util/bin2h.c
69
util/bin2h.c
|
@ -15,82 +15,19 @@
|
|||
* along with GRUB. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include <config.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
#define _GNU_SOURCE 1
|
||||
#include <getopt.h>
|
||||
|
||||
#include "progname.h"
|
||||
|
||||
static struct option options[] =
|
||||
{
|
||||
{"help", no_argument, 0, 'h' },
|
||||
{"version", no_argument, 0, 'V' },
|
||||
{0, 0, 0, 0 }
|
||||
};
|
||||
|
||||
static void __attribute__ ((noreturn))
|
||||
usage (int status)
|
||||
{
|
||||
if (status)
|
||||
fprintf (stderr,
|
||||
"Try ``%s --help'' for more information.\n", program_name);
|
||||
else
|
||||
printf ("\
|
||||
Usage: %s [OPTIONS] SYMBOL-NAME\n\
|
||||
\n\
|
||||
Convert a binary file to a C header.\n\
|
||||
\n\
|
||||
-h, --help display this message and exit\n\
|
||||
-V, --version print version information and exit\n\
|
||||
\n\
|
||||
Report bugs to <%s>.\n\
|
||||
", program_name, PACKAGE_BUGREPORT);
|
||||
|
||||
exit (status);
|
||||
}
|
||||
|
||||
int
|
||||
main (int argc, char *argv[])
|
||||
{
|
||||
int b, i;
|
||||
char *sym;
|
||||
|
||||
set_program_name (argv[0]);
|
||||
if (2 != argc)
|
||||
return 1;
|
||||
|
||||
/* Check for options. */
|
||||
while (1)
|
||||
{
|
||||
int c = getopt_long (argc, argv, "snm:r:hVv", options, 0);
|
||||
|
||||
if (c == -1)
|
||||
break;
|
||||
else
|
||||
switch (c)
|
||||
{
|
||||
case 'h':
|
||||
usage (0);
|
||||
break;
|
||||
|
||||
case 'V':
|
||||
printf ("%s (%s) %s\n", program_name, PACKAGE_NAME, PACKAGE_VERSION);
|
||||
return 0;
|
||||
|
||||
default:
|
||||
usage (1);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (optind >= argc)
|
||||
usage (1);
|
||||
|
||||
if (optind + 1 != argc)
|
||||
usage (1);
|
||||
|
||||
sym = argv[optind];
|
||||
sym = argv[1];
|
||||
|
||||
b = getchar ();
|
||||
if (b == EOF)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue