RTL819X 交叉编译curl(支持https)

curl的交叉编译比较简单,但是如果curl需要支持https,则需要先编译openssl。

--with-ssl指向openssl的安装目录。

include ./config.mk

prefix ?= $(shell pwd)/temp_install
BUILD_ROOT = ./curl-7.59.0

.PHONY: all build install clean prepare

all: build

build: prepare
	$(MAKE) -C $(BUILD_ROOT)

install: build
	$(MAKE) -C $(BUILD_ROOT) install

$(BUILD_ROOT)/Makefile: config.mk Makefile
	mkdir $(prefix) && \
	tar zxvf curl.tar.gz && \
	pushd $(BUILD_ROOT) && \
	./configure $(CONFIG_OPTS) && \
	popd

prepare: $(BUILD_ROOT)/Makefile

clean:
	rm -r $(BUILD_ROOT)
	rm -r $(prefix)

config.mk

# if LD is unset, the configure script will get wrong exe. weird.
LD=

# Note from curl's webpage to shrink .so size
LDFLAGS += -Wl,-Bsymbolic -Wl,-s

CONFIG_OPTS = --prefix=$(shell pwd)/temp_install --host=mips-linux
CONFIG_OPTS += --enable-shared --disable-static
CONFIG_OPTS += --with-ssl=openssl/install

 

你可能感兴趣的:(linux,嵌入式开发,路由器)