Windows IT Pro is the leading independent community for IT professionals deploying Microsoft Windows server and client applications and technologies.
  
  
  Advanced Search 


September 2008

Move Apps from UNIX to Windows with SUA

Use SUA with Vista for an intriguing alternative to UNIX
RSS
Subscribe to Windows IT Pro | See More UNIX Articles Here | Reprints | Or get the Monthly Online Pass—only $5.95 a month!

Port Shell Scripts
With fully functional C and Korn shells along with the usual crop of data-crunching tools such as sort, uniq, and col, porting most shell scripts should be relatively easy. Good candidates are scripts that transform data files—for example, sorting or merging them, removing duplicates, or filtering out selected columns before they are loaded into or after they are retrieved from a database—and a script that uses FTP to send or receive data files. The FTP client and server that come with the subsystem are more functional than their Windows counterparts. Many organizations still rely on FTP to move vast amounts of data and depend on UNIX systems for additional features and scriptable FTP clients.

Build C and C++ Applications
SUA includes support for porting UNIX C and C++ applications, but you need to know a few things. The subsystem comes with support for the GNU C and C++ compilers. However, the default is to use compiler interfaces to Microsoft Visual Studio, which must be installed. Visual Studio can be used to compile only applications that are written in C—not in C++. Figure 6 shows the contents of a Makefile—a very simple C file—and an example of what happens when you run the make command.

If you don’t have Visual Studio and you need to compile C++ source code or simply prefer to use the GNU compilers, you can do so by explicitly calling gcc or g++. When you use the GNU compilers, you have to be careful which file extensions you employ. For example, a C++ source code file in Windows usually has a .cpp file extension., but the g++ compiler expects C++ source code files to have a .cc file extension. If your file has the wrong extension, you might encounter apparently random errors, especially on 64-bit hardware platforms. I recommend that you check SUA’s Help files and release notes; these documents contain useful information that can help you avoid some pitfalls.

In the /usr/examples directory, you’ll find sample source code that demonstrates how to use the Oracle Call Interface (APIs for using an Oracle database) and ODBC APIs. The sample code included shows you how to use the Open Network Computing remote procedure call client to make calls to remote systems.

In porting packaged applications to SUA, you might come across configure shell scripts, which you can use to analyze your system and create the makefiles necessary to build applications. Older configure scripts— specifically config.guess and config.sub— don’t work well with the subsystem, and I recommend that you download the latest versions of these scripts from ftp.gnu.org before porting the applications.

When porting or building X Windows applications, make sure that the necessary prerequisites are installed and available. Many X Windows applications use thirdparty add-ons or fonts that you must build or install first. Most mainstream packages should port relatively easily, especially if you use the GNU compilers.

An Alternative
Now that I’ve introduced you to the Subsystem for UNIX-based Applications that ships with Server 2008 and Vista, you should have a good handle on some of the subsystem’s major features. This subsystem provides a feasible alternative to UNIX systems for many enterprises, letting them eliminate legacy dedicated UNIX systems by migrating applications to Server 2008 or Vista. The subsystem’s feature-rich shells, file manipulation tools, easy daemon startup, and networking support can actually make it easier to develop and run some scripts and utilities in SUA than in a native Windows environment, while still enabling organizations to benefit from the many features of the Windows platform.

End of Article

   Previous  1  [2]  Next  


Reader Comments

You must be a registered user or online subscriber to comment on this article. Please log on before posting a comment. Are you a new visitor? Register now




Top Viewed ArticlesView all articles
WinInfo Short Takes: Week of November 9, 2009

An often irreverent look at some of the week's other news, including some more Windows 7 sales momentum, some Sophos stupidity, Microsoft's cloud computing self-loathing, more whining from the browser makers, Zoho's "Fake Office," and much, much more ...

Command Prompt Tricks

One reader shares his tip for setting up the command prompt to reflect a remote path. ...

Windows 7 Sets Sales Record

Microsoft CEO Steve Ballmer described Windows 7's first ten days of sales as "fantastic" while in Japan yesterday. ...


Related Articles Windows IT Pro UPDATE--Ch-Ch-Changes in Windows Vista

JSI Tip 10453. The System event log on Windows Server 2003 R2 records Event ID 1013 when you install SUA and NFS and IIS?

SFU in R2

Related Events WinConnections and Microsoft® Exchange Connections

Check out our list of Free Email Newsletters!

Windows OSs eBooks Understanding and Leveraging Code Signing Technologies

A Guide to Windows Certification and Public Keys

SQL Server Administration for Oracle DBAs

Related Windows OSs Resources Introducing Left-Brain.com, the online IT bookstore
Looking for books, CDs, toolkits, eBooks? Prime your mind at Left-Brain.com

Discover Windows IT Pro eLearning Series!
Clear & detailed technical information and helpful how-to's, all in our trademark no-nonsense format


Windows IT Pro Home Register FAQ for Windows WinInfo News
Europe Edition About Us Contact Us/Customer Service Media Kit Affiliates / Licensing  
SQL Server Magazine Office & SharePoint Pro DevProConnections IT Job Hound
Left-Brain.com Technology Resource Directory asp.netPRO ITTV Windows SuperSite 
 
 Windows IT Pro is a Division of Penton Media Inc.
 © 2009 Penton Media, Inc. Terms of Use | Privacy Statement