Skip to content

Commit 11228e8

Browse files
committed
Don't attempt to build preloadable_libiconv.so when linking statically.
1 parent 393cf16 commit 11228e8

File tree

2 files changed

+30
-10
lines changed

2 files changed

+30
-10
lines changed

ChangeLog

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1+
2017-07-15 Bruno Haible <bruno@clisp.org>
2+
3+
Don't attempt to build preloadable_libiconv.so when linking statically.
4+
* preload/configure.ac (enable_shared, enable_static): Don't force
5+
shared libraries when LDFLAGS indicates static linking.
6+
(PLUGLIB): Set to empty when is not configured for building shared
7+
libraries.
8+
19
2017-07-15 Bruno Haible <bruno@clisp.org>
210

311
Get rid of autom4te.cache directories, as far as possible.

preload/configure.ac

Lines changed: 22 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
dnl Copyright (C) 1999-2009, 2016 Free Software Foundation, Inc.
1+
dnl Copyright (C) 1999-2009, 2016-2017 Free Software Foundation, Inc.
22
dnl This file is part of the GNU LIBICONV Library.
33
dnl
44
dnl The GNU LIBICONV Library is free software; you can redistribute it and/or
@@ -52,20 +52,32 @@ dnl check for build configuration
5252

5353
dnl Here we need to build shared object files, regardless whether the user
5454
dnl wants to the libiconv library itself to be installed shared or static or
55-
dnl both.
56-
enable_shared=yes
57-
enable_static=no
55+
dnl both. Except that if $LDFLAGS specifies static linking, the creation
56+
dnl of shared object files would fail anyway.
57+
case " $LDFLAGS " in
58+
*" -static "*) ;;
59+
*)
60+
enable_shared=yes
61+
enable_static=no
62+
;;
63+
esac
5864
LT_INIT([win32-dll])
5965
gl_VISIBILITY
6066

6167
dnl check whether OS supports plug libraries
6268

63-
case "$host_os" in
64-
linux* | solaris* | osf*)
65-
PLUGLIB="preloadable_libiconv.so" ;;
66-
*)
67-
PLUGLIB=""
68-
esac
69+
if test "$enable_shared" = yes; then
70+
case "$host_os" in
71+
linux* | solaris* | osf*)
72+
PLUGLIB="preloadable_libiconv.so" ;;
73+
*)
74+
PLUGLIB=""
75+
esac
76+
else
77+
# If libtool is not configured for building shared libraries,
78+
# the build rule for preloadable_libiconv.so would fail.
79+
PLUGLIB=""
80+
fi
6981
AC_SUBST([PLUGLIB])
7082

7183
AC_CONFIG_FILES([Makefile])

0 commit comments

Comments
 (0)