updated the shared library version (never used, but still)
[mplib] / src / texk / acklibtool.m4
1 dnl Autoconf support for Klibtool.
2 dnl $Id: acklibtool.m4,v 1.5 1997/10/03 11:38:16 olaf Exp $
3 dnl
4 dnl
5 dnl Find the script, check for subprogs, etc.
6 AC_DEFUN(kb_AC_PROG_LIBTOOL,
7 [AC_REQUIRE([AC_PROG_RANLIB])
8 AC_REQUIRE([AC_CANONICAL_HOST])
9 #
10 AC_MSG_CHECKING([for libtool object types])
11 #
12 ## Check that the klibtool script is in ac_aux_dir.  Don't bother to
13 # scan PATH.  For one thing, if we found it somewhere there, we couldn't
14 # use that directory to put the config file ... and that's what we need
15 # to do, to avoid having to configure in every subdirectory.
16 LIBTOOL=$ac_aux_dir/klibtool
17 AC_SUBST(LIBTOOL)
18 if test ! -r $LIBTOOL; then
19   AC_MSG_ERROR([klibtool not in $ac_aux_dir, goodbye])
20   exit 1
21 fi
22 #
23 ## Argument parsing: we support --enable-shared and --enable-static.
24 AC_ARG_ENABLE(shared,
25 [  --enable-shared              build shared libraries [default=no]],,
26   enable_shared=no)
27 #
28 AC_ARG_ENABLE(static,
29 [  --enable-static              build static libraries [default=yes]],,
30   enable_static=yes)
31 #
32 # If they explicitly --enable-static, make that the link type.
33 # More commonly, they will just --enable-shared; make that the link type.
34 # If they --disable-static, implicitly --enable-shared.
35 # In any case, prepend to any existing LIBTOOL_OBJTYPES.
36 # If they really want to build both and link statically,
37 # then they set LIBTOOL_OBJTYPES to SHARED and --enable-static.
38 test "$enable_static" = yes && LIBTOOL_OBJTYPES=STATIC:$LIBTOOL_OBJTYPES
39 (test "$enable_shared" = yes \
40  || test "$enable_static" = no) \
41 && LIBTOOL_OBJTYPES=SHARED:$LIBTOOL_OBJTYPES
42 # Don't bother to remove the trailing :, it'll be ignored.
43 #
44 ## Finally: Run the klibtool configure command.
45 LIBTOOL_OBJTYPES=$LIBTOOL_OBJTYPES RANLIB=$RANLIB \
46   $LIBTOOL --source-dir $ac_aux_dir --config-dir .. configure "$host"
47 AC_MSG_RESULT($LIBTOOL_OBJTYPES)
48 ])dnl
49 dnl
50 dnl
51 dnl Like AC_REPLACE_FUNCS, but add to LTLIBOBJS instead of LIBOBJS.
52 AC_DEFUN(kb_AC_KLIBTOOL_REPLACE_FUNCS,
53 [ dnl cannot require this function, since it doesn't have a provide call.
54 AC_CHECK_FUNCS($1,, LTLIBOBJS="$LTLIBOBJS $ac_func.lo")
55 AC_SUBST(LTLIBOBJS)dnl
56 ])dnl