How to compile Apache-2.2.11 to ARM
By following these steps you have great chances to compile a recent Apache to your ARM system. This is how I made it.
Toolchain
My big-endian ARM toolchain was made with Buildroot. uClibc-0.9.30, binutils-2.18, gcc-4.2.1.
Determine the so called "triplet" of your toolchain. The easiest way is to locate the cross compiler (gcc) in your toolchain directory and see prefix of gcc. In my case this is armeb-linux-uclibc. Some packages refuse this long triplet, they prefer something more traditional, or no one knows what, but armeb-linux is usually adequate to them too. In my case armeb-linux-gcc is just a symlink to armeb-linux-uclibc-gcc, but for the choosy configure scripts this also suits. Triplet is referenced as TRIPLET (armeb-linux-uclibc) in this document.
Dependencies
Apache depends on pcre, Perl Compatible Regular Expressions. In the httpd package you can find a package of pcre amongst others (Apache Portable Runtime), in case of a default compile (e.g. on x86) this package is perfect for compiling Apache. In this case of ARM we neglect this builtin package, rather use an external package.
Apache relies on APR libraries and utils. APR is the abbreviation of Apache Portable Runtime. These packages must be compiled before the final webserver can be built. In a default case they would be built automatically during the build process of Apache, but this is not the default case, so we'll handle this also manually.
Other relevant dependencies are not known by me.
Compile target directories
The target directory you intend to put the compiled libraries and binaries is depending on you highly. In this article two important directories will be used.
The first one is a development directory for development packages. Into this directory those packages (dynamic and static libraries, headers and so on) will be put that are needed to compile an other package. Typically this target directory is the usr/ subpath of your toolchain's directory, since the toolchain is capable of finding headers and libraries located under its directory structure without any additional compile flag. And in most cases the toolchain is the best place to collect all the files that are essential in compiling other packages. Toolchain directory will be referred as TOOLCHAIN_DIR.
The second directory is the location where you want to put the compiled package. This will typically consist of executables, configuration files, man pages and libraries. This is usually a path in your root filesystem. Under a regular x86 system when you compile native programs, this can be for example either /usr or /usr/local. In case of cross-compiling, something like this is possible: /home/user/arm-project/rootfs. This directory will be referred as ROOTFS_DIR.
pcre-7.9
Download package.
Nothing special, this can be cross-compiled to ARM easily.
cd pcre-7.9; /
|
./configure /
|
--host=$TRIPLET /
|
--prefix=$TOOLCHAIN_DIR/usr; /
|
make; /
|
make install
|
httpd-2.2.18 (Apache)
Download e.g. from here (Hungarian server, locate an other mirror if slow).
Autoconf variables may have other values depending on your toolchain/machine.
cd httpd-2.2.18/srclib/apr; /
|
ac_cv_file__dev_zero="yes" /
|
ac_cv_func_setpgrp_void="yes" /
|
apr_cv_tcp_nodelay_with_cork="yes" /
|
ac_cv_sizeof_struct_iovec="8" /
|
./configure /
|
--host=$TRIPLET /
|
--prefix=$ROOTFS_DIR/usr/apache; /
|
make; /
|
make install
|
Autoconf variable may have other value depending on your toolchain/machine.
cd httpd-2.2.18/srclib/apr-util; /
|
./configure /
|
--host=$TRIPLET /
|
--prefix=ROOTFS_DIR/usr/apache /
|
--with-apr=$ROOTFS_DIR/usr/apache; /
|
make; /
|
make install
|
Autoconf variables may have other values depending on your toolchain/machine. They have to be set manually, because configure script is unable to guess their values.
cd httpd-2.2.18; /
|
ap_cv_void_ptr_lt_long=no /
|
LDFLAGS="-lpthread" /
|
./configure /
|
--host=$TRIPLET /
|
--prefix=/usr/apache /
|
--with-apr=$ROOTFS_DIR/usr/apache /
|
--with-apr-util=$ROOTFS_DIR/usr/apache /
|
--with-pcre=$TOOLCHAIN_DIR/usr /
|
--enable-so /
|
--enable-cgi; /
|
make; /
|
DESTDIR=$ROOTFS_DIR make install
|
Last steps
To check the runtime library dependencies of httpd, use the $TRIPLET-ldd program. libpcre is obviously needed:
cp $TOOLCHAIN_DIR/usr/lib/libpcre.so* $ROOTFS_DIR/usr/lib
|
Don't forget to configure your new httpd (httpd.conf).
Have fun!
分享到:
相关推荐
此外,Maven还提供了生命周期(Lifecycle),如`clean`、`compile`、`test`、`package`、`install`和`deploy`等,这些生命周期阶段包含了多个预定义的目标(Goals),如`mvn clean`用于清理项目,`mvn compile`用于...
Apache Maven 是一个强大的项目管理和构建工具,主要用于Java项目。它基于项目对象模型(Project Object Model,POM)的概念,能够管理项目的构建、报告和文档。Maven 3.6.0是该工具的一个稳定版本,提供了许多改进...
Apache Ant Zip 2.3.jar 是一个用于构建和管理Java项目的工具,它是Apache Ant库的一部分。Ant是一个由Apache软件基金会开发的任务驱动的构建系统,它使用XML来描述构建过程和依赖关系,使得构建过程可移植且易于...
其中`/path/to/apache-maven-3.9.6`应替换为实际的Maven安装路径。 4. **激活更改**:保存并关闭文件后,执行`source ~/.bash_profile`或`source ~/.zshrc`使更改生效。 5. **验证安装**:在终端中输入`mvn -...
Apache Ant 是一个由Apache软件基金会开发的Java库和命令行工具,其设计目的是驱动构建过程。这个工具的名字“Ant”来源于“蚂蚁”,象征着它在软件工程中的小而有力的角色,能够处理各种复杂的构建任务。在Java开发...
export M2_HOME=/path/to/apache-maven-3.6.2 export PATH=$M2_HOME/bin:$PATH ``` 在Windows系统中,需要在系统属性的“高级”选项卡中编辑环境变量。 配置完成后,可以通过运行`mvn -version`命令检查Maven是否已...
export ANT_HOME=/path/to/apache-ant-1.9.15 export PATH=$PATH:$ANT_HOME/bin ``` Apache Ant 1.9.15版本可能包含了一些新特性、性能优化或错误修复。具体变动可以在其官方发布说明中找到。使用Ant时,主要通过`...
Apache Maven 是一个强大的项目管理工具,广泛用于Java应用程序的构建、管理和依赖管理。Maven 使用一种标准的项目对象模型(Project Object Model,POM),通过POM文件来配置项目的构建过程,解决和管理项目的依赖...
export M2_HOME=/path/to/apache-maven-3.5.4 export PATH=$M2_HOME/bin:$PATH ``` 替换`/path/to/apache-maven-3.5.4`为你的实际解压路径。保存文件并使更改生效: ```bash source ~/.bash_profile 或 source ~/....
Apache Maven 是一个强大的项目管理工具,广泛用于Java应用程序的构建、管理和依赖管理。Maven 3.9.6 是该工具的一个稳定版本,提供了一系列改进和优化,旨在提高开发效率和构建过程的可靠性。 Maven 使用一个约定...
Apache Maven 是一个强大的项目管理工具,它主要用于构建、管理和聚合Java项目。`apache-maven-3.6.2-bin.zip` 是Apache Maven的3.6.2版本的二进制发行版,它不包含源码或其他分支,因此是针对那些只需要执行构建...
Apache Maven 是一个强大的项目管理工具,它主要用于Java项目的构建、依赖管理和项目信息管理。Maven 3.5.3是该工具的一个稳定版本,提供了许多改进和修复,以提升开发人员的工作效率。在这个版本中,我们可以看到...
Apache Ant 是一个开源的构建工具,它主要用于Java项目,但也可以用于其他语言的构建过程。在"apache-ant-1.6.5-bin"这个压缩包中,包含了Ant的1.6.5版本的二进制发行版。Ant是Apache软件基金会的一个项目,它的设计...
export PATH=$PATH:/path/to/apache-ant-1.10.1/bin ``` 然后运行`source ~/.bashrc`或`source ~/.bash_profile`使更改生效。 使用Apache Ant时,开发者会创建一个`build.xml`文件,该文件定义了构建过程的各个步骤...
Apache Maven 是一个强大的项目管理工具,它基于项目对象模型(Project Object Model,POM)的概念,可以帮助Java开发者管理和构建他们的项目。Maven 提供了一种标准化的方式来管理项目的依赖、构建过程以及文档生成...
Maven的核心概念是“约定优于配置”,它通过默认的构建生命周期和一组预定义的目标(如`clean`, `compile`, `test`, `package`, `install`, `deploy`)简化了项目构建过程。每个项目通过一个名为`pom.xml`的项目对象...
Apache Maven 是一个强大的Java项目管理工具,它通过提供一套标准化的构建过程,使得Java开发更加简单和高效。Maven 3.9.2是Maven的最新版本之一,它包含了各种改进和修复,以优化开发者的工作流程。在这个“apache-...
Apache Maven 是一个强大的项目管理和构建工具,主要用于Java项目。它基于项目对象模型(Project Object Model,POM)的概念,能够管理项目的构建、报告和文档。Maven 的核心目标是简化项目构建过程,通过自动化构建...
Apache Maven 是一个强大的Java项目管理工具,它基于项目对象模型(Project Object Model,POM)的概念,能够自动化构建、依赖管理和项目信息报告。Maven 3.5.2是Maven的一个稳定版本,包含了多项改进和修复,为...
Apache Ant 是一个广泛使用的Java构建工具,它遵循XML格式的构建文件来定义任务,从而自动化构建过程,包括编译、打包、测试和部署等。在Java开发中,Ant以其灵活性和可扩展性著称,是许多项目管理和持续集成流程的...