annotate kpathsea/acklibtool.m4 @ 4286:0e427b227329

[project @ 2003-01-04 19:30:09 by jwe]
author jwe
date Sat, 04 Jan 2003 19:30:09 +0000
parents fccab8e7d35f
children 48d5b36ba35a
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
3000
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
1 dnl Autoconf support for Klibtool.
4286
0e427b227329 [project @ 2003-01-04 19:30:09 by jwe]
jwe
parents: 3176
diff changeset
2 dnl $Id: acklibtool.m4,v 1.6 2003-01-04 19:30:09 jwe Exp $
3000
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
3 dnl
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
4 dnl
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
5 dnl Find the script, check for subprogs, etc.
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
6 AC_DEFUN(kb_AC_PROG_LIBTOOL,
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
7 [AC_REQUIRE([AC_PROG_RANLIB])
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
8 AC_REQUIRE([AC_CANONICAL_HOST])
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
9 #
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
10 AC_MSG_CHECKING([for libtool object types])
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
11 #
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
12 ## Check that the klibtool script is in ac_aux_dir. Don't bother to
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
13 # scan PATH. For one thing, if we found it somewhere there, we couldn't
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
14 # use that directory to put the config file ... and that's what we need
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
15 # to do, to avoid having to configure in every subdirectory.
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
16 LIBTOOL=$ac_aux_dir/klibtool
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
17 AC_SUBST(LIBTOOL)
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
18 if test ! -r $LIBTOOL; then
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
19 AC_MSG_ERROR([klibtool not in $ac_aux_dir, goodbye])
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
20 exit 1
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
21 fi
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
22 #
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
23 ## Argument parsing: we support --enable-shared and --enable-static.
4286
0e427b227329 [project @ 2003-01-04 19:30:09 by jwe]
jwe
parents: 3176
diff changeset
24 AC_ARG_ENABLE(shared,
0e427b227329 [project @ 2003-01-04 19:30:09 by jwe]
jwe
parents: 3176
diff changeset
25 [ --enable-shared build shared libraries [default=no]],,
0e427b227329 [project @ 2003-01-04 19:30:09 by jwe]
jwe
parents: 3176
diff changeset
26 [if test "$enableval" = no; then enable_shared=no;
0e427b227329 [project @ 2003-01-04 19:30:09 by jwe]
jwe
parents: 3176
diff changeset
27 else enable_shared=yes; fi],
0e427b227329 [project @ 2003-01-04 19:30:09 by jwe]
jwe
parents: 3176
diff changeset
28 enable_shared=no)
0e427b227329 [project @ 2003-01-04 19:30:09 by jwe]
jwe
parents: 3176
diff changeset
29 #
0e427b227329 [project @ 2003-01-04 19:30:09 by jwe]
jwe
parents: 3176
diff changeset
30 AC_ARG_ENABLE(static,
0e427b227329 [project @ 2003-01-04 19:30:09 by jwe]
jwe
parents: 3176
diff changeset
31 [ --enable-static build static libraries [default=yes]],,
0e427b227329 [project @ 2003-01-04 19:30:09 by jwe]
jwe
parents: 3176
diff changeset
32 [if test "$enableval" = no; then enable_static=no;
0e427b227329 [project @ 2003-01-04 19:30:09 by jwe]
jwe
parents: 3176
diff changeset
33 else enable_static=yes; fi],
0e427b227329 [project @ 2003-01-04 19:30:09 by jwe]
jwe
parents: 3176
diff changeset
34 enable_static=yes)
3000
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
35 #
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
36 # If they explicitly --enable-static, make that the link type.
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
37 # More commonly, they will just --enable-shared; make that the link type.
3172
1f0b06020e36 [project @ 1998-04-24 04:24:34 by jwe]
jwe
parents: 3034
diff changeset
38 # If they --disable-static, implicitly --enable-shared.
1f0b06020e36 [project @ 1998-04-24 04:24:34 by jwe]
jwe
parents: 3034
diff changeset
39 # In any case, prepend to any existing LIBTOOL_OBJTYPES.
3000
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
40 # If they really want to build both and link statically,
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
41 # then they set LIBTOOL_OBJTYPES to SHARED and --enable-static.
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
42 test "$enable_static" = yes && LIBTOOL_OBJTYPES=STATIC:$LIBTOOL_OBJTYPES
3172
1f0b06020e36 [project @ 1998-04-24 04:24:34 by jwe]
jwe
parents: 3034
diff changeset
43 (test "$enable_shared" = yes \
1f0b06020e36 [project @ 1998-04-24 04:24:34 by jwe]
jwe
parents: 3034
diff changeset
44 || test "$enable_static" = no) \
1f0b06020e36 [project @ 1998-04-24 04:24:34 by jwe]
jwe
parents: 3034
diff changeset
45 && LIBTOOL_OBJTYPES=SHARED:$LIBTOOL_OBJTYPES
3000
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
46 # Don't bother to remove the trailing :, it'll be ignored.
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
47 #
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
48 ## Finally: Run the klibtool configure command.
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
49 LIBTOOL_OBJTYPES=$LIBTOOL_OBJTYPES RANLIB=$RANLIB \
3174
390d5e396682 [project @ 1998-05-04 16:36:17 by jwe]
jwe
parents: 3172
diff changeset
50 $LIBTOOL --source-dir $ac_aux_dir --config-dir . configure "$host"
3000
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
51 AC_MSG_RESULT($LIBTOOL_OBJTYPES)
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
52 ])dnl
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
53 dnl
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
54 dnl
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
55 dnl Like AC_REPLACE_FUNCS, but add to LTLIBOBJS instead of LIBOBJS.
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
56 AC_DEFUN(kb_AC_KLIBTOOL_REPLACE_FUNCS,
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
57 [ dnl cannot require this function, since it doesn't have a provide call.
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
58 AC_CHECK_FUNCS($1,, LTLIBOBJS="$LTLIBOBJS $ac_func.lo")
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
59 AC_SUBST(LTLIBOBJS)dnl
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
60 ])dnl