configure.ac: Detect os type, add -Wl,-bind_at_load to oggvorbis ld flags on Darwin.
authorAndre Noll <maan@systemlinux.org>
Thu, 15 Feb 2007 16:34:00 +0000 (17:34 +0100)
committerAndre Noll <maan@systemlinux.org>
Thu, 15 Feb 2007 16:34:00 +0000 (17:34 +0100)
This gets rid of zillions of warnings of the kind

ld: warning suggest use of -bind_at_load, as lazy binding may result in errors or different symbols being used

on Mac OS X (10.4.6)

configure.ac

index 1fa5ac4f2f71c9fe949862278e25a51a8a5b0fb5..3db6082d30ce94c205c9a979cbd463070ca78eaf 100644 (file)
@@ -7,7 +7,14 @@ AC_PREREQ(2.60)
 AC_INIT(paraslash, [git], maan@systemlinux.org)
 AC_CONFIG_HEADER([config.h])
 
 AC_INIT(paraslash, [git], maan@systemlinux.org)
 AC_CONFIG_HEADER([config.h])
 
-########################################################################### generic
+AC_PATH_PROG(UNAMEPATH, uname, no)
+if test "$UNAMEPATH" = "no"; then
+       AC_MSG_ERROR(unable to determine system type)
+fi
+AC_MSG_CHECKING(os type)
+OSTYPE="`$UNAMEPATH -s`"
+AC_MSG_RESULT("$OSTYPE")
+
 AC_PROG_CC
 AC_PROG_CPP
 AC_PROG_INSTALL
 AC_PROG_CC
 AC_PROG_CPP
 AC_PROG_INSTALL
@@ -276,6 +283,9 @@ AC_CHECK_HEADERS([ogg/ogg.h vorbis/codec.h], [], [ have_ogg="no" ])
 if test "$have_ogg" = "yes"; then
        AC_DEFINE(HAVE_OGGVORBIS, 1, define to 1 to turn on ogg vorbis support)
        filters="$filters oggdec"
 if test "$have_ogg" = "yes"; then
        AC_DEFINE(HAVE_OGGVORBIS, 1, define to 1 to turn on ogg vorbis support)
        filters="$filters oggdec"
+       if test "$OSTYPE" = "Darwin"; then
+               oggvorbis_libs="-Wl,-bind_at_load  $oggvorbis_libs"
+       fi
        server_ldflags="$server_ldflags $oggvorbis_libs -logg -lvorbis -lvorbisfile"
        filter_ldflags="$filter_ldflags $oggvorbis_libs -lvorbis -lvorbisfile"
        audiod_ldflags="$audiod_ldflags $oggvorbis_libs -lvorbis -lvorbisfile"
        server_ldflags="$server_ldflags $oggvorbis_libs -logg -lvorbis -lvorbisfile"
        filter_ldflags="$filter_ldflags $oggvorbis_libs -lvorbis -lvorbisfile"
        audiod_ldflags="$audiod_ldflags $oggvorbis_libs -lvorbis -lvorbisfile"