configure.in 3.97 KB
Newer Older
1 2 3
dnl
dnl  configure.in
dnl
4
dnl  Copyright (C) 2000-2001 Taketoshi Sano <[email protected]>
5
dnl  Copyright (C) 2008-2015 Agustin Martin <[email protected]>
6 7 8 9 10 11 12 13 14
dnl
dnl  Process this file with autoconf to produce a configure script.

AC_INIT(sgmls-1.1)

AC_PROG_INSTALL

AC_PATH_PROG(PERL, perl)
AC_SUBST(PERL)
15 16

dnl ------ Check if we have at least perl 5.004 ---------
17 18 19 20 21 22 23
if echo 'require 5.004;exit' | $PERL
then
  : # Solaris and OSF/1 /bin/sh don't know about negation operators...
else
  AC_MSG_ERROR(You don't have Perl 5.004...)
  exit 1
fi
24

25
dnl ------ Make perl a bit more verbose if desired ---------
26
AC_ARG_WITH(perl-w,
27 28
   [AS_HELP_STRING([--with-perl-w],
	[use perl -w option])],
29 30 31 32
   PERLWARN=-w,
   PERLWARN=
)
AC_SUBST(PERLWARN)
33 34

dnl ------ Check if groff is available ---------------------
35 36 37
AC_PATH_PROG(GROFF, groff)
AC_SUBST(GROFF)

38
dnl ------ Check if groff should take -mgs or -ms ----------
39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57
AC_CACHE_CHECK(whether ${GROFF} accepts -mgs, ac_cv_linuxdoctools_groff_mgs,
[  if test -z "`${GROFF} -mgs < /dev/null 2>&1`"; then
      ac_cv_linuxdoctools_groff_mgs=yes
   else
      ac_cv_linuxdoctools_groff_mgs=no
   fi
])

if test ${ac_cv_linuxdoctools_groff_mgs:-ERROR} = yes; then
  GROFFMACRO="-mgs"
else
  GROFFMACRO="-ms"
fi
AC_SUBST(GROFFMACRO)

AC_PATH_PROGS(AWK, gawk mawk, notfound)
AC_SUBST(AWK)
   test "$AWK" = "notfound" && AC_MSG_ERROR(neither gawk nor mawk is found)

58
dnl ------ Check for sgmls parser --------------------------
59 60 61 62 63 64
AC_PATH_PROGS(NSGMLS, nsgmls onsgmls, notfound)
AC_SUBST(NSGMLS)
   test "$NSGMLS" = "notfound" && AC_MSG_ERROR(neither onsgmls nor nsgmls is found)
   BUILD_NSGMLS=
AC_SUBST(BUILD_NSGMLS)

65
dnl ------ Check for sgmlsasp ------------------------------
66 67
AC_PATH_PROG(SGMLSASP, sgmlsasp)
AC_ARG_WITH(installed-sgmlsasp,
68 69
   [AS_HELP_STRING([--with-installed-sgmlsasp],
		   [use installed sgmlsasp])],
70 71 72 73
   test -n "$SGMLSASP" || AC_MSG_ERROR(sgmlsasp not found)
   BUILD_SGMLSASP=,
   SGMLSASP=\${prefix}/bin/sgmlsasp
   BUILD_SGMLSASP=true
74
)
75 76 77
AC_SUBST(SGMLSASP)
AC_SUBST(BUILD_SGMLSASP)

78
dnl ------ Check if we will use installed entity-map -------
79
AC_ARG_WITH(installed-entity-map,
80 81
   [AS_HELP_STRING([--with-installed-entity-map],
		   [use installed entity-map])],
82 83 84 85 86
   BUILD_ENTITY_MAP=,
   BUILD_ENTITY_MAP=true
)
AC_SUBST(BUILD_ENTITY_MAP)

87
dnl ------ Check if we will use installed iso-entities -----
88
AC_ARG_WITH(installed-iso-entities,
89 90
   [AS_HELP_STRING([--with-installed-iso-entities],
	           [use installed iso-entities])],
91 92 93 94 95
   BUILD_ISO_ENTITIES=,
   BUILD_ISO_ENTITIES=true
)
AC_SUBST(BUILD_ISO_ENTITIES)

96 97
dnl ------ Set dir for auxiliary programs like sgmlpre -----
AC_ARG_WITH(auxbindir,
98 99
  [AS_HELP_STRING([--with-auxbindir=dir],
		  [dir for internal use programs (default: EPREFIX/bin)])],
100 101 102 103 104 105
  auxbindir="$withval",
  auxbindir="\${exec_prefix}/bin"
)
AC_SUBST(auxbindir)

dnl ------ Set dir for package datadir --------------------
106
AC_ARG_WITH(pkgdatadir,
107 108
  [AS_HELP_STRING([--with-pkgdatadir=dir],
		  [dir for package datadir (default: PREFIX/share/linuxdoc-tools)])],
109 110 111 112 113
  pkgdatadir="$withval",
  pkgdatadir="\${prefix}/share/linuxdoc-tools"
)
AC_SUBST(pkgdatadir)

114 115
dnl ------ Set dir for package perl modules ---------------
AC_ARG_WITH(perllibdir,
116 117
  [AS_HELP_STRING([--with-perllibdir=dir],
		  [dir for package perl modules (default: PKGDATADIR)])],
118 119 120 121 122 123 124
  perl5libdir="$withval",
  perl5libdir="\${pkgdatadir}"
)
AC_SUBST(perl5libdir)

dnl ------ Set dir for tex style files --------------------
AC_ARG_WITH(texdir,
125 126
  [AS_HELP_STRING([--with-texdir=dir],
		  [dir for tex style files (default: PKGDATADIR)])],
127 128 129 130 131
  texdir="$withval",
  texdir="\${pkgdatadir}"
)
AC_SUBST(texdir)

132
dnl ------ Create list of possible extra subdirs -----------
133 134
if test "$BUILD_NSGMLS" = "true"
then
135
  AC_CONFIG_SUBDIRS([sp])
136 137 138
fi
if test "$BUILD_ENTITY_MAP" = "true"
then
139
  AC_CONFIG_SUBDIRS([entity-map])
140 141 142 143
fi

if test "$BUILD_ISO_ENTITIES" = "true"
then
144
  AC_CONFIG_SUBDIRS([iso-entities])
145 146
fi

147
AC_OUTPUT(Makefile)
148 149 150 151 152 153

if test "$BUILD_SGMLSASP" = "true"
then
  echo "Configuring sgmls-1.1";
  cd sgmls-1.1; make config.h; cd ..
fi