diff --git a/applications/star2html/Makefile.am b/applications/star2html/Makefile.am index ac7b7e4521a..957dce2f6d0 100644 --- a/applications/star2html/Makefile.am +++ b/applications/star2html/Makefile.am @@ -26,6 +26,8 @@ l2hdir=$(DESTDIR)$(datadir)/latex2html/bin/ edit=sed \ -e 's,@ENV\@,$(ENV),g' \ + -e 's,@PDFTOPS\@,$(PDFTOPS),g' \ + -e 's,@PDF2PS\@,$(PDF2PS),g' \ -e 's,@PACKAGE_VERSION\@,$(PACKAGE_VERSION),g' \ -e 's,@PACKAGE_BUGREPORT\@,$(PACKAGE_BUGREPORT),g' \ -e 's,@l2hdir\@,$(l2hdir),g' diff --git a/applications/star2html/configure.ac b/applications/star2html/configure.ac index 161b2616fcf..1da1b5160dc 100644 --- a/applications/star2html/configure.ac +++ b/applications/star2html/configure.ac @@ -24,6 +24,8 @@ dnl And requires that Perl is already built, from which we use the dnl starperl command. STAR_DECLARE_DEPENDENCIES([configure], [perl]) STAR_CHECK_PROGS([env]) +AC_CHECK_PROGS(PDF2PS, 'pdf2ps') +AC_CHECK_PROGS(PDFTOPS, 'pdftops -eps') dnl List the sun/ssn/... numbers which document this package and dnl which are present as .tex files in this directory. diff --git a/applications/star2html/star2html.in b/applications/star2html/star2html.in index a47ae39a796..8364518a871 100755 --- a/applications/star2html/star2html.in +++ b/applications/star2html/star2html.in @@ -257,6 +257,8 @@ # on exit # 31-AUG-2013 (TIMJ): # - Convert PDF images to EPS +# 2013-10-02 (TIMJ): +# - Use autoconf to find pdftops # {enter_further_changes_here} # Bugs: @@ -270,7 +272,6 @@ use Cwd; use File::Spec; use Pod::Usage; use Getopt::Long; -use File::SearchPath qw/ searchpath /; # Print introductory message. my $announce = "Star2HTML V@PACKAGE_VERSION@"; @@ -435,12 +436,15 @@ if ( ( -T $TEXFILE ) && ( -r $TEXFILE ) ) { { # First work out which converter to use + my %TOOLS = ( pdftops => '@PDFTOPS@', + pdf2ps => '@PDF2PS@', + ); + my @pdftops; for my $tool (qw/ pdftops pdf2ps /) { - my $path = searchpath( $tool, $ENV{PATH} ); - if (defined $path) { - push(@pdftops, $tool); - push(@pdftops, "-eps") if $tool eq 'pdftops'; + my $exe = $TOOLS{$tool}; + if ($exe) { + push(@pdftops, split(/\s+/,$exe)); last; } }