1#!/bin/sh
2set -ex
3
4if [ "$PLATFORM_NAME" != "macosx" ]; then
5	exit 0
6fi
7
8curlver_h="$PROJECT_DIR"/curl/include/curl/curlver.h
9
10major=`grep '^#define LIBCURL_VERSION_MAJOR ' "$curlver_h" | awk '{print $3}'`
11minor=`grep '^#define LIBCURL_VERSION_MINOR ' "$curlver_h" | awk '{print $3}'`
12patch=`grep '^#define LIBCURL_VERSION_PATCH ' "$curlver_h" | awk '{print $3}'`
13CURLVERSION=$major.$minor.$patch
14
15VERSIONNUM=`grep '^#define LIBCURL_VERSION_NUM ' "$curlver_h" | cut -f2 -dx`
16
17${SED} \
18	-e "s|@prefix@|${CURL_PREFIX}|" \
19	-e "s|@exec_prefix@|${CURL_PREFIX}|" \
20	-e "s|@includedir@|${CURL_PREFIX}/include|" \
21	-e "s|@libdir@|${CURL_PREFIX}/lib|g" \
22	-e 's|@ENABLE_SHARED@|yes|' \
23	-e 's|@CURL_CA_BUNDLE@||' \
24	-e 's|@CC@|cc|' \
25	-e "s|@SUPPORT_FEATURES@|${CURL_SUPPORT_FEATURES}|" \
26	-e "s|@SUPPORT_PROTOCOLS@|${CURL_SUPPORT_PROTOCOLS}|" \
27	-e "s|@CURLVERSION@|${CURLVERSION}|" \
28	-e "s|@VERSIONNUM@|${VERSIONNUM}|" \
29	-e "s|@CONFIGURE_OPTIONS@|${CURL_CONFIGURE_OPTIONS}|" \
30	-e "s|@CPPFLAG_CURL_STATICLIB@||" \
31	"$PROJECT_DIR"/curl/curl-config.in > \
32	"$TEMP_DIR"/curl-config
33
34install -m 0755 "$TEMP_DIR"/curl-config "$INSTALL_DIR"/curl-config
35