From 61bfcb1fdf6f118e9347e668b9f9c4956b0b9999 Mon Sep 17 00:00:00 2001 From: "H. Peter Anvin" Date: Mon, 19 Jul 2010 17:23:16 -0700 Subject: [PATCH] dos, win32: use our own getopt_long() for both Use our own version of getopt_long() for both the DOS and Win32 installers. Currently, on MinGW, getopt_long() is a static library, but that could change in some installations. Signed-off-by: H. Peter Anvin --- dos/Makefile | 5 +++-- {dos => libinstaller/getopt}/getopt.h | 0 {dos => libinstaller/getopt}/getopt_long.c | 2 +- win32/Makefile | 5 +++-- 4 files changed, 7 insertions(+), 5 deletions(-) rename {dos => libinstaller/getopt}/getopt.h (100%) rename {dos => libinstaller/getopt}/getopt_long.c (99%) diff --git a/dos/Makefile b/dos/Makefile index 9f48962..54bfb59 100644 --- a/dos/Makefile +++ b/dos/Makefile @@ -23,13 +23,14 @@ CFLAGS += -D__MSDOS__ LDFLAGS = -T dosexe.ld OPTFLAGS = -g INCLUDES = -include code16.h -nostdinc -iwithprefix include \ - -I. -I.. -I../libfat -I ../libinstaller + -I. -I.. -I../libfat -I ../libinstaller -I ../libinstaller/getopt SRCS = syslinux.c \ ../libinstaller/fat.c \ ../libinstaller/syslxmod.c \ ../libinstaller/syslxopt.c \ ../libinstaller/setadv.c \ + ../libinstaller/getopt/getopt_long.c \ ../libinstaller/bootsect_bin.c \ ../libinstaller/mbr_bin.c \ $(wildcard ../libfat/*.c) @@ -39,7 +40,7 @@ LIBOBJS = int2526.o conio.o memcpy.o memset.o memmove.o skipatou.o atou.o \ malloc.o free.o getopt_long.o getsetsl.o strchr.o strtoul.o \ strntoumax.o argv.o printf.o __divdi3.o __udivmoddi4.o -VPATH = .:../libfat:../libinstaller +VPATH = .:../libfat:../libinstaller:../libinstaller/getopt TARGETS = syslinux.com diff --git a/dos/getopt.h b/libinstaller/getopt/getopt.h similarity index 100% rename from dos/getopt.h rename to libinstaller/getopt/getopt.h diff --git a/dos/getopt_long.c b/libinstaller/getopt/getopt_long.c similarity index 99% rename from dos/getopt_long.c rename to libinstaller/getopt/getopt_long.c index 1458779..cd7fef5 100644 --- a/dos/getopt_long.c +++ b/libinstaller/getopt/getopt_long.c @@ -10,8 +10,8 @@ #include #include +#include #include -#include "mystuff.h" char *optarg; int optind, opterr, optopt; diff --git a/win32/Makefile b/win32/Makefile index 81a6e9e..922913d 100755 --- a/win32/Makefile +++ b/win32/Makefile @@ -35,7 +35,7 @@ WINCFLAGS := $(GCCWARN) -Wno-sign-compare -Os -fomit-frame-pointer \ -D_FILE_OFFSET_BITS=64 WINLDFLAGS := -Os -s endif -WINCFLAGS += -I. -I.. -I../libfat -I../libinstaller +WINCFLAGS += -I. -I.. -I../libfat -I../libinstaller -I../libinstaller/getopt WINCC := $(WINPREFIX)gcc WINAR := $(WINPREFIX)ar @@ -51,6 +51,7 @@ LIBSRC = ../libinstaller/fat.c \ ../libinstaller/syslxmod.c \ ../libinstaller/syslxopt.c \ ../libinstaller/setadv.c \ + ../libinstaller/getopt/getopt_long.c \ ../libinstaller/bootsect_bin.c \ ../libinstaller/ldlinux_bin.c \ ../libinstaller/mbr_bin.c \ @@ -59,7 +60,7 @@ LIBOBJS = $(patsubst %.c,%.obj,$(notdir $(LIBSRC))) LIB = syslinux.lib -VPATH = .:../libfat:../libinstaller +VPATH = .:../libfat:../libinstaller:../libinstaller/getopt TARGETS = syslinux.exe -- 2.7.4