summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorH. Peter Anvin <hpa@linux.intel.com>2010-07-21 12:33:13 -0700
committerH. Peter Anvin <hpa@linux.intel.com>2010-07-21 12:33:13 -0700
commit4ad669661e034f6069c3ce0d6b97a8f297cf33b3 (patch)
treec8d83c04f6b805cbb18c83fa1589f0ef0a45fec3
parenta6616dc0e872b3d12ab6e25c8d9d22a9977e8e28 (diff)
downloadsyslinux-4ad669661e034f6069c3ce0d6b97a8f297cf33b3.tar.gz
win64: experimental Win64 installer (syslinux64.exe)syslinux-4.02
Experimental Win64 installer. This is necessary to be able to run on WinPE64, since WinPE64 doesn't support running 32-bit binaries. Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
-rw-r--r--Makefile11
-rw-r--r--NEWS1
-rw-r--r--win/hello.c (renamed from win32/hello.c)0
-rw-r--r--win/sysexits.h (renamed from win32/sysexits.h)0
-rw-r--r--win/syslinux.c (renamed from win32/syslinux.c)5
-rw-r--r--win32/Makefile14
-rw-r--r--win32/README6
-rwxr-xr-xwin32/find-mingw32.sh (renamed from win32/find-mingw.sh)1
-rw-r--r--win64/Makefile92
-rw-r--r--win64/README10
-rwxr-xr-xwin64/find-mingw64.sh24
11 files changed, 148 insertions, 16 deletions
diff --git a/Makefile b/Makefile
index 9b40e368..da90cdc4 100644
--- a/Makefile
+++ b/Makefile
@@ -1,7 +1,7 @@
## -----------------------------------------------------------------------
##
## Copyright 1998-2009 H. Peter Anvin - All Rights Reserved
-## Copyright 2009 Intel Corporation; author: H. Peter Anvin
+## Copyright 2009-2010 Intel Corporation; author: H. Peter Anvin
##
## This program is free software; you can redistribute it and/or modify
## it under the terms of the GNU General Public License as published by
@@ -43,7 +43,8 @@ BOBJECTS = $(BTARGET) \
mbr/mbr_c.bin mbr/altmbr_c.bin mbr/gptmbr_c.bin \
mbr/mbr_f.bin mbr/altmbr_f.bin mbr/gptmbr_f.bin \
core/pxelinux.0 core/isolinux.bin core/isolinux-debug.bin \
- gpxe/gpxelinux.0 dos/syslinux.com win32/syslinux.exe \
+ gpxe/gpxelinux.0 dos/syslinux.com \
+ win32/syslinux.exe win64/syslinux64.exe \
dosutil/*.com dosutil/*.sys \
$(MODULES)
@@ -54,7 +55,7 @@ BOBJECTS = $(BTARGET) \
# files that depend only on the B phase, but may have to be regenerated
# for "make installer".
BSUBDIRS = codepage com32 lzo core memdisk modules mbr memdump gpxe sample \
- libinstaller dos win32 dosutil
+ libinstaller dos win32 win64 dosutil
ITARGET =
IOBJECTS = $(ITARGET) \
utils/gethostip utils/isohybrid utils/mkdiskimage \
@@ -68,9 +69,9 @@ INSTALL_SBIN = extlinux/extlinux
# Things to install in /usr/lib/syslinux
INSTALL_AUX = core/pxelinux.0 gpxe/gpxelinux.0 core/isolinux.bin \
core/isolinux-debug.bin \
- dos/syslinux.com win32/syslinux.exe \
+ dos/syslinux.com \
mbr/*.bin $(MODULES)
-INSTALL_AUX_OPT = win32/syslinux.exe
+INSTALL_AUX_OPT = win32/syslinux.exe win64/syslinux64.exe
# These directories manage their own installables
INSTALLSUBDIRS = com32 utils dosutil
diff --git a/NEWS b/NEWS
index 61801955..8ecb6cd9 100644
--- a/NEWS
+++ b/NEWS
@@ -28,6 +28,7 @@ Changes in 4.02:
command line options.
* PXELINUX: fix the use of IP addresses in TFTP :: or tftp://
host syntax.
+ * SYSLINUX: experimental Win64 installer (syslinux64.exe).
Changes in 4.01:
* ISOLINUX: fix initialization on systems which don't zero
diff --git a/win32/hello.c b/win/hello.c
index 4934689b..4934689b 100644
--- a/win32/hello.c
+++ b/win/hello.c
diff --git a/win32/sysexits.h b/win/sysexits.h
index 483d3bab..483d3bab 100644
--- a/win32/sysexits.h
+++ b/win/sysexits.h
diff --git a/win32/syslinux.c b/win/syslinux.c
index 1f95e842..0e833d8d 100644
--- a/win32/syslinux.c
+++ b/win/syslinux.c
@@ -46,12 +46,15 @@ void error(char *msg);
#define PART_ACTIVE 0x80
// The following struct should be in the ntddstor.h file, but I didn't have it.
-// TODO: Make this a conditional compilation
+// mingw32 has <ddk/ntddstor.h>, but including that file causes all kinds
+// of other failures. mingw64 has it in <winioctl.h>.
+#ifndef __x86_64__
typedef struct _STORAGE_DEVICE_NUMBER {
DEVICE_TYPE DeviceType;
ULONG DeviceNumber;
ULONG PartitionNumber;
} STORAGE_DEVICE_NUMBER, *PSTORAGE_DEVICE_NUMBER;
+#endif
BOOL GetStorageDeviceNumberByHandle(HANDLE handle,
const STORAGE_DEVICE_NUMBER * sdn)
diff --git a/win32/Makefile b/win32/Makefile
index b8879db9..d4133ff8 100644
--- a/win32/Makefile
+++ b/win32/Makefile
@@ -29,23 +29,25 @@ else
ifeq ($(findstring MINGW32,$(OSTYPE)),MINGW32)
WINPREFIX :=
else
-WINPREFIX := $(shell ./find-mingw.sh gcc)
+WINPREFIX := $(shell ./find-mingw32.sh gcc)
endif
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 -I../libinstaller/getopt
+WINCFLAGS += -I. -I../win -I.. -I../libfat -I../libinstaller \
+ -I../libinstaller/getopt
WINCC := $(WINPREFIX)gcc
WINAR := $(WINPREFIX)ar
WINRANLIB := $(WINPREFIX)ranlib
-WINCC_IS_GOOD := $(shell $(WINCC) $(WINCFLAGS) $(WINLDFLAGS) -o hello.exe hello.c >/dev/null 2>&1 ; echo $$?)
+WINCC_IS_GOOD := $(shell $(WINCC) $(WINCFLAGS) $(WINLDFLAGS) \
+ -o hello.exe ../win/hello.c >/dev/null 2>&1 ; echo $$?)
-.SUFFIXES: .c .o .i .s .S
+.SUFFIXES: .c .obj .lib .exe .i .s .S
-SRCS = syslinux.c
+SRCS = ../win/syslinux.c
OBJS = $(patsubst %.c,%.obj,$(notdir $(SRCS)))
LIBSRC = ../libinstaller/fat.c \
../libinstaller/syslxmod.c \
@@ -60,7 +62,7 @@ LIBOBJS = $(patsubst %.c,%.obj,$(notdir $(LIBSRC)))
LIB = syslinux.lib
-VPATH = .:../libfat:../libinstaller:../libinstaller/getopt
+VPATH = .:../win:../libfat:../libinstaller:../libinstaller/getopt
TARGETS = syslinux.exe
diff --git a/win32/README b/win32/README
index a1578f91..8775cf0a 100644
--- a/win32/README
+++ b/win32/README
@@ -2,7 +2,5 @@ Building the Win32 installer requires the MinGW compiler, available at:
http://www.mingw.org/
-Prepackaged versions of the MinGW cross-compiler in RPM format for
-Linux are available at:
-
- http://mirzam.it.vu.nl/mingw/
+Prepackaged versions of the MinGW cross-compiler are now included in
+several Linux distributions, including Fedora.
diff --git a/win32/find-mingw.sh b/win32/find-mingw32.sh
index 7a4491cd..f79949c7 100755
--- a/win32/find-mingw.sh
+++ b/win32/find-mingw32.sh
@@ -4,6 +4,7 @@ cc="$1"
for prefix in \
mingw- \
+ mingw32- \
i386-pc-mingw32- \
i486-pc-mingw32- \
i586-pc-mingw32- \
diff --git a/win64/Makefile b/win64/Makefile
new file mode 100644
index 00000000..0bc746d5
--- /dev/null
+++ b/win64/Makefile
@@ -0,0 +1,92 @@
+## -----------------------------------------------------------------------
+##
+## Copyright 1998-2008 H. Peter Anvin - All Rights Reserved
+## Copyright 2010 Intel Corporation; author: H. Peter Anvin
+##
+## This program is free software; you can redistribute it and/or modify
+## it under the terms of the GNU General Public License as published by
+## the Free Software Foundation, Inc., 53 Temple Place Ste 330,
+## Boston MA 02111-1307, USA; either version 2 of the License, or
+## (at your option) any later version; incorporated herein by reference.
+##
+## -----------------------------------------------------------------------
+
+#
+# Makefile for SYSLINUX Win64
+#
+# This is separated out mostly so we can have a different set of Makefile
+# variables.
+#
+
+OSTYPE = $(shell uname -msr)
+# Don't know how to do a native compile here...
+WINPREFIX := $(shell ./find-mingw64.sh gcc)
+WINCFLAGS := $(GCCWARN) -Wno-sign-compare -Os -fomit-frame-pointer \
+ -D_FILE_OFFSET_BITS=64
+WINLDFLAGS := -Os -s
+
+WINCFLAGS += -I. -I../win -I.. -I../libfat -I../libinstaller \
+ -I../libinstaller/getopt
+
+WINCC := $(WINPREFIX)gcc
+WINAR := $(WINPREFIX)ar
+WINRANLIB := $(WINPREFIX)ranlib
+
+WINCC_IS_GOOD := $(shell $(WINCC) $(WINCFLAGS) $(WINLDFLAGS) \
+ -o hello.exe ../win/hello.c >/dev/null 2>&1 ; echo $$?)
+
+.SUFFIXES: .c .obj .lib .exe .i .s .S
+
+SRCS = ../win/syslinux.c
+OBJS = $(patsubst %.c,%.obj,$(notdir $(SRCS)))
+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 \
+ $(wildcard ../libfat/*.c)
+LIBOBJS = $(patsubst %.c,%.obj,$(notdir $(LIBSRC)))
+
+LIB = syslinux.lib
+
+VPATH = .:../win:../libfat:../libinstaller:../libinstaller/getopt
+
+TARGETS = syslinux64.exe
+
+ifeq ($(WINCC_IS_GOOD),0)
+all: $(TARGETS)
+else
+all:
+ rm -f $(TARGETS)
+endif
+
+tidy dist:
+ -rm -f *.o *.obj *.lib *.i *.s *.a .*.d *.tmp *_bin.c hello.exe
+
+clean: tidy
+
+spotless: clean
+ -rm -f *~ $(TARGETS)
+
+installer:
+
+$(LIB): $(LIBOBJS)
+ rm -f $@
+ $(WINAR) cq $@ $^
+ $(WINRANLIB) $@
+
+syslinux64.exe: $(OBJS) $(LIB)
+ $(WINCC) $(WINLDFLAGS) -o $@ $^
+
+
+%.obj: %.c
+ $(WINCC) $(UMAKEDEPS) $(WINCFLAGS) -c -o $@ $<
+%.i: %.c
+ $(WINCC) $(UMAKEDEPS) $(WINCFLAGS) -E -o $@ $<
+%.s: %.c
+ $(WINCC) $(UMAKEDEPS) $(WINCFLAGS) -S -o $@ $<
+
+-include .*.d *.tmp
diff --git a/win64/README b/win64/README
new file mode 100644
index 00000000..05b41607
--- /dev/null
+++ b/win64/README
@@ -0,0 +1,10 @@
+Building the Win64 installer requires the MinGW-W64 compiler,
+available at:
+
+ http://mingw-w64.sourceforge.net/
+
+For prepackaged versions of the MinGW-W64 cross-compiler for the
+Fedora Linux distribution (and possibly other RPM-based
+distributions), see:
+
+ http://lists.fedoraproject.org/pipermail/mingw/2010-May/002589.html
diff --git a/win64/find-mingw64.sh b/win64/find-mingw64.sh
new file mode 100755
index 00000000..6b620c87
--- /dev/null
+++ b/win64/find-mingw64.sh
@@ -0,0 +1,24 @@
+#!/bin/sh
+
+cc="$1"
+
+for prefix in \
+ mingw64- \
+ x86_64-pc-mingw64- \
+ x86_64-pc-mingw64msvc- \
+ x86_64-pc-mingw32- \
+ x86_64-pc-mingw32msvc- \
+ x86_64-mingw64- \
+ x86_64-mingw64msvc- \
+ x86_64-mingw32- \
+ x86_64-mingw32msvc- \
+ ; do
+ if "${prefix}${cc}" -v > /dev/null 2>&1; then
+ echo "$prefix"
+ exit 0
+ fi
+done
+
+# No prefix, no idea what to do now...
+echo missing-
+exit 1