New modules relocatable, relocatable-lib, relocatable-script.
[gnulib.git] / m4 / relocatable-lib.m4
1 # relocatable-lib.m4 serial 1
2 dnl Copyright (C) 2003, 2005-2006, 2007 Free Software Foundation, Inc.
3 dnl This file is free software; the Free Software Foundation
4 dnl gives unlimited permission to copy and/or distribute it,
5 dnl with or without modifications, as long as this notice is preserved.
6
7 dnl From Bruno Haible.
8
9 dnl Support for relocatable libraries.
10 AC_DEFUN([gl_RELOCATABLE_LIBRARY],
11 [
12   AC_REQUIRE([gl_RELOCATABLE_NOP])
13   dnl Easier to put this here once, instead of into the DEFS of each Makefile.
14   if test "X$prefix" = "XNONE"; then
15     reloc_final_prefix="$ac_default_prefix"
16   else
17     reloc_final_prefix="$prefix"
18   fi
19   AC_DEFINE_UNQUOTED([INSTALLPREFIX], ["${reloc_final_prefix}"],
20     [Define to the value of ${prefix}, as a string.])
21 ])
22
23 dnl Support for relocatable packages for which it is a nop.
24 AC_DEFUN([gl_RELOCATABLE_NOP],
25 [
26   AC_MSG_CHECKING([whether to activate relocatable installation])
27   AC_ARG_ENABLE(relocatable,
28     [  --enable-relocatable    install a package that can be moved in the filesystem],
29     [if test "$enableval" != no; then
30        RELOCATABLE=yes
31      else
32        RELOCATABLE=no
33      fi
34     ], RELOCATABLE=no)
35   AC_SUBST(RELOCATABLE)
36   AC_MSG_RESULT([$RELOCATABLE])
37 ])
38