HPlogo HP C/HP-UX Programmer's Guide: HP 9000 Computers > Chapter 6 Migrating C Programs to HP-UX

Migrating an Application

» 

Technical documentation

Complete book in PDF

 » Table of Contents

Following are the general steps to migrate a C program from an HP-UX or UNIX system.

  1. Test your program on the current system so you have a copy of the results.

  2. Use the tar command (see the HP-UX Reference manual) with the cv options to transfer the source files you want to migrate to tape.

  3. Use the tar command with the r option to transfer any associated data files to tape.

  4. Install the source files and any related data files on the HP 9000 workstation or server using the tar command with the x option.

  5. Check your makefiles for any implementation-specific options. Change programs depending on implementation-specific command options. On HP-UX systems, these options are generally preceded by -W or +, and may include options to be passed to ld or cpp. You can optionally include the -g option to permit symbolic debugging.

  6. Review Chapter 5 “Programming for Portability ” and “Practices to Avoid ” and check over the source code for system-dependent programming. (If the source files are extensive, you may want to skip this step and catch errors when you run lint or compile.)

  7. Search for instances of #include files and make sure that the files or routines included appear in the correct directory or library on the HP 9000 workstation or server.

  8. Run lint, a C program checker that verifies source code and prints warning messages about problems with the source code style, efficiency, portability, and consistency.

  9. Compile the program on the HP 9000 workstation or server using the cc command. (Refer to the HP C/HP-UX Reference Manual for details about the cc command and options, and explanations of error, warning, and panic messages.) Change the source code to resolve any messages you receive.

  10. Recompile the program until you receive no messages.

  11. Link the program. The linker reports any symbols that cannot be found.

  12. Run the program on the HP 9000 workstation or server. Compare the results with those received on the original computer.

© Hewlett-Packard Development Company, L.P.