Compilation patch for Solaris and Darwin
Hi list,
Please find attached a patch to fix compilation on at least Solaris and
Darwin of dpkg-1.15.8.3. Both platforms do not have _POSIX_MAX_PATH
defined, unless limits.h is included. Further, linking fails, because
of missing libintl_* symbols, which is due to a missing -lintl on these
platforms which get it from gettext, as it is not in their libc (like
GNU libc).
On a sidenote, compilation on Darwin fails early in the process like
this:
cc1: error: unrecognized command line option "-Wvla"
You may want to check the WFLAGS if they are supported. However, it is
fine for me just to use --disable-compiler-warnings.
Regards,
--
Fabian Groffen
Gentoo on a different level
On Solaris and Darwin (possibly more platforms):
* make sure we link with -lintl to avoid missing gettext symbols
* include limits.h for _POSIX_PATH_MAX
--- utils/Makefile.am
+++ utils/Makefile.am
@@ -25,7 +25,7 @@
update_alternatives_LDADD = \
../lib/compat/libcompat.a \
- $(UA_LIBS)
+ $(UA_LIBS) $(LIBINTL)
sbin_PROGRAMS =
--- utils/Makefile.in
+++ utils/Makefile.in
@@ -284,7 +284,7 @@
update_alternatives_LDADD = \
../lib/compat/libcompat.a \
- $(UA_LIBS)
+ $(UA_LIBS) $(LIBINTL)
@WITH_START_STOP_DAEMON_TRUE@start_stop_daemon_SOURCES = \
@WITH_START_STOP_DAEMON_TRUE@ start-stop-daemon.c
--- utils/update-alternatives.c
+++ utils/update-alternatives.c
@@ -41,6 +41,7 @@
#include <assert.h>
#include <locale.h>
#include <ctype.h>
+#include <limits.h>
#include <dpkg/macros.h>
#include <dpkg/i18n.h>
Reply to: