1. 系统需要安装以下软件
GNU Automake
GNU Autoconf
GNU m4
perl
GNU Libtool (如果你需要产生 shared library
2. 我们的例子,目录xmlspy_newxsd,子目录Altova, AltovaXML, OpenPNR, OpenPNRTest
3. 在xmlspy_newxsd下建立configure.in文件,内容如下:
AC_INIT(OpenPNRTest/OpenPNRTest.cpp)
AM_INIT_AUTOMAKE(OpenPNR_XMLGen, 0.0.1)
AC_PROG_CXX
AC_PROG_CC
AC_PROG_RANLIB
AC_OUTPUT(Makefile
Altova/Makefile
AltovaXML/Makefile
OpenPNR/Makefile
OpenPNRTest/Makefile
)
建立Makefile.am
SUBDIRS=Altova AltovaXML OpenPNR OpenPNRTest
建立autogen.sh
#!/bin/sh
aclocal
autoconf
automake --add-missing
4. 在Altova子目录下建立Makefile.am
noinst_LIBRARIES=Altova_a
Altova_a_SOURCES=AltovaException.cpp SchemaTypeBinary.cpp SchemaTypeCalendar.cpp SchemaTypeNumber.cpp SchemaTypes.cpp SchemaTypeString.cpp StdAfx.cpp
5. 在AltovaXML下建立Makefile.am
INCLUDES= -I../Altova
noinst_LIBRARIES=AltovaXML_a
AltovaXML_a_SOURCES=Doc.cpp Node.cpp StdAfx.cpp XmlException.cpp
AltovaXML_a_LIBADD=../Altova/Altova_a
6. 在OpenPNR下建立Makefile.am
INCLUDES= -I../Altova ../AltovaXML
noinst_LIBRARIES=OpenPNRLib_a
OpenPNRLib_a_SOURCES=OpenPNR.cpp StdAfx.cpp
OpenPNRLib_a_LIBADD=../Altova/Altova_a ../AltovaXML/AltovaXML_a
7. 在OpenPNRTest下建立Makefile.am
INCLUDES= -I../Altova ../AltovaXML ../OpenPNR
bin_PROGRAMS=OpenPNRTest
OpenPNRTest_SOURCES=StdAfx.cpp OpenPNRTest.cpp
OpenPNRTest_LDADD=../Altova/Altova_a ../AltovaXML/AltovaXML_a ../OpenPNR/OpenPNR_a
8. ./autogen.sh
9. ./configure
10. make
11. make install
参考文献
|