convert bridge to new packaging style
[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_URL:=\
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:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
18 PKG_CAT:=zcat
19
20 PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
21
22 IPKG_LIBMYSQLCLIENT:=$(PACKAGE_DIR)/libmysqlclient_$(PKG_VERSION)-$(PKG_RELEASE)_$(ARCH).ipk
23 IDIR_LIBMYSQLCLIENT:=$(PKG_BUILD_DIR)/ipkg/libmysqlclient
24 INFO_LIBMYSQLCLIENT:=$(IPKG_STATE_DIR)/info/libmysqlclient.list
25
26 $(DL_DIR)/$(PKG_SOURCE):
27 $(SCRIPT_DIR)/download.pl $(DL_DIR) $(PKG_SOURCE) $(PKG_MD5SUM) $(PKG_SOURCE_URL)
28
29 $(PKG_BUILD_DIR)/.prepared: $(DL_DIR)/$(PKG_SOURCE)
30 $(PKG_CAT) $(DL_DIR)/$(PKG_SOURCE) | tar -C $(BUILD_DIR) $(TAR_OPTIONS) -
31 $(PATCH) $(PKG_BUILD_DIR) ./patches
32 touch $(PKG_BUILD_DIR)/.prepared
33
34 $(PKG_BUILD_DIR)/.configured: $(PKG_BUILD_DIR)/.prepared
35 (cd $(PKG_BUILD_DIR); rm -rf config.cache config.status; \
36 touch configure.in; \
37 touch aclocal.m4; \
38 touch Makefile.in; \
39 touch config.h.in; \
40 touch configure; \
41 $(TARGET_CONFIGURE_OPTS) \
42 CPPFLAGS="-I$(STAGING_DIR)/usr/include" \
43 LDFLAGS="-L$(STAGING_DIR)/usr/lib" \
44 OPTIMIZE_CFLAGS="$(TARGET_CFLAGS)" \
45 OPTIMIZE_CXXFLAGS="$(TARGET_CFLAGS)" \
46 ac_atomic_add=yes \
47 ac_atomic_sub=yes \
48 ac_cv_sys_restartable_syscalls=yes \
49 ac_cv_conv_longlong_to_float=yes \
50 mysql_cv_compress=yes \
51 mysql_cv_gethostname_style=glibc2 \
52 ./configure \
53 --target=$(GNU_TARGET_NAME) \
54 --host=$(GNU_TARGET_NAME) \
55 --build=$(GNU_HOST_NAME) \
56 --program-prefix="" \
57 --program-suffix="" \
58 --prefix=/usr \
59 --exec-prefix=/usr \
60 --bindir=/usr/bin \
61 --datadir=/usr/share \
62 --includedir=/usr/include \
63 --infodir=/usr/share/info \
64 --libdir=/usr/lib \
65 --libexecdir=/usr/lib \
66 --localstatedir=/var \
67 --mandir=/usr/share/man \
68 --sbindir=/usr/sbin \
69 --sysconfdir=/etc \
70 $(DISABLE_NLS) \
71 $(DISABLE_LARGEFILE) \
72 --enable-shared \
73 --enable-static \
74 --disable-assembler \
75 --with-pthread \
76 --without-raid \
77 --with-unix-socket-path=/tmp \
78 --without-libwrap \
79 --without-pstack \
80 --with-low-memory \
81 --without-server \
82 --without-embedded-server \
83 --without-query-cache \
84 --without-mysqlfs \
85 --without-vio \
86 --without-openssl \
87 --without-docs \
88 --without-bench \
89 --without-readline \
90 );
91 touch $(PKG_BUILD_DIR)/.configured
92
93 $(PKG_BUILD_DIR)/.built: $(PKG_BUILD_DIR)/.configured
94 $(MAKE) -C "$(PKG_BUILD_DIR)/libmysql" \
95 CC="$(HOSTCC)" \
96 LINK="$(HOSTCC) -o conf_to_src -lc" \
97 CFLAGS="" \
98 conf_to_src
99 $(MAKE) -C "$(PKG_BUILD_DIR)" \
100 SUBDIRS="include libmysql" \
101 all
102 touch $(PKG_BUILD_DIR)/.built
103
104 $(STAGING_DIR)/usr/lib/mysql/libmysqlclient.so: $(PKG_BUILD_DIR)/.built
105 $(MAKE) -C "$(PKG_BUILD_DIR)" \
106 DESTDIR="$(STAGING_DIR)" \
107 SUBDIRS="include libmysql" \
108 install
109 rm -rf $(STAGING_DIR)/usr/lib/mysql/libmysqlclient.la
110
111 $(IPKG_LIBMYSQLCLIENT): $(STAGING_DIR)/usr/lib/mysql/libmysqlclient.so
112 $(SCRIPT_DIR)/make-ipkg-dir.sh $(IDIR_LIBMYSQLCLIENT) ./ipkg/libmysqlclient.control $(PKG_VERSION)-$(PKG_RELEASE) $(ARCH)
113 mkdir -p $(IDIR_LIBMYSQLCLIENT)/usr/lib
114 cp -fpR $(STAGING_DIR)/usr/lib/mysql/libmysqlclient.so.* $(IDIR_LIBMYSQLCLIENT)/usr/lib/
115 $(STRIP) $(IDIR_LIBMYSQLCLIENT)/usr/lib/*.so*
116 mkdir -p $(PACKAGE_DIR)
117 $(IPKG_BUILD) $(IDIR_LIBMYSQLCLIENT) $(PACKAGE_DIR)
118
119 $(INFO_LIBMYSQLCLIENT): $(IPKG_LIBMYSQLCLIENT)
120 $(IPKG) install $(IPKG_LIBMYSQLCLIENT)
121
122 source: $(DL_DIR)/$(PKG_SOURCE)
123 prepare: $(PKG_BUILD_DIR)/.prepared
124 compile: $(IPKG_LIBMYSQLCLIENT)
125 install: $(INFO_LIBMYSQLCLIENT)
126
127 clean:
128 -$(MAKE) -C "$(PKG_BUILD_DIR)" \
129 DESTDIR="$(STAGING_DIR)" \
130 SUBDIRS="include libmysql" \
131 uninstall
132 rm -rf $(PKG_BUILD_DIR) $(IPKG_LIBMYSQLCLIENT)
This page took 0.047591 seconds and 5 git commands to generate.