~ubuntu-branches/ubuntu/breezy/xscreensaver/breezy

« back to all changes in this revision

Viewing changes to configure.in

  • Committer: Bazaar Package Importer
  • Author(s): Oliver Grawert
  • Date: 2005-10-11 21:00:42 UTC
  • mfrom: (2.1.1 sarge)
  • Revision ID: james.westby@ubuntu.com-20051011210042-u7q6zslgevdxspr3
Tags: 4.21-4ubuntu17
updated pt_BR again, fixed to UTF-8 

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# configure.in --- xscreensaver, Copyright (c) 1997-2000 Jamie Zawinski.
 
1
# configure.in --- xscreensaver, Copyright (c) 1997-2005 Jamie Zawinski.
2
2
#
3
3
 
 
4
AC_PREREQ(2.52)
4
5
AC_INIT(driver/subprocs.c)
5
6
AC_CONFIG_HEADER(config.h)
6
7
 
23
24
  fi
24
25
done
25
26
 
26
 
 
27
27
###############################################################################
28
28
#
29
29
#       Function to figure out how to run the compiler.
34
34
 [AC_PROG_CC
35
35
 
36
36
  if test -z "$GCC"; then
 
37
    # not using GCC
37
38
    AC_MSG_CHECKING(how to request ANSI compilation)
38
39
    case "$host" in
39
40
      *-hpux* )
44
45
        AC_MSG_RESULT(AIX: adding -qlanglvl=ansi -qhalt=e)
45
46
        CC="$CC -qlanglvl=ansi -qhalt=e"
46
47
      ;;
47
 
 
48
48
      *-dec-* )
49
49
        AC_MSG_RESULT(DEC: adding -std1 -ieee)
50
50
        CC="$CC -std1"
51
51
      ;;
52
 
 
53
52
      *)
54
53
        AC_MSG_RESULT(no idea)
55
54
      ;;
56
55
    esac
 
56
  else
 
57
    # using GCC
 
58
    case "$host" in
 
59
      *-solaris*)
 
60
        AC_MSG_RESULT(Solaris: adding -D__EXTENSIONS__)
 
61
        CC="$CC -D__EXTENSIONS__"
 
62
      ;;
 
63
    esac
57
64
  fi
58
65
 
 
66
  OBJCC="$CC"
 
67
 
59
68
  AC_MSG_CHECKING([whether the compiler works on ANSI C])
60
69
  AC_TRY_RUN([ main(int ac, char **av) { return 0; } ],
61
70
     AC_MSG_RESULT(yes),
65
74
 
66
75
  if test -n "$GCC"; then
67
76
    AC_MSG_RESULT(Turning on gcc compiler warnings.)
68
 
    CC="$CC -Wall -Wstrict-prototypes -Wnested-externs -Wno-format"
 
77
    CC="$CC -pedantic -Wall -Wstrict-prototypes -Wnested-externs"
 
78
    OBJCC="$OBJCC -Wall"
 
79
    # supposedly gcc 3.4 will have "-Wdeclaration-after-statement"
 
80
    # and then perhaps we can do without -pedantic?
69
81
  else
70
82
    case "$host" in
71
83
      *-irix5* |*-irix6.[0-3]* )
92
104
#       gcc.  Old gcc doesn't support -std, and new gcc doesn't support -lang.
93
105
#       so much for compatibility!)
94
106
#
 
107
#       UPDATE: apparently there is NO WAY to tell gcc 3.2.2 to require that
 
108
#       declarations preceed statements, without resorting to "-pedantic".
 
109
#       This means that there is no way to get gcc3 to issue warnings that
 
110
#       ensure that your code complies with the ANSI/ISO C89 standard, without
 
111
#       also drowning in totally useless warnings.  Thank you master may I
 
112
#       have another.
 
113
#
 
114
#       So, I give up, let's just use -pedantic.
 
115
#
95
116
###############################################################################
96
117
 
97
118
AC_DEFUN(AC_GCC_ACCEPTS_STD,
98
119
 [if test -n "$GCC"; then
99
120
   AC_CACHE_CHECK([whether gcc accepts -std],
100
121
     ac_cv_gcc_accepts_std,
101
 
    [if ( gcc -E -std=c89 - </dev/null 2>&1 >/dev/null | \
 
122
    [if ( ( gcc -E -std=c89 - </dev/null >/dev/null ) 2>&1 | \
102
123
          grep unrecognized >/dev/null ); then
103
124
       ac_cv_gcc_accepts_std=no
104
125
     else
142
163
 
143
164
###############################################################################
144
165
#
 
166
#       Function to figure out how to turn off Objective C on MacOS X.
 
167
#       (We have to do this to work around an Apple-specific gcc bug.)
 
168
#
 
169
###############################################################################
 
170
 
 
171
AC_DEFUN(AC_GCC_ACCEPTS_NO_CPP_PRECOMP,
 
172
 [if test -n "$GCC"; then
 
173
   AC_CACHE_CHECK([whether gcc accepts -no-cpp-precomp],
 
174
     ac_cv_gcc_accepts_no_cpp_precomp,
 
175
    [if ( ( gcc -E -no-cpp-precomp - </dev/null >/dev/null ) 2>&1 | \
 
176
          grep unrecognized >/dev/null ); then
 
177
       ac_cv_gcc_accepts_no_cpp_precomp=no
 
178
     else
 
179
       ac_cv_gcc_accepts_no_cpp_precomp=yes
 
180
     fi])
 
181
   ac_gcc_accepts_no_cpp_precomp="$ac_cv_gcc_accepts_no_cpp_precomp"
 
182
  fi
 
183
])
 
184
 
 
185
AC_DEFUN(AC_NO_OBJECTIVE_C,
 
186
 [if test -n "$GCC"; then
 
187
   AC_GCC_ACCEPTS_NO_CPP_PRECOMP
 
188
   if test "$ac_gcc_accepts_no_cpp_precomp" = yes ; then
 
189
     AC_MSG_RESULT(Disabling Objective C extensions in ANSI C code.)
 
190
     CC="$CC -no-cpp-precomp"
 
191
   fi
 
192
  fi
 
193
])
 
194
 
 
195
 
 
196
###############################################################################
 
197
#
145
198
#       Function to figure out how to create directory trees.
146
199
#
147
200
###############################################################################
148
201
 
149
202
AC_DEFUN(AC_PROG_INSTALL_DIRS,
150
 
 [AC_CACHE_CHECK([whether \"\${INSTALL} -d\" creates intermediate directories],
 
203
 [AC_CACHE_CHECK([whether "\${INSTALL} -d" creates intermediate directories],
151
204
    ac_cv_install_d_creates_dirs,
152
205
    [ac_cv_install_d_creates_dirs=no
153
206
     rm -rf conftestdir
154
207
     if mkdir conftestdir; then
155
 
       cd conftestdir >&-
156
 
       ${INSTALL} -d `pwd`/dir1/dir2 >&- 2>&-
 
208
       cd conftestdir 2>/dev/null
 
209
       ${INSTALL} -d `pwd`/dir1/dir2 >/dev/null 2>&1
157
210
       if test -d dir1/dir2/. ; then
158
211
         ac_cv_install_d_creates_dirs=yes
159
212
       fi
160
 
       cd .. >&-
 
213
       cd .. 2>/dev/null
161
214
       rm -rf conftestdir
162
215
     fi
163
216
    ])
164
217
 
165
218
  if test "$ac_cv_install_d_creates_dirs" = no ; then
166
 
    AC_CACHE_CHECK([whether \"mkdir -p\" creates intermediate directories],
 
219
    AC_CACHE_CHECK([whether "mkdir -p" creates intermediate directories],
167
220
      ac_cv_mkdir_p_creates_dirs,
168
221
      [ac_cv_mkdir_p_creates_dirs=no
169
222
       rm -rf conftestdir
170
223
       if mkdir conftestdir; then
171
 
         cd conftestdir >&-
172
 
         mkdir -p dir1/dir2 >&- 2>&-
 
224
         cd conftestdir 2>/dev/null
 
225
         mkdir -p dir1/dir2 >/dev/null 2>&1
173
226
         if test -d dir1/dir2/. ; then
174
227
           ac_cv_mkdir_p_creates_dirs=yes
175
228
         fi
176
 
         cd .. >&-
 
229
         cd .. 2>/dev/null
177
230
         rm -rf conftestdir
178
231
       fi
179
232
      ])
368
421
AC_DEFUN(AC_PATH_X_APP_DEFAULTS_XMKMF,[
369
422
  rm -fr conftestdir
370
423
  if mkdir conftestdir; then
371
 
    cd conftestdir >&-
 
424
    cd conftestdir 2>/dev/null
372
425
    # Make sure to not put "make" in the Imakefile rules, since we grep it out.
373
426
    cat > Imakefile <<'EOF'
374
427
acfindx:
375
428
        @echo 'ac_x_app_defaults="${XAPPLOADDIR}"'
376
429
EOF
377
 
    if (xmkmf) >/dev/null 2>/dev/null && test -f Makefile; then
 
430
    if (xmkmf) >/dev/null 2>&1 && test -f Makefile; then
378
431
      # GNU make sometimes prints "make[1]: Entering...", which'd confuse us.
379
432
      eval `${MAKE-make} acfindx 2>/dev/null | grep -v make`
380
433
    fi
381
 
    cd .. >&-
 
434
    cd .. 2>/dev/null
382
435
    rm -fr conftestdir
383
436
  fi])
384
437
 
585
638
      #
586
639
      if test -f /usr/dt/include/Xm/Xm.h ; then
587
640
        X_CFLAGS="$X_CFLAGS -I/usr/dt/include"
588
 
        X_LIBS="$X_LIBS -L/usr/dt/lib -R:/usr/dt/lib"
 
641
        MOTIF_LIBS="$MOTIF_LIBS -L/usr/dt/lib -R/usr/dt/lib"
589
642
 
590
643
        # Some versions of Slowlaris Motif require -lgen.  But not all.  Why?
591
 
        AC_CHECK_LIB(gen, regcmp, [X_LIBS="$X_LIBS -lgen"])
 
644
        AC_CHECK_LIB(gen, regcmp, [MOTIF_LIBS="$MOTIF_LIBS -lgen"])
 
645
      fi
 
646
 
 
647
    ;;
 
648
    *-darwin*)
 
649
 
 
650
      # On MacOS X (10.x with "fink"), many things are under /sw/.
 
651
      #
 
652
      if test -d /sw/include ; then
 
653
        X_CFLAGS="-I/sw/include $X_CFLAGS"
 
654
        X_LIBS="-L/sw/lib $X_LIBS"
592
655
      fi
593
656
    ;;
594
657
  esac])
609
672
    CPPFLAGS="$CPPFLAGS -I$includedir"
610
673
  fi
611
674
  CPPFLAGS="$CPPFLAGS $X_CFLAGS"
612
 
  AC_CHECK_HEADER([$1], [$2])
 
675
  AC_CHECK_HEADER([$1],[$2],[$3],[$4])
613
676
  CPPFLAGS="$ac_save_CPPFLAGS"])
614
677
 
615
678
# Like AC_EGREP_HEADER, but it uses the already-computed -I directories.
743
806
AC_CANONICAL_HOST
744
807
AC_PROG_CC_ANSI
745
808
AC_NO_CPLUSPLUS_COMMENTS_IN_C_CODE
 
809
AC_NO_OBJECTIVE_C
746
810
AC_PROG_CPP
747
811
AC_C_CONST
748
812
AC_C_INLINE
 
813
AC_EXEEXT
749
814
AC_DEMAND_BC
750
815
 
751
816
# stuff for Makefiles
771
836
AC_HEADER_SYS_WAIT
772
837
AC_HEADER_DIRENT
773
838
AC_GETTIMEOFDAY_ARGS
774
 
AC_CHECK_FUNCS(select fcntl uname nice setpriority getcwd getwd putenv)
775
 
 
 
839
AC_CHECK_FUNCS(select fcntl uname nice setpriority getcwd getwd putenv sbrk)
776
840
AC_CHECK_FUNCS(sigaction syslog realpath setrlimit)
777
841
AC_CHECK_ICMP
778
842
AC_CHECK_ICMPHDR
787
851
AC_PATH_XTRA
788
852
 
789
853
if test "$have_x" != yes; then
790
 
  AC_MSG_ERROR(Couldn't find X11 headers/libs.  Try \`$0 --help'.)
 
854
  AC_MSG_ERROR(Couldn't find X11 headers/libs.  Try `$0 --help'.)
791
855
fi
792
856
 
793
857
AC_PATH_X_APP_DEFAULTS
794
858
AC_X_RANDOM_PATHS
795
859
AC_XPOINTER
796
860
 
 
861
AC_MSG_CHECKING(whether this is MacOS X)
 
862
  ac_macosx=no
 
863
  case "$host" in
 
864
    *-apple-darwin* )
 
865
      ac_macosx=yes
 
866
    ;;
 
867
  esac
 
868
AC_MSG_RESULT($ac_macosx)
 
869
 
 
870
 
 
871
 
 
872
###############################################################################
 
873
#
 
874
#       Gettext support
 
875
#
 
876
###############################################################################
 
877
 
 
878
AC_PROG_INTLTOOL
 
879
GETTEXT_PACKAGE=xscreensaver
 
880
AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE, "$GETTEXT_PACKAGE")
 
881
AC_DEFINE_UNQUOTED(PACKAGE, "$GETTEXT_PACKAGE")
 
882
AC_SUBST(GETTEXT_PACKAGE)
 
883
 
 
884
ALL_LINGUAS="ca da de es et fi fr hu it ja ko nl no pl pt pt_BR ru sk sv vi wa zh_CN zh_TW"
 
885
AM_GLIB_GNU_GETTEXT
 
886
MKINSTALLDIRS="$INSTALL_DIRS"
797
887
 
798
888
 
799
889
###############################################################################
803
893
###############################################################################
804
894
 
805
895
have_xmu=no
806
 
AC_CHECK_X_HEADER(X11/Xmu/Error.h, [have_xmu=yes])
 
896
AC_CHECK_X_HEADER(X11/Xmu/Error.h, [have_xmu=yes],,
 
897
                  [#include <stdlib.h>
 
898
                   #include <stdio.h>
 
899
                   #include <X11/Intrinsic.h>])
807
900
if test "$have_xmu" = no ; then
808
901
  XMU_SRCS='$(UTILS_SRC)/xmu.c'
809
902
  XMU_OBJS='$(UTILS_BIN)/xmu.o'
861
954
 
862
955
###############################################################################
863
956
#
864
 
#       Handle the --enable-subdir option
 
957
#       Handle the --with-hackdir option
865
958
#
866
959
###############################################################################
867
960
 
868
 
AC_ARG_ENABLE(subdir,[
 
961
have_hackdir=yes
 
962
with_hackdir_req=unspecified
 
963
AC_ARG_WITH(hackdir,[
 
964
 
869
965
Installation options:
870
 
 
871
 
  --enable-subdir=DIR     Put the demo programs in a subdirectory of \`bindir',
872
 
                          instead of putting them in bindir itself.  You can
873
 
                          specify the name of the subdirectory.  For example,
874
 
                          \`--exec-prefix=/usr/local --enable-subdir=demos'
875
 
                          would put xscreensaver in /usr/local/bin/, and would
876
 
                          put the demos in /usr/local/bin/demos/.  (If DIR
877
 
                          begins with /, then bindir will not be prepended.)
878
 
 
879
 
  --disable-subdir        Just put the demos in \`bindir' (this is the default.)
880
 
],
881
 
  [enable_subdir="$enableval"],[enable_subdir=no])
882
 
if test x"$enable_subdir" = xno; then
 
966
  --with-hackdir=DIR      Where to install the hundreds of demo executables.
 
967
                          Default: `EPREFIX/lib/xscreensaver/'],
 
968
  [with_hackdir="$withval"; with_hackdir_req="$withval"],[with_hackdir=yes])
 
969
 
 
970
if test x"$with_hackdir" = xyes; then
 
971
  HACKDIR='${libexecdir}/xscreensaver'
 
972
elif test x"$with_hackdir" = xno; then
883
973
  HACKDIR='${bindir}'
884
 
elif test x"$enable_subdir" = xyes -o x"$enable_subdir" = x ; then
885
 
  echo "error: must be a subdirectory name: --enable-subdir=$enable_subdir"
 
974
else
 
975
  HACKDIR=$with_hackdir
 
976
fi
 
977
 
 
978
# canonicalize slashes.
 
979
HACKDIR=`echo "${HACKDIR}" | sed 's@/$@@;s@//*@/@g'`
 
980
 
 
981
# This option used to be called --enable-subdir; make sure that is no longer
 
982
# used, since configure brain-damagedly ignores unknown --enable options.
 
983
 
 
984
obsolete_enable=
 
985
AC_ARG_ENABLE(subdir,,[obsolete_enable=yes])
 
986
if test -n "$obsolete_enable"; then
 
987
  echo "error: the --enable-subdir option has been replaced with"
 
988
  echo "       the new --with-hackdir option; see \`configure --help'"
 
989
  echo "       for more information."
 
990
  exit 1
 
991
fi
 
992
 
 
993
 
 
994
###############################################################################
 
995
#
 
996
#       Handle the --with-configdir option
 
997
#
 
998
###############################################################################
 
999
 
 
1000
have_configdir=yes
 
1001
with_configdir_req=unspecified
 
1002
AC_ARG_WITH(configdir,
 
1003
[  --with-configdir=DIR    Where to install the data files that describe each
 
1004
                          of the display modes to the GUI.
 
1005
                          Default: `PREFIX/share/xscreensaver/config/'
 
1006
],
 
1007
  [with_configdir="$withval"; with_configdir_req="$withval"],
 
1008
  [with_configdir=yes])
 
1009
 
 
1010
if test x"$with_configdir" = xyes; then
 
1011
  HACK_CONF_DIR='${datadir}/xscreensaver/config'
 
1012
elif test x"$with_configdir" = xno; then
 
1013
  echo "error: must be yes, or a pathname: --with-configdir=$with_configdir"
886
1014
  exit 1
887
1015
else
888
1016
  # there must be a better way than this...
889
 
  if test -z "`echo $enable_subdir | sed 's@^/.*@@'`" ; then
 
1017
  if test -z "`echo $with_configdir | sed 's@^/.*@@'`" ; then
890
1018
    # absolute path
891
 
    HACKDIR=$enable_subdir
 
1019
    HACK_CONF_DIR=$with_configdir
892
1020
  else
893
1021
    # relative path
894
 
    HACKDIR='${bindir}/'$enable_subdir
 
1022
    HACK_CONF_DIR="\${exec_prefix}$with_configdir"
895
1023
  fi
896
1024
fi
897
1025
 
898
 
# canonicalize slashes.
899
 
HACKDIR=`echo "${HACKDIR}" | sed 's@/$@@;s@//*@/@g'`
 
1026
 
900
1027
 
901
1028
 
902
1029
###############################################################################
909
1036
with_sgi_req=unspecified
910
1037
AC_ARG_WITH(sgi-ext,
911
1038
[Except where noted, all of the --with options below can also take a
912
 
directory argument: for example, \`--with-motif=/opt/Motif'.  That would
 
1039
directory argument: for example, `--with-motif=/opt/Motif'.  That would
913
1040
cause /opt/Motif/include/ to be added to the -I list, and /opt/Motif/lib/
914
1041
to be added to the -L list, assuming those directories exist.  
915
1042
 
929
1056
if test "$with_sgi" = yes; then
930
1057
  AC_CHECK_X_HEADER(X11/extensions/XScreenSaver.h,
931
1058
                    [have_sgi=yes
932
 
                     AC_DEFINE(HAVE_SGI_SAVER_EXTENSION)])
 
1059
                     AC_DEFINE(HAVE_SGI_SAVER_EXTENSION)],,
 
1060
                    [#include <X11/Xlib.h>])
933
1061
 
934
1062
elif test "$with_sgi" != no; then
935
1063
  echo "error: must be yes or no: --with-sgi-ext=$with_sgi"
939
1067
 
940
1068
###############################################################################
941
1069
#
942
 
#       Check for the MIT-SCREEN-SAVER server extension.
943
 
#
944
 
###############################################################################
945
 
 
946
 
have_mit=no
947
 
with_mit_req=unspecified
948
 
AC_ARG_WITH(mit-ext,
949
 
[  --with-mit-ext          Include support for the MIT-SCREEN-SAVER extension.],
950
 
  [with_mit="$withval"; with_mit_req="$withval"],[with_mit=yes])
951
 
 
952
 
HANDLE_X_PATH_ARG(with_mit, --with-mit-ext, MIT-SCREEN-SAVER)
953
 
 
954
 
if test "$with_mit" = yes; then
955
 
  AC_CHECK_X_HEADER(X11/extensions/scrnsaver.h, [have_mit=yes])
956
 
 
957
 
  # Now check to see if it's really in the library; XF86Free-3.3 ships
958
 
  # scrnsaver.h, but doesn't include the code in libXext.a, the idiots!
959
 
  #
960
 
  if test "$have_mit" = yes; then
961
 
    AC_CHECK_X_LIB(Xext, XScreenSaverRegister, [true], [have_mit=no], -lm)
962
 
 
963
 
    if test "$have_mit" = no; then
964
 
      # Fuck!  Looks like XF86Free-3.3 actually puts it in XExExt instead
965
 
      # of in Xext.  Thank you master, may I have another.
966
 
      AC_CHECK_X_LIB(XExExt, XScreenSaverRegister,
967
 
                     [have_mit=yes; SAVER_LIBS="$SAVER_LIBS -lXExExt"],
968
 
                     [true], -lX11 -lXext -lm)
969
 
    fi
970
 
 
971
 
    if test "$have_mit" = no; then
972
 
      # Double fuck!  Looks like some versions of XFree86 (whichever version
973
 
      # it is that comes with RedHat Linux 2.0 -- I can't find a version 
974
 
      # number) put this garbage in Xss instead of Xext.  Thank you master,
975
 
      #  may I have another.
976
 
      AC_CHECK_X_LIB(Xss, XScreenSaverRegister,
977
 
                     [have_mit=yes; SAVER_LIBS="$SAVER_LIBS -lXss"],
978
 
                     [true], -lX11 -lXext -lm)
979
 
    fi
980
 
 
981
 
  if test "$have_mit" = yes; then
982
 
    AC_DEFINE(HAVE_MIT_SAVER_EXTENSION)
983
 
  fi
984
 
 
985
 
  fi
986
 
 
987
 
elif test "$with_mit" != no; then
988
 
  echo "error: must be yes or no: --with-mit-ext=$with_mit"
989
 
  exit 1
990
 
fi
991
 
 
992
 
 
993
 
###############################################################################
994
 
#
995
1070
#       Check for the XIDLE server extension.
996
1071
#
997
1072
###############################################################################
1007
1082
if test "$with_xidle" = yes; then
1008
1083
  AC_CHECK_X_HEADER(X11/extensions/xidle.h,
1009
1084
                    [have_xidle=yes
1010
 
                     AC_DEFINE(HAVE_XIDLE_EXTENSION)])
 
1085
                     AC_DEFINE(HAVE_XIDLE_EXTENSION)],,
 
1086
                    [#include <X11/Xlib.h>])
1011
1087
elif test "$with_xidle" != no; then
1012
1088
  echo "error: must be yes or no: --with-xidle-ext=$with_xidle"
1013
1089
  exit 1
1031
1107
if test "$with_sgivc" = yes; then
1032
1108
 
1033
1109
  # first check for XSGIvc.h
1034
 
  AC_CHECK_X_HEADER(X11/extensions/XSGIvc.h, [have_sgivc=yes])
 
1110
  AC_CHECK_X_HEADER(X11/extensions/XSGIvc.h, [have_sgivc=yes],,
 
1111
                    [#include <X11/Xlib.h>])
1035
1112
 
1036
1113
  # if that succeeded, then check for the -lXsgivc
1037
1114
  if test "$have_sgivc" = yes; then
1069
1146
if test "$with_dpms" = yes; then
1070
1147
 
1071
1148
  # first check for dpms.h
1072
 
  AC_CHECK_X_HEADER(X11/extensions/dpms.h, [have_dpms=yes])
 
1149
  AC_CHECK_X_HEADER(X11/extensions/dpms.h, [have_dpms=yes],,
 
1150
                    [#include <X11/Xlib.h>
 
1151
                     #include <X11/Xmd.h>])
1073
1152
 
1074
1153
  # if that succeeded, then check for the DPMS code in the libraries
1075
1154
  if test "$have_dpms" = yes; then
1100
1179
 
1101
1180
###############################################################################
1102
1181
#
 
1182
#       Check for the XINERAMA server extension.
 
1183
#
 
1184
###############################################################################
 
1185
 
 
1186
have_xinerama=no
 
1187
with_xinerama_req=unspecified
 
1188
AC_ARG_WITH(xinerama-ext,
 
1189
[  --with-xinerama-ext     Include support for the XINERAMA extension.],
 
1190
  [with_xinerama="$withval"; with_xinerama_req="$withval"],[with_xinerama=yes])
 
1191
 
 
1192
HANDLE_X_PATH_ARG(with_xinerama, --with-xinerama-ext, XINERAMA)
 
1193
 
 
1194
if test "$with_xinerama" = yes; then
 
1195
 
 
1196
  # first check for Xinerama.h
 
1197
  AC_CHECK_X_HEADER(X11/extensions/Xinerama.h, [have_xinerama=yes],,
 
1198
                    [#include <X11/Xlib.h>])
 
1199
 
 
1200
  # if that succeeded, then check for the XINERAMA code in the libraries
 
1201
  if test "$have_xinerama" = yes; then
 
1202
 
 
1203
    # first look in -lXext
 
1204
    have_xinerama=no
 
1205
    AC_CHECK_X_LIB(Xext, XineramaQueryScreens, [have_xinerama=yes], [true],
 
1206
                  -lXext -lX11)
 
1207
 
 
1208
    # if that failed, look in -lXinerama (this is where it is in XFree86 4.1.)
 
1209
    if test "$have_xinerama" = no; then
 
1210
      AC_CHECK_X_LIB(Xinerama, XineramaQueryScreens,
 
1211
                     [have_xinerama=yes; XINERAMA_LIBS="-lXinerama"],
 
1212
                     [true], -lXext -lX11)
 
1213
    fi
 
1214
  fi
 
1215
 
 
1216
  # if that succeeded, then we've really got it.
 
1217
  if test "$have_xinerama" = yes; then
 
1218
    AC_DEFINE(HAVE_XINERAMA)
 
1219
  fi
 
1220
 
 
1221
elif test "$with_xinerama" != no; then
 
1222
  echo "error: must be yes or no: --with-xinerama-ext=$with_xinerama"
 
1223
  exit 1
 
1224
fi
 
1225
 
 
1226
 
 
1227
###############################################################################
 
1228
#
1103
1229
#       Check for the XF86VMODE server extension (for virtual screens.)
1104
1230
#
1105
1231
###############################################################################
1113
1239
 
1114
1240
HANDLE_X_PATH_ARG(with_xf86vmode, --with-xf86vmode-ext, xf86vmode)
1115
1241
 
 
1242
VIDMODE_LIBS=""
 
1243
 
1116
1244
if test "$with_xf86vmode" = yes; then
1117
1245
 
1118
1246
  # first check for xf86vmode.h
1119
 
  AC_CHECK_X_HEADER(X11/extensions/xf86vmode.h, [have_xf86vmode=yes])
 
1247
  AC_CHECK_X_HEADER(X11/extensions/xf86vmode.h, [have_xf86vmode=yes],,
 
1248
                    [#include <X11/Xlib.h>])
1120
1249
 
1121
1250
  # if that succeeded, then check for the -lXxf86vm
1122
1251
  if test "$have_xf86vmode" = yes; then
1123
1252
    have_xf86vmode=no
1124
1253
    AC_CHECK_X_LIB(Xxf86vm, XF86VidModeGetViewPort,
1125
 
                  [have_xf86vmode=yes; SAVER_LIBS="$SAVER_LIBS -lXxf86vm"],
 
1254
                  [have_xf86vmode=yes;
 
1255
                   VIDMODE_LIBS="-lXxf86vm";
 
1256
                   SAVER_LIBS="$SAVER_LIBS $VIDMODE_LIBS"],
1126
1257
                   [true], -lXext -lX11)
1127
1258
  fi
1128
1259
 
1159
1290
  if test "$have_xf86vmode" = yes; then
1160
1291
    have_xf86gamma=yes
1161
1292
  else
1162
 
    AC_CHECK_X_HEADER(X11/extensions/xf86vmode.h, [have_xf86gamma=yes])
 
1293
    AC_CHECK_X_HEADER(X11/extensions/xf86vmode.h, [have_xf86gamma=yes],,
 
1294
                      [#include <X11/Xlib.h>])
1163
1295
  fi
1164
1296
 
1165
1297
  # if that succeeded, then check for the -lXxf86vm
1200
1332
 
1201
1333
###############################################################################
1202
1334
#
 
1335
#       Check for the RANDR (Resize and Rotate) server extension.
 
1336
#
 
1337
#       We need this to detect when the resolution of the desktop
 
1338
#       has changed out from under us (this is a newer, different
 
1339
#       mechanism than the XF86VMODE virtual viewports.)
 
1340
#
 
1341
###############################################################################
 
1342
 
 
1343
have_randr=no
 
1344
with_randr_req=unspecified
 
1345
AC_ARG_WITH(randr-ext,
 
1346
[  --with-randr-ext        Include support for the X Resize+Rotate extension.],
 
1347
  [with_randr="$withval"; with_randr_req="$withval"],[with_randr=yes])
 
1348
 
 
1349
HANDLE_X_PATH_ARG(with_randr, --with-randr-ext, RANDR)
 
1350
 
 
1351
if test "$with_randr" = yes; then
 
1352
 
 
1353
  # first check for Randr.h
 
1354
  AC_CHECK_X_HEADER(X11/extensions/Xrandr.h, [have_randr=yes],,
 
1355
                    [#include <X11/Xlib.h>])
 
1356
 
 
1357
  # if that succeeded, then check for the XRR code in the libraries
 
1358
  if test "$have_randr" = yes; then
 
1359
 
 
1360
    # RANDR probably needs -lXrender
 
1361
    xrender_libs=
 
1362
    AC_CHECK_X_LIB(Xrender, XRenderSetSubpixelOrder,
 
1363
                   [xrender_libs="-lXrender"], [true], -lXext -lX11)
 
1364
 
 
1365
    # first look for RANDR in -lXext
 
1366
    have_randr=no
 
1367
    AC_CHECK_X_LIB(Xext, XRRGetScreenInfo,
 
1368
                   [have_randr=yes; SAVER_LIBS="$SAVER_LIBS $xrender_libs"],
 
1369
                   [true], $xrender_libs -lXext -lX11)
 
1370
 
 
1371
    # if that failed, look in -lXrandr
 
1372
    if test "$have_randr" = no; then
 
1373
      AC_CHECK_X_LIB(Xrandr, XRRGetScreenInfo,
 
1374
             [have_randr=yes; SAVER_LIBS="$SAVER_LIBS -lXrandr $xrender_libs"],
 
1375
                     [true], $xrender_libs -lXext -lX11)
 
1376
    fi
 
1377
  fi
 
1378
 
 
1379
  # if that succeeded, then we've really got it.
 
1380
  if test "$have_randr" = yes; then
 
1381
    AC_DEFINE(HAVE_RANDR)
 
1382
  fi
 
1383
 
 
1384
elif test "$with_randr" != no; then
 
1385
  echo "error: must be yes or no: --with-randr-ext=$with_randr"
 
1386
  exit 1
 
1387
fi
 
1388
 
 
1389
 
 
1390
###############################################################################
 
1391
#
 
1392
#       Check for XF86MiscSetGrabKeysState (but only bother if we are already
 
1393
#       using other XF86 stuff.)
 
1394
#
 
1395
###############################################################################
 
1396
 
 
1397
have_xf86miscsetgrabkeysstate=no
 
1398
if test "$have_xf86gamma" = yes -o "$have_xf86vmode" = yes; then
 
1399
  AC_CHECK_X_LIB(Xxf86misc, XF86MiscSetGrabKeysState,
 
1400
                [have_xf86miscsetgrabkeysstate=yes],
 
1401
                [true], -lXext -lX11)
 
1402
  if test "$have_xf86miscsetgrabkeysstate" = yes ; then
 
1403
    SAVER_LIBS="$SAVER_LIBS -lXxf86misc"
 
1404
    AC_DEFINE(HAVE_XF86MISCSETGRABKEYSSTATE)
 
1405
  fi
 
1406
fi
 
1407
 
 
1408
 
 
1409
###############################################################################
 
1410
#
1203
1411
#       Check for HP XHPDisableReset and XHPEnableReset.
1204
1412
#
1205
1413
###############################################################################
1206
1414
 
 
1415
AC_MSG_CHECKING([for XHPDisableReset in X11/XHPlib.h])
1207
1416
AC_EGREP_X_HEADER(XHPDisableReset, X11/XHPlib.h,
1208
1417
                  [AC_DEFINE(HAVE_XHPDISABLERESET)
1209
 
                   SAVER_LIBS="-lXhp11 $SAVER_LIBS"])
 
1418
                   SAVER_LIBS="-lXhp11 $SAVER_LIBS"
 
1419
                   AC_MSG_RESULT(yes)],
 
1420
                  [AC_MSG_RESULT(no)])
1210
1421
 
1211
1422
 
1212
1423
###############################################################################
1228
1439
   AC_CACHE_CHECK([whether /proc/interrupts contains keyboard data],
1229
1440
    ac_cv_have_proc_interrupts,
1230
1441
    [ac_cv_have_proc_interrupts=no
1231
 
     if grep keyboard /proc/interrupts >/dev/null 2>&1 ; then
 
1442
     if grep 'keyboard\|i8042' /proc/interrupts >/dev/null 2>&1 ; then
1232
1443
       ac_cv_have_proc_interrupts=yes
1233
1444
     fi
1234
1445
    ])
1250
1461
#
1251
1462
###############################################################################
1252
1463
 
1253
 
AC_ARG_ENABLE(locking,[
1254
 
Screen locking options:
1255
 
 
 
1464
AC_ARG_ENABLE(locking,[Screen locking options:
1256
1465
  --enable-locking        Compile in support for locking the display.
1257
 
  --disable-locking       Do not allow locking at all.
1258
 
],
 
1466
  --disable-locking       Do not allow locking at all.],
1259
1467
  [enable_locking="$enableval"],[enable_locking=yes])
1260
1468
if test "$enable_locking" = yes; then
1261
1469
  true
1266
1474
  exit 1
1267
1475
fi
1268
1476
 
 
1477
# We can't lock on MacOS X, so don't even bother compiling in support for it.
 
1478
#
 
1479
if test "$ac_macosx" = yes; then
 
1480
  if test "$enable_locking" = yes; then
 
1481
    AC_MSG_RESULT(locking disabled: it doesn't work on MacOS X)
 
1482
    enable_locking=no
 
1483
    AC_DEFINE(NO_LOCKING)
 
1484
  fi
 
1485
fi
1269
1486
 
1270
1487
 
1271
1488
###############################################################################
1308
1525
#fi
1309
1526
 
1310
1527
 
1311
 
 
1312
1528
###############################################################################
1313
1529
#
1314
1530
#       Check for PAM.
1350
1566
    # those are in libc.  On Linux and Solaris, they're in libdl.
1351
1567
    AC_CHECK_LIB(dl, dlopen, [PASSWD_LIBS="${PASSWD_LIBS} -ldl"])
1352
1568
 
 
1569
    # On Linux, sigtimedwait() is in libc; on Solaris, it's in librt.
 
1570
    have_timedwait=no
 
1571
    AC_CHECK_LIB(c, sigtimedwait, [have_timedwait=yes])
 
1572
    if test "$have_timedwait" = no ; then
 
1573
      AC_CHECK_LIB(rt, sigtimedwait, [PASSWD_LIBS="${PASSWD_LIBS} -lrt"])
 
1574
    fi
 
1575
 
1353
1576
    AC_MSG_CHECKING(how to call pam_strerror)
1354
1577
    AC_CACHE_VAL(ac_cv_pam_strerror_args,
1355
1578
     [AC_TRY_COMPILE([#include <stdio.h>
1411
1634
  fi
1412
1635
 
1413
1636
  if test "$ac_cv_kerberos5" = yes ; then
1414
 
    have_kerberos=yes
1415
 
    have_kerberos5=yes
1416
 
    AC_DEFINE(HAVE_KERBEROS)
1417
 
    AC_DEFINE(HAVE_KERBEROS5)
 
1637
 
 
1638
    # Andrew Snare <ajs@pigpond.com> wrote:
 
1639
    #
 
1640
    # You were assuming that if kerberosV (krb5) was found, then kerberosIV
 
1641
    # (krb4) was also available.  This turns out not to be the case with
 
1642
    # mit-krb-1.2.7; apparently backwards-compatibility with KerberosIV
 
1643
    # is optional.
 
1644
    #
 
1645
    # So, disable kerberosV support if libkrb4 can't be found.
 
1646
    # This is not the best solution, but it makes the compile not fail.
 
1647
    #
 
1648
    AC_CHECK_X_LIB(krb4, krb_get_tf_realm,
 
1649
                   [have_kerberos=yes],
 
1650
                   [have_kerberos=no])
 
1651
    if test "$have_kerberos" = yes ; then
 
1652
      have_kerberos5=yes
 
1653
      AC_DEFINE(HAVE_KERBEROS)
 
1654
      AC_DEFINE(HAVE_KERBEROS5)
 
1655
    else
 
1656
      have_kerberos5=no
 
1657
      AC_MSG_WARN([Cannot find compat lib (libkrb4) needed to use Kerberos 5])
 
1658
    fi
 
1659
 
1418
1660
  fi
1419
1661
 
1420
1662
  if test "$have_kerberos5" = yes ; then
1421
1663
    # from Matt Knopp <mhat@infocalypse.netlag.com>
1422
1664
    # (who got it from amu@mit.edu)
1423
 
    PASSWD_LIBS="$PASSWD_LIBS -lkrb4 -ldes425 -lkrb5 -lk5crypto -lcrypt -lcom_err"
 
1665
 
 
1666
    PASSWD_LIBS="$PASSWD_LIBS -lkrb4 -ldes425 -lkrb5 -lk5crypto -lcom_err"
 
1667
 
 
1668
    # jwz: MacOS X uses -lkrb5, but not -lcrypt
 
1669
    AC_CHECK_X_LIB(crypt, crypt, [PASSWD_LIBS="$PASSWD_LIBS -lcrypt"])
 
1670
 
1424
1671
  elif test "$have_kerberos" = yes ; then
1425
 
    # from Tim Showalter <tjs+@andrew.cmu.edu>
1426
 
    PASSWD_LIBS="$PASSWD_LIBS -lkrb -ldes"
 
1672
    # from Tim Showalter <tjs@psaux.com> for FreeBSD 4.2
 
1673
    PASSWD_LIBS="$PASSWD_LIBS -lkrb -ldes -lcom_err"
1427
1674
  fi
1428
1675
 
1429
1676
  if test "$have_kerberos" = yes ; then
1653
1900
 
1654
1901
###############################################################################
1655
1902
#
1656
 
#       Check for -lXm.
1657
 
#
1658
 
###############################################################################
1659
 
 
1660
 
have_motif=no
1661
 
with_motif_req=unspecified
1662
 
AC_ARG_WITH(motif,[
1663
 
User interface options:
1664
 
 
1665
 
  --with-motif            Use the Motif toolkit for the user interface.],
1666
 
  [with_motif="$withval"; with_motif_req="$withval"],[with_motif=yes])
1667
 
 
1668
 
HANDLE_X_PATH_ARG(with_motif, --with-motif, Motif)
1669
 
 
1670
 
if test "$with_motif" != yes -a "$with_motif" != no ; then
1671
 
  echo "error: must be yes or no: --with-motif=$with_motif"
1672
 
  exit 1
1673
 
fi
1674
 
 
1675
 
if test "$with_motif" = yes; then
1676
 
  have_motif=no
1677
 
  AC_CHECK_X_HEADER(Xm/Xm.h,
1678
 
                    [have_motif=yes
1679
 
                     AC_DEFINE(HAVE_MOTIF)
1680
 
                     MOTIF_LIBS="$MOTIF_LIBS -lXm"])
1681
 
fi
1682
 
 
1683
 
 
1684
 
if test "$have_motif" = yes; then
1685
 
  AC_CHECK_X_HEADER(Xm/ComboBox.h, [AC_DEFINE(HAVE_XMCOMBOBOX)])
1686
 
fi
 
1903
#       Check for external password helper
 
1904
#       On SuSE, instead of having xscreensaver be a setuid program, they
 
1905
#       fork an external program that takes the password on stdin, and
 
1906
#       returns true if that password is a valid one.  Then only that
 
1907
#       smaller program needs to be setuid.
 
1908
#
 
1909
#       (Note that this external program is not a GUI: the GUI is still
 
1910
#       all in xscreensaver itself; the external program just does auth.)
 
1911
#
 
1912
###############################################################################
 
1913
 
 
1914
have_passwd_helper=no
 
1915
with_passwd_helper_req=unspecified
 
1916
 
 
1917
AC_ARG_WITH(passwd-helper,
 
1918
[  --with-passwd-helper    Include support for an external password
 
1919
                          verification helper program.],
 
1920
  [with_passwd_helper="$withval"; with_passwd_helper_req="$withval"],[with_passwd_helper=no])
 
1921
# no HANDLE_X_PATH_ARG for this one
 
1922
 
 
1923
if test "$enable_locking" = no ; then
 
1924
  with_passwd_helper_req=no
 
1925
  with_passwd_helper=no
 
1926
fi
 
1927
 
 
1928
case "$with_passwd_helper" in
 
1929
  ""|no) : ;;
 
1930
  /*)
 
1931
    AC_DEFINE_UNQUOTED(PASSWD_HELPER_PROGRAM, "$with_passwd_helper")
 
1932
    have_passwd_helper=yes;;
 
1933
  *)
 
1934
    echo "error: --with-passwd-helper needs full pathname of helper (not '$with_passwd_helper')." >&2
 
1935
    exit 1
 
1936
esac
 
1937
 
 
1938
 
 
1939
###############################################################################
 
1940
#
 
1941
#       Check for a login manager for a "New Login" button on the lock dialog.
 
1942
#       Usually this will be "/usr/bin/gdmflexiserver".
 
1943
#
 
1944
###############################################################################
 
1945
 
 
1946
have_login_manager=no
 
1947
with_login_manager_req=unspecified
 
1948
default_login_manager='gdmflexiserver -sl'
 
1949
 
 
1950
AC_ARG_WITH(login-manager,
 
1951
[  --with-login-manager    Put a "New Login" button on the unlock dialog that
 
1952
                          runs a login manager such as gdmflexiserver.],
 
1953
  [with_login_manager="$withval"; with_login_manager_req="$withval"],
 
1954
  [with_login_manager=no])
 
1955
# no HANDLE_X_PATH_ARG for this one
 
1956
 
 
1957
if test "$enable_locking" = no ; then
 
1958
  with_login_manager_req=no
 
1959
  with_login_manager=no
 
1960
fi
 
1961
 
 
1962
if test -n "$with_login_manager_req" ; then
 
1963
  ac_cv_login_manager_program=""
 
1964
 
 
1965
 if test "$with_login_manager_req" = "yes" ; then
 
1966
   with_login_manager=$default_login_manager
 
1967
 fi
 
1968
 
 
1969
#  case "$with_login_manager_req" in
 
1970
#    /*)
 
1971
#      # absolute path
 
1972
#      set dummy $with_login_manager_req ; login_manager_tmp=$2
 
1973
#      AC_MSG_CHECKING([for $login_manager_tmp])
 
1974
#      if test -x "$login_manager_tmp" ; then
 
1975
#        AC_MSG_RESULT(yes)
 
1976
#        with_login_manager="$login_manager_tmp"
 
1977
#      else
 
1978
#        AC_MSG_RESULT(no)
 
1979
#        with_login_manager=""
 
1980
#      fi
 
1981
#    ;;
 
1982
#    *)
 
1983
#      # relative path
 
1984
#      set dummy $with_login_manager_req ; login_manager_tmp=$2
 
1985
#      # don't cache
 
1986
#      unset ac_cv_path_login_manager_tmp
 
1987
#      AC_PATH_PROG(login_manager_tmp, $login_manager_tmp, [])
 
1988
#      if test -z "$login_manager_tmp" ; then
 
1989
#        with_login_manager=""
 
1990
#      else
 
1991
#        with_login_manager="$login_manager_tmp"
 
1992
#      fi
 
1993
#    ;;
 
1994
#  esac
 
1995
  ac_cv_login_manager_program="$with_login_manager"
 
1996
 
 
1997
elif test -n "$ac_cv_login_manager_program"; then
 
1998
  AC_MSG_RESULT([checking for login_manager... (cached) $ac_cv_login_manager_program])
 
1999
fi
 
2000
 
 
2001
NEW_LOGIN_COMMAND_P=''
 
2002
NEW_LOGIN_COMMAND="$ac_cv_login_manager_program"
 
2003
 
 
2004
if test -z "$NEW_LOGIN_COMMAND" ; then
 
2005
  NEW_LOGIN_COMMAND="$default_login_manager"
 
2006
  NEW_LOGIN_COMMAND_P='! '
 
2007
fi
 
2008
 
1687
2009
 
1688
2010
 
1689
2011
###############################################################################
1694
2016
 
1695
2017
have_gtk=no
1696
2018
with_gtk_req=unspecified
1697
 
AC_ARG_WITH(gtk,
1698
 
[  --with-gtk              Use the Gtk toolkit for the user interface.],
 
2019
AC_ARG_WITH(gtk,[
 
2020
User interface options:
 
2021
 
 
2022
  --with-gtk              Use the Gtk toolkit for the user interface.],
1699
2023
  [with_gtk="$withval"; with_gtk_req="$withval"],[with_gtk=yes])
1700
2024
 
1701
2025
# if --with-gtk=/directory/ was specified, remember that directory so that
1716
2040
  exit 1
1717
2041
fi
1718
2042
 
1719
 
have_gnome=no
1720
 
with_gnome_req=unspecified
1721
 
AC_ARG_WITH(gnome,
1722
 
[  --with-gnome            Include support for the Gnome Control Center.],
1723
 
  [with_gnome="$withval"; with_gnome_req="$withval"],[with_gnome=yes])
1724
 
 
1725
 
# if --with-gnome=/directory/ was specified, remember that directory so that
1726
 
# we can also look for the `gnome-config' program in that directory.
1727
 
case "$with_gnome" in
1728
 
  /*)
1729
 
    gnome_dir="$with_gnome"
1730
 
    ;;
1731
 
  *)
1732
 
    gnome_dir=""
1733
 
    ;;
1734
 
esac
1735
 
 
1736
 
HANDLE_X_PATH_ARG(with_gnome, --with-gnome, Gnome)
1737
 
 
1738
 
if test "$with_gnome" != yes -a "$with_gnome" != no ; then
1739
 
  echo "error: must be yes or no: --with-gnome=$with_gnome"
1740
 
  exit 1
1741
 
fi
 
2043
 
 
2044
parse_gtk_version_string() {
 
2045
  # M4 sucks!!
 
2046
  changequote(X,Y)
 
2047
  maj=`echo $ac_gtk_version_string | sed -n 's/\..*//p'`
 
2048
  min=`echo $ac_gtk_version_string | sed -n 's/[^.]*\.\([^.]*\).*/\1/p'`
 
2049
  changequote([,])
 
2050
  ac_gtk_version=`echo "$maj * 1000 + $min" | bc`
 
2051
  if test -z "$ac_gtk_version"; then
 
2052
    ac_gtk_version=unknown
 
2053
    ac_gtk_version_string=unknown
 
2054
  fi
 
2055
}
 
2056
 
 
2057
# Find pkg-config... (need this for both gtk and gdk_pixbuf.)
 
2058
# if the user specified --with-gtk=/foo/ then look there.
 
2059
#
 
2060
gtk_path="$PATH"
 
2061
if test ! -z "$gtk_dir"; then
 
2062
  # canonicalize slashes.
 
2063
  foo=`echo "${gtk_dir}/bin" | sed 's@//*@/@g'`
 
2064
  gtk_path="$foo:$gtk_path"
 
2065
fi
 
2066
 
 
2067
AC_PATH_PROGS(pkg_config, pkg-config,, $gtk_path)
 
2068
 
 
2069
if test -z "$pkg_config" ; then
 
2070
  AC_MSG_WARN([pkg-config not found!])
 
2071
  pkg_config="false"
 
2072
fi
 
2073
 
 
2074
 
 
2075
# Utility function for running pkg-config-based tests...
 
2076
#
 
2077
pkgs=''
 
2078
pkg_check_version() {
 
2079
  if test "$ok" = yes ; then
 
2080
    req="$1"
 
2081
    min="$2"
 
2082
    AC_MSG_CHECKING(for $req)
 
2083
    if $pkg_config --exists "$req" ; then
 
2084
      vers=`$pkg_config --modversion "$req"`
 
2085
      if $pkg_config --exists "$req >= $min" ; then
 
2086
        AC_MSG_RESULT($vers)
 
2087
        pkgs="$pkgs $req"
 
2088
        return 1
 
2089
      else
 
2090
        AC_MSG_RESULT($vers (wanted >= $min))
 
2091
        ok=no
 
2092
        return 0
 
2093
      fi
 
2094
    else
 
2095
      AC_MSG_RESULT(no)
 
2096
      ok=no
 
2097
      return 0
 
2098
    fi
 
2099
  fi
 
2100
}
1742
2101
 
1743
2102
 
1744
2103
jurassic_gtk=no
 
2104
gtk_halfassed=no
 
2105
 
1745
2106
if test "$with_gtk" = yes; then
1746
2107
  have_gtk=no
1747
2108
  
1748
 
  # if the user specified --with-gtk=/foo/ then look in /foo/bin/
1749
 
  # for glib-config and gtk-config.
1750
 
  #
1751
 
  gtk_path="$PATH"
1752
 
 
1753
 
  if test ! -z "$gtk_dir"; then
1754
 
    # canonicalize slashes.
1755
 
    gtk_dir=`echo "${gtk_dir}/bin" | sed 's@//*@/@g'`
1756
 
    gtk_path="$gtk_dir:$gtk_path"
1757
 
  fi
1758
 
 
1759
 
  if test ! -z "gnome_dir"; then
1760
 
    # canonicalize slashes.
1761
 
    gnome_dir=`echo "${gnome_dir}/bin" | sed 's@//*@/@g'`
1762
 
    gtk_path="$gnome_dir:$gtk_path"
1763
 
  fi
1764
 
 
1765
 
  AC_PATH_PROGS(glib_config,  glib12-config glib-config,,  $gtk_path)
1766
 
  AC_PATH_PROGS(gtk_config,   gtk12-config  gtk-config,,   $gtk_path)
1767
 
 
1768
 
  if test "$with_gnome" = yes; then
1769
 
    AC_PATH_PROGS(gnome_config, gnome-config,, $gtk_path)
1770
 
  fi
1771
 
 
1772
 
  if test -n "$glib_config" -a  -n "gtk_config" ; then
1773
 
    have_gtk=yes
1774
 
    if test "$with_gnome" = yes -a -n "$gnome_config" ; then
1775
 
      have_gnome=yes
 
2109
  ok="yes"
 
2110
  pkg_check_version            gtk+-2.0  2.0.1  ; ac_gtk_version_string="$vers"
 
2111
  pkg_check_version         gmodule-2.0  2.0.0
 
2112
  pkg_check_version          libxml-2.0  2.4.6
 
2113
  pkg_check_version        libglade-2.0  1.99.0
 
2114
  pkg_check_version      gdk-pixbuf-2.0  2.0.0
 
2115
  pkg_check_version gdk-pixbuf-xlib-2.0  2.0.0
 
2116
  have_gtk="$ok"
 
2117
 
 
2118
  if test "$have_gtk" = no; then
 
2119
    if test -n "$ac_gtk_version_string" ; then
 
2120
      gtk_halfassed="$ac_gtk_version_string"
 
2121
      gtk_halfassed_lib="$req"
1776
2122
    fi
1777
2123
  fi
1778
2124
 
1779
2125
  if test "$have_gtk" = yes; then
1780
 
    AC_CACHE_CHECK([Gtk version number], ac_cv_gtk_version_string,
1781
 
                   [ac_cv_gtk_version_string=`$gtk_config --version`])
1782
 
    ac_gtk_version_string=$ac_cv_gtk_version_string
1783
 
    # M4 sucks!!
1784
 
    changequote(X,Y)
1785
 
    maj=`echo $ac_gtk_version_string | sed -n 's/\..*//p'`
1786
 
    min=`echo $ac_gtk_version_string | sed -n 's/[^.]*\.\([^.]*\).*/\1/p'`
1787
 
    changequote([,])
1788
 
    ac_gtk_version=`echo "$maj * 1000 + $min" | bc`
1789
 
    if test -z "$ac_gtk_version"; then
1790
 
      ac_gtk_version=unknown
1791
 
      ac_gtk_version_string=unknown
1792
 
    fi
1793
 
    if test "$ac_gtk_version" = "unknown" || test "$ac_gtk_version" -lt 1002
1794
 
    then
1795
 
      have_gtk=no
1796
 
      have_gnome=no
1797
 
      jurassic_gtk=yes
1798
 
    fi
 
2126
    parse_gtk_version_string
 
2127
    jurassic_gtk=no
1799
2128
  fi
1800
2129
 
1801
2130
  if test "$have_gtk" = yes; then
1802
2131
    AC_CACHE_CHECK([for Gtk includes], ac_cv_gtk_config_cflags,
1803
 
                   [ac_cv_gtk_config_cflags=`$gtk_config --cflags`])
 
2132
                   [ac_cv_gtk_config_cflags=`$pkg_config --cflags $pkgs`])
1804
2133
    AC_CACHE_CHECK([for Gtk libs], ac_cv_gtk_config_libs,
1805
 
                   [ac_cv_gtk_config_libs=`$gtk_config --libs`])
 
2134
                   [ac_cv_gtk_config_libs=`$pkg_config --libs $pkgs`])
1806
2135
  fi
1807
2136
  ac_gtk_config_cflags=$ac_cv_gtk_config_cflags
1808
2137
  ac_gtk_config_libs=$ac_cv_gtk_config_libs
1809
2138
 
1810
 
  # Check for Gnome Capplet support.
1811
 
  #
1812
 
  if test "$have_gnome" = yes -a "$have_gtk" = yes; then
1813
 
    gnome_config_libs="gtk capplet gnomeui"
1814
 
    AC_MSG_CHECKING(for Gnome capplet includes)
1815
 
    AC_CACHE_VAL(ac_cv_gnome_config_cflags,
1816
 
      [if ( $gnome_config --cflags $gnome_config_libs 2>&1 >/dev/null | \
1817
 
            grep Unknown >/dev/null ) ; then
1818
 
         ac_cv_gnome_config_cflags=''
1819
 
       else
1820
 
         ac_cv_gnome_config_cflags=`$gnome_config --cflags $gnome_config_libs`
1821
 
       fi])
1822
 
    ac_gnome_config_cflags=$ac_cv_gnome_config_cflags
1823
 
    if test "$ac_gnome_config_cflags" = "" ; then
1824
 
      have_gnome=no
1825
 
      AC_MSG_RESULT(no)
1826
 
    else
1827
 
      AC_MSG_RESULT($ac_gnome_config_cflags)
1828
 
    fi
1829
 
  fi
1830
 
 
1831
 
  if test "$have_gnome" = yes -a "$have_gtk" = yes; then
1832
 
    AC_MSG_CHECKING(for Gnome capplet libs)
1833
 
    AC_CACHE_VAL(ac_cv_gnome_config_libs,
1834
 
      [if ( $gnome_config --libs $gnome_config_libs 2>&1 >/dev/null |
1835
 
            grep Unknown >/dev/null ) ; then
1836
 
         ac_cv_gnome_config_libs=''
1837
 
       else
1838
 
         ac_cv_gnome_config_libs=`$gnome_config --libs $gnome_config_libs`
1839
 
       fi])
1840
 
    ac_gnome_config_libs=$ac_cv_gnome_config_libs
1841
 
    if test "$ac_gnome_config_libs" = "" ; then
1842
 
      have_gnome=no
1843
 
      AC_MSG_RESULT(no)
1844
 
    else
1845
 
      AC_MSG_RESULT($ac_gnome_config_libs)
1846
 
    fi
1847
 
  fi
1848
 
 
1849
 
  GNOME_DATADIR=""
1850
 
  if test "$have_gnome" = yes -a "$have_gtk" = yes; then
1851
 
    GNOME_DATADIR=`$gnome_config --datadir`
1852
 
  fi
1853
 
 
1854
 
 
1855
 
  # If we have Gnome, then override the gtk-config values with 
1856
 
  # the gnome-config values.
1857
 
  #
1858
 
  if test "$have_gnome" = yes -a "$have_gtk" = yes; then
1859
 
    ac_gtk_config_cflags=$ac_gnome_config_cflags
1860
 
    ac_gtk_config_libs=$ac_gnome_config_libs
1861
 
    AC_DEFINE(HAVE_CRAPPLET)
1862
 
  fi
1863
 
 
 
2139
  GTK_EXTRA_OBJS=""
 
2140
  GTK_DATADIR=""
 
2141
  if test "$have_gtk" = yes; then
 
2142
    GTK_DATADIR=`$pkg_config --variable=prefix gtk+-2.0`
 
2143
    GTK_DATADIR="$GTK_DATADIR/share"
 
2144
  fi
1864
2145
 
1865
2146
  if test "$have_gtk" = yes; then
1866
2147
    INCLUDES="$INCLUDES $ac_gtk_config_cflags"
1867
2148
    GTK_LIBS="$GTK_LIBS $ac_gtk_config_libs"
1868
2149
    AC_DEFINE(HAVE_GTK)
 
2150
    AC_DEFINE(HAVE_GTK2)
 
2151
    AC_DEFINE(HAVE_XML)
1869
2152
  fi
1870
2153
 
1871
2154
fi
1872
2155
 
1873
2156
 
1874
 
# Check for the Gnome Help Browser.
1875
 
#
1876
 
if test "$have_gnome" = yes; then
1877
 
  AC_CHECK_PROG(have_gnome_help, gnome-help-browser, yes, no)
1878
 
else
1879
 
  have_gnome_help=no
 
2157
# Check for the various Gnome help and URL loading programs.
 
2158
#
 
2159
if test "$have_gtk" = yes; then
 
2160
  AC_CHECK_PROGS(gnome_open_program,     gnome-open)
 
2161
  AC_CHECK_PROGS(gnome_url_show_program, gnome-url-show)
 
2162
fi
 
2163
 
 
2164
 
 
2165
###############################################################################
 
2166
#
 
2167
#       Check for -lXm.
 
2168
#
 
2169
###############################################################################
 
2170
 
 
2171
have_motif=no
 
2172
with_motif_req=unspecified
 
2173
AC_ARG_WITH(motif,[  --with-motif            Use the Motif toolkit for the user interface
 
2174
                          (not recommended.)],
 
2175
  [with_motif="$withval"; with_motif_req="$withval"],[with_motif=no])
 
2176
 
 
2177
HANDLE_X_PATH_ARG(with_motif, --with-motif, Motif)
 
2178
 
 
2179
if test "$with_motif" != yes -a "$with_motif" != no ; then
 
2180
  echo "error: must be yes or no: --with-motif=$with_motif"
 
2181
  exit 1
 
2182
fi
 
2183
 
 
2184
if test "$with_motif" = yes; then
 
2185
  have_motif=no
 
2186
  AC_CHECK_X_HEADER(Xm/Xm.h,
 
2187
                    [have_motif=yes
 
2188
                     AC_DEFINE(HAVE_MOTIF)
 
2189
                     MOTIF_LIBS="$MOTIF_LIBS -lXm"],,
 
2190
                    [#include <stdlib.h>
 
2191
                     #include <stdio.h>
 
2192
                     #include <X11/Intrinsic.h>])
 
2193
fi
 
2194
 
 
2195
 
 
2196
if test "$have_motif" = yes; then
 
2197
  AC_CHECK_X_HEADER(Xm/ComboBox.h, [AC_DEFINE(HAVE_XMCOMBOBOX)],,
 
2198
                    [#include <stdlib.h>
 
2199
                     #include <stdio.h>
 
2200
                     #include <X11/Intrinsic.h>])
1880
2201
fi
1881
2202
 
1882
2203
 
2046
2367
if test "$with_gl" = yes; then
2047
2368
  AC_CHECK_X_HEADER(GL/gl.h, have_gl=yes, have_gl=no)
2048
2369
  if test "$have_gl" = yes ; then
2049
 
    AC_CHECK_X_HEADER(GL/glx.h, have_gl=yes, have_gl=no)
 
2370
    AC_CHECK_X_HEADER(GL/glx.h, have_gl=yes, have_gl=no,
 
2371
                      [#include <GL/gl.h>])
2050
2372
  fi
2051
2373
 
2052
2374
  # If we have the headers, try and figure out which vendor it's from.
2084
2406
    if test "$ac_have_mesa_gl" = yes ; then
2085
2407
      AC_CHECK_X_LIB(MesaGL, glXCreateContext, 
2086
2408
                     [gl_lib_1="MesaGL"
2087
 
                      GL_LIBS="-lMesaGL -lMesaGLU $GL_LIBS"],
2088
 
                     [], -lMesaGLU $GL_LIBS -lX11 -lXext -lm)
 
2409
                      GL_LIBS="-lMesaGL -lMesaGLU $VIDMODE_LIBS $GL_LIBS"],
 
2410
                     [], -lMesaGLU $GL_LIBS -lX11 -lXext $VIDMODE_LIBS -lm)
2089
2411
    fi
2090
2412
 
2091
2413
    if test "$gl_lib_1" = "" ; then
2092
2414
      AC_CHECK_X_LIB(GL, glXCreateContext, 
2093
2415
                     [gl_lib_1="GL"
2094
 
                      GL_LIBS="-lGL -lGLU $GL_LIBS"],
2095
 
                     [], -lGLU $GL_LIBS -lX11 -lXext -lm)
 
2416
                      GL_LIBS="-lGL -lGLU $VIDMODE_LIBS $GL_LIBS"],
 
2417
                     [], -lGLU $GL_LIBS -lX11 -lXext $VIDMODE_LIBS -lm)
2096
2418
    fi
2097
2419
 
2098
2420
    if test "$gl_lib_1" = "" ; then
2126
2448
#include <GL/gl.h>
2127
2449
#ifndef MESA_MAJOR_VERSION
2128
2450
# include <GL/xmesa.h>
2129
 
# define MESA_MAJOR_VERSION XMESA_MAJOR_VERSION
2130
 
# define MESA_MINOR_VERSION XMESA_MINOR_VERSION
 
2451
# ifdef XMESA_MAJOR_VERSION
 
2452
   /* Around Mesa 3.2, they took out the Mesa version number, so instead,
 
2453
      we have to check the XMesa version number (the number of the X protocol
 
2454
      support, which seems to be the same as the Mesa version number.)
 
2455
    */
 
2456
#  define MESA_MAJOR_VERSION XMESA_MAJOR_VERSION
 
2457
#  define MESA_MINOR_VERSION XMESA_MINOR_VERSION
 
2458
# else
 
2459
   /* Oh great.  Some time after 3.4, they took out the xmesa.h header file,
 
2460
      so we have no way of telling what version of Mesa this is at all.
 
2461
      So, we'll guess that the osmesa version (the "offscreen protocol")
 
2462
      is less than or equal to the real mesa version number.  Except that
 
2463
      if OSmesa is 3.3, assume at least Mesa 3.4, since OSmesa was 3.3 in
 
2464
      Mesa 3.4.  And Mesa 3.3 had xmesa.h.  What a complete load of shit!
 
2465
    */
 
2466
# include <GL/osmesa.h>
 
2467
#  define MESA_MAJOR_VERSION OSMESA_MAJOR_VERSION
 
2468
#  define MESA_MINOR_VERSION OSMESA_MINOR_VERSION or newer, probably?
 
2469
#  if OSMESA_MAJOR_VERSION == 3 && OSMESA_MINOR_VERSION == 3
 
2470
#   undef MESA_MINOR_VERSION
 
2471
#   define MESA_MINOR_VERSION 4 or newer, probably?
 
2472
#  endif
 
2473
# endif
2131
2474
#endif
2132
2475
configure: MESA_MAJOR_VERSION MESA_MINOR_VERSION
2133
2476
EOF
2138
2481
         fi
2139
2482
         CPPFLAGS="$CPPFLAGS $X_CFLAGS"
2140
2483
 
2141
 
          # M4 sucks!!
 
2484
         mglv=`(eval "$ac_cpp conftest.$ac_ext") 2>&AC_FD_CC | grep configure:`
 
2485
 
 
2486
         # M4 sucks!!
2142
2487
         changequote(X,Y)
2143
 
         mglv=`(eval "$ac_cpp conftest.$ac_ext") 2>&AC_FD_CC | sed -n \
2144
 
              's/^configure:.*\([0-9][0-9]*\).*\([0-9][0-9]*\).*$/\1.\2/p'`
 
2488
          mglv=`echo "$mglv" | sed -n \
 
2489
             's/^configure: *\([0-9][0-9]*\)  *\([0-9].*\)$/\1.\2/p'`
2145
2490
         changequote([,])
2146
2491
 
2147
2492
         rm -f conftest.$ac_ext
2152
2497
           ac_mesagl_version=unknown
2153
2498
           ac_mesagl_version_string=unknown
2154
2499
         else
2155
 
           ac_mesagl_version_string=$mglv
2156
 
           maj=`echo $mglv | sed -n 's/\..*//p'`
2157
 
           min=`echo $mglv | sed -n 's/.*\.//p'`
 
2500
           ac_mesagl_version_string="$mglv"
 
2501
           # M4 sucks!!
 
2502
           changequote(X,Y)
 
2503
           maj=`echo "$mglv" | sed -n 's/^\([0-9][0-9]*\)\..*$/\1/p'`
 
2504
           min=`echo "$mglv" | sed -n 's/^.*\.\([0-9][0-9]*\).*$/\1/p'`
 
2505
           changequote([,])
2158
2506
           ac_mesagl_version=`echo "$maj * 1000 + $min" | bc`
2159
2507
           if test -z "$ac_mesagl_version"; then
2160
2508
             ac_mesagl_version=unknown
2199
2547
 
2200
2548
GLE_LIBS=""
2201
2549
 
2202
 
if test "$with_gle" = yes; then
 
2550
if test "$have_gl" = no ; then
 
2551
 true
 
2552
elif test "$with_gle" = yes; then
2203
2553
 
2204
 
  AC_CHECK_X_HEADER(GL/gle.h, have_gle3=yes, have_gle3=no)
 
2554
  AC_CHECK_X_HEADER(GL/gle.h, have_gle3=yes, have_gle3=no,
 
2555
                    [#include <GL/gl.h>])
2205
2556
  if test "$have_gle3" = yes ; then
2206
2557
    have_gle=yes;
2207
2558
  else
2208
 
    AC_CHECK_X_HEADER(GL/gutil.h, have_gle=yes, have_gle=no)
 
2559
    AC_CHECK_X_HEADER(GL/gutil.h, have_gle=yes, have_gle=no,
 
2560
                    [#include <GL/gl.h>])
2209
2561
    if test "$have_gle" = yes ; then
2210
 
      AC_CHECK_X_HEADER(GL/tube.h, have_gle=yes, have_gle=no)
 
2562
      AC_CHECK_X_HEADER(GL/tube.h, have_gle=yes, have_gle=no,
 
2563
                        [#include <GL/gl.h>])
2211
2564
    fi
2212
2565
  fi
2213
2566
 
2262
2615
fi
2263
2616
 
2264
2617
 
 
2618
###############################################################################
 
2619
#
 
2620
#       Check for -lgdk_pixbuf.
 
2621
#       These tests are for gdk_pixbuf usage of the hacks, 
 
2622
#       not xscreensaver-demo (thus we have to test again to get
 
2623
#       the libraries right: don't want to pull in all of GTK
 
2624
#       for the hacks.)
 
2625
#
 
2626
###############################################################################
 
2627
 
 
2628
have_gdk_pixbuf=no
 
2629
with_gdk_pixbuf_req=unspecified
 
2630
AC_ARG_WITH(pixbuf,
 
2631
[  --with-pixbuf           Include support for the GDK-Pixbuf library in some
 
2632
                          demos, which will make it possible for them to read
 
2633
                          GIF, JPEG, and PNG files as well.],
 
2634
  [with_gdk_pixbuf="$withval"; with_gdk_pixbuf_req="$withval"],
 
2635
  [with_gdk_pixbuf=yes])
 
2636
 
 
2637
# if --with-pixbuf=/directory/ was specified, remember that directory so that
 
2638
# we can also look for the `gdk-pixbuf-config' program in that directory.
 
2639
case "$with_gdk_pixbuf" in
 
2640
  /*)
 
2641
    gdk_pixbuf_dir="$with_gdk_pixbuf"
 
2642
    ;;
 
2643
  *)
 
2644
    gdk_pixbuf_dir=""
 
2645
    ;;
 
2646
esac
 
2647
 
 
2648
HANDLE_X_PATH_ARG(with_gdk_pixbuf, --with-pixbuf, GDK_PIXBUF)
 
2649
 
 
2650
if test "$with_gdk_pixbuf" != yes -a "$with_gdk_pixbuf" != no ; then
 
2651
  echo "error: must be yes or no: --with-pixbuf=$with_gdk_pixbuf"
 
2652
  exit 1
 
2653
fi
 
2654
 
 
2655
if test "$with_gdk_pixbuf" = yes; then
 
2656
  have_gdk_pixbuf=no
 
2657
 
 
2658
  pkgs=''
 
2659
  ok="yes"
 
2660
 
 
2661
  pkg_check_version gdk-pixbuf-2.0      2.0.0
 
2662
  pkg_check_version gdk-pixbuf-xlib-2.0 2.0.0
 
2663
  have_gdk_pixbuf="$ok"
 
2664
 
 
2665
  if test "$have_gdk_pixbuf" = yes; then
 
2666
    AC_CACHE_CHECK([for gdk-pixbuf includes], ac_cv_gdk_pixbuf_config_cflags,
 
2667
               [ac_cv_gdk_pixbuf_config_cflags=`$pkg_config --cflags $pkgs`])
 
2668
    AC_CACHE_CHECK([for gdk-pixbuf libs], ac_cv_gdk_pixbuf_config_libs,
 
2669
               [ac_cv_gdk_pixbuf_config_libs=`$pkg_config --libs $pkgs`])
 
2670
  fi
 
2671
  ac_gdk_pixbuf_config_cflags=$ac_cv_gdk_pixbuf_config_cflags
 
2672
  ac_gdk_pixbuf_config_libs=$ac_cv_gdk_pixbuf_config_libs
 
2673
 
 
2674
 
 
2675
  if test "$have_gdk_pixbuf" = yes; then
 
2676
    #
 
2677
    # we appear to have pixbuf; check for headers/libs to be sure.
 
2678
    #
 
2679
    ac_save_gdk_pixbuf_CPPFLAGS="$CPPFLAGS"
 
2680
    CPPFLAGS="$CPPFLAGS $ac_gdk_pixbuf_config_cflags"
 
2681
 
 
2682
    have_gdk_pixbuf=no
 
2683
 
 
2684
    # check for header A...
 
2685
    AC_CHECK_X_HEADER(gdk-pixbuf/gdk-pixbuf.h, [have_gdk_pixbuf=yes])
 
2686
 
 
2687
    # if that worked, check for header B...
 
2688
    if test "$have_gdk_pixbuf" = yes; then
 
2689
      have_gdk_pixbuf=no
 
2690
      gdk_pixbuf_halfassed=yes
 
2691
      AC_CHECK_X_HEADER(gdk-pixbuf/gdk-pixbuf-xlib.h,
 
2692
                        [have_gdk_pixbuf=yes
 
2693
                         gdk_pixbuf_halfassed=no])
 
2694
 
 
2695
      # yay, it has a new name in Gtk 2.x...
 
2696
      if test "$have_gdk_pixbuf" = no; then
 
2697
        have_gdk_pixbuf=no
 
2698
        gdk_pixbuf_halfassed=yes
 
2699
        AC_CHECK_X_HEADER(gdk-pixbuf-xlib/gdk-pixbuf-xlib.h,
 
2700
                          [have_gdk_pixbuf=yes
 
2701
                           gdk_pixbuf_halfassed=no])
 
2702
      fi
 
2703
    fi
 
2704
    CPPFLAGS="$ac_save_gdk_pixbuf_CPPFLAGS"
 
2705
  fi
 
2706
 
 
2707
  if test "$have_gdk_pixbuf" = yes; then
 
2708
    # we have the headers, now check for the libraries
 
2709
    have_gdk_pixbuf=no
 
2710
    gdk_pixbuf_halfassed=yes
 
2711
 
 
2712
    AC_MSG_RESULT(checking for gdk_pixbuf usability...)
 
2713
 
 
2714
    # library A...
 
2715
    AC_CHECK_X_LIB(c, gdk_pixbuf_new_from_file, [have_gdk_pixbuf=yes],,
 
2716
                   $ac_gdk_pixbuf_config_libs -lX11 -lXext -lm)
 
2717
    # library B...
 
2718
    if test "$have_gdk_pixbuf" = yes; then
 
2719
      have_gdk_pixbuf=no
 
2720
      AC_CHECK_X_LIB(c, gdk_pixbuf_xlib_init,
 
2721
                     [have_gdk_pixbuf=yes
 
2722
                      gdk_pixbuf_halfassed=no],,
 
2723
                     $ac_gdk_pixbuf_config_libs -lX11 -lXext -lm)
 
2724
    fi
 
2725
  fi
 
2726
 
 
2727
  if test "$have_gdk_pixbuf" = yes; then
 
2728
    INCLUDES="$INCLUDES $ac_gdk_pixbuf_config_cflags"
 
2729
    XPM_LIBS="$ac_gdk_pixbuf_config_libs"
 
2730
    AC_DEFINE(HAVE_GDK_PIXBUF)
 
2731
  else
 
2732
    AC_MSG_RESULT(checking for gdk_pixbuf usability... no)
 
2733
  fi
 
2734
fi
 
2735
 
2265
2736
 
2266
2737
###############################################################################
2267
2738
#
2272
2743
have_xpm=no
2273
2744
with_xpm_req=unspecified
2274
2745
AC_ARG_WITH(xpm,
2275
 
[  --with-xpm              Include support for XPM files in some demos.],
 
2746
[  --with-xpm              Include support for XPM files in some demos.
 
2747
                          (Not needed if Pixbuf is used.)],
2276
2748
  [with_xpm="$withval"; with_xpm_req="$withval"],[with_xpm=yes])
2277
2749
 
2278
2750
HANDLE_X_PATH_ARG(with_xpm, --with-xpm, XPM)
2281
2753
  AC_CHECK_X_HEADER(X11/xpm.h,
2282
2754
                   [have_xpm=yes
2283
2755
                    AC_DEFINE(HAVE_XPM)
2284
 
                    XPM_LIBS="-lXpm"])
 
2756
                    XPM_LIBS="-lXpm $XPM_LIBS"],,
 
2757
                    [#include <X11/Xlib.h>])
2285
2758
elif test "$with_xpm" != no; then
2286
2759
  echo "error: must be yes or no: --with-xpm=$with_xpm"
2287
2760
  exit 1
2299
2772
 
2300
2773
###############################################################################
2301
2774
#
 
2775
#       Check for -ljpeg
 
2776
#
 
2777
###############################################################################
 
2778
 
 
2779
have_jpeg=no
 
2780
with_jpeg_req=unspecified
 
2781
jpeg_halfassed=no
 
2782
AC_ARG_WITH(jpeg,
 
2783
[  --with-jpeg             Include support for the JPEG library.],
 
2784
  [with_jpeg="$withval"; with_jpeg_req="$withval"],
 
2785
  [with_jpeg=yes])
 
2786
 
 
2787
HANDLE_X_PATH_ARG(with_jpeg, --with-jpeg, JPEG)
 
2788
 
 
2789
if test "$with_jpeg" != yes -a "$with_jpeg" != no ; then
 
2790
  echo "error: must be yes or no: --with-jpeg=$with_jpeg"
 
2791
  exit 1
 
2792
fi
 
2793
 
 
2794
if test "$with_jpeg" = yes; then
 
2795
 
 
2796
  have_jpeg=no
 
2797
  AC_CHECK_X_HEADER(jpeglib.h, [have_jpeg=yes])
 
2798
 
 
2799
  if test "$have_jpeg" = yes; then
 
2800
    # we have the header, now check for the library
 
2801
    have_jpeg=no
 
2802
    jpeg_halfassed=yes
 
2803
    AC_CHECK_X_LIB(jpeg, jpeg_start_compress,
 
2804
                   [have_jpeg=yes
 
2805
                    jpeg_halfassed=no
 
2806
                    JPEG_LIBS="-ljpeg"
 
2807
                    AC_DEFINE(HAVE_JPEGLIB)])
 
2808
  fi
 
2809
fi
 
2810
 
 
2811
 
 
2812
###############################################################################
 
2813
#
 
2814
#       Check for pty support for 'phosphor'
 
2815
#
 
2816
###############################################################################
 
2817
 
 
2818
PTY_LIBS=
 
2819
AC_CHECK_HEADERS(pty.h util.h)
 
2820
AC_CHECK_X_LIB(util, forkpty,
 
2821
               [PTY_LIBS="-lutil"
 
2822
                AC_DEFINE(HAVE_FORKPTY)])
 
2823
 
 
2824
 
 
2825
###############################################################################
 
2826
#
2302
2827
#       Check for the XSHM server extension.
2303
2828
#
2304
2829
###############################################################################
2306
2831
have_xshm=no
2307
2832
with_xshm_req=unspecified
2308
2833
AC_ARG_WITH(xshm-ext,
2309
 
[  --with-xshm-ext         Include support for the XSHM extension.],
 
2834
[  --with-xshm-ext         Include support for the Shared Memory extension.],
2310
2835
  [with_xshm="$withval"; with_xshm_req="$withval"],[with_xshm=yes])
2311
2836
 
2312
2837
HANDLE_X_PATH_ARG(with_xshm, --with-xshm-ext, XSHM)
2314
2839
if test "$with_xshm" = yes; then
2315
2840
 
2316
2841
  # first check for Xshm.h.
2317
 
  AC_CHECK_X_HEADER(X11/extensions/XShm.h, [have_xshm=yes])
 
2842
  AC_CHECK_X_HEADER(X11/extensions/XShm.h, [have_xshm=yes],,
 
2843
                    [#include <X11/Xlib.h>])
2318
2844
 
2319
2845
  # if that succeeded, then check for sys/ipc.h.
2320
2846
  if test "$have_xshm" = yes; then
2372
2898
 
2373
2899
if test "$with_xdbe" = yes; then
2374
2900
 
2375
 
  AC_CHECK_X_HEADER(X11/extensions/Xdbe.h, [have_xdbe=yes])
 
2901
  AC_CHECK_X_HEADER(X11/extensions/Xdbe.h, [have_xdbe=yes],,
 
2902
                    [#include <X11/Xlib.h>])
2376
2903
  if test "$have_xdbe" = yes; then
2377
2904
    AC_DEFINE(HAVE_DOUBLE_BUFFER_EXTENSION)    
2378
2905
  fi
2404
2931
 
2405
2932
if test "$with_readdisplay" = yes; then
2406
2933
  AC_CHECK_X_HEADER(X11/extensions/readdisplay.h,
2407
 
                    AC_DEFINE(HAVE_READ_DISPLAY_EXTENSION))
 
2934
                    AC_DEFINE(HAVE_READ_DISPLAY_EXTENSION),,
 
2935
                    [#include <X11/Xlib.h>])
2408
2936
elif test "$with_readdisplay" != no; then
2409
2937
  echo "error: must be yes or no: --with-readdisplay=$with_readdisplay"
2410
2938
  exit 1
2413
2941
 
2414
2942
###############################################################################
2415
2943
#
2416
 
#       Check for a program to generate random text.
2417
 
#
2418
 
#       Zippy is funnier than the idiocy generally spat out by `fortune',
2419
 
#       so try to find that, by invoking Emacs and asking it where its 
2420
 
#       libexec directory is ("yow" lives in there.)
2421
 
#
2422
 
#       If that doesn't work, see if fortune, zippy, or yow are on $PATH,
2423
 
#       and if so, use them.
2424
 
#
2425
 
#       If that doesn't work, look in /usr/games, and if it's there, use
2426
 
#       the full pathname.
 
2944
#       Check for a directory full of images to use as the default value
 
2945
#       of the "imageDirectory" preference.
2427
2946
#
2428
2947
###############################################################################
2429
2948
 
2430
 
with_zippy_req=""
2431
 
AC_ARG_WITH(zippy,[
2432
 
  --with-zippy=PROGRAM    Some demos are able to run an external program and
2433
 
                          display its text; this names the program to use by
2434
 
                          default (though it can be overridden with X
2435
 
                          resources.)  If you don't specify this, the default
2436
 
                          is to use \"yow\" from the Emacs distribution (if you
2437
 
                          have it) or else to use \"fortune\".],
2438
 
  [with_zippy_req="$withval"; with_zippy="$withval"],[with_zippy=yes])
2439
 
 
2440
 
if test "$with_zippy" = no || test "$with_zippy" = yes ; then
2441
 
  with_zippy=""
2442
 
  with_zippy_req=""
2443
 
fi
2444
 
 
2445
 
if test -n "$with_zippy_req" ; then
2446
 
  ac_cv_zippy_program=""
2447
 
  case "$with_zippy_req" in
2448
 
    /*)
2449
 
      AC_MSG_CHECKING([for $with_zippy_req])
2450
 
      if test -x "$with_zippy_req" ; then
2451
 
        AC_MSG_RESULT(yes)
2452
 
      else
2453
 
        AC_MSG_RESULT(no)
2454
 
        with_zippy=""
2455
 
      fi
2456
 
    ;;
2457
 
    *)
2458
 
      # don't cache
2459
 
      unset ac_cv_path_zip2
2460
 
      AC_PATH_PROG(zip2, $with_zippy_req, [])
2461
 
      if test "$zip2" = ""; then
2462
 
        with_zippy=""
2463
 
      fi
2464
 
    ;;
2465
 
  esac
2466
 
  ac_cv_zippy_program="$with_zippy"
2467
 
 
2468
 
elif test -n "$ac_cv_zippy_program"; then
2469
 
  AC_MSG_RESULT([checking for zippy... (cached) $ac_cv_zippy_program])
2470
 
fi
2471
 
 
2472
 
if test ! -n "$ac_cv_zippy_program"; then
2473
 
 
2474
 
  AC_CHECK_PROGS(emacs_exe, emacs)
2475
 
  AC_CHECK_PROGS(xemacs_exe, xemacs)
2476
 
 
2477
 
  ac_cv_zippy_program=""
2478
 
  eargs='-batch -q -nw --eval'
2479
 
 
2480
 
  if test -n "$emacs_exe" ; then
2481
 
    AC_MSG_CHECKING([for emacs yow])
2482
 
    #
2483
 
    # get emacs to tell us where the libexec directory is.
2484
 
    #
2485
 
    dir=`$emacs_exe $eargs '(princ (concat exec-directory "\n"))' \
2486
 
         2>/dev/null | tail -1`
2487
 
    dir=`echo "$dir" | sed 's@///*@/@g;s@/$@@'`
2488
 
    #
2489
 
    # try running libexec/yow and see if it exits without error.
2490
 
    #
2491
 
    if test x"$dir" != x -a -x "$dir/yow" ; then
2492
 
      if $dir/yow >&- 2>&- ; then
2493
 
        ac_cv_zippy_program="$dir/yow"
2494
 
        AC_MSG_RESULT($ac_cv_zippy_program)
2495
 
      else
2496
 
        AC_MSG_RESULT(no)
2497
 
      fi
 
2949
have_imagedir=no
 
2950
with_imagedir_req=unspecified
 
2951
 
 
2952
AC_ARG_WITH(image-directory,
 
2953
[  --with-image-directory=DIR  By default, some screen savers may load
 
2954
                          random images out of this directory.],
 
2955
  [with_imagedir="$withval"; with_imagedir_req="$withval"],
 
2956
  [with_imagedir=yes])
 
2957
# no HANDLE_X_PATH_ARG for this one
 
2958
 
 
2959
case "$with_imagedir" in
 
2960
  /*)
 
2961
    # absolute path
 
2962
    AC_MSG_CHECKING([for image directory $with_imagedir])
 
2963
    if test -d "$with_imagedir" ; then
 
2964
      AC_MSG_RESULT(yes)
 
2965
    else
 
2966
      AC_MSG_RESULT(no)
 
2967
      with_imagedir=""
2498
2968
    fi
2499
 
  fi
 
2969
  ;;
 
2970
  yes)
 
2971
    with_imagedir=""
2500
2972
 
2501
 
  if test -z "$ac_cv_zippy_program" ; then
2502
 
    AC_MSG_CHECKING([for xemacs yow])
2503
 
    if test -n "$xemacs_exe" ; then
2504
 
      #
2505
 
      # get xemacs to tell us where the libexec directory is.
2506
 
      #
2507
 
      dir=`$xemacs_exe $eargs '(princ (concat exec-directory "\n"))' \
2508
 
           2>/dev/null | tail -1`
2509
 
      dir=`echo "$dir" | sed 's@///*@/@g;s@/$@@'`
2510
 
      #
2511
 
      # try running libexec/yow and see if it exits without error.
2512
 
      #
2513
 
      if test x"$dir" != x -a -x "$dir/yow" ; then
2514
 
        if $dir/yow >&- 2>&- ; then
2515
 
          ac_cv_zippy_program="$dir/yow"
2516
 
          AC_MSG_RESULT($ac_cv_zippy_program)
 
2973
    #### Could use some more defaults here...
 
2974
    for dd in \
 
2975
      "/usr/share/backgrounds/images/"          \
 
2976
      "/usr/share/wallpapers/"                  \
 
2977
      "/Library/Desktop Pictures/"              \
 
2978
    ; do
 
2979
      if test -z "$with_imagedir"; then
 
2980
        AC_MSG_CHECKING([for image directory $dd])
 
2981
        if test -d "$dd" ; then
 
2982
          AC_MSG_RESULT(yes)
 
2983
          with_imagedir="$dd"
2517
2984
        else
2518
 
          #
2519
 
          # in some xemacs installations, the pathname of the yow.lines file
2520
 
          # isn't hardcoded into the yow executable, and must be passed on 
2521
 
          # the command line.  See if it's in libexec/../etc/.
2522
 
 
2523
 
          # M4 sucks!!
2524
 
          changequote(X,Y)
2525
 
          dir_up=`echo "$dir" | sed 's@/[^/]*$@@'`
2526
 
          changequote([,])
2527
 
 
2528
 
          yowlines="$dir_up/etc/yow.lines"
2529
 
          if $dir/yow -f $yowlines >&- 2>&- ; then
2530
 
            ac_cv_zippy_program="$dir/yow -f $yowlines"
2531
 
            AC_MSG_RESULT($ac_cv_zippy_program)
2532
 
          else
2533
 
            #
2534
 
            # In newer XEmacs releases, yow.lines is in a different place,
2535
 
            # and the easiest way to get it is by calling the new function
2536
 
            # `locate-data-file'.
2537
 
            #
2538
 
            yowlines=`$xemacs_exe $eargs \
2539
 
              '(princ (concat (locate-data-file "yow.lines") "\n"))' \
2540
 
              2>/dev/null | tail -1`
2541
 
            if $dir/yow -f $yowlines >&- 2>&- ; then
2542
 
              ac_cv_zippy_program="$dir/yow -f $yowlines"
2543
 
              AC_MSG_RESULT($ac_cv_zippy_program)
2544
 
            else
2545
 
              AC_MSG_RESULT(no)
2546
 
            fi
2547
 
          fi
 
2985
          AC_MSG_RESULT(no)
2548
2986
        fi
2549
2987
      fi
2550
 
    fi
2551
 
  fi
2552
 
 
2553
 
  # if that didn't work, try for some other programs...
2554
 
  if test -z "$ac_cv_zippy_program" ; then
2555
 
    fortune=''
2556
 
    AC_CHECK_PROGS(fortune, [fortune zippy yow])
2557
 
    # if that didn't work, try for those programs in /usr/games...
2558
 
    if test -z "$fortune" ; then
2559
 
      AC_PATH_PROGS(fortune, [fortune zippy yow], fortune,
2560
 
                    /usr/games:/usr/local/games:$PATH)
2561
 
    fi
2562
 
  fi
2563
 
fi
2564
 
 
2565
 
if test -z "$ac_cv_zippy_program" ; then
2566
 
  ac_cv_zippy_program=fortune
2567
 
fi
2568
 
 
2569
 
AC_DEFINE_UNQUOTED(ZIPPY_PROGRAM, "$ac_cv_zippy_program")
 
2988
    done
 
2989
 
 
2990
  ;;
 
2991
  no)
 
2992
    with_imagedir=""
 
2993
  ;;
 
2994
 
 
2995
  *)
 
2996
    echo "error: must be an absolute path: --with-image-directory=$with_imagedir_req"
 
2997
    exit 1
 
2998
  ;;
 
2999
esac
 
3000
ac_cv_imagedir="$with_imagedir"
 
3001
 
 
3002
DEFAULT_IMAGES_P='True'
 
3003
DEFAULT_IMAGE_DIRECTORY="$ac_cv_imagedir"
 
3004
 
 
3005
if test -z "$DEFAULT_IMAGE_DIRECTORY" ; then
 
3006
  DEFAULT_IMAGES_P='False'
 
3007
fi
2570
3008
 
2571
3009
 
2572
3010
###############################################################################
2579
3017
setuid_hacks_default=no
2580
3018
setuid_hacks="$setuid_hacks_default"
2581
3019
AC_ARG_WITH(setuid-hacks,
2582
 
[  --with-setuid-hacks     Allow some demos to be installed \`setuid root'
 
3020
[  --with-setuid-hacks     Allow some demos to be installed `setuid root'
2583
3021
                          (which is needed in order to ping other hosts.)
2584
3022
],
2585
3023
  [setuid_hacks="$withval"], [setuid_hacks="$setuid_hacks_default"])
2615
3053
fi
2616
3054
 
2617
3055
 
2618
 
PREFERRED_DEMO_PROGRAM=xscreensaver-demo-Xm
 
3056
PREFERRED_DEMO_PROGRAM=''
2619
3057
ALL_DEMO_PROGRAMS=
2620
3058
if test "$have_motif" = yes; then
2621
3059
  PREFERRED_DEMO_PROGRAM=xscreensaver-demo-Xm
2636
3074
  PASSWD_OBJS="$PASSWD_OBJS \$(PAM_OBJS)"
2637
3075
  INSTALL_PAM="install-pam"
2638
3076
fi
 
3077
if test "$have_passwd_helper" = yes; then
 
3078
  PASSWD_SRCS="$PASSWD_SRCS \$(PWHELPER_SRCS)"
 
3079
  PASSWD_OBJS="$PASSWD_OBJS \$(PWHELPER_OBJS)"
 
3080
fi
2639
3081
  PASSWD_SRCS="$PASSWD_SRCS \$(PWENT_SRCS)"
2640
3082
  PASSWD_OBJS="$PASSWD_OBJS \$(PWENT_OBJS)"
2641
3083
 
2648
3090
  LOCK_OBJS='$(NOLOCK_OBJS_1)'
2649
3091
fi
2650
3092
 
 
3093
if test "$ac_macosx" = yes; then
 
3094
  EXES_OSX='$(EXES_OSX)'
 
3095
  SCRIPTS_OSX='$(SCRIPTS_OSX)'
 
3096
  MEN_OSX='$(MEN_OSX)'
 
3097
else
 
3098
  EXES_OSX=
 
3099
  SCRIPTS_OSX=
 
3100
  MEN_OSX=
 
3101
fi
 
3102
 
 
3103
 
2651
3104
INSTALL_SETUID='$(INSTALL_PROGRAM) $(SUID_FLAGS)'
2652
3105
 
2653
3106
if test "$need_setuid" = yes; then
2674
3127
 
2675
3128
if test "$have_gle" = yes; then
2676
3129
  GLE_EXES='$(GLE_EXES)'
2677
 
  GLE_MEN='$(GLE_MEN)'
2678
3130
  GLE_KLUDGE="${tab}   "
2679
3131
else
2680
3132
  GLE_KLUDGE="-${tab}   "
2681
3133
fi
2682
3134
 
 
3135
if test "$have_jpeg" = yes -a "$have_gdk_pixbuf" = yes; then
 
3136
 JPEG_EXES='$(JPEG_EXES)'
 
3137
fi
 
3138
 
2683
3139
 
2684
3140
# Another substitution in the XScreenSaver.ad.in file:
2685
3141
#
2686
 
if test "$have_gnome_help" = yes; then
2687
 
  GNOMEHELP_Y=''
2688
 
  GNOMEHELP_N='!    '
 
3142
if test "$gnome_open_program" != ''; then
 
3143
  GNOME24=''
 
3144
  GNOME22='!    '
 
3145
  NOGNOME='!    '
 
3146
elif test "$gnome_url_show_program" != ''; then
 
3147
  GNOME24='!    '
 
3148
  GNOME22=''
 
3149
  NOGNOME='!    '
2689
3150
else
2690
 
  GNOMEHELP_Y='!    '
2691
 
  GNOMEHELP_N=''
2692
 
fi
 
3151
  GNOME24='!    '
 
3152
  GNOME22='!    '
 
3153
  NOGNOME=''
 
3154
fi
 
3155
 
 
3156
 
 
3157
# Set PO_DATADIR to something sensible.
 
3158
#
 
3159
AC_MSG_CHECKING([for locale directory])
 
3160
if test -n "$GTK_DATADIR" ; then
 
3161
  PO_DATADIR="$GTK_DATADIR"
 
3162
elif test "$have_gtk" = yes; then
 
3163
  PO_DATADIR=`$pkg_config --variable=prefix gtk+-2.0`
 
3164
  PO_DATADIR="$PO_DATADIR/share"
 
3165
fi
 
3166
 
 
3167
if test -z "$PO_DATADIR" ; then
 
3168
  #
 
3169
  # #### Total fucking kludge --
 
3170
  # Map /build/prefix/usr/X11R6/share/ to /build/prefix/usr/share/
 
3171
  # but of course we need to expand all the nested variables to do that...
 
3172
  #
 
3173
  dd=$datadir
 
3174
  eval dd=${dd}
 
3175
  eval dd=${dd}
 
3176
  eval dd=${dd}
 
3177
  eval dd=${dd}
 
3178
  eval dd=${dd}
 
3179
  PO_DATADIR=`echo $dd | sed 's@/X11R6/@/@'`
 
3180
fi
 
3181
 
 
3182
AC_MSG_RESULT($PO_DATADIR/locale)
 
3183
 
 
3184
 
 
3185
# canonicalize slashes.
 
3186
HACK_CONF_DIR=`echo "${HACK_CONF_DIR}" | sed 's@/$@@;s@//*@/@g'`
 
3187
 
 
3188
# gcc 3.0 likes to issue this warning for every file:
 
3189
#
 
3190
# cc1: warning: changing search order for system directory "/usr/local/include"
 
3191
# cc1: warning:   as it has already been specified as a non-system directory
 
3192
#
 
3193
# Yay.  We can only avoid that by deleting "-I${prefix}/include" from the list.
 
3194
# Which *should* be totally redundant, and thus an ok thing to delete?
 
3195
#
 
3196
INCLUDES=`echo "$INCLUDES" | sed 's@ -I${prefix}/include@@g;'`
2693
3197
 
2694
3198
 
2695
3199
###############################################################################
2705
3209
AC_SUBST(SAVER_LIBS)
2706
3210
AC_SUBST(MOTIF_LIBS)
2707
3211
AC_SUBST(GTK_LIBS)
 
3212
AC_SUBST(XML_LIBS)
 
3213
AC_SUBST(JPEG_LIBS)
2708
3214
AC_SUBST(HACK_LIBS)
2709
3215
AC_SUBST(XPM_LIBS)
 
3216
AC_SUBST(PTY_LIBS)
2710
3217
AC_SUBST(GL_LIBS)
2711
3218
AC_SUBST(GLE_LIBS)
2712
3219
AC_SUBST(XDPMS_LIBS)
 
3220
AC_SUBST(XINERAMA_LIBS)
2713
3221
AC_SUBST(PASSWD_LIBS)
2714
3222
AC_SUBST(INSTALL_SETUID)
2715
3223
AC_SUBST(SETUID_HACKS)
2716
3224
AC_SUBST(INSTALL_DIRS)
2717
3225
AC_SUBST(NEED_SETUID)
2718
3226
AC_SUBST(INSTALL_PAM)
 
3227
AC_SUBST(NEW_LOGIN_COMMAND)
 
3228
AC_SUBST(NEW_LOGIN_COMMAND_P)
 
3229
AC_SUBST(DEFAULT_IMAGES_P)
 
3230
AC_SUBST(DEFAULT_IMAGE_DIRECTORY)
 
3231
 
 
3232
AC_SUBST(OBJCC)
 
3233
AC_SUBST(EXES_OSX)
 
3234
AC_SUBST(SCRIPTS_OSX)
 
3235
AC_SUBST(MEN_OSX)
2719
3236
 
2720
3237
AC_SUBST(PASSWD_SRCS)
2721
3238
AC_SUBST(PASSWD_OBJS)
2727
3244
AC_SUBST(SAVER_GL_LIBS)
2728
3245
AC_SUBST(LOCK_SRCS)
2729
3246
AC_SUBST(LOCK_OBJS)
 
3247
AC_SUBST(JPEG_EXES)
2730
3248
AC_SUBST(GL_EXES)
2731
3249
AC_SUBST(GL_UTIL_EXES)
2732
3250
AC_SUBST(GL_MEN)
2733
3251
AC_SUBST(GL_KLUDGE)
2734
3252
AC_SUBST(GLE_EXES)
2735
 
AC_SUBST(GLE_MEN)
2736
3253
AC_SUBST(GLE_KLUDGE)
2737
 
AC_SUBST(GNOMEHELP_Y)
2738
 
AC_SUBST(GNOMEHELP_N)
 
3254
AC_SUBST(GNOME24)
 
3255
AC_SUBST(GNOME22)
 
3256
AC_SUBST(NOGNOME)
2739
3257
AC_SUBST(HACKDIR)
2740
 
AC_SUBST(GNOME_DATADIR)
 
3258
AC_SUBST(GTK_DATADIR)
 
3259
AC_SUBST(PO_DATADIR)
 
3260
AC_SUBST(HACK_CONF_DIR)
 
3261
AC_SUBST(GTK_EXTRA_OBJS)
2741
3262
 
2742
3263
APPDEFAULTS=$ac_x_app_defaults
2743
3264
AC_SUBST(APPDEFAULTS)
2752
3273
          driver/Makefile
2753
3274
          hacks/Makefile
2754
3275
          hacks/glx/Makefile
 
3276
          po/Makefile.in
2755
3277
          driver/XScreenSaver.ad)
2756
3278
 
2757
3279
###############################################################################
2814
3336
  warn 'The SGI saver extension was requested, but was not found.'
2815
3337
fi
2816
3338
 
2817
 
if test "$with_mit_req" = yes -a "$have_mit" = no ; then
2818
 
  warn 'The MIT saver extension was requested, but was not found.'
2819
 
fi
2820
 
 
2821
3339
if test "$with_xidle_req" = yes -a "$have_xidle" = no ; then
2822
3340
  warn 'The XIdle extension was requested, but was not found.'
2823
3341
fi
2838
3356
  warn 'The DPMS extension was requested, but was not found.'
2839
3357
fi
2840
3358
 
 
3359
if test "$with_xinerama_req" = yes -a "$have_xinerama" = no ; then
 
3360
  warn 'The Xinerama extension was requested, but was not found.'
 
3361
fi
 
3362
 
2841
3363
if test "$with_xf86vmode_req" = yes -a "$have_xf86vmode" = no ; then
2842
3364
  warn 'The XF86VMODE extension was requested, but was not found.'
2843
3365
fi
2844
3366
 
 
3367
if test "$with_randr_req" = yes -a "$have_randr" = no ; then
 
3368
  warn 'The RANDR extension was requested, but was not found.'
 
3369
fi
 
3370
 
2845
3371
if test "$with_proc_interrupts_req" = yes -a "$have_proc_interrupts" = no; then
2846
3372
  warn "Checking of /proc/interrupts was requested, but it's bogus."
2847
3373
fi
2848
3374
 
 
3375
if test "$pkg_config" = false ; then
 
3376
  warnL 'The "pkg-config" program was not found.  Without that,'
 
3377
  warn2 "detection of the various GTK libraries won't work."
 
3378
else
 
3379
  pkgerr=`$pkg_config --list-all 2>&1 >/dev/null`
 
3380
  if test "x$pkgerr" != "x" ; then
 
3381
    warnL 'The "pkg-config" program produces errors.  This often causes'
 
3382
    warn2 "detection of the various GTK libraries to malfunction."
 
3383
    warn2 "The errors are:"
 
3384
    echo ''
 
3385
    echo "$pkgerr" | sed 's/^/             > /g'
 
3386
  fi
 
3387
fi
 
3388
 
 
3389
if test "$gtk_halfassed" != no ; then
 
3390
  warnL "GTK version $gtk_halfassed was found, but at least one supporting"
 
3391
  warn2 "library ($gtk_halfassed_lib) was not, so GTK can't be used."
 
3392
  warn2 "Perhaps some of the development packages are not installed?"
 
3393
  if test "$have_gtk" = yes ; then
 
3394
    v="$ac_gtk_version_string"
 
3395
    warn2 "GTK $v is also installed, so it will be used instead."
 
3396
    warn2 "Please read the above output and the \`config.log' file"
 
3397
    warn2 "for more details."
 
3398
  fi
 
3399
fi
 
3400
 
 
3401
motif_warn2() {
 
3402
  warn2 'Though the Motif front-end to xscreensaver is still'
 
3403
  warn2 'maintained, it is no longer being updated with new'
 
3404
  warn2 'features: all new development on the xscreensaver-demo'
 
3405
  warn2 'program is happening in the GTK version, and not in the'
 
3406
  warn2 'Motif version.  It is recommended that you build against'
 
3407
  warn2 'GTK instead of Motif.  See <http://www.gtk.org/>.'
 
3408
}
2849
3409
 
2850
3410
if test "$have_motif" = no -a "$have_gtk" = no; then
2851
 
  warnL "Neither Motif nor Gtk seem to be available;"
2852
 
  warn2 "the \`xscreensaver-demo' program requires one of these."
 
3411
 
 
3412
  if test "$with_motif" = yes; then
 
3413
    warnL "Neither the GTK nor Motif libraries were found; the"
 
3414
    warn2 "\`xscreensaver-demo' program requires one of these."
 
3415
    echo ''
 
3416
    motif_warn2
 
3417
  else
 
3418
    warnL "The GTK libraries do not seem to be available; the"
 
3419
    warn2 "\`xscreensaver-demo' program requires them."
 
3420
#   echo ''
 
3421
#   warn2 'You can use Motif or Lesstif instead of GTK (use the'
 
3422
#   warn2 "\`--with-motif' option) but that is NOT recommended."
 
3423
#   motif_warn2
 
3424
  fi
2853
3425
 
2854
3426
elif test "$with_motif_req" = yes -a "$have_motif" = no ; then
2855
3427
  warnL "Use of Motif was requested, but it wasn't found;"
2857
3429
 
2858
3430
elif test "$jurassic_gtk" = yes ; then
2859
3431
 
2860
 
  pref_gtk=1.2
 
3432
  pref_gtk=2.0
2861
3433
 
2862
3434
  v="$ac_gtk_version_string"
2863
3435
  if test "$with_gtk_req" = yes -a "$ac_gtk_version" = "unknown" ; then
2868
3440
    warnL "Gtk was found on this system, but it is version $v;"
2869
3441
  fi
2870
3442
 
2871
 
  warn2 "Gtk $pref_gtk or newer is required.  Motif will be used instead."
 
3443
  warn2 "Gtk $pref_gtk or newer is required."
2872
3444
 
2873
3445
elif test "$with_gtk_req" = yes -a "$have_gtk" = no ; then
2874
 
  warnL "Use of Gtk was requested, but it wasn't found;"
2875
 
  warn2 "Motif will be used instead."
2876
 
 
2877
 
fi
2878
 
 
2879
 
 
2880
 
if test "$with_gnome_req" = yes -a "$have_gnome" = no ; then
2881
 
  warn  'Use of the Gnome Control Panel was requested, but the necessary'
2882
 
  warn2 'headers and/or libraries were not found.'
2883
 
fi
2884
 
 
 
3446
  warnL "Use of Gtk was requested, but it wasn't found."
 
3447
fi
 
3448
 
 
3449
 
 
3450
if test "$have_gtk" = yes -a "$have_gdk_pixbuf" = no ; then
 
3451
  warn  "GTK is being used, but the GDK-Pixbuf library and/or"
 
3452
  warn2 "headers were not found.  That can't be good.  Please"
 
3453
  warn2 "install the GDK-Pixbuf development kit and re-configure."
 
3454
fi
2885
3455
 
2886
3456
if test "$have_motif" = yes -a "$have_lesstif" = yes ; then
2887
3457
 
2888
 
  preferred_lesstif=0.86
 
3458
  preferred_lesstif=0.92
2889
3459
 
2890
3460
  if test "$lesstif_version" = unknown; then
2891
3461
    warnL "Unable to determine the LessTif version number!"
2902
3472
fi
2903
3473
 
2904
3474
 
2905
 
 
2906
 
if test "$have_xpm" = no ; then
2907
 
  if test "$with_xpm_req" = yes ; then
2908
 
    warnL 'Use of XPM was requested, but it was not found.'
 
3475
if test "$have_motif" = yes -a "$have_gtk" = no ; then
 
3476
  warn  'Motif is being used, and GTK is not.'
 
3477
  echo  ''
 
3478
  motif_warn2
 
3479
fi
 
3480
 
 
3481
 
 
3482
if test "$with_xpm_req" = yes -a "$have_xpm" = no; then
 
3483
  warnL 'Use of XPM was requested, but it was not found.'
 
3484
fi
 
3485
 
 
3486
if test "$with_gdk_pixbuf_req" = yes  -a "$have_gdk_pixbuf" = no; then
 
3487
  warnL 'Use of GDK-Pixbuf was requested, but it was not found.'
 
3488
fi
 
3489
 
 
3490
if test "$have_gdk_pixbuf" = no -o "$gdk_pixbuf_halfassed" = yes || \
 
3491
   test "$have_gdk_pixbuf" = no -a "$have_xpm" = no ; then
 
3492
 
 
3493
  if test "$with_gdk_pixbuf_req" = yes ; then
 
3494
    true
 
3495
  elif test "$with_gdk_pixbuf_req" = no ; then
 
3496
    warnL 'The GDK-Pixbuf library is not being used.'
 
3497
  else
 
3498
    warnL 'The GDK-Pixbuf library was not found.'
 
3499
  fi
 
3500
 
 
3501
  if test "$with_xpm_req" = yes -o "$have_xpm" = yes ; then
 
3502
    true
2909
3503
  elif test "$with_xpm_req" = no ; then
2910
 
    noteL 'The XPM library is not being used.'
 
3504
    warnL 'The XPM library is not being used.'
2911
3505
  else
2912
 
    noteL 'The XPM library was not found.'
 
3506
    warnL 'The XPM library was not found.'
 
3507
  fi
 
3508
 
 
3509
  if test "$have_gdk_pixbuf" = no -a "$have_xpm" = yes ; then
 
3510
    warn2 'The XPM library is being used instead.'
 
3511
  fi
 
3512
 
 
3513
  if test "$gdk_pixbuf_halfassed" = yes ; then
 
3514
    echo ''
 
3515
    warn2 'More specifically, we found the headers, but not the'
 
3516
    warn2 'libraries; so either GDK-Pixbuf is half-installed on this'
 
3517
    warn2 "system, or something else went wrong.  The \`config.log'"
 
3518
    warn2 'file might contain some clues.'
2913
3519
  fi
2914
3520
 
2915
3521
  echo ''
2916
 
  warn2 'Some of the demos will not be as colorful as they'
2917
 
  warn2 'could be.  You might want to consider installing XPM'
2918
 
  warn2 'and re-running configure.  (Remember to delete the'
2919
 
  warn2 'config.cache file first.)  You can find XPM at most'
2920
 
  warn2 'X11 archive sites, such as <http://sunsite.unc.edu/>.'
 
3522
  warn2 'Some of the demos will not use images as much as they could.'
 
3523
  warn2 'You should consider installing GDK-Pixbuf and re-running'
 
3524
  warn2 'configure.  (GDK-Pixbuf is recommended over XPM, as it'
 
3525
  warn2 'provides support for more image formats.)'
 
3526
fi
 
3527
 
 
3528
 
 
3529
if test "$have_jpeg" = no ; then
 
3530
  if test "$with_jpeg_req" = yes ; then
 
3531
    warnL 'Use of libjpeg was requested, but it was not found.'
 
3532
  elif test "$with_jpeg_req" = no ; then
 
3533
    noteL 'The JPEG library is not being used.'
 
3534
  else
 
3535
    noteL 'The JPEG library was not found.'
 
3536
  fi
 
3537
 
 
3538
  if test "$jpeg_halfassed" = yes ; then
 
3539
    echo ''
 
3540
    warn2 'More specifically, we found the headers, but not the'
 
3541
    warn2 'library; so either JPEG is half-installed on this'
 
3542
    warn2 "system, or something else went wrong.  The \`config.log'"
 
3543
    warn2 'file might contain some clues.'
 
3544
    echo ''
 
3545
  fi
 
3546
 
 
3547
  if test "$have_gdk_pixbuf" = no ; then
 
3548
    warn2 "This means that it won't be possible for the image-manipulating"
 
3549
    warn2 "display modes to load files from disk; and it also means that"
 
3550
    warn2 "the \`webcollage' program will be much slower."
 
3551
  else
 
3552
    warn2 "This means the \`webcollage' program will be much slower."
 
3553
  fi
2921
3554
fi
2922
3555
 
2923
3556
 
2931
3564
    warn2 "Make sure you are using version $preferred_mesagl or newer."
2932
3565
 
2933
3566
  elif test \! "$ac_mesagl_version" -gt 2006; then
2934
 
    warnL "MesaGL version $mgv is being used.  MesaGL 2.6 and earlier"
2935
 
    warn2 "have a security bug.  It is strongly recommended that you"
2936
 
    warn2 "upgrade to at least version $preferred_mesagl."
 
3567
    warnL "MesaGL version number is $mgv --"
 
3568
    warn2 "MesaGL 2.6 and earlier have a security bug.  It is strongly"
 
3569
    warn2 "recommended that you upgrade to at least version $preferred_mesagl."
2937
3570
 
2938
3571
  elif test \! "$ac_mesagl_version" -gt 3003; then
2939
 
    warnL "MesaGL version $mgv is being used.  That version has some"
2940
 
    warn2 "bugs; it is recommended that you upgrade to $pgl or newer."
 
3572
    warnL "MesaGL version number is $mgv --"
 
3573
    warn2 "MesaGL 3.3 and earlier have some bugs; it is recommended"
 
3574
    warn2 "that you upgrade to $pgl or newer."
2941
3575
  fi
2942
3576
fi
2943
3577
 
2961
3595
  echo ''
2962
3596
  warn2 'Those demos which use 3D will not be built or installed.'
2963
3597
  warn2 'You might want to consider installing OpenGL and'
2964
 
  warn2 're-running configure.  (Remember to delete the'
2965
 
  warn2 "config.cache file first.)  If your vendor doesn't ship"
 
3598
  warn2 "re-running configure.  If your vendor doesn't ship"
2966
3599
  warn2 'their own implementation of OpenGL, you can get a free'
2967
3600
  warn2 'version at <http://www.mesa3d.org/>.  For general OpenGL'
2968
3601
  warn2 'info, see <http://www.opengl.org/>.'
2971
3604
 
2972
3605
 
2973
3606
if test "$have_gl" = yes -a "$have_gle" = no ; then
 
3607
 
 
3608
 # nobody cares about this; don't print the warning unless it was
 
3609
 # requested and not found, or halfway-found.
 
3610
 if test "$with_gle_req" = yes -o "$gle_halfassed" = yes ; then
 
3611
 
2974
3612
  if test "$with_gle_req" = yes ; then
2975
3613
    noteL 'Use of the GLE (GL Extrusion) library was requested, but'
2976
3614
    warn2 'it was not found (though the OpenGL library was found, and'
2994
3632
  echo ''
2995
3633
  warn2 'Some of the OpenGL (3D) demos (those that depend on GLE)'
2996
3634
  warn2 'will not be built or installed.  You might want to consider'
2997
 
  warn2 'installing GLE and re-running configure.  (Remember to delete'
2998
 
  warn2 'the config.cache file first.)  You can find the GLE library'
2999
 
  warn2 'at <http://www.linas.org/gle/>.  For general OpenGL info,'
3000
 
  warn2 'see <http://www.opengl.org/>.'
 
3635
  warn2 'installing GLE and re-running configure.  You can find the'
 
3636
  warn2 'GLE library at <http://www.linas.org/gle/>.  For general'
 
3637
  warn2 'OpenGL info, see <http://www.opengl.org/>.'
3001
3638
 
 
3639
 fi
3002
3640
fi
3003
3641
 
3004
3642
 
3006
3644
  warn 'Use of XReadDisplay was requested, but it was not found.'
3007
3645
fi
3008
3646
 
3009
 
if test -n "$with_zippy_req"; then
3010
 
  if test "$with_zippy_req" != "$ac_cv_zippy_program" ; then
3011
 
    warnL "$with_zippy_req was requested as the Zippy program,"
3012
 
    warn2 "but was not found.  The default will be used instead."
3013
 
  fi
3014
 
fi
3015
 
 
3016
3647
if test "$with_kerberos_req" = yes -a "$have_kerberos" = no ; then
3017
3648
  warn 'Use of Kerberos was requested, but it was not found.'
3018
3649
fi
3041
3672
eval HACKDIR=${HACKDIR}
3042
3673
eval HACKDIR=${HACKDIR}
3043
3674
eval HACKDIR=${HACKDIR}
 
3675
eval HACK_CONF_DIR=${HACK_CONF_DIR}
 
3676
eval HACK_CONF_DIR=${HACK_CONF_DIR}
 
3677
eval HACK_CONF_DIR=${HACK_CONF_DIR}
 
3678
eval HACK_CONF_DIR=${HACK_CONF_DIR}
 
3679
eval HACK_CONF_DIR=${HACK_CONF_DIR}
 
3680
eval HACK_CONF_DIR=${HACK_CONF_DIR}
3044
3681
 
3045
3682
# canonicalize slashes.
3046
 
bindir=`echo  "${bindir}"  | sed 's@/$@@;s@//*@/@g'`
3047
 
HACKDIR=`echo "${HACKDIR}" | sed 's@/$@@;s@//*@/@g'`
3048
 
 
3049
 
 
3050
 
# Sanity check the subdir
 
3683
bindir=`echo  "${bindir}"              | sed 's@/$@@;s@//*@/@g'`
 
3684
HACKDIR=`echo "${HACKDIR}"             | sed 's@/$@@;s@//*@/@g'`
 
3685
HACK_CONF_DIR=`echo "${HACK_CONF_DIR}" | sed 's@/$@@;s@//*@/@g'`
 
3686
 
 
3687
 
 
3688
# Sanity check the hackdir
3051
3689
for bad_choice in xscreensaver xscreensaver-demo xscreensaver-command ; do
3052
3690
  if test "${HACKDIR}" = "${bindir}/${bad_choice}" ; then
3053
3691
    echo ""
3054
 
    AC_MSG_ERROR([\"--enable-subdir=${bindir}/${bad_choice}\" won't work.
 
3692
    AC_MSG_ERROR([\"--with-hackdir=${bindir}/${bad_choice}\" won't work.
3055
3693
                   There will be an executable installed with that name, so
3056
3694
                   that can't be the name of a directory as well.  Please
3057
3695
                   re-configure with a different directory name.])
3061
3699
 
3062
3700
do_dir_warning=no
3063
3701
 
3064
 
# Now let's see if there's a previous RPM version already installed.  Blargh!
3065
 
 
3066
 
# M4 sucks!!
3067
 
changequote(X,Y)
3068
 
rpmv=`(rpm -qv xscreensaver) 2>&- | \
3069
 
      sed -n 's/^xscreensaver-\([0-9][0-9]*[.][0-9][0-9]*\)-.*$/\1/p'`
3070
 
changequote([,])
3071
 
 
3072
 
if test \! -z "$rpmv" ; then
3073
 
  rpmbdir=`rpm -ql xscreensaver | sed -n 's@^\(.*\)/xscreensaver-demo$@\1@p'`
3074
 
  rpmhdir=`rpm -ql xscreensaver | sed -n 's@^\(.*\)/attraction$@\1@p'`
3075
 
 
3076
 
  warning=no
3077
 
  warnL "There is already an installed RPM of xscreensaver $rpmv"
3078
 
  warn2 "on this system.  You might want to remove it (with"
3079
 
  warn2 '"rpm -ve xscreensaver") before running "make install"'
3080
 
  warn2 "from this directory."
3081
 
  echo ""
3082
 
  warn2 "Alternately, you could build this version of xscreensaver"
3083
 
  warn2 'as an RPM, and then install that.  An "xscreensaver.spec"'
3084
 
  warn2 "file is included.  See the RPM documentation for more info."
3085
 
  echo ""
3086
 
 
3087
 
  if test "$rpmbdir" = "$rpmhdir" ; then
3088
 
    warn2 "The RPM version was installed in $rpmbdir."
3089
 
  else
3090
 
    warn2 "The RPM version was installed in $rpmbdir,"
3091
 
    warn2 "with demos in $rpmhdir."
 
3702
# Now let's warn if there's a previous RPM version already installed.
 
3703
# But don't bother with this test if we are currently *building* an RPM.
 
3704
 
 
3705
if test -z "$RPM_PACKAGE_VERSION" ; then
 
3706
 
 
3707
  rpmnames="xscreensaver xscreensaver-base xscreensaver-extras"
 
3708
 
 
3709
  # M4 sucks!!
 
3710
  changequote(X,Y)
 
3711
  rpmv=`(rpm -qv $rpmnames) 2>/dev/null | \
 
3712
        sed -n 's/^[-a-z]*-\([0-9][0-9]*[.][0-9][0-9a-z]*\)-.*$/\1/p' | \
 
3713
        head -1`
 
3714
  changequote([,])
 
3715
 
 
3716
  if test \! -z "$rpmv" ; then
 
3717
    rpmbdir=`rpm -ql $rpmnames | sed -n 's@^\(.*\)/xscreensaver-demo$@\1@p'`
 
3718
    rpmhdir=`rpm -ql $rpmnames | sed -n 's@^\(.*\)/attraction$@\1@p'`
 
3719
 
 
3720
    warning=no
 
3721
    warnL "There is already an installed RPM of xscreensaver $rpmv"
 
3722
    warn2 'on this system.  You might want to remove it ("rpm -ve")'
 
3723
    warn2 'before running "make install" in this directory.'
 
3724
    echo ""
 
3725
    warn2 "Alternately, you could build this version of xscreensaver"
 
3726
    warn2 'as an RPM, and then install that.  An "xscreensaver.spec"'
 
3727
    warn2 'file is included.  Try "rpmbuild -v -ba xscreensaver.spec".'
 
3728
    warn2 "See the RPM documentation for more info."
 
3729
    echo ""
 
3730
 
 
3731
    if test "$rpmbdir" = "$rpmhdir" ; then
 
3732
      warn2 "The RPM version was installed in $rpmbdir/."
 
3733
      do_dir_warning=yes
 
3734
    else
 
3735
      warn2 "The RPM version was installed in $rpmbdir/,"
 
3736
      warn2 "with demos in $rpmhdir/."
 
3737
    fi
3092
3738
  fi
3093
 
 
3094
 
  do_dir_warning=yes
3095
3739
fi
3096
3740
 
3097
 
 
3098
 
# Warn about egregious GNOME bogosity.
3099
 
#
3100
 
#if (rpm -qv control-center) >&- 2>&- ; then
3101
 
#  warning=no
3102
 
#  warnL "The Gnome Control Center seems to be installed."
3103
 
#  echo  ""
3104
 
#  warn2 "Note that simply installing this version of xscreensaver"
3105
 
#  warn2 "will not cause GNOME to know about the newly-added display"
3106
 
#  warn2 "modes -- GNOME is just lame that way.  Instead of using the"
3107
 
#  warn2 "Control Center, try using the \`xscreensaver-demo' command."
3108
 
#fi
3109
 
 
3110
 
 
3111
3741
if test "${bindir}" = "${HACKDIR}" ; then
3112
3742
  do_dir_warning=yes
3113
3743
fi
3118
3748
  echo ""
3119
3749
  echo '      When you run "make install", the "xscreensaver",'
3120
3750
  echo '      "xscreensaver-demo", and "xscreensaver-command" executables'
3121
 
  echo "      will be installed in ${bindir}."
3122
 
  echo ""
3123
 
  echo "      The various graphics demos (120+ different executables) will"
3124
 
  echo "      also be installed in ${HACKDIR}."
3125
 
  echo ""
3126
 
  echo "      If you would prefer the demos to be installed elsewhere"
3127
 
  echo "      (for example, in a dedicated directory) you should re-run"
3128
 
  echo "      configure with the --enable-subdir=DIR option.  For more"
3129
 
  echo "      information, run $0 --help."
 
3751
  echo "      will be installed in ${bindir}/."
 
3752
  echo ""
 
3753
  echo "      The various graphics demos (190+ different executables) will"
 
3754
  echo "      be installed in ${HACKDIR}/."
 
3755
  echo ""
 
3756
  echo "      If you would prefer the demos to be installed elsewhere,"
 
3757
  echo "      you should re-run configure with the --with-hackdir=DIR"
 
3758
  echo "      option.  For more information, run \`./configure --help'."
3130
3759
  warning=yes
3131
3760
fi
3132
3761
 
3133
3762
if test "$warning" != no; then
3134
3763
  echo '' ; echo "$warnsep" ; echo ''
3135
3764
fi
 
3765
 
 
3766
if test "$do_dir_warning" = no; then
 
3767
  if test "$warning" = no; then
 
3768
    echo ''
 
3769
  fi
 
3770
  echo "User programs will be installed in ${bindir}/"
 
3771
  echo "Screen savers will be installed in ${HACKDIR}/"
 
3772
  echo "Configuration will be installed in ${HACK_CONF_DIR}/"
 
3773
  echo ''
 
3774
fi