1 # relocatable-lib.m4 serial 5
2 dnl Copyright (C) 2003, 2005-2007, 2009-2011 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.
9 dnl Support for relocatable libraries.
10 AC_DEFUN([gl_RELOCATABLE_LIBRARY],
12 AC_REQUIRE([gl_RELOCATABLE_LIBRARY_BODY])
13 if test $RELOCATABLE = yes; then
14 AC_LIBOBJ([relocatable])
17 AC_DEFUN([gl_RELOCATABLE_LIBRARY_BODY],
19 AC_REQUIRE([gl_RELOCATABLE_NOP])
20 dnl Easier to put this here once, instead of into the DEFS of each Makefile.
21 if test "X$prefix" = "XNONE"; then
22 reloc_final_prefix="$ac_default_prefix"
24 reloc_final_prefix="$prefix"
26 AC_DEFINE_UNQUOTED([INSTALLPREFIX], ["${reloc_final_prefix}"],
27 [Define to the value of ${prefix}, as a string.])
28 if test $RELOCATABLE = yes; then
29 AC_DEFINE([ENABLE_RELOCATABLE], [1],
30 [Define to 1 if the package shall run at any location in the file
35 dnl Like gl_RELOCATABLE_LIBRARY, except prepare for separate compilation
37 AC_DEFUN([gl_RELOCATABLE_LIBRARY_SEPARATE],
39 AC_REQUIRE([gl_RELOCATABLE_LIBRARY_BODY])
42 dnl Support for relocatable packages for which it is a nop.
43 AC_DEFUN([gl_RELOCATABLE_NOP],
45 AC_MSG_CHECKING([whether to activate relocatable installation])
46 AC_ARG_ENABLE([relocatable],
47 [AS_HELP_STRING([--enable-relocatable],
48 [install a package that can be moved in the file system])],
49 [if test "$enableval" != no; then
55 AC_SUBST([RELOCATABLE])
56 AC_MSG_RESULT([$RELOCATABLE])