我从来没有真正习惯在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
#
Env-Vars:在运行make命令之前设置了ORACLE_HOME,NLS_LANG,LD_LIBRARY_PATH 。
我的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
Oracle 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 抱歉,我必须将参考部分放入代码标签,否则我收到的消息是我的帖子似乎包含非格式化的代码... < / p>
答案 0 :(得分:0)
所以看起来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
处理时没有任何警告或错误。