我以前从未真正在Linux上编译过东西,现在我不得不这样做。
我想编译一个称为[modowa] [1]的较旧的Apache模块。
运行make -lf modowa.mk
时遇到一些麻烦。多次相同的错误:
cc -DAPACHE22 -DLINUX -D_ISOC99_SOURCE -D_GNU_SOURCE -D_LARGEFILE64_SOURCE -D_REENTRANT -fPIC -Wall -O -fPIC -I. -I/rdbms/public -I/network/public -I/xdk/include -I/home/myuser/tmp/apache22/include -I/usr/include/apr-1 -I/usr/include/apache2 -c owasql.c
In file included from owasql.c:60:0:
./modowa.h:179:22: fatal error: oratypes.h: No such file or directory
compilation terminated.
make: *** [owasql.o] Error 1
第60行的owasql.c包含modowa.h,第179行的modowa.h包括oratypes.h。
oratypes.h
文件在$ORACLE_HOME/rdbms/public
上确实存在: # ls $ORACLE_HOME/rdbms/public/oratypes*
$ORACLE_HOME/rdbms/public/oratypes.h
#
信封: ORACLE_HOME,NLS_LANG和LD_LIBRARY_PATH在运行make命令之前已设置为。
我的makefile看起来像这样:
# Makefile for mod_owa.so
.SUFFIXES:
.SUFFIXES: .lc .oc .lpc .opc .pc .c .o .cpp .oln
# It's assumed that you have ORACLE_HOME set in your build environment;
# if not, add a definition here to support the make process.
ORA_LIB = $(ORACLE_HOME)/lib
# Change this to point to wherever you've installed Apache.
APACHE_TOP = /home/myuser/tmp/apache22
ORAINC = -I$(ORACLE_HOME)/rdbms/public \
-I$(ORACLE_HOME)/network/public \
-I$(ORACLE_HOME)/xdk/include
INCLUDES = -I. $(ORAINC) -I$(APACHE_TOP)/include -I/usr/include/apr-1 -I/usr/include/apache2
# CC = cc almost everywhere, but change as necessary for your platform
# (e.g. CC = gcc, or CC = /path/to/yourcc).
#
# You might need to define LD = ld on some platforms. Mainly this matters
# in cases where the flag to build a shared library isn't understood by cc.
# Actually ld is probably correct on most platforms; it would work on
# Linux, too, except that Oracle built the OCI library in such a way that
# you will have unresolved symbols unless you use cc to link.
CC = cc
LD = cc
# This consists of -D<platform>, plus whatever other flags may be required
# on your platform. In general, -O (optimization) is a good idea. Other
# flags may be needed to improve the code, for example special flags to
# force string literals into the code segment (e.g. "-xstrconst" on Solaris).
# Some platforms require that loadable libraries be build with "position-
# independent code", and a special flag is needed here to generate such
# code (e.g. "-Z" on HP/UX). Finally, the OCI may require certain other
# compilation flags, particularly flags that govern how structures and
# structure members are aligned and ordered, and flags that govern
# misaligned read/write operations (in general, the compiler defaults
# will be correct).
# On Linux x86_64, you may need -m64 and you definitely need -fPIC.
DEFS = -D_ISOC99_SOURCE -D_GNU_SOURCE -D_LARGEFILE64_SOURCE \
-D_REENTRANT
CFLAGS = -DAPACHE22 -DLINUX $(DEFS) -fPIC -Wall -O -fPIC
# Mainly, LDFLAGS needs to contain whatever flag is required to cause the
# linker to generate a shared/dynamic library instead of a normal executable.
# This is different on every platform.
LDFLAGS = -shared
# Other libraries may be needed on other platforms (e.g. "-lcl" on HP/UX).
CLIBS = -L/usr/lib -ldl -lpthread -lc
ORALINK = -L$(ORACLE_HOME)/lib -lclntsh
# Build the target stubs against this library, which forces older glibc
# dependencies to be built into the binary and ensures compatibility with
# older versions of Linux.
ORASTUBS = $(ORACLE_HOME)/lib/stubs/libc-2.3.4-stub.so
OBJS = owautil.o owafile.o owanls.o owasql.o owalog.o \
owadoc.o owahand.o owaplsql.o owacache.o modowa.o
mod_owa.so: $(OBJS)
$(LD) $(LDFLAGS) -o $@ $(OBJS) $(ORALINK) $(CLIBS)
stubs: $(OBJS)
$(LD) $(LDFLAGS) -o mod_owa.so $(OBJS) $(ORALINK) $(ORASTUBS) $(CLIBS)
.c.o:
$(CC) $(CFLAGS) $(INCLUDES) -c $<
我的命题:包含的目录
$ORACLE_HOME/rdbms/public
没有包含在内。此目录中的所有文件都具有相同的文件许可权-rwxr-xr-x
,因此我在这里说没有权限问题,除了该目录的其他文件没有被使用。我的问题:我可以在某处检查论文吗?有人知道我该怎么做吗?
最好的祝福。
系统:
SUSE Linux
甲骨文11g XE
Apache 2.2.17
**Referenzes:**
[Apache PL/SQL Gateway Module][1]
[Users guide to compile modowa][2]
[Just another users guide to compile modowa][3]
[1]: https://oss.oracle.com/projects/mod_owa/dist/documentation/modowa.htm
[2]: http://bshensky.livejournal.com/7424.html
[3]: http://elisabeth-olaf.de/Oracle_Apex_PLSQL/Entries/2008/9/2_How_I_installed_modowa_(mod_owa)_on_Linux_X86_64_bit.html
更新1:抱歉,但是我必须将引用部件放入代码标签中,否则我得到的消息是我的帖子似乎包含非格式化代码...
最佳答案
因此,似乎makefile格式错误。我看了看原始的makefile文件,发现这部分在换行符上少了4个空格...
ORAINC = -I$(ORACLE_HOME)/rdbms/public \
-I$(ORACLE_HOME)/network/public \
-I$(ORACLE_HOME)/xdk/include
。
ORAINC = -I$(ORACLE_HOME)/rdbms/public \
-I$(ORACLE_HOME)/network/public \
-I$(ORACLE_HOME)/xdk/include
make .kf modowa.mk
已处理,没有任何警告或错误。