Revision: 9517 https://osdn.net/projects/ttssh2/scm/svn/commits/9517 Author: zmatsuo Date: 2021-11-10 22:01:33 +0900 (Wed, 10 Nov 2021) Log Message: ----------- cygwin/cygterm/cyglaunch を削除 Modified Paths: -------------- trunk/cygwin/cygterm/Makefile Removed Paths: ------------- trunk/cygwin/cygterm/cyglaunch.c -------------- next part -------------- Modified: trunk/cygwin/cygterm/Makefile =================================================================== --- trunk/cygwin/cygterm/Makefile 2021-11-10 13:01:23 UTC (rev 9516) +++ trunk/cygwin/cygterm/Makefile 2021-11-10 13:01:33 UTC (rev 9517) @@ -7,8 +7,6 @@ #CFLAGS = -g -fno-exceptions LDFLAGS = -mwindows -LAUNCH = cyglaunch.exe -LAUNCH_SRC = cyglaunch.c EXE = cygterm.exe SRC = $(EXE:.exe=.cc) CFG = $(EXE:.exe=.cfg) @@ -19,7 +17,7 @@ .PHONY: all clean install uninstall -all : $(EXE) $(LAUNCH) $(ARCHIVE) +all : $(EXE) $(ARCHIVE) $(EXE) : $(SRC) $(ICO) $(RC) windres -O coff -o $(RES) $(RC) @@ -30,32 +28,11 @@ endif strip $(EXE) -$(LAUNCH) : $(LAUNCH_SRC) $(ICO) $(RC) - @# gcc 4.3.2? or later doesn't support "-mno-cygwin" flag. - @# - @# $(CC) gcc less than 4.3.2 (supports "-mno-cygwin") - @# gcc-3 gcc3 (supports "-mno-cygwin") - @# i686-pc-mingw32-gcc mingw-gcc-core - @# i686-w64-mingw32-gcc mingw64-i686-gcc-core - @# x86_64-w64-mingw32-gcc mingw64-x86_64-gcc-core - ifeq (i686, $(shell uname -m)) - windres -O coff -o $(RES) $(RC) - ( i686-pc-mingw32-gcc $(CFLAGS) $(LDFLAGS) -o $(LAUNCH) $(LAUNCH_SRC) $(RES) ) || \ - ( i686-w64-mingw32-gcc $(CFLAGS) $(LDFLAGS) -o $(LAUNCH) $(LAUNCH_SRC) $(RES) ) || \ - ( $(CC) $(CFLAGS) $(LDFLAGS) -mno-cygwin -o $(LAUNCH) $(LAUNCH_SRC) $(RES) ) || \ - ( gcc-3 $(CFLAGS) $(LDFLAGS) -mno-cygwin -o $(LAUNCH) $(LAUNCH_SRC) $(RES) ) - strip $(LAUNCH) - else - x86_64-w64-mingw32-windres -O coff -o $(RES) $(RC) - x86_64-w64-mingw32-gcc $(CFLAGS) $(LDFLAGS) -o $(LAUNCH) $(LAUNCH_SRC) $(RES) - x86_64-w64-mingw32-strip $(LAUNCH) - endif - $(RC): echo 'icon ICON $(ICO)' > $(RC) clean : - rm -f $(EXE) $(RC) $(RES) $(LAUNCH) $(ARCHIVE) + rm -f $(EXE) $(RC) $(RES) $(ARCHIVE) install : $(EXE) @ install -v $(EXE) $(BINDIR)/$(EXE) @@ -67,5 +44,5 @@ rm -f $(BINDIR)/$(EXE) rm -f $(BINDIR)/$(CFG) -$(ARCHIVE) : $(SRC) $(ICO) $(CFG) $(LAUNCH_SRC) README README-j Makefile - tar cf - $(SRC) $(ICO) $(CFG) $(LAUNCH_SRC) COPYING README README-j Makefile | gzip > $(ARCHIVE) +$(ARCHIVE) : $(SRC) $(ICO) $(CFG) README README-j Makefile + tar cf - $(SRC) $(ICO) $(CFG) COPYING README README-j Makefile | gzip > $(ARCHIVE) Deleted: trunk/cygwin/cygterm/cyglaunch.c =================================================================== --- trunk/cygwin/cygterm/cyglaunch.c 2021-11-10 13:01:23 UTC (rev 9516) +++ trunk/cygwin/cygterm/cyglaunch.c 2021-11-10 13:01:33 UTC (rev 9517) @@ -1,145 +0,0 @@ -// -// Cygterm launcher -// -// (C) 2007- TeraTerm Project -// https://ttssh2.osdn.jp/ -// -// [How to compile] -// Cygwin: -// # cc -mno-cygwin -mwindows -o cyglaunch cyglaunch.c -// - -#include <windows.h> -#include <stdio.h> -#include <stdlib.h> -#include <direct.h> - -#define Section "Tera Term" -char *FName = "TERATERM.INI"; - - -// -// Connect to local cygwin -// -void OnCygwinConnection(char *CygwinDirectory, char *cmdline) -{ - char file[MAX_PATH], *filename; - char c, *envptr, *envbuff; - int envbufflen; - char *exename = "cygterm.exe"; - char cmd[1024]; - STARTUPINFO si; - PROCESS_INFORMATION pi; - - if (strlen(CygwinDirectory) > 0) { - if (SearchPath(CygwinDirectory, "bin\\cygwin1", ".dll", sizeof(file), file, &filename) > 0) { - goto found_dll; - } - } - - if (SearchPath(NULL, "cygwin1", ".dll", sizeof(file), file, &filename) > 0) { - goto found_path; - } - - for (c = 'C' ; c <= 'Z' ; c++) { - char tmp[MAX_PATH]; - sprintf(tmp, "%c:\\cygwin\\bin;%c:\\cygwin64\\bin", c, c); - if (SearchPath(tmp, "cygwin1", ".dll", sizeof(file), file, &filename) > 0) { - goto found_dll; - } - } - - MessageBox(NULL, "Can't find Cygwin directory.", "ERROR", MB_OK | MB_ICONWARNING); - return; - -found_dll:; - envptr = getenv("PATH"); - file[strlen(file)-12] = '\0'; // delete "\\cygwin1.dll" - if (envptr != NULL) { - envbufflen = strlen(file) + strlen(envptr) + 7; // "PATH="(5) + ";"(1) + NUL(1) - if ((envbuff=malloc(envbufflen)) == NULL) { - MessageBox(NULL, "Can't allocate memory.", "ERROR", MB_OK | MB_ICONWARNING); - return; - } - _snprintf(envbuff, envbufflen, "PATH=%s;%s", file, envptr); - } else { - envbufflen = strlen(file) + strlen(envptr) + 6; // "PATH="(5) + NUL(1) - if ((envbuff=malloc(envbufflen)) == NULL) { - MessageBox(NULL, "Can't allocate memory.", "ERROR", MB_OK | MB_ICONWARNING); - return; - } - _snprintf(envbuff, envbufflen, "PATH=%s", file); - } - _putenv(envbuff); - if (envbuff) { - free(envbuff); - envbuff = NULL; - } - -found_path:; - memset(&si, 0, sizeof(si)); - GetStartupInfo(&si); - memset(&pi, 0, sizeof(pi)); - - strcpy(cmd, exename); - strcat(cmd, " "); - strncat(cmd, cmdline, sizeof(cmd)-strlen(cmd)-1); -//printf("%s", cmd); -//MessageBox(NULL, cmd, "", MB_OK); - if (CreateProcess( - NULL, - cmd, - NULL, NULL, FALSE, 0, - NULL, NULL, - &si, &pi) == 0) { - MessageBox(NULL, "Can't execute Cygterm.", "ERROR", MB_OK | MB_ICONWARNING); - } -} - - -int main(int argc, char** argv) -{ - char Temp[256], CygwinDir[256], Cmdline[256]; - char *bs; - int i; - BOOL d_opt=FALSE; - - if (GetModuleFileName(NULL, Temp, sizeof(Temp)) > 0 && - (bs = strrchr(Temp, '\\')) != NULL) { - *bs = 0; - _chdir(Temp); - _snprintf(bs, sizeof(Temp) + Temp - bs, "\\%s", FName); - } - else { - _snprintf(Temp, sizeof(Temp), ".\\", FName); - } - - // Cygwin install path - GetPrivateProfileString(Section, "CygwinDirectory", "c:\\cygwin", - CygwinDir, sizeof(CygwinDir), Temp); - - //printf("%s %d\n", CygwinDir, GetLastError()); - - Cmdline[0] = 0; - for (i=1; i<argc; i++) { - if (i != 1) { - strncat(Cmdline, " ", sizeof(Cmdline)-strlen(Cmdline)-1); - } - if (d_opt && strncmp("\"\\\\", argv[i], 3) == 0) { - argv[i][1] = '/'; - argv[i][2] = '/'; - } - strncat(Cmdline, argv[i], sizeof(Cmdline)-strlen(Cmdline)-1); - if (strcmp(argv[i], "-d") == 0) { - d_opt = TRUE; - } - else { - d_opt = FALSE; - } - } - //printf("%s\n", Cmdline); - - OnCygwinConnection(CygwinDir, Cmdline); - - return 0; -}