Fix chillispot configure and install
[openwrt.git] / openwrt / package / mysql / Makefile
1 # $Id$
2
3 include $(TOPDIR)/rules.mk
4
5 PKG_NAME := mysql
6 PKG_VERSION := 4.0.24
7 PKG_RELEASE := 2
8 PKG_MD5SUM := 408d3001ed715ddc90009c247e548638
9
10 PKG_SOURCE_SITE := \
11 http://mysql.he.net/Downloads/MySQL-4.0/ \
12 http://www.linorg.usp.br/mysql/Downloads/MySQL-4.0/ \
13 http://mysql.planetmirror.com/Downloads/MySQL-4.0/ \
14 http://mysql.holywar.net/Downloads/MySQL-4.0/ \
15 http://netmirror.org/mirror/mysql.com/Downloads/MySQL-4.0/ \
16 http://nthill.free.fr/openwrt/sources/$(PKG_NAME)/
17 PKG_SOURCE_FILE := $(PKG_NAME)-$(PKG_VERSION).tar.gz
18 PKG_SOURCE_CAT := zcat
19 PKG_SOURCE_DIR := $(PKG_NAME)-$(PKG_VERSION)
20 PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_SOURCE_DIR)
21 PKG_IPK := $(PACKAGE_DIR)/libmysqlclient_$(PKG_VERSION)-$(PKG_RELEASE)_$(ARCH).ipk
22 PKG_IPK_DIR := $(PKG_BUILD_DIR)/ipkg
23
24 $(DL_DIR)/$(PKG_SOURCE_FILE):
25 mkdir -p $(DL_DIR)
26 $(SCRIPT_DIR)/download.pl $(DL_DIR) $(PKG_SOURCE_FILE) $(PKG_MD5SUM) $(PKG_SOURCE_SITE)
27
28 $(PKG_BUILD_DIR)/.patched: $(DL_DIR)/$(PKG_SOURCE_FILE)
29 $(PKG_SOURCE_CAT) $(DL_DIR)/$(PKG_SOURCE_FILE) | tar -C $(BUILD_DIR) $(TAR_OPTIONS) -
30 $(PATCH) $(PKG_BUILD_DIR) ./patches
31 touch $(PKG_BUILD_DIR)/.patched
32
33 $(PKG_BUILD_DIR)/.configured: $(PKG_BUILD_DIR)/.patched
34 (cd $(PKG_BUILD_DIR); rm -rf config.cache; \
35 touch configure.in; \
36 touch aclocal.m4; \
37 touch Makefile.in; \
38 touch config.h.in; \
39 touch configure; \
40 $(TARGET_CONFIGURE_OPTS) \
41 CFLAGS="-I$(STAGING_DIR)/usr/include" \
42 LDFLAGS="-L$(STAGING_DIR)/usr/lib" \
43 OPTIMIZE_CFLAGS="$(TARGET_CFLAGS)" \
44 OPTIMIZE_CXXFLAGS="$(TARGET_CFLAGS)" \
45 ac_atomic_add=yes \
46 ac_atomic_sub=yes \
47 ac_cv_sys_restartable_syscalls=yes \
48 ac_cv_conv_longlong_to_float=yes \
49 mysql_cv_compress=yes \
50 mysql_cv_gethostname_style=glibc2 \
51 ./configure \
52 --target=$(GNU_TARGET_NAME) \
53 --host=$(GNU_TARGET_NAME) \
54 --build=$(GNU_HOST_NAME) \
55 --prefix=/ \
56 --exec-prefix=/ \
57 --bindir=/usr/bin \
58 --sbindir=/usr/sbin \
59 --libexecdir=/usr/lib \
60 --sysconfdir=/etc \
61 --datadir=/usr/share \
62 --localstatedir=/var \
63 --mandir=/usr/man \
64 --infodir=/usr/info \
65 --enable-shared \
66 --enable-static \
67 --disable-assembler \
68 --with-pthread \
69 --without-raid \
70 --with-unix-socket-path=/tmp \
71 --without-libwrap \
72 --without-pstack \
73 --with-low-memory \
74 --without-server \
75 --without-embedded-server \
76 --without-query-cache \
77 --without-mysqlfs \
78 --without-vio \
79 --without-openssl \
80 --without-docs \
81 --without-bench \
82 --without-readline \
83 $(DISABLE_NLS) \
84 $(DISABLE_LARGEFILE) \
85 );
86 touch $(PKG_BUILD_DIR)/.configured
87
88 $(PKG_BUILD_DIR)/libmysql/.libs/libmysqlclient.so: $(PKG_BUILD_DIR)/.configured
89 $(MAKE) -C "$(PKG_BUILD_DIR)/libmysql" \
90 CC="$(HOSTCC)" \
91 LINK="$(HOSTCC) -o conf_to_src -lc" \
92 CFLAGS="" \
93 conf_to_src
94 $(MAKE) -C "$(PKG_BUILD_DIR)" \
95 SUBDIRS="include libmysql" \
96 all
97
98 $(STAGING_DIR)/include/mysql/mysql.h: $(PKG_BUILD_DIR)/libmysql/.libs/libmysqlclient.so
99 $(MAKE) -C "$(PKG_BUILD_DIR)" \
100 DESTDIR="$(STAGING_DIR)" \
101 SUBDIRS="include libmysql" \
102 install
103
104 $(PKG_IPK): $(PKG_BUILD_DIR)/libmysql/.libs/libmysqlclient.so
105 $(SCRIPT_DIR)/make-ipkg-dir.sh $(PKG_IPK_DIR) libmysqlclient.control $(PKG_VERSION)-$(PKG_RELEASE) $(ARCH)
106 mkdir -p $(PKG_IPK_DIR)/usr/lib
107 cp $< $(PKG_IPK_DIR)/usr/lib/
108 $(STRIP) $(PKG_IPK_DIR)/usr/lib/*
109 mkdir -p $(PACKAGE_DIR)
110 $(IPKG_BUILD) $(PKG_IPK_DIR) $(PACKAGE_DIR)
111
112 $(IPKG_STATE_DIR)/info/libmysqlclient.list: $(PKG_IPK)
113 $(IPKG) install $(PKG_IPK)
114
115 source: $(DL_DIR)/$(PKG_SOURCE)
116 prepare: $(PKG_BUILD_DIR)/.patched
117 compile: $(STAGING_DIR)/include/mysql/mysql.h $(PKG_IPK)
118 install: $(IPKG_STATE_DIR)/info/libmysqlclient.list
119
120 clean:
121 rm -rf $(PKG_BUILD_DIR)
122 rm -f $(PKG_IPK)
This page took 0.042826 seconds and 5 git commands to generate.