Configure precompilation parameters for pro * c Programs in linux

Source: Internet
Author: User
In the linux environment, configure the precompiled parameters of the pro * c program-general Linux technology-Linux programming and kernel information. For more information, see the following. Operating System:

Red Hat Linux 2.4.21-4.EL

Database: oracle10g

Configuration steps:

1. Create an etc directory under $ HOME. In this directory, resume a configuration file Make. defines, edit the file, and write the following content:

Include $ (ORACLE_HOME)/precomp/lib/env_precomp.mk

PROC = proc
GCC = gcc

BINDIR = $ (HOME)/bin

# Oracle include directory

ORAIFLAG =-I $ (ORACLE_HOME)/rdbms/public-I $ (ORACLE_HOME)/rdbms/demo-I $ (ORACLE_HOME)/precomp/public-I $ (ORACLE_HOME) /plsql/public

# Oracle database file path

ORALFLAG =-L $ (ORACLE_HOME)/lib-L $ (ORACLE_HOME)/precomp/lib-L $ (ORACLE_HOME)/rdbms/lib-L $ (ORACLE_HOME) /sqlplus/lib-L $ (ORACLE_HOME)/network/lib-L $ (ORACLE_HOME)/plsql/lib

IFLAG =-I $ (HOME)/include $ (ORAIFLAG)
LFLAG =-L $ (HOME)/lib $ (ORALFLAG)-lclntsh

PROCFLAGS = char_map = string

. SUFFIXES:. pc. c. o
. Pc. c:
$ (PROC) $ (PROCFLAGS) iname = $ *
Rm *. lis
. Pc. o:
$ (PROC) $ (PROCFLAGS) iname = $ *
Rm *. lis
$ (GCC) $ (IFLAG)-c $ *. c
. C. o:
$ (GCC) $ (IFLAG)-c $ *. c


2. Make sure that the. bash_profile file contains the following environment variable Configuration:

Export LD_LIBRARY_PATH = $ LD_LIBRARY_PATH: $ ORACLE_HOME/lib

3. Write the following statement in the first line of your makefile:

Include $ (HOME)/etc/Make. defines

Other makefile writing methods remain unchanged.

Example:

I have a source program test. pc. The content of my makefile file is as follows:

Include $ (HOME)/etc/Make. defines
All: test
Test: test. o
$ (GCC) $? -O $ @ $ (LFLAG)
Rm./tp *./*. c./*. o
Run make test during compilation.

Generate the test executable program.

Note: The above configuration method is related to the author's program organization habits (generally, the General Compilation parameters are put in a file, and the specific makefile file then includes this definition ). In short, you can write all the statements mentioned above in the makefile file.
Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.