lintian doesn't like orphan packages with uploaders...
[debian/amanda] / config / amanda / swig.m4
index dadfc890837a79fa33f7d8695aec7955beb49044..cdc7f5d81bdbc11edb0cc9ee4e7a0c979f764851 100644 (file)
@@ -14,8 +14,13 @@ AC_DEFUN([AMANDA_SETUP_SWIG],
     AC_REQUIRE([AMANDA_PROG_SWIG])
     AC_REQUIRE([AMANDA_PROG_PERL])
 
-    # If we want cygwin to copy ddl to modules directory.
-    WANT_CYGWIN_COPY_PERL_DLL="false"
+    WANT_CYGWIN_COPY_PERL_DLL=false
+    WANT_MANDATORY_THREAD_CHECK=false
+
+    # test for ExtUtils::Embed
+    AC_PERL_MODULE_VERSION([ExtUtils::Embed 0.0], [], [
+       AC_MSG_ERROR([*** Amanda requires the perl package ExtUtils::Embed to build its perl modules])
+    ])
 
     # get the include path for building perl extensions
     PERL_INC=`$PERL -MExtUtils::Embed -e perl_inc`
@@ -25,8 +30,8 @@ AC_DEFUN([AMANDA_SETUP_SWIG],
        AC_MSG_ERROR([*** Amanda cannot be compiled without shared-library support (do not use --disable-shared)])
     fi
 
-    case "$target" in
-       *freebsd@<:@123456@:>@*) # up to and including FreeBSD 6.*
+    case "$host" in
+       *freebsd@<:@123456@:>@.*) # up to and including FreeBSD 6.*
            # Before 7.0, FreeBSD systems don't include a DT_NEEDS segment in
            # libgthread to automatically pull in the desired threading library.
            # Instead, they assume that any application linking against
@@ -53,15 +58,26 @@ AC_DEFUN([AMANDA_SETUP_SWIG],
            #   http://lists.freebsd.org/pipermail/freebsd-stable/2006-June/026229.html
 
            PERLEXTLIBS="-lpthread"
+           WANT_MANDATORY_THREAD_CHECK=true
+           ;;
+
+       *freebsd*) # all FreeBSD not matched above
+           # for all FreeBSD (including 1.0-6.0, above), we want to run the
+           # thread-check rule in perl/Makefile.am to double-check that a Perl
+           # script can call a C extension that uses threads.
+           WANT_MANDATORY_THREAD_CHECK=true
            ;;
+
        *-pc-cygwin)
            # When need -lperl and the '-L' where it is located,
            # we don't want the DynaLoader.a
            PERLEXTLIBS=`perl -MExtUtils::Embed -e ldopts | sed -e 's/^.*-L/-L/'`
+           # we want cygwin to copy ddl to modules directory.
            WANT_CYGWIN_COPY_PERL_DLL="true";
            ;;
     esac
     AM_CONDITIONAL(WANT_CYGWIN_COPY_PERL_DLL,$WANT_CYGWIN_COPY_PERL_DLL)
+    AM_CONDITIONAL(WANT_MANDATORY_THREAD_CHECK,$WANT_MANDATORY_THREAD_CHECK)
 
     AC_ARG_WITH(perlextlibs,
        AC_HELP_STRING([--with-perlextlibs=libs],[extra LIBS for Perl extensions]),