Author: Ole Streicher <debian@liska.ath.cx>
Description: The external PAL library in Debian is called "starlink-pal".
--- a/configure.ac
+++ b/configure.ac
@@ -55,7 +55,7 @@
         external_pal="0")
 AC_SUBST( EXTERNAL_PAL, $external_pal )
 if test "$external_pal" = "1"; then
-   AC_SUBST( LIBPAL, "-lpal" )
+   AC_SUBST( LIBPAL, "-lstarlink_pal" )
    AC_DEFINE([EXTERNAL_PAL],[1],[use external PAL and ERFA libraries]),
 else
    AC_SUBST( LIBPAL, "" )
--- a/ast_link.in
+++ b/ast_link.in
@@ -337,7 +337,7 @@
 
 #  If we configured --with-external_pal include a link option to pick up
 #  an external PAL library.
-      1) args="${args} -lpal";;
+      1) args="${args} @LIBPAL@";;
 
 #  Otherwise, use the internal PAL & ERFA libraries.
       *) args="${args} -last_pal";;
--- a/Makefile.am
+++ b/Makefile.am
@@ -559,8 +559,6 @@
     $(PAL_LIB) \
     libstarlink_ast.la \
     libstarlink_ast_err.la \
-    libstarlink_ast_ems.la \
-    libstarlink_ast_drama.la \
     libstarlink_ast_grf3d.la \
     libstarlink_ast_grf_2.0.la \
     libstarlink_ast_grf_3.2.la \
@@ -622,7 +620,7 @@
 # libstarlink_ast_pal library will be empty, and we link to an external PAL
 # library instead.
 if EXTERNAL_PAL
-libstarlink_ast_la_LIBADD =  $(libdir)/libpal.la
+libstarlink_ast_la_LIBADD = @LIBPAL@ -lerfa -lm
 else
 libstarlink_ast_la_LIBADD = libstarlink_ast_pal.la
 endif
@@ -774,4 +772,4 @@
 
 #ast_test_LDADD = `ast_link`
 # Expand ast_link to avoid libstarlink_ast_pass2, which causes problems for Solaris
-ast_test_LDADD = @LIBPAL@ libstarlink_ast.la libstarlink_ast_pal.la libstarlink_ast_grf_3.2.la libstarlink_ast_grf_5.6.la libstarlink_ast_grf_2.0.la libstarlink_ast_grf3d.la libstarlink_ast_err.la -lm
+ast_test_LDADD = @LIBPAL@ libstarlink_ast.la libstarlink_ast_grf_3.2.la libstarlink_ast_grf_5.6.la libstarlink_ast_grf_2.0.la libstarlink_ast_grf3d.la libstarlink_ast_err.la -lm
