2.4. Directory Structure. Comtrol DeviceMaster Software Development Kit
Anúncio
Anúncio
Chapter 2. Setting Up Cygwin
The source code is split into two units: user tools and development tools. If you want the user tools source code, cd into the user-src-split subdirectory. Download the files there. If you want the development tools sources, cd into the dev-src-split subdirectory. Download the files there.
Back in the Windows command shell, for the user tools source:
C:\Cygnus\> src.tar.bz2
copy /b xba + xbb + xbc + xbd + xbe + xbf + xbg user-
C:\Cygnus\>
C:\Cygnus\>
C:\Cygnus\> del xb*.* bunzip2 user-src.tar.bz2
tar xvf user-src.tar
For the development tools source:
C:\Cygnus\> src.tar.bz2
copy /b xca + xcb + xcc + xcd + ... + xck + xcl dev-
C:\Cygnus\>
C:\Cygnus\>
C:\Cygnus\> del xc*.* bunzip2 dev-src.tar.bz2
tar xvf dev-src.tar
Both will expand into a directory called src .
Note: if you want the sources corresponding to everything in the full.exe binary installer, you will need to download and expand both the user-src.tar.bz2
and dev-src.tar.bz2
source archives!
2.4. Directory Structure
Cygwin knows how to emulate a standard UNIX directory structure, to some extent.
This is done through the use of mount tables that map Win32 paths to POSIX ones. The mount table may be set up and modified with the mount command. This section explains how to properly organize the structure.
19
Chapter 2. Setting Up Cygwin
When you set up the system you should decide where you want the root to be mapped.
Possible choices are the root of your Windows system, such as c: or a directory such as c:\progra~1\root .
Execute the following commands inside bash as it is difficult to change the position of the root from the Windows command prompt. Changing the mount points may invalidate PATH, if this happens simply exit and relaunch bash. Create the directory if needed, then umount / the current root and mount it in its new place. You also have to decide if you want to use text or binary mode.
Next, create the traditional main UNIX directories, with the following command (in some shells it is necessary to issue separate mkdir commands, each with a single argument).
/$ mkdir /tmp /bin /etc /var /usr
Next we will initialize the content of these directories.
You should make sure that you always have a valid /tmp directory. If you want to avoid creating a real /tmp , you can use the mount utility to point /tmp to another directory, such as c:\tmp , or create a symbolic link /tmp to point to such a directory.
The /bin directory should contain the shell sh.exe
. You have three choices. The first is to copy this program from the Cygnus bin directory. The second is to use mount to mount the Cygnus bin directory to /bin (the advantage of this approach is that your
PATH will be shorter inside bash). The third is to make /bin a symbolic link to the
Cygnus bin directory.
Note that Cygwin comes with two shells: bash.exe and sh.exe, which is based on ash.
The system is faster when ash is used as the non-interactive shell. The only functionality supported in ash is that of the traditional sh. In case of trouble with ash make sh.exe point to bash.exe.
We now turn to /etc . You may want to copy in it the termcap file from the Cygnus etc directory, although the defaults built into the programs suffice for the normal console. You may also use mount or create as symbolic link to the Cygnus etc , just as for /bin above.
20
Download
Anúncio