annotate m4/buildsys.m4 @ 1879:81cdc01db60e

Update buildsys (adds ${PROG_SUFFIX}).
author Jonathan Schleifer <js@h3c.de>
date Wed, 26 Sep 2007 03:05:48 +0200
parents m4/sharedlib.m4@911853b3d451
children 0d8899c4ba25
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
1763
a99495a865eb Import Mk2 core.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
1 dnl
a99495a865eb Import Mk2 core.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
2 dnl Copyright (c) 2007, Jonathan Schleifer <js@h3c.de>
a99495a865eb Import Mk2 core.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
3 dnl
a99495a865eb Import Mk2 core.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
4 dnl Permission to use, copy, modify, and/or distribute this software for any
a99495a865eb Import Mk2 core.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
5 dnl purpose with or without fee is hereby granted, provided that the above
a99495a865eb Import Mk2 core.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
6 dnl copyright notice and this permission notice is present in all copies.
a99495a865eb Import Mk2 core.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
7 dnl
a99495a865eb Import Mk2 core.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
8 dnl THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
a99495a865eb Import Mk2 core.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
9 dnl AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
a99495a865eb Import Mk2 core.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
10 dnl IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
a99495a865eb Import Mk2 core.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
11 dnl ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
a99495a865eb Import Mk2 core.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
12 dnl LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
a99495a865eb Import Mk2 core.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
13 dnl CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
a99495a865eb Import Mk2 core.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
14 dnl SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
a99495a865eb Import Mk2 core.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
15 dnl INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
a99495a865eb Import Mk2 core.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
16 dnl CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
a99495a865eb Import Mk2 core.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
17 dnl ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
a99495a865eb Import Mk2 core.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
18 dnl POSSIBILITY OF SUCH DAMAGE.
a99495a865eb Import Mk2 core.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
19 dnl
a99495a865eb Import Mk2 core.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
20
1879
81cdc01db60e Update buildsys (adds ${PROG_SUFFIX}).
Jonathan Schleifer <js@h3c.de>
parents: 1864
diff changeset
21 AC_DEFUN([BUILDSYS_SHARED_LIB], [
1763
a99495a865eb Import Mk2 core.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
22 AC_MSG_CHECKING(for shared library system)
a99495a865eb Import Mk2 core.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
23 case "$target" in
a99495a865eb Import Mk2 core.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
24 intel-apple-*)
a99495a865eb Import Mk2 core.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
25 AC_MSG_RESULT([Mac OS X (Intel)])
a99495a865eb Import Mk2 core.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
26 LIB_CPPFLAGS='-DPIC'
a99495a865eb Import Mk2 core.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
27 LIB_CFLAGS='-fPIC'
a99495a865eb Import Mk2 core.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
28 LIB_LDFLAGS='-dynamiclib -fPIC -install_name ${libdir}/${LIB}'
a99495a865eb Import Mk2 core.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
29 LIB_PREFIX='lib'
a99495a865eb Import Mk2 core.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
30 LIB_SUFFIX='.dylib'
a99495a865eb Import Mk2 core.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
31 PLUGIN_CPPFLAGS=''
a99495a865eb Import Mk2 core.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
32 PLUGIN_CFLAGS=''
a99495a865eb Import Mk2 core.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
33 PLUGIN_LDFLAGS='-bundle -fno-common -flat_namespace -undefined suppress'
a99495a865eb Import Mk2 core.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
34 PLUGIN_SUFFIX='.impl'
a99495a865eb Import Mk2 core.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
35 INSTALL_LIB='${INSTALL} -m 755 $$i ${DESTDIR}${libdir}/$${i%.dylib}.${LIB_MAJOR}.${LIB_MINOR}.dylib && ${LN_S} -f $${i%.dylib}.${LIB_MAJOR}.${LIB_MINOR}.dylib ${DESTDIR}${libdir}/$${i%.dylib}.${LIB_MAJOR}.dylib && ${LN_S} -f $${i%.dylib}.${LIB_MAJOR}.${LIB_MINOR}.dylib ${DESTDIR}${libdir}/$$i'
a99495a865eb Import Mk2 core.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
36 UNINSTALL_LIB='rm -f ${DESTDIR}${libdir}/$$i ${DESTDIR}${libdir}/$${i%.dylib}.${LIB_MAJOR}.dylib ${DESTDIR}${libdir}/$${i%.dylib}.${LIB_MAJOR}.${LIB_MINOR}.dylib'
a99495a865eb Import Mk2 core.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
37 CLEAN_LIB=''
a99495a865eb Import Mk2 core.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
38 ;;
a99495a865eb Import Mk2 core.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
39 *-apple-*)
a99495a865eb Import Mk2 core.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
40 AC_MSG_RESULT(Mac OS X)
a99495a865eb Import Mk2 core.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
41 LIB_CPPFLAGS='-DPIC'
a99495a865eb Import Mk2 core.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
42 LIB_CFLAGS=''
a99495a865eb Import Mk2 core.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
43 LIB_LDFLAGS='-dynamiclib -fPIC -install_name ${libdir}/${LIB}'
a99495a865eb Import Mk2 core.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
44 LIB_PREFIX='lib'
a99495a865eb Import Mk2 core.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
45 LIB_SUFFIX='.dylib'
a99495a865eb Import Mk2 core.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
46 PLUGIN_CPPFLAGS=''
a99495a865eb Import Mk2 core.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
47 PLUGIN_CFLAGS=''
a99495a865eb Import Mk2 core.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
48 PLUGIN_LDFLAGS='-bundle -fno-common -flat_namespace -undefined suppress'
a99495a865eb Import Mk2 core.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
49 PLUGIN_SUFFIX='.impl'
a99495a865eb Import Mk2 core.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
50 INSTALL_LIB='${INSTALL} -m 755 $$i ${DESTDIR}${libdir}/$${i%.dylib}.${LIB_MAJOR}.${LIB_MINOR}.dylib && ${LN_S} -f $${i%.dylib}.${LIB_MAJOR}.${LIB_MINOR}.dylib ${DESTDIR}${libdir}/$${i%.dylib}.${LIB_MAJOR}.dylib && ${LN_S} -f $${i%.dylib}.${LIB_MAJOR}.${LIB_MINOR}.dylib ${DESTDIR}${libdir}/$$i'
a99495a865eb Import Mk2 core.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
51 UNINSTALL_LIB='rm -f ${DESTDIR}${libdir}/$$i ${DESTDIR}${libdir}/$${i%.dylib}.${LIB_MAJOR}.dylib ${DESTDIR}${libdir}/$${i%.dylib}.${LIB_MAJOR}.${LIB_MINOR}.dylib'
a99495a865eb Import Mk2 core.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
52 CLEAN_LIB=''
a99495a865eb Import Mk2 core.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
53 ;;
1864
911853b3d451 Update sharedlib.m4.
Jonathan Schleifer <js@h3c.de>
parents: 1763
diff changeset
54 *-*-solaris* | *-openbsd-* | *-mirbsd-*)
1763
a99495a865eb Import Mk2 core.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
55 AC_MSG_RESULT(Solaris)
a99495a865eb Import Mk2 core.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
56 LIB_CPPFLAGS='-DPIC'
a99495a865eb Import Mk2 core.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
57 LIB_CFLAGS='-fPIC'
a99495a865eb Import Mk2 core.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
58 LIB_LDFLAGS='-shared -fPIC -Wl,-soname=${LIB}.${LIB_MAJOR}.${LIB_MINOR}'
a99495a865eb Import Mk2 core.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
59 LIB_PREFIX='lib'
a99495a865eb Import Mk2 core.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
60 LIB_SUFFIX='.so'
a99495a865eb Import Mk2 core.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
61 PLUGIN_CPPFLAGS='-DPIC'
a99495a865eb Import Mk2 core.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
62 PLUGIN_CFLAGS='-fPIC'
a99495a865eb Import Mk2 core.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
63 PLUGIN_LDFLAGS='-shared -fPIC'
a99495a865eb Import Mk2 core.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
64 PLUGIN_SUFFIX='.so'
1864
911853b3d451 Update sharedlib.m4.
Jonathan Schleifer <js@h3c.de>
parents: 1763
diff changeset
65 INSTALL_LIB='${INSTALL} -m 755 $$i ${DESTDIR}${libdir}/$$i.${LIB_MAJOR}.${LIB_MINOR} && rm -f ${DESTDIR}${libdir}/$$i && ${LN_S} $$i.${LIB_MAJOR}.${LIB_MINOR} ${DESTDIR}${libdir}/$$i'
1763
a99495a865eb Import Mk2 core.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
66 UNINSTALL_LIB='rm -f ${DESTDIR}${libdir}/$$i ${DESTDIR}${libdir}/$$i.${LIB_MAJOR}.${LIB_MINOR}'
a99495a865eb Import Mk2 core.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
67 CLEAN_LIB=''
a99495a865eb Import Mk2 core.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
68 ;;
1879
81cdc01db60e Update buildsys (adds ${PROG_SUFFIX}).
Jonathan Schleifer <js@h3c.de>
parents: 1864
diff changeset
69 *-*-cygwin | *-*-ming32)
1864
911853b3d451 Update sharedlib.m4.
Jonathan Schleifer <js@h3c.de>
parents: 1763
diff changeset
70 AC_MSG_RESULT(Win32)
1763
a99495a865eb Import Mk2 core.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
71 LIB_CPPFLAGS='-DPIC'
a99495a865eb Import Mk2 core.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
72 LIB_CFLAGS=''
a99495a865eb Import Mk2 core.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
73 LIB_LDFLAGS='-shared -Wl,--out-implib,${LIB}.a'
a99495a865eb Import Mk2 core.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
74 LIB_PREFIX='lib'
a99495a865eb Import Mk2 core.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
75 LIB_SUFFIX='.dll'
a99495a865eb Import Mk2 core.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
76 PLUGIN_CPPFLAGS=''
a99495a865eb Import Mk2 core.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
77 PLUGIN_CFLAGS=''
1864
911853b3d451 Update sharedlib.m4.
Jonathan Schleifer <js@h3c.de>
parents: 1763
diff changeset
78 PLUGIN_LDFLAGS='-shared'
1763
a99495a865eb Import Mk2 core.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
79 PLUGIN_SUFFIX='.dll'
a99495a865eb Import Mk2 core.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
80 INSTALL_LIB='${INSTALL} -m 755 $$i ${DESTDIR}${bindir}/$$i && ${INSTALL} -m 755 $$i.a ${DESTDIR}${libdir}/$$i.a'
a99495a865eb Import Mk2 core.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
81 UNINSTALL_LIB='rm -f ${DESTDIR}${bindir}/$$i ${DESTDIR}${libdir}/$$i.a'
a99495a865eb Import Mk2 core.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
82 CLEAN_LIB='${LIB}.a'
a99495a865eb Import Mk2 core.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
83 ;;
a99495a865eb Import Mk2 core.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
84 *)
a99495a865eb Import Mk2 core.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
85 AC_MSG_RESULT(POSIX)
a99495a865eb Import Mk2 core.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
86 LIB_CPPFLAGS='-DPIC'
a99495a865eb Import Mk2 core.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
87 LIB_CFLAGS='-fPIC'
a99495a865eb Import Mk2 core.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
88 LIB_LDFLAGS='-shared -fPIC -Wl,-soname=${LIB}.${LIB_MAJOR}.${LIB_MINOR}.0'
a99495a865eb Import Mk2 core.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
89 LIB_PREFIX='lib'
a99495a865eb Import Mk2 core.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
90 LIB_SUFFIX='.so'
a99495a865eb Import Mk2 core.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
91 PLUGIN_CPPFLAGS='-DPIC'
a99495a865eb Import Mk2 core.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
92 PLUGIN_CFLAGS='-fPIC'
a99495a865eb Import Mk2 core.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
93 PLUGIN_LDFLAGS='-shared -fPIC'
a99495a865eb Import Mk2 core.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
94 PLUGIN_SUFFIX='.so'
a99495a865eb Import Mk2 core.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
95 INSTALL_LIB='${INSTALL} -m 755 $$i ${DESTDIR}${libdir}/$$i.${LIB_MAJOR}.${LIB_MINOR}.0 && ${LN_S} -f $$i.${LIB_MAJOR}.${LIB_MINOR}.0 ${DESTDIR}${libdir}/$$i.${LIB_MAJOR} && ${LN_S} -f $$i.${LIB_MAJOR}.${LIB_MINOR}.0 ${DESTDIR}${libdir}/$$i'
a99495a865eb Import Mk2 core.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
96 UNINSTALL_LIB='rm -f ${DESTDIR}${libdir}/$$i ${DESTDIR}${libdir}/$$i.${LIB_MAJOR} ${DESTDIR}${libdir}/$$i.${LIB_MAJOR}.${LIB_MINOR}.0'
a99495a865eb Import Mk2 core.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
97 CLEAN_LIB=''
a99495a865eb Import Mk2 core.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
98 ;;
a99495a865eb Import Mk2 core.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
99 esac
a99495a865eb Import Mk2 core.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
100
a99495a865eb Import Mk2 core.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
101 AC_SUBST(LIB_CPPFLAGS)
a99495a865eb Import Mk2 core.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
102 AC_SUBST(LIB_CFLAGS)
a99495a865eb Import Mk2 core.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
103 AC_SUBST(LIB_LDFLAGS)
a99495a865eb Import Mk2 core.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
104 AC_SUBST(LIB_PREFIX)
a99495a865eb Import Mk2 core.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
105 AC_SUBST(LIB_SUFFIX)
a99495a865eb Import Mk2 core.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
106 AC_SUBST(PLUGIN_CPPFLAGS)
a99495a865eb Import Mk2 core.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
107 AC_SUBST(PLUGIN_CFLAGS)
a99495a865eb Import Mk2 core.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
108 AC_SUBST(PLUGIN_LDFLAGS)
a99495a865eb Import Mk2 core.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
109 AC_SUBST(PLUGIN_SUFFIX)
a99495a865eb Import Mk2 core.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
110 AC_SUBST(INSTALL_LIB)
a99495a865eb Import Mk2 core.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
111 AC_SUBST(UNINSTALL_LIB)
a99495a865eb Import Mk2 core.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
112 AC_SUBST(CLEAN_LIB)
a99495a865eb Import Mk2 core.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
113 ])