Skip to content

Commit

Permalink
Remove Cygwin32 completely
Browse files Browse the repository at this point in the history
  • Loading branch information
dra27 committed Mar 2, 2023
1 parent 0be0cf0 commit 5e9c96c
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 30 deletions.
1 change: 1 addition & 0 deletions CHANGES
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
Next version
- GPR#108: Add -lgcc_s to Cygwin's link libraries, upstreaming a patch from the
Cygwin flexdll package (David Allsopp)
- GPR#116: Remove Cygwin32 (David Allsopp)

Version 0.42
- GPR#106: Support -l: syntax, to allow static linking of specific libraries (David Allsopp)
Expand Down
17 changes: 2 additions & 15 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
## Tips to build flexdll:
##
## To use an already configured 64-bit MSVC toolchain:
## make all MSVC_DETECT=0 CHAINS="mingw mingw64 cygwin cygwin64 msvc64"
## make all MSVC_DETECT=0 CHAINS="mingw mingw64 cygwin64 msvc64"
##


Expand All @@ -28,9 +28,6 @@ MINCC = $(MINGW_PREFIX)gcc
MINGW64_PREFIX = x86_64-w64-mingw32-
MIN64CC = $(MINGW64_PREFIX)gcc

CYGWIN_PREFIX = i686-pc-cygwin-
CYGCC = $(CYGWIN_PREFIX)gcc

CYGWIN64_PREFIX = x86_64-pc-cygwin-
CYG64CC = $(CYGWIN64_PREFIX)gcc

Expand All @@ -41,7 +38,7 @@ version.ml: Makefile

# Supported tool-chains

CHAINS = mingw mingw64 cygwin cygwin64 msvc msvc64
CHAINS = mingw mingw64 cygwin64 msvc msvc64

# Compilers

Expand Down Expand Up @@ -133,7 +130,6 @@ support: $(addprefix build_, $(CHAINS))
build_gnat: flexdll_gnat.o flexdll_initer_gnat.o
build_msvc: flexdll_msvc.obj flexdll_initer_msvc.obj
build_msvc64: flexdll_msvc64.obj flexdll_initer_msvc64.obj
build_cygwin: flexdll_cygwin.o flexdll_initer_cygwin.o
build_cygwin64: flexdll_cygwin64.o flexdll_initer_cygwin64.o
build_mingw: flexdll_mingw.o flexdll_initer_mingw.o
build_mingw64: flexdll_mingw64.o flexdll_initer_mingw64.o
Expand Down Expand Up @@ -175,9 +171,6 @@ flexdll_msvc.obj: flexdll.h flexdll.c
flexdll_msvc64.obj: flexdll.h flexdll.c
$(MSVC64_PREFIX) $(MSVCC64) /DMSVC /DMSVC64 -c /Fo"flexdll_msvc64.obj" flexdll.c

flexdll_cygwin.o: flexdll.h flexdll.c
$(CYGCC) -c -DCYGWIN -o flexdll_cygwin.o flexdll.c

flexdll_cygwin64.o: flexdll.h flexdll.c
$(CYG64CC) -c -DCYGWIN -o flexdll_cygwin64.o flexdll.c

Expand All @@ -196,9 +189,6 @@ flexdll_initer_msvc.obj: flexdll_initer.c
flexdll_initer_msvc64.obj: flexdll_initer.c
$(MSVC64_PREFIX) $(MSVCC64) -c /Fo"flexdll_initer_msvc64.obj" flexdll_initer.c

flexdll_initer_cygwin.o: flexdll_initer.c
$(CYGCC) -c -o flexdll_initer_cygwin.o flexdll_initer.c

flexdll_initer_cygwin64.o: flexdll_initer.c
$(CYG64CC) -c -o flexdll_initer_cygwin64.o flexdll_initer.c

Expand All @@ -215,9 +205,6 @@ flexdll_initer_mingw64.o: flexdll_initer.c
demo_msvc: flexlink.exe flexdll_msvc.obj flexdll_initer_msvc.obj
$(MSVC_PREFIX) $(MAKE) -C test clean demo CHAIN=msvc CC="$(MSVCC)" PLUG2_CFLAGS="/bigobj" O=obj

demo_cygwin: flexlink.exe flexdll_cygwin.o flexdll_initer_cygwin.o
$(MAKE) -C test clean demo CHAIN=cygwin CC="$(CYGCC)" O=o

demo_cygwin64: flexlink.exe flexdll_cygwin64.o flexdll_initer_cygwin64.o
$(MAKE) -C test clean demo CHAIN=cygwin64 CC="$(CYG64CC)" O=o RUN="PATH=\"/cygdrive/c/cygwin64/bin:$(PATH)\""

Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ This main program can be compiled and linked like the commands below
# CYGWIN
gcc -I[...] -c dump.c
flexlink -chain cygwin -exe -o dump.exe dump.o
flexlink -chain cygwin64 -exe -o dump.exe dump.o
````

The compilation step is completely standard, but in order to link the
Expand Down Expand Up @@ -192,7 +192,7 @@ commands:
# CYGWIN
gcc -D_CYGWIN_ -c plug1.c
flexlink -chain cygwin -o plug1.dll plug1.o
flexlink -chain cygwin64 -o plug1.dll plug1.o
````

And now you can ask the main program to load the plugin:
Expand Down Expand Up @@ -516,7 +516,7 @@ Command line for the flexlink wrapper
-I <dir> Add a directory where to search for files
-L <dir> Add a directory where to search for files
-l <lib> Library file
-chain {msvc|msvc64|cygwin|mingw|mingw64|ld}
-chain {msvc|msvc64|cygwin64|mingw|mingw64|ld}
Choose which linker to use
-defaultlib <obj> External object (no export, no import)
-save-temps Do not delete intermediate files
Expand Down
2 changes: 1 addition & 1 deletion appveyor_build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ fi
if [ "$ARTEFACTS" = 'yes' ] ; then
pushd "$APPVEYOR_BUILD_FOLDER" &> /dev/null

make CHAINS="$CHAINS" package_bin installer
make package_bin installer
SUFFIX="$(git describe)"
VERSION="$(sed -ne 's/^VERSION *= *//p' Makefile)"
if [ "$SUFFIX" != "$VERSION" ] ; then
Expand Down
5 changes: 2 additions & 3 deletions cmdline.ml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ let use_default_libs = ref true
let subsystem = ref "console"
let explain = ref false
let builtin_linker = ref false
let toolchain : [ `MSVC | `MSVC64 | `MINGW | `MINGW64 | `GNAT | `GNAT64 | `CYGWIN | `CYGWIN64 | `LIGHTLD ] ref = ref `MSVC
let toolchain : [ `MSVC | `MSVC64 | `MINGW | `MINGW64 | `GNAT | `GNAT64 | `CYGWIN64 | `LIGHTLD ] ref = ref `MSVC
let save_temps = ref false
let show_exports = ref false
let show_imports = ref false
Expand Down Expand Up @@ -99,13 +99,12 @@ let specs = [
"-l", Arg.String (fun s -> files := ("-l" ^ s) :: !files),
"<lib> Library file";

"-chain", Arg.Symbol (["msvc";"msvc64";"cygwin";"cygwin64";"mingw";"mingw64";"gnat";"gnat64";"ld"],
"-chain", Arg.Symbol (["msvc";"msvc64";"cygwin64";"mingw";"mingw64";"gnat";"gnat64";"ld"],
(fun s ->
machine := `x86; underscore := true;
toolchain := match s with
| "msvc" -> `MSVC
| "msvc64" -> machine := `x64; underscore := false; `MSVC64
| "cygwin" -> `CYGWIN
| "cygwin64" -> machine := `x64; underscore := false; `CYGWIN64
| "mingw" -> `MINGW
| "gnat" -> `GNAT
Expand Down
15 changes: 7 additions & 8 deletions reloc.ml
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ type cmdline = {
let new_cmdline () =
let rf = match !toolchain with
| `MSVC | `MSVC64 | `LIGHTLD -> true
| `MINGW | `MINGW64 | `GNAT | `GNAT64 | `CYGWIN | `CYGWIN64 -> false
| `MINGW | `MINGW64 | `GNAT | `GNAT64 | `CYGWIN64 -> false
in
{
may_use_response_file = rf;
Expand All @@ -207,7 +207,7 @@ let run_command cmdline cmd =
in
(* note: for Cygwin, using bash allow to follow symlinks to find
gcc... *)
if !toolchain = `CYGWIN || !toolchain = `CYGWIN64 ||
if !toolchain = `CYGWIN64 ||
String.length cmd + String.length silencer > max_command_length
then begin
(* Dump the command in a text file and apply bash to it. *)
Expand Down Expand Up @@ -608,7 +608,7 @@ let parse_dll_exports fn =
let dll_exports fn = match !toolchain with
| `MSVC | `MSVC64 | `LIGHTLD ->
failwith "Creation of import library not supported for this toolchain"
| `GNAT | `GNAT64 | `CYGWIN | `CYGWIN64 | `MINGW | `MINGW64 ->
| `GNAT | `GNAT64 | `CYGWIN64 | `MINGW | `MINGW64 ->
let dmp = temp_file "dyndll" ".dmp" in
if cmd_verbose (Printf.sprintf "%s -p %s > %s" !objdump fn dmp) <> 0
then failwith "Error while extracting exports from a DLL";
Expand Down Expand Up @@ -1089,7 +1089,7 @@ let build_dll link_exe output_file files exts extra_args =
!subsystem
files descr
extra_args
| `CYGWIN | `CYGWIN64 ->
| `CYGWIN64 ->
let def_file =
if main_pgm then ""
else
Expand Down Expand Up @@ -1289,7 +1289,7 @@ let setup_toolchain () =
search_path := !dirs;
add_flexdll_obj := false;
noentry := true
| `CYGWIN | `CYGWIN64 ->
| `CYGWIN64 ->
gcc := "gcc";
objdump := "objdump";
search_path :=
Expand Down Expand Up @@ -1360,7 +1360,7 @@ let compile_if_needed file =
(mk_dirs_opt "/I")
file
pipe
| `CYGWIN | `CYGWIN64 ->
| `CYGWIN64 ->
Printf.sprintf
"gcc -c -o %s %s %s"
(Filename.quote tmp_obj)
Expand Down Expand Up @@ -1414,7 +1414,6 @@ let all_files () =
let tc = match !toolchain with
| `MSVC -> "msvc.obj"
| `MSVC64 -> "msvc64.obj"
| `CYGWIN -> "cygwin.o"
| `CYGWIN64 -> "cygwin64.o"
| `MINGW64 -> "mingw64.o"
| `GNAT -> "gnat.o"
Expand All @@ -1436,7 +1435,7 @@ let main () =
match !toolchain, !cygpath_arg with
| _, `Yes -> true
| _, `No -> false
| (`GNAT|`GNAT64|`MINGW|`MINGW64|`CYGWIN|`CYGWIN64), `None ->
| (`GNAT|`GNAT64|`MINGW|`MINGW64|`CYGWIN64), `None ->
begin match Sys.os_type with
| "Unix" | "Cygwin" ->
Sys.command "cygpath -S 2>/dev/null >/dev/null" = 0
Expand Down

0 comments on commit 5e9c96c

Please sign in to comment.