MinGW, MSYS, Cygwin 설치 법, D 드라이브에 그대로 옮기는 법

* MinGW(GCC) 컴파일러 Suite 설치하는 법 - http://mingw.org/wiki/HOWTO_Install_the_MinGW_GCC_Compiler_Suite
installer 설치 - MinGW-5.1.4.exe 직접 설치
http://sourceforge.net/project/showfiles.php?group_id=2435&package_id=240780
mingw-runtime, w32api, GCC, binutils, mingw32-make 설치함(각각 최신 버전은 아님)
mingw32-make는 MSYS나 Cygwin이 있으면 불필요 - 설치 후 업그레이드 패키지 받아서
MinGW 디렉토리에 풀어줌.
MSYS-1.0.11 이전 버전에서는 MinGW를 MSYS와 같은 경로에 설치하지 말 것.
(MSYS bin 디렉토리에 MSYS 실행 파일이 아닌 파일이 없다면 서브디렉토리로는 할 수 있음)
msys와 mingw를 설치하고 /mingw가 mingw 디렉토리에 map 되게 할 때 port나 다른 프로그램을
설치한다면 gcc가 이용할 수 있게 그들을 /mingw에 설치해야 함(예 - ./configure --prefix=/mingw)

수동 설치 - 필요한 패키지들을 구해서 서브디렉토리에 직접 풀어줌. 권장 방법
MinGW download page - http://sourceforge.net/project/showfiles.php?group_id=2435
최소 아래의 패키지가 필요(automated mingw installer는 이들 패키지를 적절한 디렉토리에 풀어주는 것임)

* GNU Binutils: http://sourceforge.net/project/showfiles.php?group_id=2435&package_id=11290
* GCC Version 3: http://sourceforge.net/project/showfiles.php?group_id=2435&package_id=82723
* MINGW Runtime: http://sourceforge.net/project/showfiles.php?group_id=2435&package_id=11598
* Windows 32 API: http://sourceforge.net/project/showfiles.php?group_id=2435&package_id=11550

gcc frontend가 적절히 동작하기 위해서는 gcc-core가 필요
binutils-2.19.1-mingw32-bin.tar.gz
gcc-core-3.4.5-20060117-3.tar.gz, gcc-g++-3.4.5-20060117-3.tar.gz
mingwrt-3.15.2-mingw32-dev.tar.gz, mingwrt-3.15.2-mingw32-dll.tar.gz
w32api-3.13-mingw32-dev.tar.gz

윈도우즈용 gzip 필요 - http://gnuwin32.sourceforge.net/packages/gzip.htm
윈도우즈용 tar, LibArchive for Windows - http://gnuwin32.sourceforge.net/packages/tar.htm
설치 후 경로에 추가.

설치 디렉토리 생성(여기서는 d:\MinGW)하고 위의 파일들을 모두 복사하고 압축 해제

추가적인 프로그래밍 언어 설치
tar xvzf gcc-ada-3.4.5-20060117-3.tar.gz
tar xvzf gcc-g77-3.4.5-20060117-3.tar.gz
tar xvzf gcc-java-3.4.5-20060117-3.tar.gz
tar xvzf gcc-objc-3.4.5-20060117-3.tar.gz

gdb-6.8-mingw-3.tar.bz2 - 이 파일의 것 중 기존 것과 겹치는 파일들은 이 파일의 것이 오래된 것 같음. 그냥 skip 함
mingw32-make-3.81-20080326-3.tar.gz - 이것도 그냥 설치함
mingw-utils-0.3.tar.gz
wget-1.9.1.tar.gz - 이것은 컴파일해야 하는 것

gcc를 바로 실행할 수 있도록 d:\mingw\bin을 경로에 등재해야 할 듯함 - 일단 다른 폴더에 설치할 수도 있으므로 보류해둠
임의의 디렉토리에 압축 풀고 PATH 등재해주면 됨.

* MSYS 설치(Minimal System)
GNU utility(bash, make, gawk, grep 등)의 모음. MinGW를 보조해주고 cmd shell을 보완하기 위한 것임
유닉스 tool들에 의존하는 프로그램 구축을 위한 것임(예. autotool build system - 보통 "./configure;make"를 이용)
MSYS 자체는 컴파일러나 C 라이브러리를 가지지 않으며 유닉스 고유의 기능을 제공하지도 않음.
이런 기능은 Cygwin이나 MS의 Interix를 이용(Microsoft's Interix, Interop는 비슷한 듯한데 상용으로 보임)

MinGW를 설치하지 않았다면 MinGW 설치(C:\MinGW 권장. D:\MinGW에 설치)
MSYS 설치(C:\msys\1.0 권장. D:\msys\1.0에 설치) - http://sourceforge.net/project/showfiles.php?group_id=2435
MSYS-1.0.10.exe 설치, 링크- http://downloads.sourceforge.net/mingw/msysDTK-1.0.1.exe
base에 있음 - http://jaist.dl.sourceforge.net/sourceforge/mingw/MSYS-1.0.10.exe

post install process에서 MinGW가 설치된 디렉토리를 묻는데 여기에 "C:/mingw(또는 D:/mingw)" 입력)
잘못 입력했을 때 "C:\msys\1.0\etc\fstab" 파일을 편집하면 된다('LF line ending에 주의)
fstab의 예제는 아래와 유사함
c:/mingw /mingw
c:/java /java

일단 레지스트리에 설치하는지 모르니까 SVS로 설치해봄
파일은 windows/msys.ini 파일이 생성됨. 그 외에는 특별한 것은 없는 듯함. 레지스트리도 특별한 것은 없는 듯함
[InstallSettings]
InstallPath=D:\msys\1.0

-geometry 80x25 => 80x45

그냥 그대로 옮기고 C:/windows/msys.ini 추가(편집), mys/1.0/etc/fstab 파일 편집

* MSYS DTK 1.0 설치 C:\msys\1.0. => D:\msys\1.0
이것도 SVS로 설치해봄. 역시 특별한 것은 없는 듯함. msys.ini도 바뀌지 않는 것으로 보임
msysDTK-1.0.1.exe - http://jaist.dl.sourceforge.net/sourceforge/mingw/msysDTK-1.0.1.exe
MSYS Supplementary Tools에 있음 - autoconf, autogen, automake, bison, crypt, cvs, flex,
gdbm, gettext, gettext-devel, gmp, guile, inetutils, libiconv, libtool, lndir, lpr,
minires, openssh, openssl, perl, regex, vim, zlib

* MSYS Core 1.0.11 설치. 압축 파일을 C:\msys\1.0 => D:\msys\1.0에 해제.
msysCORE-1.0.11-20080826.tar.gz -
MYSY Base에 있음 - http://jaist.dl.sourceforge.net/sourceforge/mingw/msysCORE-1.0.11-20080826.tar.gz
링크 - http://ncu.dl.sourceforge.net/sourceforge/mingw/msysCORE-1.0.11-2007.01.19-1.tar.bz2

* 환경 변수 HOME을 C:\msys\1.0\home(D:\msys\1.0\home)으로 설정. 이것은 cygwin과 충돌할 수 있으므로 보류함
바탕화면에 "M" 아이콘 생성됨. 이 아이콘 더불 클릭하면 MSYS 실행됨

* MYSY update
MSYS Base System - 아래 업데이트 설치.
* Bash
* Coreutils
* m4

# MSYS for Unix-style commands and shell (see the MSYS page for installation instructions)
# msysDTK for Unix-style developer toolkit
* Install MSYS 1.0.10. I usually install it in d:\msys\1.0, but you can use any directory that you prefer.
* Install MSYS DTK 1.0 in d:\msys\1.0.
* Install MSYS Core 1.0.11. It is an archive. Untar it in d:\msys\1.0.
* Install MinGW 5.1.3 in d:\msys\1.0\mingw. It is better to not install it in the same directory than MSYS, though there should be no problem since MSYS 1.0.11. In the installer, choose "Download and install", then "Candidate" (it will install gcc 3.4.5).

vvv
Using MSYS with MinGW

FIXME: This is confusing, and mostly irrelevant. The entire section needs a complete rewrite; discussion of GNU autotools is not directly pertinent to the primary subject matter.

The autotools that are installed by MSYS DTK do not work well and can't build DLLs. If you need newer versions of autoconf, automake and libtool then follow these instructions.

We will install autoconf, automake and libtool.

* You will need to download updated versions.
o autoconf
o automake
o libtool

* Unpack autoconf, automake and libtool to a directory of your choice.
* Install them with the 3 with the following command (avoid building in the source tree if possible):

../path/to/configure --prefix=/mingw && make && make install

* If make seems to be stuck in an infinite loop, csmake should probably be used instead.

As all the libraries will be installed in /mingw, PKG_CONFIG_PATH must be set. Optionally, if you want to get the cvs repository as a developer, CVS_RSH must also be set.

Open the file /etc/profile (C:\msys\1.0\etc\profile) with your favorite editor (make sure it uses LF line endings) and add:

PKG_CONFIG_PATH="/mingw/lib/pkgconfig"
CVS_RSH=ssh

You might also want to set CFLAGS. Safe options for MinGW are:

CFLAGS="-pipe -O2 -mms-bitfields -march=i686"

just before

export HOME LOGNAME MSYSTEM HISTFILE

and modify that line by adding the four variables:

export HOME LOGNAME MSYSTEM HISTFILE CFLAGS PKG_CONFIG_PATH CVS_RSH

Now restart MSYS. You should now be able to use MSYS without problems.

* To install 3rd party library and applications which uses the autotools build system the following commands are often used.

./configure --prefix=/mingw
make
make install

* Installing to "/usr/local" should be avoided, "/mingw" should be used instead to avoid conflicts with msysdvlpr.

Building for MSYS

To build an application for MSYS (as opposed to using MSYS), users will need to install msysDVLPR. It contains the headers and libraries to for MSYS along with an old version of GCC and Binutils. Resulting programs will only run under MSYS.

Msysdvlpr should never be treated as a targeted platform. It should also be noted that msysdvlpr is unlikely to be updated in the near future.
MinGW build VS MSYS build

Some programs when used under the MSYS shell can be tricky. One such example is sed.

$ ls *.txt -1 | sed -e s/.exe/\&\!/g

Normally, sed will append "!" to the end of every .txt file, but if sed was compiled and link using MinGW, MSYS will treat it as a native application and will try to change "/" to "\" to compensate for the difference between UNIX path and WIN32, resulting in unpredictability when used under the MSYS shell.

* Cygwin 설치 - SVS로 setup.exe 실행하여 바뀐 내용만 정리함. 일단 설치된 것은 그대로 가져다가 이용할 수 있는 것으로 보임

Cygwin.reg - 유니코드의 ULE-DOS 파일 레지스트리. C: 부분을 D:로 바꾸어주면 됨.
Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions]

[HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions\Cygwin]

[HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions\Cygwin\mounts v2]
"cygdrive prefix"="/cygdrive"
"cygdrive flags"=dword:00000022

[HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions\Cygwin\mounts v2\/]
"native"="C:\\cygwin"
"flags"=dword:0000000a

[HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions\Cygwin\mounts v2\/usr/bin]
"native"="C:\\cygwin/bin"
"flags"=dword:0000000a

[HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions\Cygwin\mounts v2\/usr/lib]
"native"="C:\\cygwin/lib"
"flags"=dword:0000000a

[HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions\Cygwin\Program Options]

Cygwin_d.bat <= D:에서 실행되도록 수정하면 됨. 여기도 geometry 수정할 수 있음. -geometry 80x25 => 80x45
@echo off

D:
chdir \cygwin\bin

set TEXMFCNF=/usr/share/texmf-local/web2c
set CYGWIN=tty

rxvt -tn xterm -rv -fn fixedsys -e /bin/bash --login -i

rem chcp 949
rem bash --login -i

댓글

이 블로그의 인기 게시물

언어 문법 관련

보안 관련

가상관련