153
156
Consider adjusting the PKG_CONFIG_PATH environment variable if you
154
157
installed software in a non-standard prefix.
160
161
elif test $pkg_failed = untried; then
161
ifelse([$4], , [AC_MSG_FAILURE(dnl
163
m4_default([$4], [AC_MSG_FAILURE(
162
164
[The pkg-config script could not be found or is too old. Make sure it
163
165
is in your PATH or set the PKG_CONFIG environment variable to the full
164
166
path to pkg-config.
168
To get pkg-config, see <http://pkg-config.freedesktop.org/>.])],
170
To get pkg-config, see <http://pkg-config.freedesktop.org/>.])dnl
171
173
$1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS
172
174
$1[]_LIBS=$pkg_cv_[]$1[]_LIBS
173
175
AC_MSG_RESULT([yes])
174
ifelse([$3], , :, [$3])
176
178
])# PKG_CHECK_MODULES
180
dnl xorg-macros.m4. Generated from xorg-macros.m4.in xorgversion.m4 by configure.
179
182
dnl Copyright 2005-2006 Sun Microsystems, Inc. All rights reserved.
181
184
dnl Permission is hereby granted, free of charge, to any person obtaining a
182
dnl copy of this software and associated documentation files (the
183
dnl "Software"), to deal in the Software without restriction, including
184
dnl without limitation the rights to use, copy, modify, merge, publish,
185
dnl distribute, and/or sell copies of the Software, and to permit persons
186
dnl to whom the Software is furnished to do so, provided that the above
187
dnl copyright notice(s) and this permission notice appear in all copies of
188
dnl the Software and that both the above copyright notice(s) and this
189
dnl permission notice appear in supporting documentation.
191
dnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
192
dnl OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
193
dnl MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
194
dnl OF THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
195
dnl HOLDERS INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL
196
dnl INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING
197
dnl FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
198
dnl NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
199
dnl WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
201
dnl Except as contained in this notice, the name of a copyright holder
202
dnl shall not be used in advertising or otherwise to promote the sale, use
203
dnl or other dealings in this Software without prior written authorization
204
dnl of the copyright holder.
185
dnl copy of this software and associated documentation files (the "Software"),
186
dnl to deal in the Software without restriction, including without limitation
187
dnl the rights to use, copy, modify, merge, publish, distribute, sublicense,
188
dnl and/or sell copies of the Software, and to permit persons to whom the
189
dnl Software is furnished to do so, subject to the following conditions:
191
dnl The above copyright notice and this permission notice (including the next
192
dnl paragraph) shall be included in all copies or substantial portions of the
195
dnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
196
dnl IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
197
dnl FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
198
dnl THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
199
dnl LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
200
dnl FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
201
dnl DEALINGS IN THE SOFTWARE.
206
203
# XORG_MACROS_VERSION(required-version)
207
204
# -------------------------------------
481
524
AC_SUBST(MAKE_HTML)
482
525
]) # XORG_CHECK_DOCBOOK
527
# XORG_WITH_XMLTO([MIN-VERSION])
529
# Minimum version: 1.5.0
531
# Documentation tools are not always available on all platforms and sometimes
532
# not at the appropriate level. This macro enables a module to test for the
533
# presence of the tool and obtain it's path in separate variables. Coupled with
534
# the --with-xmlto option, it allows maximum flexibilty in making decisions
535
# as whether or not to use the xmlto package.
537
# Interface to module:
538
# HAVE_XMLTO: used in makefiles to conditionally generate documentation
539
# XMLTO: returns the path of the xmlto program found
540
# returns the path set by the user in the environment
541
# --with-xmlto: 'yes' user instructs the module to use xmlto
542
# 'no' user instructs the module not to use xmlto
544
# Added in version 1.10.0
545
# HAVE_XMLTO_TEXT: used in makefiles to conditionally generate text documentation
546
# xmlto for text output requires either lynx, links, or w3m browsers
548
# If the user sets the value of XMLTO, AC_PATH_PROG skips testing the path.
550
AC_DEFUN([XORG_WITH_XMLTO],[
551
AC_ARG_VAR([XMLTO], [Path to xmlto command])
553
AS_HELP_STRING([--with-xmlto],
554
[Use xmlto to regenerate documentation (default: yes, if installed)]),
555
[use_xmlto=$withval], [use_xmlto=auto])
557
if test "x$use_xmlto" = x"auto"; then
558
AC_PATH_PROG([XMLTO], [xmlto])
559
if test "x$XMLTO" = "x"; then
560
AC_MSG_WARN([xmlto not found - documentation targets will be skipped])
565
elif test "x$use_xmlto" = x"yes" ; then
566
AC_PATH_PROG([XMLTO], [xmlto])
567
if test "x$XMLTO" = "x"; then
568
AC_MSG_ERROR([--with-xmlto=yes specified but xmlto not found in PATH])
571
elif test "x$use_xmlto" = x"no" ; then
572
if test "x$XMLTO" != "x"; then
573
AC_MSG_WARN([ignoring XMLTO environment variable since --with-xmlto=no was specified])
577
AC_MSG_ERROR([--with-xmlto expects 'yes' or 'no'])
580
# Test for a minimum version of xmlto, if provided.
582
[if test "$have_xmlto" = yes; then
583
# scrape the xmlto version
584
AC_MSG_CHECKING([the xmlto version])
585
xmlto_version=`$XMLTO --version 2>/dev/null | cut -d' ' -f3`
586
AC_MSG_RESULT([$xmlto_version])
587
AS_VERSION_COMPARE([$xmlto_version], [$1],
588
[if test "x$use_xmlto" = xauto; then
589
AC_MSG_WARN([xmlto version $xmlto_version found, but $1 needed])
592
AC_MSG_ERROR([xmlto version $xmlto_version found, but $1 needed])
596
# Test for the ability of xmlto to generate a text target
598
cat > conftest.xml << "EOF"
600
AS_IF([test "$have_xmlto" = yes],
601
[AS_IF([$XMLTO --skip-validation txt conftest.xml >/dev/null 2>&1],
602
[have_xmlto_text=yes],
603
[AC_MSG_WARN([xmlto cannot generate text format, this format skipped])])])
605
AM_CONDITIONAL([HAVE_XMLTO_TEXT], [test $have_xmlto_text = yes])
606
AM_CONDITIONAL([HAVE_XMLTO], [test "$have_xmlto" = yes])
609
# XORG_WITH_ASCIIDOC([MIN-VERSION])
611
# Minimum version: 1.5.0
613
# Documentation tools are not always available on all platforms and sometimes
614
# not at the appropriate level. This macro enables a module to test for the
615
# presence of the tool and obtain it's path in separate variables. Coupled with
616
# the --with-asciidoc option, it allows maximum flexibilty in making decisions
617
# as whether or not to use the asciidoc package.
619
# Interface to module:
620
# HAVE_ASCIIDOC: used in makefiles to conditionally generate documentation
621
# ASCIIDOC: returns the path of the asciidoc program found
622
# returns the path set by the user in the environment
623
# --with-asciidoc: 'yes' user instructs the module to use asciidoc
624
# 'no' user instructs the module not to use asciidoc
626
# If the user sets the value of ASCIIDOC, AC_PATH_PROG skips testing the path.
628
AC_DEFUN([XORG_WITH_ASCIIDOC],[
629
AC_ARG_VAR([ASCIIDOC], [Path to asciidoc command])
630
AC_ARG_WITH(asciidoc,
631
AS_HELP_STRING([--with-asciidoc],
632
[Use asciidoc to regenerate documentation (default: yes, if installed)]),
633
[use_asciidoc=$withval], [use_asciidoc=auto])
635
if test "x$use_asciidoc" = x"auto"; then
636
AC_PATH_PROG([ASCIIDOC], [asciidoc])
637
if test "x$ASCIIDOC" = "x"; then
638
AC_MSG_WARN([asciidoc not found - documentation targets will be skipped])
643
elif test "x$use_asciidoc" = x"yes" ; then
644
AC_PATH_PROG([ASCIIDOC], [asciidoc])
645
if test "x$ASCIIDOC" = "x"; then
646
AC_MSG_ERROR([--with-asciidoc=yes specified but asciidoc not found in PATH])
649
elif test "x$use_asciidoc" = x"no" ; then
650
if test "x$ASCIIDOC" != "x"; then
651
AC_MSG_WARN([ignoring ASCIIDOC environment variable since --with-asciidoc=no was specified])
655
AC_MSG_ERROR([--with-asciidoc expects 'yes' or 'no'])
658
[if test "$have_asciidoc" = yes; then
659
# scrape the asciidoc version
660
AC_MSG_CHECKING([the asciidoc version])
661
asciidoc_version=`$ASCIIDOC --version 2>/dev/null | cut -d' ' -f2`
662
AC_MSG_RESULT([$asciidoc_version])
663
AS_VERSION_COMPARE([$asciidoc_version], [$1],
664
[if test "x$use_asciidoc" = xauto; then
665
AC_MSG_WARN([asciidoc version $asciidoc_version found, but $1 needed])
668
AC_MSG_ERROR([asciidoc version $asciidoc_version found, but $1 needed])
671
AM_CONDITIONAL([HAVE_ASCIIDOC], [test "$have_asciidoc" = yes])
672
]) # XORG_WITH_ASCIIDOC
674
# XORG_WITH_DOXYGEN([MIN-VERSION])
675
# --------------------------------
676
# Minimum version: 1.5.0
678
# Documentation tools are not always available on all platforms and sometimes
679
# not at the appropriate level. This macro enables a module to test for the
680
# presence of the tool and obtain it's path in separate variables. Coupled with
681
# the --with-doxygen option, it allows maximum flexibilty in making decisions
682
# as whether or not to use the doxygen package.
684
# Interface to module:
685
# HAVE_DOXYGEN: used in makefiles to conditionally generate documentation
686
# DOXYGEN: returns the path of the doxygen program found
687
# returns the path set by the user in the environment
688
# --with-doxygen: 'yes' user instructs the module to use doxygen
689
# 'no' user instructs the module not to use doxygen
691
# If the user sets the value of DOXYGEN, AC_PATH_PROG skips testing the path.
693
AC_DEFUN([XORG_WITH_DOXYGEN],[
694
AC_ARG_VAR([DOXYGEN], [Path to doxygen command])
696
AS_HELP_STRING([--with-doxygen],
697
[Use doxygen to regenerate documentation (default: yes, if installed)]),
698
[use_doxygen=$withval], [use_doxygen=auto])
700
if test "x$use_doxygen" = x"auto"; then
701
AC_PATH_PROG([DOXYGEN], [doxygen])
702
if test "x$DOXYGEN" = "x"; then
703
AC_MSG_WARN([doxygen not found - documentation targets will be skipped])
708
elif test "x$use_doxygen" = x"yes" ; then
709
AC_PATH_PROG([DOXYGEN], [doxygen])
710
if test "x$DOXYGEN" = "x"; then
711
AC_MSG_ERROR([--with-doxygen=yes specified but doxygen not found in PATH])
714
elif test "x$use_doxygen" = x"no" ; then
715
if test "x$DOXYGEN" != "x"; then
716
AC_MSG_WARN([ignoring DOXYGEN environment variable since --with-doxygen=no was specified])
720
AC_MSG_ERROR([--with-doxygen expects 'yes' or 'no'])
723
[if test "$have_doxygen" = yes; then
724
# scrape the doxygen version
725
AC_MSG_CHECKING([the doxygen version])
726
doxygen_version=`$DOXYGEN --version 2>/dev/null`
727
AC_MSG_RESULT([$doxygen_version])
728
AS_VERSION_COMPARE([$doxygen_version], [$1],
729
[if test "x$use_doxygen" = xauto; then
730
AC_MSG_WARN([doxygen version $doxygen_version found, but $1 needed])
733
AC_MSG_ERROR([doxygen version $doxygen_version found, but $1 needed])
736
AM_CONDITIONAL([HAVE_DOXYGEN], [test "$have_doxygen" = yes])
737
]) # XORG_WITH_DOXYGEN
741
# Minimum version: 1.6.0
743
# Documentation tools are not always available on all platforms and sometimes
744
# not at the appropriate level. This macro enables a module to test for the
745
# presence of the tool and obtain it's path in separate variables. Coupled with
746
# the --with-groff option, it allows maximum flexibilty in making decisions
747
# as whether or not to use the groff package.
749
# Interface to module:
750
# HAVE_GROFF: used in makefiles to conditionally generate documentation
751
# HAVE_GROFF_MM: the memorandum macros (-mm) package
752
# HAVE_GROFF_MS: the -ms macros package
753
# GROFF: returns the path of the groff program found
754
# returns the path set by the user in the environment
755
# --with-groff: 'yes' user instructs the module to use groff
756
# 'no' user instructs the module not to use groff
758
# Added in version 1.9.0:
759
# HAVE_GROFF_HTML: groff has dependencies to output HTML format:
760
# pnmcut pnmcrop pnmtopng pnmtops from the netpbm package.
761
# psselect from the psutils package.
762
# the ghostcript package. Refer to the grohtml man pages
764
# If the user sets the value of GROFF, AC_PATH_PROG skips testing the path.
766
# OS and distros often splits groff in a basic and full package, the former
767
# having the groff program and the later having devices, fonts and macros
768
# Checking for the groff executable is not enough.
770
# If macros are missing, we cannot assume that groff is useless, so we don't
771
# unset HAVE_GROFF or GROFF env variables.
772
# HAVE_GROFF_?? can never be true while HAVE_GROFF is false.
774
AC_DEFUN([XORG_WITH_GROFF],[
775
AC_ARG_VAR([GROFF], [Path to groff command])
777
AS_HELP_STRING([--with-groff],
778
[Use groff to regenerate documentation (default: yes, if installed)]),
779
[use_groff=$withval], [use_groff=auto])
781
if test "x$use_groff" = x"auto"; then
782
AC_PATH_PROG([GROFF], [groff])
783
if test "x$GROFF" = "x"; then
784
AC_MSG_WARN([groff not found - documentation targets will be skipped])
789
elif test "x$use_groff" = x"yes" ; then
790
AC_PATH_PROG([GROFF], [groff])
791
if test "x$GROFF" = "x"; then
792
AC_MSG_ERROR([--with-groff=yes specified but groff not found in PATH])
795
elif test "x$use_groff" = x"no" ; then
796
if test "x$GROFF" != "x"; then
797
AC_MSG_WARN([ignoring GROFF environment variable since --with-groff=no was specified])
801
AC_MSG_ERROR([--with-groff expects 'yes' or 'no'])
804
# We have groff, test for the presence of the macro packages
805
if test "x$have_groff" = x"yes"; then
806
AC_MSG_CHECKING([for ${GROFF} -ms macros])
807
if ${GROFF} -ms -I. /dev/null >/dev/null 2>&1 ; then
812
AC_MSG_RESULT([$groff_ms_works])
813
AC_MSG_CHECKING([for ${GROFF} -mm macros])
814
if ${GROFF} -mm -I. /dev/null >/dev/null 2>&1 ; then
819
AC_MSG_RESULT([$groff_mm_works])
822
# We have groff, test for HTML dependencies, one command per package
823
if test "x$have_groff" = x"yes"; then
824
AC_PATH_PROGS(GS_PATH, [gs gswin32c])
825
AC_PATH_PROG(PNMTOPNG_PATH, [pnmtopng])
826
AC_PATH_PROG(PSSELECT_PATH, [psselect])
827
if test "x$GS_PATH" != "x" -a "x$PNMTOPNG_PATH" != "x" -a "x$PSSELECT_PATH" != "x"; then
831
AC_MSG_WARN([grohtml dependencies not found - HTML Documentation skipped. Refer to grohtml man pages])
835
# Set Automake conditionals for Makefiles
836
AM_CONDITIONAL([HAVE_GROFF], [test "$have_groff" = yes])
837
AM_CONDITIONAL([HAVE_GROFF_MS], [test "$groff_ms_works" = yes])
838
AM_CONDITIONAL([HAVE_GROFF_MM], [test "$groff_mm_works" = yes])
839
AM_CONDITIONAL([HAVE_GROFF_HTML], [test "$have_groff_html" = yes])
844
# Minimum version: 1.6.0
846
# Documentation tools are not always available on all platforms and sometimes
847
# not at the appropriate level. This macro enables a module to test for the
848
# presence of the tool and obtain it's path in separate variables. Coupled with
849
# the --with-fop option, it allows maximum flexibilty in making decisions
850
# as whether or not to use the fop package.
852
# Interface to module:
853
# HAVE_FOP: used in makefiles to conditionally generate documentation
854
# FOP: returns the path of the fop program found
855
# returns the path set by the user in the environment
856
# --with-fop: 'yes' user instructs the module to use fop
857
# 'no' user instructs the module not to use fop
859
# If the user sets the value of FOP, AC_PATH_PROG skips testing the path.
861
AC_DEFUN([XORG_WITH_FOP],[
862
AC_ARG_VAR([FOP], [Path to fop command])
864
AS_HELP_STRING([--with-fop],
865
[Use fop to regenerate documentation (default: yes, if installed)]),
866
[use_fop=$withval], [use_fop=auto])
868
if test "x$use_fop" = x"auto"; then
869
AC_PATH_PROG([FOP], [fop])
870
if test "x$FOP" = "x"; then
871
AC_MSG_WARN([fop not found - documentation targets will be skipped])
876
elif test "x$use_fop" = x"yes" ; then
877
AC_PATH_PROG([FOP], [fop])
878
if test "x$FOP" = "x"; then
879
AC_MSG_ERROR([--with-fop=yes specified but fop not found in PATH])
882
elif test "x$use_fop" = x"no" ; then
883
if test "x$FOP" != "x"; then
884
AC_MSG_WARN([ignoring FOP environment variable since --with-fop=no was specified])
888
AC_MSG_ERROR([--with-fop expects 'yes' or 'no'])
890
AM_CONDITIONAL([HAVE_FOP], [test "$have_fop" = yes])
895
# Minimum version: 1.6.0
897
# Documentation tools are not always available on all platforms and sometimes
898
# not at the appropriate level. This macro enables a module to test for the
899
# presence of the tool and obtain it's path in separate variables. Coupled with
900
# the --with-ps2pdf option, it allows maximum flexibilty in making decisions
901
# as whether or not to use the ps2pdf package.
903
# Interface to module:
904
# HAVE_PS2PDF: used in makefiles to conditionally generate documentation
905
# PS2PDF: returns the path of the ps2pdf program found
906
# returns the path set by the user in the environment
907
# --with-ps2pdf: 'yes' user instructs the module to use ps2pdf
908
# 'no' user instructs the module not to use ps2pdf
910
# If the user sets the value of PS2PDF, AC_PATH_PROG skips testing the path.
912
AC_DEFUN([XORG_WITH_PS2PDF],[
913
AC_ARG_VAR([PS2PDF], [Path to ps2pdf command])
915
AS_HELP_STRING([--with-ps2pdf],
916
[Use ps2pdf to regenerate documentation (default: yes, if installed)]),
917
[use_ps2pdf=$withval], [use_ps2pdf=auto])
919
if test "x$use_ps2pdf" = x"auto"; then
920
AC_PATH_PROG([PS2PDF], [ps2pdf])
921
if test "x$PS2PDF" = "x"; then
922
AC_MSG_WARN([ps2pdf not found - documentation targets will be skipped])
927
elif test "x$use_ps2pdf" = x"yes" ; then
928
AC_PATH_PROG([PS2PDF], [ps2pdf])
929
if test "x$PS2PDF" = "x"; then
930
AC_MSG_ERROR([--with-ps2pdf=yes specified but ps2pdf not found in PATH])
933
elif test "x$use_ps2pdf" = x"no" ; then
934
if test "x$PS2PDF" != "x"; then
935
AC_MSG_WARN([ignoring PS2PDF environment variable since --with-ps2pdf=no was specified])
939
AC_MSG_ERROR([--with-ps2pdf expects 'yes' or 'no'])
941
AM_CONDITIONAL([HAVE_PS2PDF], [test "$have_ps2pdf" = yes])
942
]) # XORG_WITH_PS2PDF
944
# XORG_ENABLE_DOCS (enable_docs=yes)
946
# Minimum version: 1.6.0
948
# Documentation tools are not always available on all platforms and sometimes
949
# not at the appropriate level. This macro enables a builder to skip all
950
# documentation targets except traditional man pages.
951
# Combined with the specific tool checking macros XORG_WITH_*, it provides
952
# maximum flexibilty in controlling documentation building.
954
# XORG_WITH_XMLTO --with-xmlto
955
# XORG_WITH_ASCIIDOC --with-asciidoc
956
# XORG_WITH_DOXYGEN --with-doxygen
957
# XORG_WITH_FOP --with-fop
958
# XORG_WITH_GROFF --with-groff
959
# XORG_WITH_PS2PDF --with-ps2pdf
961
# Interface to module:
962
# ENABLE_DOCS: used in makefiles to conditionally generate documentation
963
# --enable-docs: 'yes' user instructs the module to generate docs
964
# 'no' user instructs the module not to generate docs
965
# parm1: specify the default value, yes or no.
967
AC_DEFUN([XORG_ENABLE_DOCS],[
969
if test "x$default" = x ; then
973
AS_HELP_STRING([--enable-docs],
974
[Enable building the documentation (default: yes)]),
975
[build_docs=$enableval], [build_docs=$default])
976
AM_CONDITIONAL(ENABLE_DOCS, [test x$build_docs = xyes])
977
AC_MSG_CHECKING([whether to build documentation])
978
AC_MSG_RESULT([$build_docs])
979
]) # XORG_ENABLE_DOCS
981
# XORG_ENABLE_DEVEL_DOCS (enable_devel_docs=yes)
983
# Minimum version: 1.6.0
985
# This macro enables a builder to skip all developer documentation.
986
# Combined with the specific tool checking macros XORG_WITH_*, it provides
987
# maximum flexibilty in controlling documentation building.
989
# XORG_WITH_XMLTO --with-xmlto
990
# XORG_WITH_ASCIIDOC --with-asciidoc
991
# XORG_WITH_DOXYGEN --with-doxygen
992
# XORG_WITH_FOP --with-fop
993
# XORG_WITH_GROFF --with-groff
994
# XORG_WITH_PS2PDF --with-ps2pdf
996
# Interface to module:
997
# ENABLE_DEVEL_DOCS: used in makefiles to conditionally generate developer docs
998
# --enable-devel-docs: 'yes' user instructs the module to generate developer docs
999
# 'no' user instructs the module not to generate developer docs
1000
# parm1: specify the default value, yes or no.
1002
AC_DEFUN([XORG_ENABLE_DEVEL_DOCS],[
1004
if test "x$devel_default" = x ; then
1007
AC_ARG_ENABLE(devel-docs,
1008
AS_HELP_STRING([--enable-devel-docs],
1009
[Enable building the developer documentation (default: yes)]),
1010
[build_devel_docs=$enableval], [build_devel_docs=$devel_default])
1011
AM_CONDITIONAL(ENABLE_DEVEL_DOCS, [test x$build_devel_docs = xyes])
1012
AC_MSG_CHECKING([whether to build developer documentation])
1013
AC_MSG_RESULT([$build_devel_docs])
1014
]) # XORG_ENABLE_DEVEL_DOCS
1016
# XORG_ENABLE_SPECS (enable_specs=yes)
1018
# Minimum version: 1.6.0
1020
# This macro enables a builder to skip all functional specification targets.
1021
# Combined with the specific tool checking macros XORG_WITH_*, it provides
1022
# maximum flexibilty in controlling documentation building.
1024
# XORG_WITH_XMLTO --with-xmlto
1025
# XORG_WITH_ASCIIDOC --with-asciidoc
1026
# XORG_WITH_DOXYGEN --with-doxygen
1027
# XORG_WITH_FOP --with-fop
1028
# XORG_WITH_GROFF --with-groff
1029
# XORG_WITH_PS2PDF --with-ps2pdf
1031
# Interface to module:
1032
# ENABLE_SPECS: used in makefiles to conditionally generate specs
1033
# --enable-specs: 'yes' user instructs the module to generate specs
1034
# 'no' user instructs the module not to generate specs
1035
# parm1: specify the default value, yes or no.
1037
AC_DEFUN([XORG_ENABLE_SPECS],[
1039
if test "x$spec_default" = x ; then
1042
AC_ARG_ENABLE(specs,
1043
AS_HELP_STRING([--enable-specs],
1044
[Enable building the specs (default: yes)]),
1045
[build_specs=$enableval], [build_specs=$spec_default])
1046
AM_CONDITIONAL(ENABLE_SPECS, [test x$build_specs = xyes])
1047
AC_MSG_CHECKING([whether to build functional specifications])
1048
AC_MSG_RESULT([$build_specs])
1049
]) # XORG_ENABLE_SPECS
484
1051
# XORG_CHECK_MALLOC_ZERO
485
1052
# ----------------------
486
1053
# Minimum version: 1.0.0
575
1174
# Sets up flags for building lint libraries for checking programs that call
576
1175
# functions in the library.
577
# Disabled by default, enable with --enable-lint-library
579
# @LINTLIB@ - name of lint library file to make
580
# MAKE_LINT_LIB - automake conditional
1177
# Interface to module:
1178
# LINTLIB - Automake variable with the name of lint library file to make
1179
# MAKE_LINT_LIB - Automake conditional
1181
# --enable-lint-library: - 'yes' user instructs the module to created a lint library
1182
# - 'no' user instructs the module not to create a lint library (default)
583
1184
AC_DEFUN([XORG_LINT_LIBRARY],[
584
1185
AC_REQUIRE([XORG_WITH_LINT])
585
# Build lint "library" for more indepth checks of programs calling this library
586
AC_ARG_ENABLE(lint-library, [AC_HELP_STRING([--enable-lint-library],
1186
AC_ARG_ENABLE(lint-library, [AS_HELP_STRING([--enable-lint-library],
587
1187
[Create lint library (default: disabled)])],
588
1188
[make_lint_lib=$enableval], [make_lint_lib=no])
589
if test "x$make_lint_lib" != "xno" ; then
590
if test "x$LINT" = "xno" ; then
591
AC_MSG_ERROR([Cannot make lint library without --with-lint])
593
if test "x$make_lint_lib" = "xyes" ; then
596
LINTLIB=$make_lint_lib
1190
if test "x$make_lint_lib" = x"yes" ; then
1192
if test "x$LINT" = "x"; then
1193
AC_MSG_ERROR([Cannot make lint library without --with-lint])
1195
elif test "x$make_lint_lib" != x"no" ; then
1196
AC_MSG_ERROR([--enable-lint-library expects 'yes' or 'no'.])
599
1199
AC_SUBST(LINTLIB)
600
1200
AM_CONDITIONAL(MAKE_LINT_LIB, [test x$make_lint_lib != xno])
602
1202
]) # XORG_LINT_LIBRARY
604
# Copyright (C) 2002, 2003, 2005, 2006, 2007 Free Software Foundation, Inc.
1206
# Minimum version: 1.2.0
1208
# Defines CWARNFLAGS to enable C compiler warnings.
1210
AC_DEFUN([XORG_CWARNFLAGS], [
1211
AC_REQUIRE([AC_PROG_CC_C99])
1212
if test "x$GCC" = xyes ; then
1213
CWARNFLAGS="-Wall -Wpointer-arith -Wstrict-prototypes -Wmissing-prototypes \
1214
-Wmissing-declarations -Wnested-externs -fno-strict-aliasing \
1215
-Wbad-function-cast -Wformat=2"
1216
case `$CC -dumpversion` in
1218
CWARNFLAGS="$CWARNFLAGS -Wold-style-definition -Wdeclaration-after-statement"
1222
AC_CHECK_DECL([__SUNPRO_C], [SUNCC="yes"], [SUNCC="no"])
1223
if test "x$SUNCC" = "xyes"; then
1227
AC_SUBST(CWARNFLAGS)
1228
]) # XORG_CWARNFLAGS
1230
# XORG_STRICT_OPTION
1231
# -----------------------
1232
# Minimum version: 1.3.0
1234
# Add configure option to enable strict compilation
1235
AC_DEFUN([XORG_STRICT_OPTION], [
1236
# If the module's configure.ac calls AC_PROG_CC later on, CC gets set to C89
1237
AC_REQUIRE([AC_PROG_CC_C99])
1238
AC_REQUIRE([XORG_CWARNFLAGS])
1240
AC_ARG_ENABLE(strict-compilation,
1241
AS_HELP_STRING([--enable-strict-compilation],
1242
[Enable all warnings from compiler and make them errors (default: disabled)]),
1243
[STRICT_COMPILE=$enableval], [STRICT_COMPILE=no])
1244
if test "x$STRICT_COMPILE" = "xyes"; then
1245
AC_CHECK_DECL([__SUNPRO_C], [SUNCC="yes"], [SUNCC="no"])
1246
AC_CHECK_DECL([__INTEL_COMPILER], [INTELCC="yes"], [INTELCC="no"])
1247
if test "x$GCC" = xyes ; then
1248
STRICT_CFLAGS="-pedantic -Werror"
1249
elif test "x$SUNCC" = "xyes"; then
1250
STRICT_CFLAGS="-errwarn"
1251
elif test "x$INTELCC" = "xyes"; then
1252
STRICT_CFLAGS="-Werror"
1255
CWARNFLAGS="$CWARNFLAGS $STRICT_CFLAGS"
1256
AC_SUBST([CWARNFLAGS])
1257
]) # XORG_STRICT_OPTION
1259
# XORG_DEFAULT_OPTIONS
1260
# --------------------
1261
# Minimum version: 1.3.0
1263
# Defines default options for X.Org modules.
1265
AC_DEFUN([XORG_DEFAULT_OPTIONS], [
1266
AC_REQUIRE([AC_PROG_INSTALL])
1269
XORG_RELEASE_VERSION
1272
XORG_MANPAGE_SECTIONS
1273
m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])],
1274
[AC_SUBST([AM_DEFAULT_VERBOSITY], [1])])
1275
]) # XORG_DEFAULT_OPTIONS
1279
# Minimum version: 1.4.0
1281
# Defines the variable INSTALL_CMD as the command to copy
1282
# INSTALL from $prefix/share/util-macros.
1284
AC_DEFUN([XORG_INSTALL], [
1285
AC_REQUIRE([PKG_PROG_PKG_CONFIG])
1286
macros_datadir=`$PKG_CONFIG --print-errors --variable=pkgdatadir xorg-macros`
1287
INSTALL_CMD="(cp -f "$macros_datadir/INSTALL" \$(top_srcdir)/.INSTALL.tmp && \
1288
mv \$(top_srcdir)/.INSTALL.tmp \$(top_srcdir)/INSTALL) \
1289
|| (rm -f \$(top_srcdir)/.INSTALL.tmp; touch \$(top_srcdir)/INSTALL; \
1290
echo 'util-macros \"pkgdatadir\" from xorg-macros.pc not found: installing possibly empty INSTALL.' >&2)"
1291
AC_SUBST([INSTALL_CMD])
1293
dnl Copyright 2005 Red Hat, Inc
1295
dnl Permission to use, copy, modify, distribute, and sell this software and its
1296
dnl documentation for any purpose is hereby granted without fee, provided that
1297
dnl the above copyright notice appear in all copies and that both that
1298
dnl copyright notice and this permission notice appear in supporting
1301
dnl The above copyright notice and this permission notice shall be included
1302
dnl in all copies or substantial portions of the Software.
1304
dnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
1305
dnl OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
1306
dnl MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
1307
dnl IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR
1308
dnl OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
1309
dnl ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
1310
dnl OTHER DEALINGS IN THE SOFTWARE.
1312
dnl Except as contained in this notice, the name of the copyright holders shall
1313
dnl not be used in advertising or otherwise to promote the sale, use or
1314
dnl other dealings in this Software without prior written authorization
1315
dnl from the copyright holders.
1318
# XORG_RELEASE_VERSION
1319
# --------------------
1320
# Defines PACKAGE_VERSION_{MAJOR,MINOR,PATCHLEVEL} for modules to use.
1322
AC_DEFUN([XORG_RELEASE_VERSION],[
1323
AC_DEFINE_UNQUOTED([PACKAGE_VERSION_MAJOR],
1324
[`echo $PACKAGE_VERSION | cut -d . -f 1`],
1325
[Major version of this package])
1326
PVM=`echo $PACKAGE_VERSION | cut -d . -f 2 | cut -d - -f 1`
1327
if test "x$PVM" = "x"; then
1330
AC_DEFINE_UNQUOTED([PACKAGE_VERSION_MINOR],
1332
[Minor version of this package])
1333
PVP=`echo $PACKAGE_VERSION | cut -d . -f 3 | cut -d - -f 1`
1334
if test "x$PVP" = "x"; then
1337
AC_DEFINE_UNQUOTED([PACKAGE_VERSION_PATCHLEVEL],
1339
[Patch version of this package])
1344
# Minimum version: 1.2.0
1346
# Defines the variable CHANGELOG_CMD as the command to generate
1347
# ChangeLog from git.
1350
AC_DEFUN([XORG_CHANGELOG], [
1351
CHANGELOG_CMD="(GIT_DIR=\$(top_srcdir)/.git git log > \$(top_srcdir)/.changelog.tmp && \
1352
mv \$(top_srcdir)/.changelog.tmp \$(top_srcdir)/ChangeLog) \
1353
|| (rm -f \$(top_srcdir)/.changelog.tmp; touch \$(top_srcdir)/ChangeLog; \
1354
echo 'git directory not found: installing possibly empty changelog.' >&2)"
1355
AC_SUBST([CHANGELOG_CMD])
1358
# Copyright (C) 2002, 2003, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
606
1360
# This file is free software; the Free Software Foundation
607
1361
# gives unlimited permission to copy and/or distribute it,
886
1665
# Generate code to set up dependency tracking. -*- Autoconf -*-
888
# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005
1667
# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2008
889
1668
# Free Software Foundation, Inc.
891
1670
# This file is free software; the Free Software Foundation
892
1671
# gives unlimited permission to copy and/or distribute it,
893
1672
# with or without modifications, as long as this notice is preserved.
897
1676
# _AM_OUTPUT_DEPENDENCY_COMMANDS
898
1677
# ------------------------------
899
1678
AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
900
[for mf in $CONFIG_FILES; do
901
# Strip MF so we end up with the name of the file.
902
mf=`echo "$mf" | sed -e 's/:.*$//'`
903
# Check whether this is an Automake generated Makefile or not.
904
# We used to match only the files named `Makefile.in', but
905
# some people rename them; so instead we look at the file content.
906
# Grep'ing the first line is not enough: some people post-process
907
# each Makefile.in and add a new line on top of each file to say so.
908
# Grep'ing the whole file is not good either: AIX grep has a line
909
# limit of 2048, but all sed's we know have understand at least 4000.
910
if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then
911
dirpart=`AS_DIRNAME("$mf")`
915
# Extract the definition of DEPDIR, am__include, and am__quote
916
# from the Makefile without running `make'.
917
DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
918
test -z "$DEPDIR" && continue
919
am__include=`sed -n 's/^am__include = //p' < "$mf"`
920
test -z "am__include" && continue
921
am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
922
# When using ansi2knr, U may be empty or an underscore; expand it
923
U=`sed -n 's/^U = //p' < "$mf"`
924
# Find all dependency output files, they are included files with
925
# $(DEPDIR) in their names. We invoke sed twice because it is the
926
# simplest approach to changing $(DEPDIR) to its actual value in the
928
for file in `sed -n "
929
s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
930
sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
931
# Make sure the directory exists.
932
test -f "$dirpart/$file" && continue
933
fdir=`AS_DIRNAME(["$file"])`
934
AS_MKDIR_P([$dirpart/$fdir])
935
# echo "creating $dirpart/$file"
936
echo '# dummy' > "$dirpart/$file"
1680
# Autoconf 2.62 quotes --file arguments for eval, but not when files
1681
# are listed without --file. Let's play safe and only enable the eval
1682
# if we detect the quoting.
1683
case $CONFIG_FILES in
1684
*\'*) eval set x "$CONFIG_FILES" ;;
1685
*) set x $CONFIG_FILES ;;
1690
# Strip MF so we end up with the name of the file.
1691
mf=`echo "$mf" | sed -e 's/:.*$//'`
1692
# Check whether this is an Automake generated Makefile or not.
1693
# We used to match only the files named `Makefile.in', but
1694
# some people rename them; so instead we look at the file content.
1695
# Grep'ing the first line is not enough: some people post-process
1696
# each Makefile.in and add a new line on top of each file to say so.
1697
# Grep'ing the whole file is not good either: AIX grep has a line
1698
# limit of 2048, but all sed's we know have understand at least 4000.
1699
if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then
1700
dirpart=`AS_DIRNAME("$mf")`
1704
# Extract the definition of DEPDIR, am__include, and am__quote
1705
# from the Makefile without running `make'.
1706
DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
1707
test -z "$DEPDIR" && continue
1708
am__include=`sed -n 's/^am__include = //p' < "$mf"`
1709
test -z "am__include" && continue
1710
am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
1711
# When using ansi2knr, U may be empty or an underscore; expand it
1712
U=`sed -n 's/^U = //p' < "$mf"`
1713
# Find all dependency output files, they are included files with
1714
# $(DEPDIR) in their names. We invoke sed twice because it is the
1715
# simplest approach to changing $(DEPDIR) to its actual value in the
1717
for file in `sed -n "
1718
s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
1719
sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
1720
# Make sure the directory exists.
1721
test -f "$dirpart/$file" && continue
1722
fdir=`AS_DIRNAME(["$file"])`
1723
AS_MKDIR_P([$dirpart/$fdir])
1724
# echo "creating $dirpart/$file"
1725
echo '# dummy' > "$dirpart/$file"
939
1729
])# _AM_OUTPUT_DEPENDENCY_COMMANDS
1489
2364
AC_SUBST([am__untar])
1490
2365
]) # _AM_PROG_TAR
1492
dnl xorg-macros.m4. Generated from xorg-macros.m4.in xorgversion.m4 by configure.
1494
dnl Copyright 2005-2006 Sun Microsystems, Inc. All rights reserved.
1496
dnl Permission is hereby granted, free of charge, to any person obtaining a
1497
dnl copy of this software and associated documentation files (the
1498
dnl "Software"), to deal in the Software without restriction, including
1499
dnl without limitation the rights to use, copy, modify, merge, publish,
1500
dnl distribute, and/or sell copies of the Software, and to permit persons
1501
dnl to whom the Software is furnished to do so, provided that the above
1502
dnl copyright notice(s) and this permission notice appear in all copies of
1503
dnl the Software and that both the above copyright notice(s) and this
1504
dnl permission notice appear in supporting documentation.
1506
dnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
1507
dnl OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
1508
dnl MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
1509
dnl OF THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
1510
dnl HOLDERS INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL
1511
dnl INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING
1512
dnl FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
1513
dnl NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
1514
dnl WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
1516
dnl Except as contained in this notice, the name of a copyright holder
1517
dnl shall not be used in advertising or otherwise to promote the sale, use
1518
dnl or other dealings in this Software without prior written authorization
1519
dnl of the copyright holder.
1521
# XORG_MACROS_VERSION(required-version)
1522
# -------------------------------------
1523
# Minimum version: 1.1.0
1525
# If you're using a macro added in Version 1.1 or newer, include this in
1526
# your configure.ac with the minimum required version, such as:
1527
# XORG_MACROS_VERSION(1.1)
1529
# To ensure that this macro is defined, also add:
1530
# m4_ifndef([XORG_MACROS_VERSION],
1531
# [m4_fatal([must install xorg-macros 1.1 or later before running autoconf/autogen])])
1534
# See the "minimum version" comment for each macro you use to see what
1535
# version you require.
1536
m4_defun([XORG_MACROS_VERSION],[
1537
m4_define([vers_have], [1.2.1])
1538
m4_define([maj_have], m4_substr(vers_have, 0, m4_index(vers_have, [.])))
1539
m4_define([maj_needed], m4_substr([$1], 0, m4_index([$1], [.])))
1540
m4_if(m4_cmp(maj_have, maj_needed), 0,,
1541
[m4_fatal([xorg-macros major version ]maj_needed[ is required but ]vers_have[ found])])
1542
m4_if(m4_version_compare(vers_have, [$1]), -1,
1543
[m4_fatal([xorg-macros version $1 or higher is required but ]vers_have[ found])])
1544
m4_undefine([vers_have])
1545
m4_undefine([maj_have])
1546
m4_undefine([maj_needed])
1547
]) # XORG_MACROS_VERSION
1549
# XORG_PROG_RAWCPP()
1550
# ------------------
1551
# Minimum version: 1.0.0
1553
# Find cpp program and necessary flags for use in pre-processing text files
1554
# such as man pages and config files
1555
AC_DEFUN([XORG_PROG_RAWCPP],[
1556
AC_REQUIRE([AC_PROG_CPP])
1557
AC_PATH_PROGS(RAWCPP, [cpp], [${CPP}],
1558
[$PATH:/bin:/usr/bin:/usr/lib:/usr/libexec:/usr/ccs/lib:/usr/ccs/lbin:/lib])
1560
# Check for flag to avoid builtin definitions - assumes unix is predefined,
1561
# which is not the best choice for supporting other OS'es, but covers most
1562
# of the ones we need for now.
1563
AC_MSG_CHECKING([if $RAWCPP requires -undef])
1564
AC_LANG_CONFTEST([Does cpp redefine unix ?])
1565
if test `${RAWCPP} < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
1568
if test `${RAWCPP} -undef < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
1570
AC_MSG_RESULT([yes])
1571
# under Cygwin unix is still defined even with -undef
1572
elif test `${RAWCPP} -undef -ansi < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
1573
RAWCPPFLAGS="-undef -ansi"
1574
AC_MSG_RESULT([yes, with -ansi])
1576
AC_MSG_ERROR([${RAWCPP} defines unix with or without -undef. I don't know what to do.])
1579
rm -f conftest.$ac_ext
1581
AC_MSG_CHECKING([if $RAWCPP requires -traditional])
1582
AC_LANG_CONFTEST([Does cpp preserve "whitespace"?])
1583
if test `${RAWCPP} < conftest.$ac_ext | grep -c 'preserve \"'` -eq 1 ; then
1586
if test `${RAWCPP} -traditional < conftest.$ac_ext | grep -c 'preserve \"'` -eq 1 ; then
1587
RAWCPPFLAGS="${RAWCPPFLAGS} -traditional"
1588
AC_MSG_RESULT([yes])
1590
AC_MSG_ERROR([${RAWCPP} does not preserve whitespace with or without -traditional. I don't know what to do.])
1593
rm -f conftest.$ac_ext
1594
AC_SUBST(RAWCPPFLAGS)
1595
]) # XORG_PROG_RAWCPP
1597
# XORG_MANPAGE_SECTIONS()
1598
# -----------------------
1599
# Minimum version: 1.0.0
1601
# Determine which sections man pages go in for the different man page types
1602
# on this OS - replaces *ManSuffix settings in old Imake *.cf per-os files.
1603
# Not sure if there's any better way than just hardcoding by OS name.
1604
# Override default settings by setting environment variables
1606
AC_DEFUN([XORG_MANPAGE_SECTIONS],[
1607
AC_REQUIRE([AC_CANONICAL_HOST])
1609
if test x$APP_MAN_SUFFIX = x ; then
1612
if test x$APP_MAN_DIR = x ; then
1613
APP_MAN_DIR='$(mandir)/man$(APP_MAN_SUFFIX)'
1616
if test x$LIB_MAN_SUFFIX = x ; then
1619
if test x$LIB_MAN_DIR = x ; then
1620
LIB_MAN_DIR='$(mandir)/man$(LIB_MAN_SUFFIX)'
1623
if test x$FILE_MAN_SUFFIX = x ; then
1625
solaris*) FILE_MAN_SUFFIX=4 ;;
1626
*) FILE_MAN_SUFFIX=5 ;;
1629
if test x$FILE_MAN_DIR = x ; then
1630
FILE_MAN_DIR='$(mandir)/man$(FILE_MAN_SUFFIX)'
1633
if test x$MISC_MAN_SUFFIX = x ; then
1635
solaris*) MISC_MAN_SUFFIX=5 ;;
1636
*) MISC_MAN_SUFFIX=7 ;;
1639
if test x$MISC_MAN_DIR = x ; then
1640
MISC_MAN_DIR='$(mandir)/man$(MISC_MAN_SUFFIX)'
1643
if test x$DRIVER_MAN_SUFFIX = x ; then
1645
solaris*) DRIVER_MAN_SUFFIX=7 ;;
1646
*) DRIVER_MAN_SUFFIX=4 ;;
1649
if test x$DRIVER_MAN_DIR = x ; then
1650
DRIVER_MAN_DIR='$(mandir)/man$(DRIVER_MAN_SUFFIX)'
1653
if test x$ADMIN_MAN_SUFFIX = x ; then
1655
solaris*) ADMIN_MAN_SUFFIX=1m ;;
1656
*) ADMIN_MAN_SUFFIX=8 ;;
1659
if test x$ADMIN_MAN_DIR = x ; then
1660
ADMIN_MAN_DIR='$(mandir)/man$(ADMIN_MAN_SUFFIX)'
1664
AC_SUBST([APP_MAN_SUFFIX])
1665
AC_SUBST([LIB_MAN_SUFFIX])
1666
AC_SUBST([FILE_MAN_SUFFIX])
1667
AC_SUBST([MISC_MAN_SUFFIX])
1668
AC_SUBST([DRIVER_MAN_SUFFIX])
1669
AC_SUBST([ADMIN_MAN_SUFFIX])
1670
AC_SUBST([APP_MAN_DIR])
1671
AC_SUBST([LIB_MAN_DIR])
1672
AC_SUBST([FILE_MAN_DIR])
1673
AC_SUBST([MISC_MAN_DIR])
1674
AC_SUBST([DRIVER_MAN_DIR])
1675
AC_SUBST([ADMIN_MAN_DIR])
1676
]) # XORG_MANPAGE_SECTIONS
1678
# XORG_CHECK_LINUXDOC
1679
# -------------------
1680
# Minimum version: 1.0.0
1682
# Defines the variable MAKE_TEXT if the necessary tools and
1683
# files are found. $(MAKE_TEXT) blah.sgml will then produce blah.txt.
1684
# Whether or not the necessary tools and files are found can be checked
1685
# with the AM_CONDITIONAL "BUILD_LINUXDOC"
1686
AC_DEFUN([XORG_CHECK_LINUXDOC],[
1687
if test x$XORG_SGML_PATH = x ; then
1688
XORG_SGML_PATH=$prefix/share/sgml
1692
if test x"$cross_compiling" = x"yes" ; then
1695
AC_CHECK_FILE([$XORG_SGML_PATH/X11/defs.ent], [HAVE_DEFS_ENT=yes])
1698
AC_PATH_PROG(LINUXDOC, linuxdoc)
1699
AC_PATH_PROG(PS2PDF, ps2pdf)
1701
AC_MSG_CHECKING([Whether to build documentation])
1703
if test x$HAVE_DEFS_ENT != x && test x$LINUXDOC != x ; then
1709
AM_CONDITIONAL(BUILD_LINUXDOC, [test x$BUILDDOC = xyes])
1711
AC_MSG_RESULT([$BUILDDOC])
1713
AC_MSG_CHECKING([Whether to build pdf documentation])
1715
if test x$PS2PDF != x && test x$BUILD_PDFDOC != xno; then
1721
AM_CONDITIONAL(BUILD_PDFDOC, [test x$BUILDPDFDOC = xyes])
1723
AC_MSG_RESULT([$BUILDPDFDOC])
1725
MAKE_TEXT="SGML_SEARCH_PATH=$XORG_SGML_PATH GROFF_NO_SGR=y $LINUXDOC -B txt"
1726
MAKE_PS="SGML_SEARCH_PATH=$XORG_SGML_PATH $LINUXDOC -B latex --papersize=letter --output=ps"
1728
MAKE_HTML="SGML_SEARCH_PATH=$XORG_SGML_PATH $LINUXDOC -B html --split=0"
1734
]) # XORG_CHECK_LINUXDOC
1736
# XORG_CHECK_DOCBOOK
1737
# -------------------
1738
# Minimum version: 1.0.0
1740
# Checks for the ability to build output formats from SGML DocBook source.
1741
# For XXX in {TXT, PDF, PS, HTML}, the AM_CONDITIONAL "BUILD_XXXDOC"
1742
# indicates whether the necessary tools and files are found and, if set,
1743
# $(MAKE_XXX) blah.sgml will produce blah.xxx.
1744
AC_DEFUN([XORG_CHECK_DOCBOOK],[
1745
if test x$XORG_SGML_PATH = x ; then
1746
XORG_SGML_PATH=$prefix/share/sgml
1754
AC_CHECK_FILE([$XORG_SGML_PATH/X11/defs.ent], [HAVE_DEFS_ENT=yes])
1756
AC_PATH_PROG(DOCBOOKPS, docbook2ps)
1757
AC_PATH_PROG(DOCBOOKPDF, docbook2pdf)
1758
AC_PATH_PROG(DOCBOOKHTML, docbook2html)
1759
AC_PATH_PROG(DOCBOOKTXT, docbook2txt)
1761
AC_MSG_CHECKING([Whether to build text documentation])
1762
if test x$HAVE_DEFS_ENT != x && test x$DOCBOOKTXT != x &&
1763
test x$BUILD_TXTDOC != xno; then
1766
AM_CONDITIONAL(BUILD_TXTDOC, [test x$BUILDTXTDOC = xyes])
1767
AC_MSG_RESULT([$BUILDTXTDOC])
1769
AC_MSG_CHECKING([Whether to build PDF documentation])
1770
if test x$HAVE_DEFS_ENT != x && test x$DOCBOOKPDF != x &&
1771
test x$BUILD_PDFDOC != xno; then
1774
AM_CONDITIONAL(BUILD_PDFDOC, [test x$BUILDPDFDOC = xyes])
1775
AC_MSG_RESULT([$BUILDPDFDOC])
1777
AC_MSG_CHECKING([Whether to build PostScript documentation])
1778
if test x$HAVE_DEFS_ENT != x && test x$DOCBOOKPS != x &&
1779
test x$BUILD_PSDOC != xno; then
1782
AM_CONDITIONAL(BUILD_PSDOC, [test x$BUILDPSDOC = xyes])
1783
AC_MSG_RESULT([$BUILDPSDOC])
1785
AC_MSG_CHECKING([Whether to build HTML documentation])
1786
if test x$HAVE_DEFS_ENT != x && test x$DOCBOOKHTML != x &&
1787
test x$BUILD_HTMLDOC != xno; then
1790
AM_CONDITIONAL(BUILD_HTMLDOC, [test x$BUILDHTMLDOC = xyes])
1791
AC_MSG_RESULT([$BUILDHTMLDOC])
1793
MAKE_TEXT="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKTXT"
1794
MAKE_PS="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKPS"
1795
MAKE_PDF="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKPDF"
1796
MAKE_HTML="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKHTML"
1802
]) # XORG_CHECK_DOCBOOK
1804
# XORG_CHECK_MALLOC_ZERO
1805
# ----------------------
1806
# Minimum version: 1.0.0
1808
# Defines {MALLOC,XMALLOC,XTMALLOC}_ZERO_CFLAGS appropriately if
1809
# malloc(0) returns NULL. Packages should add one of these cflags to
1810
# their AM_CFLAGS (or other appropriate *_CFLAGS) to use them.
1811
AC_DEFUN([XORG_CHECK_MALLOC_ZERO],[
1812
AC_ARG_ENABLE(malloc0returnsnull,
1813
AC_HELP_STRING([--enable-malloc0returnsnull],
1814
[malloc(0) returns NULL (default: auto)]),
1815
[MALLOC_ZERO_RETURNS_NULL=$enableval],
1816
[MALLOC_ZERO_RETURNS_NULL=auto])
1818
AC_MSG_CHECKING([whether malloc(0) returns NULL])
1819
if test "x$MALLOC_ZERO_RETURNS_NULL" = xauto; then
1825
char *m0, *r0, *c0, *p;
1830
exit(m0 == 0 || r0 == 0 || c0 == 0 ? 0 : 1);
1832
[MALLOC_ZERO_RETURNS_NULL=yes],
1833
[MALLOC_ZERO_RETURNS_NULL=no])
1835
AC_MSG_RESULT([$MALLOC_ZERO_RETURNS_NULL])
1837
if test "x$MALLOC_ZERO_RETURNS_NULL" = xyes; then
1838
MALLOC_ZERO_CFLAGS="-DMALLOC_0_RETURNS_NULL"
1839
XMALLOC_ZERO_CFLAGS=$MALLOC_ZERO_CFLAGS
1840
XTMALLOC_ZERO_CFLAGS="$MALLOC_ZERO_CFLAGS -DXTMALLOC_BC"
1842
MALLOC_ZERO_CFLAGS=""
1843
XMALLOC_ZERO_CFLAGS=""
1844
XTMALLOC_ZERO_CFLAGS=""
1847
AC_SUBST([MALLOC_ZERO_CFLAGS])
1848
AC_SUBST([XMALLOC_ZERO_CFLAGS])
1849
AC_SUBST([XTMALLOC_ZERO_CFLAGS])
1850
]) # XORG_CHECK_MALLOC_ZERO
1854
# Minimum version: 1.1.0
1856
# Sets up flags for source checkers such as lint and sparse if --with-lint
1857
# is specified. (Use --with-lint=sparse for sparse.)
1858
# Sets $LINT to name of source checker passed with --with-lint (default: lint)
1859
# Sets $LINT_FLAGS to flags to pass to source checker
1860
# Sets LINT automake conditional if enabled (default: disabled)
1862
AC_DEFUN([XORG_WITH_LINT],[
1864
# Allow checking code with lint, sparse, etc.
1865
AC_ARG_WITH(lint, [AC_HELP_STRING([--with-lint],
1866
[Use a lint-style source code checker (default: disabled)])],
1867
[use_lint=$withval], [use_lint=no])
1868
if test "x$use_lint" = "xyes" ; then
1873
if test "x$LINT_FLAGS" = "x" -a "x$LINT" != "xno" ; then
1878
LINT_FLAGS="-u -b -h -erroff=E_INDISTING_FROM_TRUNC2"
1886
AC_SUBST(LINT_FLAGS)
1887
AM_CONDITIONAL(LINT, [test x$LINT != xno])
1891
# XORG_LINT_LIBRARY(LIBNAME)
1892
# --------------------------
1893
# Minimum version: 1.1.0
1895
# Sets up flags for building lint libraries for checking programs that call
1896
# functions in the library.
1897
# Disabled by default, enable with --enable-lint-library
1899
# @LINTLIB@ - name of lint library file to make
1900
# MAKE_LINT_LIB - automake conditional
1903
AC_DEFUN([XORG_LINT_LIBRARY],[
1904
AC_REQUIRE([XORG_WITH_LINT])
1905
# Build lint "library" for more indepth checks of programs calling this library
1906
AC_ARG_ENABLE(lint-library, [AC_HELP_STRING([--enable-lint-library],
1907
[Create lint library (default: disabled)])],
1908
[make_lint_lib=$enableval], [make_lint_lib=no])
1909
if test "x$make_lint_lib" != "xno" ; then
1910
if test "x$LINT" = "xno" ; then
1911
AC_MSG_ERROR([Cannot make lint library without --with-lint])
1913
if test "x$make_lint_lib" = "xyes" ; then
1916
LINTLIB=$make_lint_lib
1920
AM_CONDITIONAL(MAKE_LINT_LIB, [test x$make_lint_lib != xno])
1922
]) # XORG_LINT_LIBRARY
1926
# Minimum version: 1.2.0
1928
# Defines CWARNFLAGS to enable C compiler warnings.
1930
AC_DEFUN([XORG_CWARNFLAGS], [
1931
AC_REQUIRE([AC_PROG_CC])
1932
if test "x$GCC" = xyes ; then
1933
CWARNFLAGS="-Wall -Wpointer-arith -Wstrict-prototypes -Wmissing-prototypes \
1934
-Wmissing-declarations -Wnested-externs -fno-strict-aliasing \
1935
-Wbad-function-cast"
1936
case `gcc -dumpversion` in
1938
CWARNFLAGS="$CWARNFLAGS -Wold-style-definition -Wdeclaration-after-statement"
1942
AC_CHECK_DECL([__SUNPRO_C], [SUNCC="yes"], [SUNCC="no"])
1943
if test "x$SUNCC" = "xyes"; then
1947
AC_SUBST(CWARNFLAGS)
1948
]) # XORG_CWARNFLAGS
1949
dnl Copyright 2005 Red Hat, Inc
1951
dnl Permission to use, copy, modify, distribute, and sell this software and its
1952
dnl documentation for any purpose is hereby granted without fee, provided that
1953
dnl the above copyright notice appear in all copies and that both that
1954
dnl copyright notice and this permission notice appear in supporting
1957
dnl The above copyright notice and this permission notice shall be included
1958
dnl in all copies or substantial portions of the Software.
1960
dnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
1961
dnl OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
1962
dnl MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
1963
dnl IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR
1964
dnl OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
1965
dnl ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
1966
dnl OTHER DEALINGS IN THE SOFTWARE.
1968
dnl Except as contained in this notice, the name of the copyright holders shall
1969
dnl not be used in advertising or otherwise to promote the sale, use or
1970
dnl other dealings in this Software without prior written authorization
1971
dnl from the copyright holders.
1974
# XORG_RELEASE_VERSION
1975
# --------------------
1976
# Adds --with/without-release-string and changes the PACKAGE and
1977
# PACKAGE_TARNAME to use "$PACKAGE{_TARNAME}-$RELEASE_VERSION". If
1978
# no option is given, PACKAGE and PACKAGE_TARNAME are unchanged. Also
1979
# defines PACKAGE_VERSION_{MAJOR,MINOR,PATCHLEVEL} for modules to use.
1981
AC_DEFUN([XORG_RELEASE_VERSION],[
1982
AC_ARG_WITH(release-version,
1983
AC_HELP_STRING([--with-release-version=STRING],
1984
[Use release version string in package name]),
1985
[RELEASE_VERSION="$withval"],
1986
[RELEASE_VERSION=""])
1987
if test "x$RELEASE_VERSION" != "x"; then
1988
PACKAGE="$PACKAGE-$RELEASE_VERSION"
1989
PACKAGE_TARNAME="$PACKAGE_TARNAME-$RELEASE_VERSION"
1990
AC_MSG_NOTICE([Building with package name set to $PACKAGE])
1992
AC_DEFINE_UNQUOTED([PACKAGE_VERSION_MAJOR],
1993
[`echo $PACKAGE_VERSION | cut -d . -f 1`],
1994
[Major version of this package])
1995
PVM=`echo $PACKAGE_VERSION | cut -d . -f 2 | cut -d - -f 1`
1996
if test "x$PVM" = "x"; then
1999
AC_DEFINE_UNQUOTED([PACKAGE_VERSION_MINOR],
2001
[Minor version of this package])
2002
PVP=`echo $PACKAGE_VERSION | cut -d . -f 3 | cut -d - -f 1`
2003
if test "x$PVP" = "x"; then
2006
AC_DEFINE_UNQUOTED([PACKAGE_VERSION_PATCHLEVEL],
2008
[Patch version of this package])
2013
# Minimum version: 1.2.0
2015
# Defines the variable CHANGELOG_CMD as the command to generate
2016
# ChangeLog from git.
2018
# Arrange that distcleancheck ignores ChangeLog left over by distclean.
2020
AC_DEFUN([XORG_CHANGELOG], [
2021
CHANGELOG_CMD="(GIT_DIR=\$(top_srcdir)/.git git log > .changelog.tmp && \
2022
mv .changelog.tmp ChangeLog) || (rm -f .changelog.tmp; touch ChangeLog; \
2023
echo 'git directory not found: installing possibly empty changelog.' >&2)"
2024
AC_SUBST([CHANGELOG_CMD])
2025
AC_SUBST([distcleancheck_listfiles], ['find . -type f ! -name ChangeLog -print'])