From 2587581c41ae254fc09eb6a940b97e53d862fa3e Mon Sep 17 00:00:00 2001 From: Peter Breitenlohner Date: Thu, 30 Apr 2009 14:03:03 +0000 Subject: new build system: update for texk/xdvik/ git-svn-id: svn://tug.org/texlive/trunk@12895 c570f23f-e606-0410-a88d-b1316a301751 --- Build/source/texk/xdvik/configure | 633 +++++++++++++++++--------- Build/source/texk/xdvik/configure.ac | 24 +- Build/source/texk/xdvik/m4/xdvi-check-xaw.m4 | 27 +- Build/source/texk/xdvik/m4/xdvi-find-motif.m4 | 263 ++++++----- Build/source/texk/xdvik/m4/xdvi-find-xpm.m4 | 88 ++-- 5 files changed, 651 insertions(+), 384 deletions(-) (limited to 'Build/source/texk') diff --git a/Build/source/texk/xdvik/configure b/Build/source/texk/xdvik/configure index 9986dd1b236..41f8b47c763 100755 --- a/Build/source/texk/xdvik/configure +++ b/Build/source/texk/xdvik/configure @@ -1636,9 +1636,7 @@ Optional Packages: --with-xpm-libdir=DIR Specify the location of Xpm libraries --with-motif-include=DIR Specify the location of Motif include files - motif_include=$withval --with-motif-libdir=DIR Specify the location of Motif libraries - motif_libdir=$withval --with-system-kpathsea use installed kpathsea headers and library --with-kpathsea-includes=DIR kpathsea headers installed in DIR @@ -4245,13 +4243,13 @@ if test "${lt_cv_nm_interface+set}" = set; then else lt_cv_nm_interface="BSD nm" echo "int some_variable = 0;" > conftest.$ac_ext - (eval echo "\"\$as_me:4248: $ac_compile\"" >&5) + (eval echo "\"\$as_me:4246: $ac_compile\"" >&5) (eval "$ac_compile" 2>conftest.err) cat conftest.err >&5 - (eval echo "\"\$as_me:4251: $NM \\\"conftest.$ac_objext\\\"\"" >&5) + (eval echo "\"\$as_me:4249: $NM \\\"conftest.$ac_objext\\\"\"" >&5) (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out) cat conftest.err >&5 - (eval echo "\"\$as_me:4254: output\"" >&5) + (eval echo "\"\$as_me:4252: output\"" >&5) cat conftest.out >&5 if $GREP 'External.*some_variable' conftest.out > /dev/null; then lt_cv_nm_interface="MS dumpbin" @@ -5457,7 +5455,7 @@ ia64-*-hpux*) ;; *-*-irix6*) # Find out which ABI we are using. - echo '#line 5460 "configure"' > conftest.$ac_ext + echo '#line 5458 "configure"' > conftest.$ac_ext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? @@ -7504,11 +7502,11 @@ else -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:7507: $lt_compile\"" >&5) + (eval echo "\"\$as_me:7505: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:7511: \$? = $ac_status" >&5 + echo "$as_me:7509: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. @@ -7843,11 +7841,11 @@ else -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:7846: $lt_compile\"" >&5) + (eval echo "\"\$as_me:7844: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:7850: \$? = $ac_status" >&5 + echo "$as_me:7848: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. @@ -7948,11 +7946,11 @@ else -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:7951: $lt_compile\"" >&5) + (eval echo "\"\$as_me:7949: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 - echo "$as_me:7955: \$? = $ac_status" >&5 + echo "$as_me:7953: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized @@ -8003,11 +8001,11 @@ else -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:8006: $lt_compile\"" >&5) + (eval echo "\"\$as_me:8004: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 - echo "$as_me:8010: \$? = $ac_status" >&5 + echo "$as_me:8008: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized @@ -10803,7 +10801,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 10806 "configure" +#line 10804 "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -10899,7 +10897,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 10902 "configure" +#line 10900 "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -20188,8 +20186,6 @@ fi # Check whether -lXpm can be used -xpm_includes= -xpm_libraries= # Check whether --with-xpm was given. if test "${with_xpm+set}" = set; then @@ -20199,14 +20195,16 @@ fi # Check whether --with-xpm-includes was given. if test "${with_xpm_includes+set}" = set; then withval=$with_xpm_includes; xpm_includes=$withval +else + xpm_includes= fi - # Check whether --with-xpm-libraries was given. if test "${with_xpm_libraries+set}" = set; then withval=$with_xpm_libraries; xpm_libraries=$withval +else + xpm_libraries= fi - if test "x$with_xpm" = xno; then xpm_includes=no xpm_libraries=no @@ -20303,25 +20301,32 @@ fi xpm_includes=$xdvi_cv_xpm_includes fi -if test "x$xpm_includes" != x; then - if test "x$xpm_includes" = xdefault; then +if test "x$xpm_includes" = xdefault; then cat >>confdefs.h <<\_ACEOF #define HAVE_X11_XPM_H 1 _ACEOF - elif test -f "$xpm_includes/X11/xpm.h"; then - cat >>confdefs.h <<\_ACEOF +elif test -f "$xpm_includes/X11/xpm.h"; then + cat >>confdefs.h <<\_ACEOF #define HAVE_X11_XPM_H 1 _ACEOF - elif test -f "$xpm_includes/xpm.h"; then +elif test -f "$xpm_includes/xpm.h"; then cat >>confdefs.h <<\_ACEOF #define HAVE_XPM_H 1 _ACEOF - fi +fi +# +# Add Xpm definition to X_CFLAGS (and remember previous value) +# +xdvi_xpm_save_X_CFLAGS=$X_CFLAGS +if test "x$xpm_includes" != xdefault \ + && test "x$xpm_includes" != "x$x_includes" && test "x$xpm_includes" != xno +then + X_CFLAGS="-I$xpm_includes $X_CFLAGS" fi # # Check the libraries. @@ -20423,69 +20428,63 @@ fi xpm_libraries="$xdvi_cv_xpm_libraries" fi # -# Add Xpm definitions to X flags +# Report the results of headers and libraries. # -if test "x$xpm_includes" != xdefault && test "x$xpm_includes" != x \ - && test "x$xpm_includes" != "x$x_includes" && test "x$xpm_includes" != xno -then - X_CFLAGS="-I$xpm_includes $X_CFLAGS" +xdvi_use_xpm=yes +# +# +xpm_libraries_result=$xpm_libraries +if test "x$xpm_libraries_result" = xdefault; then + xpm_libraries_result="in default path" +elif test "x$xpm_libraries_result" = xno; then + xpm_libraries_result="(none)" + xdvi_use_xpm=no fi # -if test "x$xpm_libraries" != xdefault && test "x$xpm_libraries" != x \ - && test "x$xpm_libraries" != "x$x_libraries" && test "x$xpm_libraries" != xno -then - case "$X_LIBS" in - *-R\ *) X_LIBS="-L$xpm_libraries -R $xpm_libraries $X_LIBS";; - *-R*) X_LIBS="-L$xpm_libraries -R$xpm_libraries $X_LIBS";; - *) X_LIBS="-L$xpm_libraries $X_LIBS";; - esac +xpm_includes_result=$xpm_includes +if test "x$xpm_includes_result" = xdefault; then + xpm_includes_result="in default path" +elif test "x$xpm_includes_result" = xno; then + xpm_includes_result="(none)" + xdvi_use_xpm=no fi # -# Now check the results of headers and libraries and set USE_XPM to 0 -# if one of them hadn't been found. +{ $as_echo "$as_me:$LINENO: result: libraries $xpm_libraries_result, headers $xpm_includes_result" >&5 +$as_echo "libraries $xpm_libraries_result, headers $xpm_includes_result" >&6; } # +if test "x$xdvi_use_xpm" = xyes; then + # + # Add Xpm definition to X_LIBS + # + if test "x$xpm_libraries" != xdefault \ + && test "x$xpm_libraries" != "x$x_libraries" && test "x$xpm_libraries" != xno + then + case "$X_LIBS" in + *-R\ *) X_LIBS="-L$xpm_libraries -R $xpm_libraries $X_LIBS";; + *-R*) X_LIBS="-L$xpm_libraries -R$xpm_libraries $X_LIBS";; + *) X_LIBS="-L$xpm_libraries $X_LIBS";; + esac + fi + # cat >>confdefs.h <<\_ACEOF #define USE_XPM 1 _ACEOF -x_xpm_libs="-lXpm" -# -xpm_libraries_result=$xpm_libraries -if test "x$xpm_libraries_result" = xdefault ; then - xpm_libraries_result="in default path" -elif test "x$xpm_libraries_result" = xno || test "x$xpm_libraries_result" = x; then - xpm_libraries_result="(none)" + x_xpm_libs="-lXpm" +else + # Restore previous X_CFLAGS + X_CFLAGS=$xdvi_xpm_save_X_CFLAGS cat >>confdefs.h <<\_ACEOF #define USE_XPM 0 _ACEOF - x_xpm_libs="" + x_xpm_libs= fi -# -xpm_includes_result=$xpm_includes -if test "x$xpm_includes_result" = xdefault; then - xpm_includes_result="in default path" -elif test "x$xpm_includes_result" = xno || test "x$xpm_includes_result" = x; then - cat >>confdefs.h <<\_ACEOF -#define USE_XPM 0 -_ACEOF - - xpm_includes_result="(none)" -fi -# -{ $as_echo "$as_me:$LINENO: result: libraries $xpm_libraries_result, headers $xpm_includes_result" >&5 -$as_echo "libraries $xpm_libraries_result, headers $xpm_includes_result" >&6; } -# Check for libXext and libXp. -# Although libXp is now defunct (no longer part of XOrg), older versions -# of libXm may need to include libXp. Same for the equally defunct libXaw8. -# We certainly don't want to include libXp unless necessay,this would just -# perpetuate the need to keep libXp.so around. Moreover for ELF shared -# libraries the need for libXp is probably encoded into libXm.so and/or -# libXaw.so and need not to be specified explicitly. +# Check for libXext. if test -n "$x_libraries"; then XLFLAG="-L$x_libraries" else @@ -20562,7 +20561,17 @@ if test "x$ac_cv_lib_Xext_XextCreateExtension" = x""yes; then x_ext_lib='-lXext' fi - { $as_echo "$as_me:$LINENO: checking for XpQueryVersion in -lXp" >&5 +fi + + +# Check for libXp. +# Although libXp is now defunct (no longer part of XOrg), older versions +# of libXm may need to link with libXp; same for the equally defunct libXaw8. +# We certainly don't want to include libXp unless necessay, since this might +# only perpetuate the need to keep libXp.so around. +# Moreover for ELF shared libraries a requirement for libXp.so is probably +# encoded into libXm.so and/or libXaw.so and need not be specified explicitly. +{ $as_echo "$as_me:$LINENO: checking for XpQueryVersion in -lXp" >&5 $as_echo_n "checking for XpQueryVersion in -lXp... " >&6; } if test "${ac_cv_lib_Xp_XpQueryVersion+set}" = set; then $as_echo_n "(cached) " >&6 @@ -20631,8 +20640,6 @@ if test "x$ac_cv_lib_Xp_XpQueryVersion" = x""yes; then x_xp_lib='-lXp' fi -fi - # Check which toolkit was specified case $with_xdvi_x_toolkit in @@ -20657,12 +20664,15 @@ elif test "x$with_xdvi_x_toolkit" = xneXtaw; then prog_extension="nextaw" x_tool_libs="-lneXtaw" else - # Check for Xaw headers + # Check for Xaw headers and library version save_CPPFLAGS=$CPPFLAGS CPPFLAGS="$CPPFLAGS $X_CFLAGS" { $as_echo "$as_me:$LINENO: checking for Xaw headers" >&5 $as_echo_n "checking for Xaw headers... " >&6; } -cat >conftest.$ac_ext <<_ACEOF +if test "${xdvi_cv_xaw_headers+set}" = set; then + $as_echo_n "(cached) " >&6 +else + cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext @@ -20702,17 +20712,19 @@ $as_echo "$ac_try_echo") >&5 test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then - xdvi_have_xaw=yes + xdvi_cv_xaw_headers=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - xdvi_have_xaw=no + xdvi_cv_xaw_headers=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ $as_echo "$as_me:$LINENO: result: $xdvi_have_xaw" >&5 -$as_echo "$xdvi_have_xaw" >&6; } +fi +{ $as_echo "$as_me:$LINENO: result: $xdvi_cv_xaw_headers" >&5 +$as_echo "$xdvi_cv_xaw_headers" >&6; } +xdvi_have_xaw=$xdvi_cv_xaw_headers # if test "x$xdvi_have_xaw" = xyes; then { $as_echo "$as_me:$LINENO: checking for SimpleClassPart.extension" >&5 @@ -20847,39 +20859,34 @@ CPPFLAGS=$save_CPPFLAGS default_toolkit=Xaw fi -motif_include= -motif_libdir= # Check whether --with-motif-include was given. if test "${with_motif_include+set}" = set; then - withval=$with_motif_include; + withval=$with_motif_include; motif_include=$withval +else + motif_include= fi - # Check whether --with-motif-libdir was given. if test "${with_motif_libdir+set}" = set; then - withval=$with_motif_libdir; + withval=$with_motif_libdir; motif_libdir=$withval +else + motif_libdir= fi - { $as_echo "$as_me:$LINENO: checking for Motif" >&5 $as_echo_n "checking for Motif... " >&6; } # # Search the include files. # -if test "$motif_include" = ""; then +if test "x$motif_include" = x; then if test "${xdvi_cv_motif_include+set}" = set; then $as_echo_n "(cached) " >&6 else - -xdvi_motif_save_LIBS="$LIBS" -xdvi_motif_save_CFLAGS="$CFLAGS" -xdvi_motif_save_CPPFLAGS="$CPPFLAGS" -xdvi_motif_save_LDFLAGS="$LDFLAGS" + xdvi_motif_save_CFLAGS=$CFLAGS +xdvi_motif_save_CPPFLAGS=$CPPFLAGS # -LIBS="$X_PRE_LIBS -lXm -lXt -lX11 $X_EXTRA_LIBS $LIBS" CFLAGS="$X_CFLAGS $CFLAGS" CPPFLAGS="$X_CFLAGS $CPPFLAGS" -LDFLAGS="$X_LIBS $LDFLAGS" # cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -20914,16 +20921,14 @@ $as_echo "$ac_try_echo") >&5 test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then - -# Xm/Xm.h is in the standard search path. -xdvi_cv_motif_include= - + # Xm/Xm.h is in the standard search path. + xdvi_cv_motif_include=default else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - -# Xm/Xm.h is not in the standard search path. + # Xm/Xm.h is not in the standard search path. + xdvi_cv_motif_include=no # Locate it and put its directory in `motif_include' # # /usr/include/Motif* are used on HP-UX (Motif). @@ -20939,42 +20944,43 @@ for dir in "$x_includes" "${prefix}/include" /usr/include /usr/local/include \ "${prefix}"/*/include /usr/*/include /usr/local/*/include \ "${prefix}"/include/* /usr/include/* /usr/local/include/*; do if test -f "$dir/Xm/Xm.h"; then - xdvi_cv_motif_include="$dir" + xdvi_cv_motif_include=$dir break fi done -if test "$xdvi_cv_motif_include" = ""; then -xdvi_cv_motif_include=no -fi - fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext # -LIBS="$xdvi_motif_save_LIBS" -CFLAGS="$xdvi_motif_save_CFLAGS" -CPPFLAGS="$xdvi_motif_save_CPPFLAGS" -LDFLAGS="$xdvi_motif_save_LDFLAGS" - +CFLAGS=$xdvi_motif_save_CFLAGS +CPPFLAGS=$xdvi_motif_save_CPPFLAGS fi -motif_include="$xdvi_cv_motif_include" +motif_include=$xdvi_cv_motif_include +fi +# +# Add Motif definition to X_CFLAGS (and remember previous value) +# +xdvi_motif_save_X_CFLAGS=$X_CFLAGS +if test "x$motif_include" != xdefault \ + && test "x$motif_include" != "x$x_includes" && test "x$motif_include" != xno +then + X_CFLAGS="-I$motif_include $X_CFLAGS" fi # # Now for the libraries. # -if test "$motif_libdir" = ""; then +if test "x$motif_libdir" = x; then if test "${xdvi_cv_motif_libdir+set}" = set; then $as_echo_n "(cached) " >&6 else - -xdvi_motif_save_LIBS="$LIBS" -xdvi_motif_save_CFLAGS="$CFLAGS" -xdvi_motif_save_CPPFLAGS="$CPPFLAGS" -xdvi_motif_save_LDFLAGS="$LDFLAGS" + xdvi_motif_save_LIBS=$LIBS +xdvi_motif_save_CFLAGS=$CFLAGS +xdvi_motif_save_CPPFLAGS=$CPPFLAGS +xdvi_motif_save_LDFLAGS=$LDFLAGS # -LIBS="$X_PRE_LIBS -lXm -lXt -lX11 $X_EXTRA_LIBS $LIBS" +LIBS="$X_PRE_LIBS -lXm $x_xp_lib -lXt -lX11 $X_EXTRA_LIBS $LIBS" CFLAGS="$X_CFLAGS $CFLAGS" CPPFLAGS="$X_CFLAGS $CPPFLAGS" LDFLAGS="$X_LIBS $LDFLAGS" @@ -20989,7 +20995,6 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include - int main () { @@ -21019,16 +21024,14 @@ $as_echo "$ac_try_echo") >&5 test "$cross_compiling" = yes || $as_test_x conftest$ac_exeext }; then - -# libXm.a is in the standard search path. -xdvi_cv_motif_libdir= - + # libXm.a is in the standard search path. + xdvi_cv_motif_libdir=default else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - -# libXm.a is not in the standard search path. + # libXm.a is not in the standard search path. + xdvi_cv_motif_libdir=no # Locate it and put its directory in `motif_libdir' # # /usr/lib/Motif* are used on HP-UX (Motif). @@ -21046,88 +21049,158 @@ for dir in "$x_libraries" "${prefix}/lib" /usr/lib /usr/local/lib \ "${prefix}"/*/lib /usr/*/lib /usr/local/*/lib \ "${prefix}"/lib/* /usr/lib/* /usr/local/lib/*; do if test -d "$dir" && test "`ls $dir/libXm.* 2> /dev/null`" != ""; then - xdvi_cv_motif_libdir="$dir" + xdvi_cv_motif_libdir=$dir break fi done -if test "$xdvi_cv_motif_libdir" = ""; then -xdvi_cv_motif_libdir=no -fi - fi rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext # -LIBS="$xdvi_motif_save_LIBS" -CFLAGS="$xdvi_motif_save_CFLAGS" -CPPFLAGS="$xdvi_motif_save_CPPFLAGS" -LDFLAGS="$xdvi_motif_save_LDFLAGS" - +LIBS=$xdvi_motif_save_LIBS +CFLAGS=$xdvi_motif_save_CFLAGS +CPPFLAGS=$xdvi_motif_save_CPPFLAGS +LDFLAGS=$xdvi_motif_save_LDFLAGS fi # motif_libdir="$xdvi_cv_motif_libdir" fi -# Add Motif definitions to X flags # -if test "$motif_include" != "" && test "$motif_include" != "$x_includes" && test "$motif_include" != "no" -then -X_CFLAGS="-I$motif_include $X_CFLAGS" +# Report the results of headers and libraries. +# +xdvi_have_motif=yes +# +motif_libdir_result=$motif_libdir +if test "x$motif_libdir_result" = xdefault; then + motif_libdir_result="in default path" +elif test "x$motif_libdir_result" = xno; then + motif_libdir_result="(none)" + xdvi_have_motif=no fi -if test "$motif_libdir" != "" && test "$motif_libdir" != "$x_libraries" && test "$motif_libdir" != "no" -then -case "$X_LIBS" in - *-R\ *) X_LIBS="-L$motif_libdir -R $motif_libdir $X_LIBS";; - *-R*) X_LIBS="-L$motif_libdir -R$motif_libdir $X_LIBS";; - *) X_LIBS="-L$motif_libdir $X_LIBS";; -esac +# +motif_include_result=$motif_include +if test "x$motif_include_result" = xdefault; then + motif_include_result="in default path" +elif test "x$motif_include_result" = xno; then + motif_include_result="(none)" + xdvi_have_motif=no fi # +{ $as_echo "$as_me:$LINENO: result: libraries $motif_libdir_result, headers $motif_include_result" >&5 +$as_echo "libraries $motif_libdir_result, headers $motif_include_result" >&6; } # -motif_libdir_result="$motif_libdir" -motif_include_result="$motif_include" -test "$motif_libdir_result" = "" && - motif_libdir_result="in default path" && +if test "x$xdvi_have_motif" = xyes; then + # + # Add Motif definition to X_LIBS + # + if test "x$motif_libdir" != xdefault \ + && test "x$motif_libdir" != "x$x_libraries" && test "x$motif_libdir" != no + then + case "$X_LIBS" in + *-R\ *) X_LIBS="-L$motif_libdir -R $motif_libdir $X_LIBS";; + *-R*) X_LIBS="-L$motif_libdir -R$motif_libdir $X_LIBS";; + *) X_LIBS="-L$motif_libdir $X_LIBS";; + esac + fi + # + prog_extension="motif" + cat >>confdefs.h <<\_ACEOF #define MOTIF 1 _ACEOF -test "$motif_include_result" = "" && - motif_include_result="in default path" && cat >>confdefs.h <<\_ACEOF -#define MOTIF 1 + x_tool_libs="-lXm" + if test "x$x_xp_lib" != x; then + # check if libXm requires libXp + { $as_echo "$as_me:$LINENO: checking if libXm requires libXp" >&5 +$as_echo_n "checking if libXm requires libXp... " >&6; } +if test "${xdvi_cv_motif_xp+set}" = set; then + $as_echo_n "(cached) " >&6 +else + xdvi_motif_save_LIBS=$LIBS +xdvi_motif_save_CFLAGS=$CFLAGS +xdvi_motif_save_CPPFLAGS=$CPPFLAGS +xdvi_motif_save_LDFLAGS=$LDFLAGS +# +LIBS="$X_PRE_LIBS -lXm -lXt -lX11 $X_EXTRA_LIBS $LIBS" +CFLAGS="$X_CFLAGS $CFLAGS" +CPPFLAGS="$X_CFLAGS $CPPFLAGS" +LDFLAGS="$X_LIBS $LDFLAGS" +# +# We use XtToolkitInitialize() here since it takes no arguments +# and thus also works with a C++ compiler. +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ _ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +#include +int +main () +{ +XtToolkitInitialize(); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then + xdvi_cv_motif_xp=no +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 -if test "$motif_libdir_result" = "no"; then - if test "$default_toolkit" = "none"; then - motif_libdir_result="(none)" - else - motif_libdir_result="" - fi -fi -if test "$motif_include_result" = "no"; then - if test "$default_toolkit" = "none"; then - motif_include_result="(none)" - else - motif_include_result="" - fi + xdvi_cv_motif_xp=yes fi -if test "$motif_include_result" != "" && test "$motif_libdir_result" != ""; then - { $as_echo "$as_me:$LINENO: result: libraries $motif_libdir_result, headers $motif_include_result" >&5 -$as_echo "libraries $motif_libdir_result, headers $motif_include_result" >&6; } - prog_extension="motif" - cat >>confdefs.h <<\_ACEOF -#define MOTIF 1 -_ACEOF +rm -rf conftest.dSYM +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext +# +LIBS=$xdvi_motif_save_LIBS +CFLAGS=$xdvi_motif_save_CFLAGS +CPPFLAGS=$xdvi_motif_save_CPPFLAGS +LDFLAGS=$xdvi_motif_save_LDFLAGS +fi +{ $as_echo "$as_me:$LINENO: result: $xdvi_cv_motif_xp" >&5 +$as_echo "$xdvi_cv_motif_xp" >&6; } +if test "x$xdvi_cv_motif_xp" = xyes; then + x_tool_libs="$x_tool_libs $x_xp_lib" +fi - x_tool_libs="-lXm" + fi # now warn if we're using LessTif (see LESSTIF-BUGS for why ...) { $as_echo "$as_me:$LINENO: checking for LessTif" >&5 $as_echo_n "checking for LessTif... " >&6; } -save_CPPFLAGS="$CPPFLAGS" +if test "${xdvi_cv_using_lesstif+set}" = set; then + $as_echo_n "(cached) " >&6 +else + save_CPPFLAGS=$CPPFLAGS CPPFLAGS="$CPPFLAGS $X_CFLAGS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -21135,7 +21208,6 @@ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ - #include #include #include @@ -21146,7 +21218,6 @@ int main () { const char *p = LesstifVERSION_STRING; - ; return 0; } @@ -21169,11 +21240,21 @@ $as_echo "$ac_try_echo") >&5 test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then + xdvi_cv_using_lesstif=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 -# yes, we're running LessTif -{ $as_echo "$as_me:$LINENO: result: yes" >&5 -$as_echo "yes" >&6; } -{ $as_echo "$as_me:$LINENO: WARNING: LessTif header detected. + xdvi_cv_using_lesstif=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +CPPFLAGS=$save_CPPFLAGS +fi +{ $as_echo "$as_me:$LINENO: result: $xdvi_cv_using_lesstif" >&5 +$as_echo "$xdvi_cv_using_lesstif" >&6; } +if test "x$xdvi_cv_using_lesstif" = xyes; then + { $as_echo "$as_me:$LINENO: WARNING: LessTif header detected. ***************************************************************** * Warning: You are using LessTif instead of OpenMotif. * * Some GUI elements might be broken; please see the file * @@ -21191,25 +21272,15 @@ $as_echo "$as_me: WARNING: LessTif header detected. * * * for more information. * *****************************************************************" >&2;} - -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - -# no, not running LessTif -{ $as_echo "$as_me:$LINENO: result: no" >&5 -$as_echo "no" >&6; } - fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -CPPFLAGS=$save_CPPFLAGS - # Check whether to compile for Motif with Xaw Panner. { $as_echo "$as_me:$LINENO: checking whether to compile in panner (requires Xaw)" >&5 $as_echo_n "checking whether to compile in panner (requires Xaw)... " >&6; } -save_CPPFLAGS=$CPPFLAGS +if test "${xdvi_cv_use_xaw_panner+set}" = set; then + $as_echo_n "(cached) " >&6 +else + save_CPPFLAGS=$CPPFLAGS CPPFLAGS="$CPPFLAGS $X_CFLAGS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -21217,7 +21288,6 @@ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ - #include #include #include @@ -21251,19 +21321,20 @@ $as_echo "$ac_try_echo") >&5 test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then - xdvi_use_xaw_panner=yes + xdvi_cv_use_xaw_panner=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - xdvi_use_xaw_panner=no + xdvi_cv_use_xaw_panner=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext CPPFLAGS=$save_CPPFLAGS -{ $as_echo "$as_me:$LINENO: result: $xdvi_use_xaw_panner" >&5 -$as_echo "$xdvi_use_xaw_panner" >&6; } -if test "x$xdvi_use_xaw_panner" = xyes; then +fi +{ $as_echo "$as_me:$LINENO: result: $xdvi_cv_use_xaw_panner" >&5 +$as_echo "$xdvi_cv_use_xaw_panner" >&6; } +if test "x$xdvi_cv_use_xaw_panner" = xyes; then cat >>confdefs.h <<\_ACEOF #define USE_XAW_PANNER 1 @@ -21271,10 +21342,16 @@ _ACEOF fi +elif test "x$default_toolkit" = xnone; then + { { $as_echo "$as_me:$LINENO: error: No Motif." >&5 +$as_echo "$as_me: error: No Motif." >&2;} + { (exit 1); exit 1; }; } else - { $as_echo "$as_me:$LINENO: result: not found, using Xaw" >&5 -$as_echo "not found, using Xaw" >&6; } - with_xdvi_x_toolkit="xaw" + # Restore previous X_CFLAGS + X_CFLAGS=$xdvi_motif_save_X_CFLAGS + { $as_echo "$as_me:$LINENO: No Motif, using Xaw." >&5 +$as_echo "$as_me: No Motif, using Xaw." >&6;} + with_xdvi_x_toolkit="xaw" fi @@ -21283,11 +21360,157 @@ fi # Requested or fallback to Xaw, check for library if test "x$xdvi_have_xaw" = xyes; then - : + # First try without libXp + { $as_echo "$as_me:$LINENO: checking for XawInitializeWidgetSet in -lXaw" >&5 +$as_echo_n "checking for XawInitializeWidgetSet in -lXaw... " >&6; } +if test "${ac_cv_lib_Xaw_XawInitializeWidgetSet+set}" = set; then + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lXaw $x_xmu_lib -lXt $X_PRE_LIBS $x_ext_lib $x_xpm_libs -lX11 $X_EXTRA_LIBS $XLFLAG $LIBS" +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char XawInitializeWidgetSet (); +int +main () +{ +return XawInitializeWidgetSet (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then + ac_cv_lib_Xaw_XawInitializeWidgetSet=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_lib_Xaw_XawInitializeWidgetSet=no +fi + +rm -rf conftest.dSYM +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_Xaw_XawInitializeWidgetSet" >&5 +$as_echo "$ac_cv_lib_Xaw_XawInitializeWidgetSet" >&6; } +if test "x$ac_cv_lib_Xaw_XawInitializeWidgetSet" = x""yes; then + x_tool_libs="-lXaw" +else + # libXaw without libXp failed + if test "x$x_xp_lib" = x; then + xdvi_have_xaw=no + else + # Now try with libXp + { $as_echo "$as_me:$LINENO: checking for XawTextReplace in -lXaw" >&5 +$as_echo_n "checking for XawTextReplace in -lXaw... " >&6; } +if test "${ac_cv_lib_Xaw_XawTextReplace+set}" = set; then + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lXaw $x_xp_lib $x_xmu_lib -lXt $X_PRE_LIBS $x_ext_lib $x_xpm_libs -lX11 $X_EXTRA_LIBS $XLFLAG $LIBS" +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char XawTextReplace (); +int +main () +{ +return XawTextReplace (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then + ac_cv_lib_Xaw_XawTextReplace=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_lib_Xaw_XawTextReplace=no +fi + +rm -rf conftest.dSYM +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_Xaw_XawTextReplace" >&5 +$as_echo "$ac_cv_lib_Xaw_XawTextReplace" >&6; } +if test "x$ac_cv_lib_Xaw_XawTextReplace" = x""yes; then + x_tool_libs="-lXaw $x_xp_lib" +else + xdvi_have_xaw=no +fi + + fi +fi + fi if test "x$xdvi_have_xaw" = xyes; then prog_extension="xaw" - x_tool_libs="-lXaw" cat >>confdefs.h <<\_ACEOF #define XAW 1 diff --git a/Build/source/texk/xdvik/configure.ac b/Build/source/texk/xdvik/configure.ac index 7ee579d0554..9eb7050ac0b 100644 --- a/Build/source/texk/xdvik/configure.ac +++ b/Build/source/texk/xdvik/configure.ac @@ -171,13 +171,7 @@ fi # Check whether -lXpm can be used XDVI_FIND_XPM -# Check for libXext and libXp. -# Although libXp is now defunct (no longer part of XOrg), older versions -# of libXm may need to include libXp. Same for the equally defunct libXaw8. -# We certainly don't want to include libXp unless necessay,this would just -# perpetuate the need to keep libXp.so around. Moreover for ELF shared -# libraries the need for libXp is probably encoded into libXm.so and/or -# libXaw.so and need not to be specified explicitly. +# Check for libXext. AS_IF([test -n "$x_libraries"], [XLFLAG="-L$x_libraries"], [XLFLAG=]) @@ -185,12 +179,20 @@ if test -z "$x_ext_lib"; then # allow envvar override AC_CHECK_LIB([Xext], [XextCreateExtension], [x_ext_lib='-lXext'], [], [-lX11 $X_EXTRA_LIBS $XLFLAG]) - AC_CHECK_LIB([Xp], [XpQueryVersion], - [x_xp_lib='-lXp'], [], - [$x_ext_lib -lX11 $X_EXTRA_LIBS $XLFLAG]) fi AC_SUBST([x_ext_lib]) +# Check for libXp. +# Although libXp is now defunct (no longer part of XOrg), older versions +# of libXm may need to link with libXp; same for the equally defunct libXaw8. +# We certainly don't want to include libXp unless necessay, since this might +# only perpetuate the need to keep libXp.so around. +# Moreover for ELF shared libraries a requirement for libXp.so is probably +# encoded into libXm.so and/or libXaw.so and need not be specified explicitly. +AC_CHECK_LIB([Xp], [XpQueryVersion], + [x_xp_lib='-lXp'], [], + [$x_ext_lib -lX11 $X_EXTRA_LIBS $XLFLAG]) + # Check which toolkit was specified AS_CASE([$with_xdvi_x_toolkit], [next | nextaw | neXtaw], [val=neXtaw], @@ -210,7 +212,7 @@ elif test "x$with_xdvi_x_toolkit" = xneXtaw; then prog_extension="nextaw" x_tool_libs="-lneXtaw" else - # Check for Xaw headers + # Check for Xaw headers and library version XDVI_CHECK_XAW_HEADERS if test "x$with_xdvi_x_toolkit" != xxaw; then if test "x$with_xdvi_x_toolkit" = xmotif; then diff --git a/Build/source/texk/xdvik/m4/xdvi-check-xaw.m4 b/Build/source/texk/xdvik/m4/xdvi-check-xaw.m4 index a1421cd3141..6f7301c6340 100644 --- a/Build/source/texk/xdvik/m4/xdvi-check-xaw.m4 +++ b/Build/source/texk/xdvik/m4/xdvi-check-xaw.m4 @@ -12,8 +12,9 @@ AC_DEFUN([XDVI_CHECK_XAW_HEADERS], [save_CPPFLAGS=$CPPFLAGS CPPFLAGS="$CPPFLAGS $X_CFLAGS" -AC_MSG_CHECKING([for Xaw headers]) -AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ +AC_CACHE_CHECK([for Xaw headers], + [xdvi_cv_xaw_headers], + [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ #include #include #include @@ -21,9 +22,9 @@ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ #include #include #include ]])], - [xdvi_have_xaw=yes], - [xdvi_have_xaw=no]) -AC_MSG_RESULT([$xdvi_have_xaw]) + [xdvi_cv_xaw_headers=yes], + [xdvi_cv_xaw_headers=no])]) +xdvi_have_xaw=$xdvi_cv_xaw_headers # if test "x$xdvi_have_xaw" = xyes; then _XDVI_CHECK_XAW_VERSION @@ -55,11 +56,23 @@ m4_define([_XDVI_CHECK_XAW_VERSION], AC_DEFUN([XDVI_CHECK_XAW_LIBRARY], [AC_REQUIRE([XDVI_CHECK_XAW_HEADERS]) if test "x$xdvi_have_xaw" = xyes; then - : + # First try without libXp + AC_CHECK_LIB([Xaw], [XawInitializeWidgetSet], + [x_tool_libs="-lXaw"], + [# libXaw without libXp failed + if test "x$x_xp_lib" = x; then + xdvi_have_xaw=no + else + # Now try with libXp + AC_CHECK_LIB([Xaw], [XawTextReplace], + [x_tool_libs="-lXaw $x_xp_lib"], + [xdvi_have_xaw=no], + [$x_xp_lib $x_xmu_lib -lXt $X_PRE_LIBS $x_ext_lib $x_xpm_libs -lX11 $X_EXTRA_LIBS $XLFLAG]) + fi], + [$x_xmu_lib -lXt $X_PRE_LIBS $x_ext_lib $x_xpm_libs -lX11 $X_EXTRA_LIBS $XLFLAG]) fi if test "x$xdvi_have_xaw" = xyes; then prog_extension="xaw" - x_tool_libs="-lXaw" AC_DEFINE([XAW], 1, [Define to use the Xaw toolkit.]) else AC_MSG_ERROR([Sorry, you will need at least the Xaw header/library files to compile xdvik.]) diff --git a/Build/source/texk/xdvik/m4/xdvi-find-motif.m4 b/Build/source/texk/xdvik/m4/xdvi-find-motif.m4 index 160f43e18d7..09f8091ce4b 100644 --- a/Build/source/texk/xdvik/m4/xdvi-find-motif.m4 +++ b/Build/source/texk/xdvik/m4/xdvi-find-motif.m4 @@ -15,78 +15,91 @@ # If default_toolkit is not `none', use Xaw as toolkit if Motif isn't found. AC_DEFUN([XDVI_FIND_MOTIF], [AC_REQUIRE([AC_PATH_XTRA]) -motif_include= -motif_libdir= AC_ARG_WITH([motif-include], AS_HELP_STRING([--with-motif-include=DIR], - [Specify the location of Motif include files]) - [motif_include=$withval]) + [Specify the location of Motif include files]), + [motif_include=$withval], [motif_include=])[]dnl AC_ARG_WITH([motif-libdir], AS_HELP_STRING([--with-motif-libdir=DIR], - [Specify the location of Motif libraries]) - [motif_libdir=$withval]) + [Specify the location of Motif libraries]), + [motif_libdir=$withval], [motif_libdir=])[]dnl AC_MSG_CHECKING([for Motif]) # # Search the include files. # -if test "$motif_include" = ""; then +if test "x$motif_include" = x; then _XDVI_FIND_MOTIF_INCLUDES fi # +# Add Motif definition to X_CFLAGS (and remember previous value) +# +xdvi_motif_save_X_CFLAGS=$X_CFLAGS +if test "x$motif_include" != xdefault \ + && test "x$motif_include" != "x$x_includes" && test "x$motif_include" != xno +then + X_CFLAGS="-I$motif_include $X_CFLAGS" +fi +# # Now for the libraries. # -if test "$motif_libdir" = ""; then +if test "x$motif_libdir" = x; then _XDVI_FIND_MOTIF_LIBRARIES fi -# Add Motif definitions to X flags # -if test "$motif_include" != "" && test "$motif_include" != "$x_includes" && test "$motif_include" != "no" -then -X_CFLAGS="-I$motif_include $X_CFLAGS" -fi -if test "$motif_libdir" != "" && test "$motif_libdir" != "$x_libraries" && test "$motif_libdir" != "no" -then -case "$X_LIBS" in - *-R\ *) X_LIBS="-L$motif_libdir -R $motif_libdir $X_LIBS";; - *-R*) X_LIBS="-L$motif_libdir -R$motif_libdir $X_LIBS";; - *) X_LIBS="-L$motif_libdir $X_LIBS";; -esac -fi +# Report the results of headers and libraries. # +xdvi_have_motif=yes # -motif_libdir_result="$motif_libdir" -motif_include_result="$motif_include" -test "$motif_libdir_result" = "" && - motif_libdir_result="in default path" && AC_DEFINE([MOTIF], 1, [Define to use the Motif toolkit.]) -test "$motif_include_result" = "" && - motif_include_result="in default path" && AC_DEFINE([MOTIF], 1) -if test "$motif_libdir_result" = "no"; then - if test "$default_toolkit" = "none"; then - motif_libdir_result="(none)" - else - motif_libdir_result="" - fi +motif_libdir_result=$motif_libdir +if test "x$motif_libdir_result" = xdefault; then + motif_libdir_result="in default path" +elif test "x$motif_libdir_result" = xno; then + motif_libdir_result="(none)" + xdvi_have_motif=no fi -if test "$motif_include_result" = "no"; then - if test "$default_toolkit" = "none"; then - motif_include_result="(none)" - else - motif_include_result="" - fi +# +motif_include_result=$motif_include +if test "x$motif_include_result" = xdefault; then + motif_include_result="in default path" +elif test "x$motif_include_result" = xno; then + motif_include_result="(none)" + xdvi_have_motif=no fi - -if test "$motif_include_result" != "" && test "$motif_libdir_result" != ""; then - AC_MSG_RESULT([libraries $motif_libdir_result, headers $motif_include_result]) +# +AC_MSG_RESULT([libraries $motif_libdir_result, headers $motif_include_result]) +# +if test "x$xdvi_have_motif" = xyes; then + # + # Add Motif definition to X_LIBS + # + if test "x$motif_libdir" != xdefault \ + && test "x$motif_libdir" != "x$x_libraries" && test "x$motif_libdir" != no + then + case "$X_LIBS" in + *-R\ *) X_LIBS="-L$motif_libdir -R $motif_libdir $X_LIBS";; + *-R*) X_LIBS="-L$motif_libdir -R$motif_libdir $X_LIBS";; + *) X_LIBS="-L$motif_libdir $X_LIBS";; + esac + fi + # prog_extension="motif" - AC_DEFINE([MOTIF], 1) + AC_DEFINE([MOTIF], 1, [Define to use the Motif toolkit.]) x_tool_libs="-lXm" + if test "x$x_xp_lib" != x; then + # check if libXm requires libXp + _XDVI_CHECK_MOTIF_XP + fi # now warn if we're using LessTif (see LESSTIF-BUGS for why ...) _XDVI_CHECK_LESSTIF # Check whether to compile for Motif with Xaw Panner. _XDVI_CHECK_PANNER +elif test "x$default_toolkit" = xnone; then + AC_MSG_ERROR([No Motif.]) else - AC_MSG_RESULT([not found, using Xaw]) - with_xdvi_x_toolkit="xaw" + # Restore previous X_CFLAGS + X_CFLAGS=$xdvi_motif_save_X_CFLAGS + AC_MSG_NOTICE([No Motif, using Xaw.]) + with_xdvi_x_toolkit="xaw" fi ]) # XDVI_FIND_MOTIF @@ -96,24 +109,18 @@ fi # Search the Xm include files. m4_define([_XDVI_FIND_MOTIF_INCLUDES], [AC_CACHE_VAL([xdvi_cv_motif_include], -[ -xdvi_motif_save_LIBS="$LIBS" -xdvi_motif_save_CFLAGS="$CFLAGS" -xdvi_motif_save_CPPFLAGS="$CPPFLAGS" -xdvi_motif_save_LDFLAGS="$LDFLAGS" +[xdvi_motif_save_CFLAGS=$CFLAGS +xdvi_motif_save_CPPFLAGS=$CPPFLAGS # -LIBS="$X_PRE_LIBS -lXm -lXt -lX11 $X_EXTRA_LIBS $LIBS" CFLAGS="$X_CFLAGS $CFLAGS" CPPFLAGS="$X_CFLAGS $CPPFLAGS" -LDFLAGS="$X_LIBS $LDFLAGS" # -AC_TRY_COMPILE([#include ],[int a;], -[ -# Xm/Xm.h is in the standard search path. -xdvi_cv_motif_include= -], -[ -# Xm/Xm.h is not in the standard search path. +AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include ]], + [[int a;]])], + [# Xm/Xm.h is in the standard search path. + xdvi_cv_motif_include=default], + [# Xm/Xm.h is not in the standard search path. + xdvi_cv_motif_include=no # Locate it and put its directory in `motif_include' # # /usr/include/Motif* are used on HP-UX (Motif). @@ -129,21 +136,14 @@ for dir in "$x_includes" "${prefix}/include" /usr/include /usr/local/include \ "${prefix}"/*/include /usr/*/include /usr/local/*/include \ "${prefix}"/include/* /usr/include/* /usr/local/include/*; do if test -f "$dir/Xm/Xm.h"; then - xdvi_cv_motif_include="$dir" + xdvi_cv_motif_include=$dir break fi -done -if test "$xdvi_cv_motif_include" = ""; then -xdvi_cv_motif_include=no -fi -]) +done]) # -LIBS="$xdvi_motif_save_LIBS" -CFLAGS="$xdvi_motif_save_CFLAGS" -CPPFLAGS="$xdvi_motif_save_CPPFLAGS" -LDFLAGS="$xdvi_motif_save_LDFLAGS" -]) -motif_include="$xdvi_cv_motif_include" +CFLAGS=$xdvi_motif_save_CFLAGS +CPPFLAGS=$xdvi_motif_save_CPPFLAGS]) +motif_include=$xdvi_cv_motif_include ]) # _XDVI_FIND_MOTIF_INCLUDES # _XDVI_FIND_MOTIF_LIBRARIES @@ -151,29 +151,25 @@ motif_include="$xdvi_cv_motif_include" # Search the Xm library. m4_define([_XDVI_FIND_MOTIF_LIBRARIES], [AC_CACHE_VAL([xdvi_cv_motif_libdir], -[ -xdvi_motif_save_LIBS="$LIBS" -xdvi_motif_save_CFLAGS="$CFLAGS" -xdvi_motif_save_CPPFLAGS="$CPPFLAGS" -xdvi_motif_save_LDFLAGS="$LDFLAGS" +[xdvi_motif_save_LIBS=$LIBS +xdvi_motif_save_CFLAGS=$CFLAGS +xdvi_motif_save_CPPFLAGS=$CPPFLAGS +xdvi_motif_save_LDFLAGS=$LDFLAGS # -LIBS="$X_PRE_LIBS -lXm -lXt -lX11 $X_EXTRA_LIBS $LIBS" +LIBS="$X_PRE_LIBS -lXm $x_xp_lib -lXt -lX11 $X_EXTRA_LIBS $LIBS" CFLAGS="$X_CFLAGS $CFLAGS" CPPFLAGS="$X_CFLAGS $CPPFLAGS" LDFLAGS="$X_LIBS $LDFLAGS" # # We use XtToolkitInitialize() here since it takes no arguments # and thus also works with a C++ compiler. -AC_TRY_LINK( -[#include -#include -],[XtToolkitInitialize();], -[ -# libXm.a is in the standard search path. -xdvi_cv_motif_libdir= -], -[ -# libXm.a is not in the standard search path. +AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include +#include ]], + [[XtToolkitInitialize();]])], + [# libXm.a is in the standard search path. + xdvi_cv_motif_libdir=default], + [# libXm.a is not in the standard search path. + xdvi_cv_motif_libdir=no # Locate it and put its directory in `motif_libdir' # # /usr/lib/Motif* are used on HP-UX (Motif). @@ -191,42 +187,72 @@ for dir in "$x_libraries" "${prefix}/lib" /usr/lib /usr/local/lib \ "${prefix}"/*/lib /usr/*/lib /usr/local/*/lib \ "${prefix}"/lib/* /usr/lib/* /usr/local/lib/*; do if test -d "$dir" && test "`ls $dir/libXm.* 2> /dev/null`" != ""; then - xdvi_cv_motif_libdir="$dir" + xdvi_cv_motif_libdir=$dir break fi -done -if test "$xdvi_cv_motif_libdir" = ""; then -xdvi_cv_motif_libdir=no -fi -]) +done]) # -LIBS="$xdvi_motif_save_LIBS" -CFLAGS="$xdvi_motif_save_CFLAGS" -CPPFLAGS="$xdvi_motif_save_CPPFLAGS" -LDFLAGS="$xdvi_motif_save_LDFLAGS" -]) +LIBS=$xdvi_motif_save_LIBS +CFLAGS=$xdvi_motif_save_CFLAGS +CPPFLAGS=$xdvi_motif_save_CPPFLAGS +LDFLAGS=$xdvi_motif_save_LDFLAGS]) # motif_libdir="$xdvi_cv_motif_libdir" ]) # _XDVI_FIND_MOTIF_LIBRARIES +# _XDVI_CHECK_MOTIF_XP +# -------------------- +# Check if libXm (explicitly) requires libXp +m4_define([_XDVI_CHECK_MOTIF_XP], +[AC_CACHE_CHECK([if libXm requires libXp], + [xdvi_cv_motif_xp], +[xdvi_motif_save_LIBS=$LIBS +xdvi_motif_save_CFLAGS=$CFLAGS +xdvi_motif_save_CPPFLAGS=$CPPFLAGS +xdvi_motif_save_LDFLAGS=$LDFLAGS +# +LIBS="$X_PRE_LIBS -lXm -lXt -lX11 $X_EXTRA_LIBS $LIBS" +CFLAGS="$X_CFLAGS $CFLAGS" +CPPFLAGS="$X_CFLAGS $CPPFLAGS" +LDFLAGS="$X_LIBS $LDFLAGS" +# +# We use XtToolkitInitialize() here since it takes no arguments +# and thus also works with a C++ compiler. +AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include +#include ]], + [[XtToolkitInitialize();]])], + [xdvi_cv_motif_xp=no], + [xdvi_cv_motif_xp=yes]) +# +LIBS=$xdvi_motif_save_LIBS +CFLAGS=$xdvi_motif_save_CFLAGS +CPPFLAGS=$xdvi_motif_save_CPPFLAGS +LDFLAGS=$xdvi_motif_save_LDFLAGS]) +if test "x$xdvi_cv_motif_xp" = xyes; then + x_tool_libs="$x_tool_libs $x_xp_lib" +fi +]) # _XDVI_CHECK_MOTIF_XP + # _XDVI_CHECK_LESSTIF # ------------------- # Check if using LessTif and warn if so. m4_define([_XDVI_CHECK_LESSTIF], -[AC_MSG_CHECKING([for LessTif]) -save_CPPFLAGS="$CPPFLAGS" +[AC_CACHE_CHECK([for LessTif], + [xdvi_cv_using_lesstif], +[save_CPPFLAGS=$CPPFLAGS CPPFLAGS="$CPPFLAGS $X_CFLAGS" -AC_TRY_COMPILE([ -#include +AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include #include #include #include #include -#include ],[const char *p = LesstifVERSION_STRING; -],[ -# yes, we're running LessTif -AC_MSG_RESULT([yes]) -AC_MSG_WARN([LessTif header detected. +#include ]], + [[const char *p = LesstifVERSION_STRING;]])], + [xdvi_cv_using_lesstif=yes], + [xdvi_cv_using_lesstif=no]) +CPPFLAGS=$save_CPPFLAGS]) +if test "x$xdvi_cv_using_lesstif" = xyes; then + AC_MSG_WARN([LessTif header detected. ***************************************************************** * Warning: You are using LessTif instead of OpenMotif. * * Some GUI elements might be broken; please see the file * @@ -235,33 +261,28 @@ AC_MSG_WARN([LessTif header detected. * * * for more information. * *****************************************************************]) -],[ -# no, not running LessTif -AC_MSG_RESULT([no]) -]) -CPPFLAGS=$save_CPPFLAGS +fi ]) # _XDVI_CHECK_LESSTIF # _XDVI_CHECK_PANNER # ------------------ # Check whether to compile for Motif with Xaw Panner. m4_define([_XDVI_CHECK_PANNER], -[AC_MSG_CHECKING([whether to compile in panner (requires Xaw)]) -save_CPPFLAGS=$CPPFLAGS +[AC_CACHE_CHECK([whether to compile in panner (requires Xaw)], + [xdvi_cv_use_xaw_panner], +[save_CPPFLAGS=$CPPFLAGS CPPFLAGS="$CPPFLAGS $X_CFLAGS" -AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ -#include +AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include #include #include #include #include #include #include ]])], - [xdvi_use_xaw_panner=yes], - [xdvi_use_xaw_panner=no]) -CPPFLAGS=$save_CPPFLAGS -AC_MSG_RESULT([$xdvi_use_xaw_panner]) -if test "x$xdvi_use_xaw_panner" = xyes; then + [xdvi_cv_use_xaw_panner=yes], + [xdvi_cv_use_xaw_panner=no]) +CPPFLAGS=$save_CPPFLAGS]) +if test "x$xdvi_cv_use_xaw_panner" = xyes; then AC_DEFINE([USE_XAW_PANNER], 1, [Define to use Xaw panner.]) fi ]) # _XDVI_CHECK_PANNER diff --git a/Build/source/texk/xdvik/m4/xdvi-find-xpm.m4 b/Build/source/texk/xdvik/m4/xdvi-find-xpm.m4 index 4a12e0c2e20..6b89c0c89f2 100644 --- a/Build/source/texk/xdvik/m4/xdvi-find-xpm.m4 +++ b/Build/source/texk/xdvik/m4/xdvi-find-xpm.m4 @@ -14,19 +14,17 @@ # and add appropriate flags to X_CFLAGS and X_LIBS. AC_DEFUN([XDVI_FIND_XPM], [AC_REQUIRE([AC_PATH_XTRA]) -xpm_includes= -xpm_libraries= AC_ARG_WITH([xpm], AS_HELP_STRING([--without-xpm], [Do not use the Xpm library (will disable the toolbar)]))[]dnl AC_ARG_WITH([xpm-includes], AS_HELP_STRING([--with-xpm-include=DIR], [Specify the location of Xpm include files]), - [xpm_includes=$withval]) + [xpm_includes=$withval], [xpm_includes=])[]dnl AC_ARG_WITH([xpm-libraries], AS_HELP_STRING([--with-xpm-libdir=DIR], [Specify the location of Xpm libraries]), - [xpm_libraries=$withval]) + [xpm_libraries=$withval], [xpm_libraries=])[]dnl dnl Treat --without-xpm like dnl --without-xpm-includes --without-xpm-libraries. if test "x$with_xpm" = xno; then @@ -40,66 +38,76 @@ AC_MSG_CHECKING([for Xpm]) if test "x$xpm_includes" = x; then _XDVI_FIND_XPM_INCLUDES fi -if test "x$xpm_includes" != x; then - if test "x$xpm_includes" = xdefault; then - AC_DEFINE([HAVE_X11_XPM_H], 1, [Define if you have the header file.]) - elif test -f "$xpm_includes/X11/xpm.h"; then - AC_DEFINE([HAVE_X11_XPM_H], 1) - elif test -f "$xpm_includes/xpm.h"; then - AC_DEFINE([HAVE_XPM_H], 1, - [Define if you have the header file (not in X11, e.g. Solaris 5.8).]) - fi -fi -# -# Check the libraries. -# -if test "x$xpm_libraries" = x; then - _XDVI_FIND_XPM_LIBRARIES +if test "x$xpm_includes" = xdefault; then + AC_DEFINE([HAVE_X11_XPM_H], 1, [Define if you have the header file.]) +elif test -f "$xpm_includes/X11/xpm.h"; then + AC_DEFINE([HAVE_X11_XPM_H], 1) +elif test -f "$xpm_includes/xpm.h"; then + AC_DEFINE([HAVE_XPM_H], 1, + [Define if you have the header file (not in X11, e.g. Solaris 5.8).]) fi # -# Add Xpm definitions to X flags +# Add Xpm definition to X_CFLAGS (and remember previous value) # -if test "x$xpm_includes" != xdefault && test "x$xpm_includes" != x \ +xdvi_xpm_save_X_CFLAGS=$X_CFLAGS +if test "x$xpm_includes" != xdefault \ && test "x$xpm_includes" != "x$x_includes" && test "x$xpm_includes" != xno then X_CFLAGS="-I$xpm_includes $X_CFLAGS" fi # -if test "x$xpm_libraries" != xdefault && test "x$xpm_libraries" != x \ - && test "x$xpm_libraries" != "x$x_libraries" && test "x$xpm_libraries" != xno -then - case "$X_LIBS" in - *-R\ *) X_LIBS="-L$xpm_libraries -R $xpm_libraries $X_LIBS";; - *-R*) X_LIBS="-L$xpm_libraries -R$xpm_libraries $X_LIBS";; - *) X_LIBS="-L$xpm_libraries $X_LIBS";; - esac +# Check the libraries. +# +if test "x$xpm_libraries" = x; then + _XDVI_FIND_XPM_LIBRARIES fi # -# Now check the results of headers and libraries and set USE_XPM to 0 -# if one of them hadn't been found. +# Report the results of headers and libraries. +# +xdvi_use_xpm=yes # -AC_DEFINE([USE_XPM], 1, [Define if you want to use the Xpm library]) -x_xpm_libs="-lXpm" # xpm_libraries_result=$xpm_libraries -if test "x$xpm_libraries_result" = xdefault ; then +if test "x$xpm_libraries_result" = xdefault; then xpm_libraries_result="in default path" -elif test "x$xpm_libraries_result" = xno || test "x$xpm_libraries_result" = x; then +elif test "x$xpm_libraries_result" = xno; then xpm_libraries_result="(none)" - AC_DEFINE([USE_XPM], 0) - x_xpm_libs="" + xdvi_use_xpm=no fi -AC_SUBST([x_xpm_libs]) # xpm_includes_result=$xpm_includes if test "x$xpm_includes_result" = xdefault; then xpm_includes_result="in default path" -elif test "x$xpm_includes_result" = xno || test "x$xpm_includes_result" = x; then - AC_DEFINE([USE_XPM], 0) +elif test "x$xpm_includes_result" = xno; then xpm_includes_result="(none)" + xdvi_use_xpm=no fi # AC_MSG_RESULT([libraries $xpm_libraries_result, headers $xpm_includes_result]) +# +if test "x$xdvi_use_xpm" = xyes; then + # + # Add Xpm definition to X_LIBS + # + if test "x$xpm_libraries" != xdefault \ + && test "x$xpm_libraries" != "x$x_libraries" && test "x$xpm_libraries" != xno + then + case "$X_LIBS" in + *-R\ *) X_LIBS="-L$xpm_libraries -R $xpm_libraries $X_LIBS";; + *-R*) X_LIBS="-L$xpm_libraries -R$xpm_libraries $X_LIBS";; + *) X_LIBS="-L$xpm_libraries $X_LIBS";; + esac + fi + # + AC_DEFINE([USE_XPM], 1, [Define if you want to use the Xpm library]) + x_xpm_libs="-lXpm" +else + # Restore previous X_CFLAGS + X_CFLAGS=$xdvi_xpm_save_X_CFLAGS + AC_DEFINE([USE_XPM], 0) + x_xpm_libs= +fi +AC_SUBST([x_xpm_libs]) ]) # XDVI_FIND_XPM # _XDVI_FIND_XPM_INCLUDES -- cgit v1.2.3