【问题标题】:make - fatal error when compiling modowa (apache-module)make - 编译 modowa (apache-module) 时出现致命错误
【发布时间】:2016-02-10 09:47:24
【问题描述】:

我从来没有真正在 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。 $ORACLE_HOME/rdbms/public 上的文件oratypes.h确实存在

    # ls $ORACLE_HOME/rdbms/public/oratypes*
    $ORACLE_HOME/rdbms/public/oratypes.h
    #

Env-Vars: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
Oracle 11g XE
阿帕奇 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: 抱歉,我必须将参考部分放入代码标签中,否则我会收到消息说我的帖子似乎包含非格式化代码...

【问题讨论】:

    标签: compiler-errors makefile apache2


    【解决方案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.mkprocessed 没有任何警告或错误。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2016-08-20
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2022-01-13
      • 2018-02-17
      相关资源
      最近更新 更多