请用autotools帮我一点 [英] please help me a little with autotools
问题描述
嗨伙计们,
我正在用c ++开发一个apache2 so模块。
目前,我正在努力让它编译与automake&朋友,但
不能让它上班。我尝试修改programmer-docs中的示例。
我创建了一个简单的c ++项目并删除了src子目录并将我的
源代码文件复制到了basedir中。 />
(这不是我想让它们最终放到的地方,但我认为最初可能会更容易开始)b / b
然后我将示例Makefile.am复制到现有的示例上并将其编辑为
我认为适合我的需求,但它只是没有用。 autotools
刚停止时出现错误代码2.没有更多的消息,没有问题。
请有人帮我制作一个在我的手册makefile中运行Makefile.am
的信息? - 如果你熟悉autotools,请
指向正确的方向。
我想构建mod_cms.so,动态链接到apache2和odbc ++
libs。
非常感谢提前,
你的Henri
8< --------样本手册makefile 8< -------- 8< -------- 8< -------- 8< - ------
################################ ###################################
#配置
################################################ ### #################
APXS = apxs2
APACHECTL = apache2ctl
#获取所有apxs的内部值。
APXS_CC =`$(APXS)-q CC`
APXS_TARGET =`$(APXS) - q TARGET`
APXS_CFLAGS =`$(APXS)-q CFLAGS`
APXS_SBINDIR =`$(APXS)-q SBINDIR`
APXS_CFLAGS_SHLIB =`$(APXS)-q CFLAGS_SHLIB`
APXS_INCLUDEDIR =`$(APXS)-q INCLUDEDIR`
APXS_LD_SHLIB =`$(APXS)-q LD_ SHLIB`
APXS_LIBEXECDIR =`$(APXS)-q LIBEXECDIR`
APXS_LDFLAGS_SHLIB =`$(APXS)-q LDFLAGS_SHLIB`
APXS_SYSCONFDIR = `$(APXS)-q SYSCONFDIR`
APXS_LIBS_SHLIB =`$(APXS)-q LIBS_SHLIB`
########## ################################################## #######
#编译
######################### ##########################################
mod_cms.o:mod_cms.cpp
libtool g ++ -W -c -fPIC -I $(APXS_INCLUDEDIR)-I / usr / include / odbc ++ -I。 -I-
$(APXS_CFLAGS)$(APXS_CFLAGS_SHLIB)-Wall -o $ @ $<
cms_request_data.o:cms_request_data.cpp >
libtool g ++ -c -fPIC -I $(APXS_INCLUDEDIR)-I。 -I- $(APXS_CFLAGS)
$(APXS_CFLAGS_SHLIB)-Wall -o $ @ $<
epcre.o:epcre.cpp >
libtool g ++ -c -fPIC -I / usr / include -I $(APXS_INCLUDEDIR)-I。 -I-
$(APXS_CFLAGS)$(APXS_CFLAGS_SHLIB)-Wall -o $ @`pcre-config --cflags` $<
## ################################################## ###############
#linking
################# ##################################################
objects = mod_cms.o cms_request_data.o epcre.o
mod_cms.so:$(对象)
libtool g ++ -W -fPIC - shared -L / usr / lib -lodbc ++`pcre-config --libs`
`pcre-config --cflags` -o $ @ $(对象)
8< --------样本手册makefile 8< -------- 8< -------- 8< -------- 8< - ------
-
| Henri Schom?cker - VIRTUAL HOMES
| DatendesignfürInternet和Intranet
| henri.schomaecker_at_virtual-homes.de
| http://www.virtual-homes.de
|公钥:/.gnupg / public_key.txt
-
Hi folks,
I am developing a apache2 so module in c++.
At the moment, I''m trying to get it to compile with automake & friends, but
don''t get it to work. I tried to modify the example in the programmer-docs.
I created a simple c++ project and deleted the src subdir and copied my
sourcecode files into the basedir.
(That''s not where I want to let them in the end, but I thought it might be
easier in the beginning)
Then I copied the sample Makefile.am over the existing one and edited it to
what I thought would fit my needs, but It just didn''t work. The autotools
just stopped with error code 2. No more "messages", no "problems".
Could please someone help me to make a working Makefile.am out of the sample
info of my manual makefile? - If you''re familiar with the autotools, please
point me into the right direction.
I want to build mod_cms.so, dynamically linked to the apache2 and odbc++
libs.
Many thanks in advance,
yours Henri
8<-------- Sample manual makefile 8<--------8<--------8<--------8<--------
################################################## #################
# configuring
################################################## #################
APXS=apxs2
APACHECTL=apache2ctl
# Get all of apxs''s internal values.
APXS_CC=`$(APXS) -q CC`
APXS_TARGET=`$(APXS) -q TARGET`
APXS_CFLAGS=`$(APXS) -q CFLAGS`
APXS_SBINDIR=`$(APXS) -q SBINDIR`
APXS_CFLAGS_SHLIB=`$(APXS) -q CFLAGS_SHLIB`
APXS_INCLUDEDIR=`$(APXS) -q INCLUDEDIR`
APXS_LD_SHLIB=`$(APXS) -q LD_SHLIB`
APXS_LIBEXECDIR=`$(APXS) -q LIBEXECDIR`
APXS_LDFLAGS_SHLIB=`$(APXS) -q LDFLAGS_SHLIB`
APXS_SYSCONFDIR=`$(APXS) -q SYSCONFDIR`
APXS_LIBS_SHLIB=`$(APXS) -q LIBS_SHLIB`
################################################## #################
# compiling
################################################## #################
mod_cms.o: mod_cms.cpp
libtool g++ -W -c -fPIC -I$(APXS_INCLUDEDIR) -I/usr/include/odbc++ -I. -I-
$(APXS_CFLAGS) $(APXS_CFLAGS_SHLIB) -Wall -o $@ $<
cms_request_data.o: cms_request_data.cpp
libtool g++ -c -fPIC -I$(APXS_INCLUDEDIR) -I. -I- $(APXS_CFLAGS)
$(APXS_CFLAGS_SHLIB) -Wall -o $@ $<
epcre.o: epcre.cpp
libtool g++ -c -fPIC -I/usr/include -I$(APXS_INCLUDEDIR) -I. -I-
$(APXS_CFLAGS) $(APXS_CFLAGS_SHLIB) -Wall -o $@ `pcre-config --cflags` $<
################################################## #################
# linking
################################################## #################
objects = mod_cms.o cms_request_data.o epcre.o
mod_cms.so: $(objects)
libtool g++ -W -fPIC -shared -L/usr/lib -lodbc++ `pcre-config --libs`
`pcre-config --cflags` -o $@ $(objects)
8<-------- Sample manual makefile 8<--------8<--------8<--------8<--------
--
| Henri Schom?cker - VIRTUAL HOMES
| Datendesign für Internet und Intranet
| henri.schomaecker_at_virtual-homes.de
| http://www.virtual-homes.de
| Public Key: /.gnupg/public_key.txt
--
推荐答案
(APXS)-q CC`
APXS_TARGET =`
(APXS) -q CC`
APXS_TARGET=`
(APXS)-q TARGET`
APXS_CFLAGS =`
(APXS) -q TARGET`
APXS_CFLAGS=`
( APXS)-q CFLAGS`
APXS_SBINDIR =`
(APXS) -q CFLAGS`
APXS_SBINDIR=`
这篇关于请用autotools帮我一点的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!