From 995c7af364cfdc254e904a3b560e068339613534 Mon Sep 17 00:00:00 2001 From: jsancho Date: Sun, 8 Jan 2012 17:31:15 +0000 Subject: [PATCH] Experimenting with autotools --- Makefile | 98 ++++++--- Makefile.am | 2 +- configure | 547 ++++++++++++++++++++++++++++++++---------------- configure.ac | 19 +- src/Makefile.am | 2 + 5 files changed, 451 insertions(+), 217 deletions(-) diff --git a/Makefile b/Makefile index 05255bf..a8b38b0 100644 --- a/Makefile +++ b/Makefile @@ -32,13 +32,19 @@ POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : +build_triplet = i686-pc-linux-gnu +host_triplet = i686-pc-linux-gnu subdir = . DIST_COMMON = README $(am__configure_deps) $(dist_doc_DATA) \ $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ - $(srcdir)/config.h.in $(top_srcdir)/configure COPYING depcomp \ - install-sh missing + $(srcdir)/config.h.in $(top_srcdir)/configure COPYING \ + config.guess config.rpath config.sub depcomp install-sh \ + ltmain.sh missing ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -am__aclocal_m4_deps = $(top_srcdir)/configure.ac +am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \ + $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ + $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ + $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \ @@ -125,38 +131,58 @@ distuninstallcheck_listfiles = find . -type f -print distcleancheck_listfiles = find . -type f -print ACLOCAL = ${SHELL} /home/jsancho/proyectos/gacela/trunk/missing --run aclocal-1.11 AMTAR = ${SHELL} /home/jsancho/proyectos/gacela/trunk/missing --run tar +AR = ar AUTOCONF = ${SHELL} /home/jsancho/proyectos/gacela/trunk/missing --run autoconf AUTOHEADER = ${SHELL} /home/jsancho/proyectos/gacela/trunk/missing --run autoheader AUTOMAKE = ${SHELL} /home/jsancho/proyectos/gacela/trunk/missing --run automake-1.11 AWK = mawk CC = gcc CCDEPMODE = depmode=gcc3 -CFLAGS = -g -O2 -I/usr/include/freetype2 +CFLAGS = -g -O2 +CPP = gcc -E CPPFLAGS = CYGPATH_W = echo DEFS = -DHAVE_CONFIG_H DEPDIR = .deps +DLLTOOL = false +DSYMUTIL = +DUMPBIN = ECHO_C = ECHO_N = -n ECHO_T = +EGREP = /bin/grep -E EXEEXT = +FGREP = /bin/grep -F +GREP = /bin/grep GUILE = /usr/bin/guile -GUILE_CFLAGS = +GUILE_CFLAGS = -pthread -I/usr/include/guile/2.0 GUILE_CONFIG = /usr/bin/guile-config -GUILE_LDFLAGS = -lguile -lltdl -lgmp -lcrypt -lm -lltdl +GUILE_LDFLAGS = -lguile-2.0 -lgc +GUILE_LIBS = -lguile-2.0 -lgc +GUILE_LTLIBS = -lguile-2.0 -lgc GUILE_TOOLS = /usr/bin/guile-tools INSTALL = /usr/bin/install -c INSTALL_DATA = ${INSTALL} -m 644 INSTALL_PROGRAM = ${INSTALL} INSTALL_SCRIPT = ${INSTALL} INSTALL_STRIP_PROGRAM = $(install_sh) -c -s +LD = /usr/bin/ld LDFLAGS = LIBOBJS = -LIBS = -lreadline -lSDL -lSDL_image -lSDL_gfx -lSDL_mixer -lGL -lGLU -lftgl +LIBS = +LIBTOOL = $(SHELL) $(top_builddir)/libtool +LIPO = +LN_S = ln -s LTLIBOBJS = MAKEINFO = ${SHELL} /home/jsancho/proyectos/gacela/trunk/missing --run makeinfo +MANIFEST_TOOL = : MKDIR_P = /bin/mkdir -p +NM = /usr/bin/nm -B +NMEDIT = +OBJDUMP = objdump OBJEXT = o +OTOOL = +OTOOL64 = PACKAGE = gacela PACKAGE_BUGREPORT = jsf@jsancho.org PACKAGE_NAME = gacela @@ -165,29 +191,41 @@ PACKAGE_TARNAME = gacela PACKAGE_URL = PACKAGE_VERSION = 0.5 PATH_SEPARATOR = : +RANLIB = ranlib +SED = /bin/sed SET_MAKE = SHELL = /bin/bash -STRIP = +STRIP = strip VERSION = 0.5 abs_builddir = /home/jsancho/proyectos/gacela/trunk abs_srcdir = /home/jsancho/proyectos/gacela/trunk abs_top_builddir = /home/jsancho/proyectos/gacela/trunk abs_top_srcdir = /home/jsancho/proyectos/gacela/trunk +ac_ct_AR = ar ac_ct_CC = gcc +ac_ct_DUMPBIN = am__include = include am__leading_dot = . am__quote = am__tar = ${AMTAR} chof - "$$tardir" am__untar = ${AMTAR} xf - bindir = ${exec_prefix}/bin +build = i686-pc-linux-gnu build_alias = +build_cpu = i686 +build_os = linux-gnu +build_vendor = pc builddir = . datadir = ${datarootdir} datarootdir = ${prefix}/share docdir = ${datarootdir}/doc/${PACKAGE_TARNAME} dvidir = ${docdir} exec_prefix = ${prefix} +host = i686-pc-linux-gnu host_alias = +host_cpu = i686 +host_os = linux-gnu +host_vendor = pc htmldir = ${docdir} includedir = ${prefix}/include infodir = ${datarootdir}/info @@ -213,6 +251,7 @@ top_builddir = . top_srcdir = . SUBDIRS = src dist_doc_DATA = README +ACLOCAL_AMFLAGS = -I m4 all: config.h $(MAKE) $(AM_MAKEFLAGS) all-recursive @@ -268,6 +307,15 @@ $(srcdir)/config.h.in: $(am__configure_deps) distclean-hdr: -rm -f config.h stamp-h1 + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs + +distclean-libtool: + -rm -f libtool config.lt install-dist_docDATA: $(dist_doc_DATA) @$(NORMAL_INSTALL) test -z "$(docdir)" || $(MKDIR_P) "$(DESTDIR)$(docdir)" @@ -634,12 +682,13 @@ maintainer-clean-generic: @echo "it deletes files that may require special tools to rebuild." clean: clean-recursive -clean-am: clean-generic mostlyclean-am +clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-recursive -rm -f $(am__CONFIG_DISTCLEAN_FILES) -rm -f Makefile -distclean-am: clean-am distclean-generic distclean-hdr distclean-tags +distclean-am: clean-am distclean-generic distclean-hdr \ + distclean-libtool distclean-tags dvi: dvi-recursive @@ -689,7 +738,7 @@ maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-recursive -mostlyclean-am: mostlyclean-generic +mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-recursive @@ -706,19 +755,20 @@ uninstall-am: uninstall-dist_docDATA .PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \ all all-am am--refresh check check-am clean clean-generic \ - ctags ctags-recursive dist dist-all dist-bzip2 dist-gzip \ - dist-lzma dist-shar dist-tarZ dist-xz dist-zip distcheck \ - distclean distclean-generic distclean-hdr distclean-tags \ - distcleancheck distdir distuninstallcheck dvi dvi-am html \ - html-am info info-am install install-am install-data \ - install-data-am install-dist_docDATA install-dvi \ - install-dvi-am install-exec install-exec-am install-html \ - install-html-am install-info install-info-am install-man \ - install-pdf install-pdf-am install-ps install-ps-am \ - install-strip installcheck installcheck-am installdirs \ - installdirs-am maintainer-clean maintainer-clean-generic \ - mostlyclean mostlyclean-generic pdf pdf-am ps ps-am tags \ - tags-recursive uninstall uninstall-am uninstall-dist_docDATA + clean-libtool ctags ctags-recursive dist dist-all dist-bzip2 \ + dist-gzip dist-lzma dist-shar dist-tarZ dist-xz dist-zip \ + distcheck distclean distclean-generic distclean-hdr \ + distclean-libtool distclean-tags distcleancheck distdir \ + distuninstallcheck dvi dvi-am html html-am info info-am \ + install install-am install-data install-data-am \ + install-dist_docDATA install-dvi install-dvi-am install-exec \ + install-exec-am install-html install-html-am install-info \ + install-info-am install-man install-pdf install-pdf-am \ + install-ps install-ps-am install-strip installcheck \ + installcheck-am installdirs installdirs-am maintainer-clean \ + maintainer-clean-generic mostlyclean mostlyclean-generic \ + mostlyclean-libtool pdf pdf-am ps ps-am tags tags-recursive \ + uninstall uninstall-am uninstall-dist_docDATA # Tell versions [3.59,3.63) of GNU make to not export all variables. diff --git a/Makefile.am b/Makefile.am index 7422777..5416851 100644 --- a/Makefile.am +++ b/Makefile.am @@ -1,3 +1,3 @@ SUBDIRS = src dist_doc_DATA = README - +ACLOCAL_AMFLAGS = -I m4 diff --git a/configure b/configure index d5a6258..222b8fd 100755 --- a/configure +++ b/configure @@ -616,10 +616,10 @@ ac_subst_vars='am__EXEEXT_FALSE am__EXEEXT_TRUE LTLIBOBJS LIBOBJS -GUILE_LTLIBS -GUILE_LIBS GUILE_LDFLAGS GUILE_CFLAGS +GUILE_LTLIBS +GUILE_LIBS GUILE_TOOLS GUILE_CONFIG GUILE @@ -741,6 +741,7 @@ enable_fast_install with_gnu_ld with_sysroot enable_libtool_lock +enable_rpath ' ac_precious_vars='build_alias host_alias @@ -1378,6 +1379,7 @@ Optional Features: --enable-fast-install[=PKGS] optimize for fast installation [default=yes] --disable-libtool-lock avoid locking (might break parallel builds) + --disable-rpath do not hardcode runtime library paths Optional Packages: --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] @@ -1387,6 +1389,7 @@ Optional Packages: --with-gnu-ld assume the C compiler uses GNU ld [default=no] --with-sysroot=DIR Search for dependent libraries within DIR (or the compiler's sysroot if not specified). + --with-gnu-ld assume the C compiler uses GNU ld default=no Some influential environment variables: CC C compiler command @@ -7615,6 +7618,10 @@ _lt_linker_boilerplate=`cat conftest.err` $RM -r conftest* +## CAVEAT EMPTOR: +## There is no encapsulation within the following macros, do not change +## the running order or otherwise move them around unless you know exactly +## what you are doing... if test -n "$compiler"; then lt_prog_compiler_no_builtin_flag= @@ -11301,206 +11308,366 @@ fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking libguile compile flags" >&5 -$as_echo_n "checking libguile compile flags... " >&6; } - GUILE_CFLAGS="`$GUILE_CONFIG compile`" - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $GUILE_CFLAGS" >&5 -$as_echo "$GUILE_CFLAGS" >&6; } - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking libguile link flags" >&5 -$as_echo_n "checking libguile link flags... " >&6; } - GUILE_LDFLAGS="`$GUILE_CONFIG link`" - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $GUILE_LDFLAGS" >&5 -$as_echo "$GUILE_LDFLAGS" >&6; } - - AC_LIB_LINKFLAGS_FROM_LIBS(GUILE_LIBS, $GUILE_LDFLAGS, ) - GUILE_LIBS="$GUILE_LDFLAGS $GUILE_LIBS" - AC_LIB_LINKFLAGS_FROM_LIBS(GUILE_LTLIBS, $GUILE_LDFLAGS, yes) - GUILE_LTLIBS="$GUILE_LDFLAGS $GUILE_LTLIBS" - - - - - - -CFLAGS="$CFLAGS -I/usr/include/freetype2" -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for main in -lreadline" >&5 -$as_echo_n "checking for main in -lreadline... " >&6; } -if ${ac_cv_lib_readline_main+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lreadline $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - - -int -main () -{ -return main (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_readline_main=yes +# Check whether --with-gnu-ld was given. +if test "${with_gnu_ld+set}" = set; then : + withval=$with_gnu_ld; test "$withval" = no || with_gnu_ld=yes else - ac_cv_lib_readline_main=no + with_gnu_ld=no fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS + +# Prepare PATH_SEPARATOR. +# The user is always right. +if test "${PATH_SEPARATOR+set}" != set; then + echo "#! /bin/sh" >conf$$.sh + echo "exit 0" >>conf$$.sh + chmod +x conf$$.sh + if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then + PATH_SEPARATOR=';' + else + PATH_SEPARATOR=: + fi + rm -f conf$$.sh fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_readline_main" >&5 -$as_echo "$ac_cv_lib_readline_main" >&6; } -if test "x$ac_cv_lib_readline_main" = xyes; then : - as_fn_error $? "*** readline library not found!" "$LINENO" 5 +ac_prog=ld +if test "$GCC" = yes; then + # Check if gcc -print-prog-name=ld gives a path. + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ld used by GCC" >&5 +$as_echo_n "checking for ld used by GCC... " >&6; } + case $host in + *-*-mingw*) + # gcc leaves a trailing carriage return which upsets mingw + ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; + *) + ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; + esac + case $ac_prog in + # Accept absolute paths. + [\\/]* | [A-Za-z]:[\\/]*) + re_direlt='/[^/][^/]*/\.\./' + # Canonicalize the path of ld + ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'` + while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do + ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"` + done + test -z "$LD" && LD="$ac_prog" + ;; + "") + # If it fails, then pretend we aren't using GCC. + ac_prog=ld + ;; + *) + # If it is relative, then search for the first ld in PATH. + with_gnu_ld=unknown + ;; + esac +elif test "$with_gnu_ld" = yes; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU ld" >&5 +$as_echo_n "checking for GNU ld... " >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for non-GNU ld" >&5 +$as_echo_n "checking for non-GNU ld... " >&6; } fi - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for main in -lSDL" >&5 -$as_echo_n "checking for main in -lSDL... " >&6; } -if ${ac_cv_lib_SDL_main+:} false; then : +if ${acl_cv_path_LD+:} false; then : $as_echo_n "(cached) " >&6 else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lSDL $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - - -int -main () -{ -return main (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_SDL_main=yes + if test -z "$LD"; then + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}" + for ac_dir in $PATH; do + test -z "$ac_dir" && ac_dir=. + if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then + acl_cv_path_LD="$ac_dir/$ac_prog" + # Check to see if the program is GNU ld. I'd rather use --version, + # but apparently some GNU ld's only accept -v. + # Break only if it was the GNU/non-GNU ld that we prefer. + case `"$acl_cv_path_LD" -v 2>&1 < /dev/null` in + *GNU* | *'with BFD'*) + test "$with_gnu_ld" != no && break ;; + *) + test "$with_gnu_ld" != yes && break ;; + esac + fi + done + IFS="$ac_save_ifs" else - ac_cv_lib_SDL_main=no + acl_cv_path_LD="$LD" # Let the user override the test with a path. fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_SDL_main" >&5 -$as_echo "$ac_cv_lib_SDL_main" >&6; } -if test "x$ac_cv_lib_SDL_main" = xyes; then : - as_fn_error $? "*** SDL library not found!" "$LINENO" 5 fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for main in -lSDL_image" >&5 -$as_echo_n "checking for main in -lSDL_image... " >&6; } -if ${ac_cv_lib_SDL_image_main+:} false; then : +LD="$acl_cv_path_LD" +if test -n "$LD"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LD" >&5 +$as_echo "$LD" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi +test -z "$LD" && as_fn_error $? "no acceptable ld found in \$PATH" "$LINENO" 5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if the linker ($LD) is GNU ld" >&5 +$as_echo_n "checking if the linker ($LD) is GNU ld... " >&6; } +if ${acl_cv_prog_gnu_ld+:} false; then : $as_echo_n "(cached) " >&6 else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lSDL_image $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ + # I'd rather use --version here, but apparently some GNU ld's only accept -v. +case `$LD -v 2>&1 &5 +$as_echo "$acl_cv_prog_gnu_ld" >&6; } +with_gnu_ld=$acl_cv_prog_gnu_ld + -int -main () -{ -return main (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_SDL_image_main=yes -else - ac_cv_lib_SDL_image_main=no -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_SDL_image_main" >&5 -$as_echo "$ac_cv_lib_SDL_image_main" >&6; } -if test "x$ac_cv_lib_SDL_image_main" = xyes; then : - as_fn_error $? "*** SDL_image library not found!" "$LINENO" 5 -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for main in -lSDL_gfx" >&5 -$as_echo_n "checking for main in -lSDL_gfx... " >&6; } -if ${ac_cv_lib_SDL_gfx_main+:} false; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for shared library run path origin" >&5 +$as_echo_n "checking for shared library run path origin... " >&6; } +if ${acl_cv_rpath+:} false; then : $as_echo_n "(cached) " >&6 else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lSDL_gfx $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ + CC="$CC" GCC="$GCC" LDFLAGS="$LDFLAGS" LD="$LD" with_gnu_ld="$with_gnu_ld" \ + ${CONFIG_SHELL-/bin/sh} "$ac_aux_dir/config.rpath" "$host" > conftest.sh + . ./conftest.sh + rm -f ./conftest.sh + acl_cv_rpath=done -int -main () -{ -return main (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_SDL_gfx_main=yes -else - ac_cv_lib_SDL_gfx_main=no -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_SDL_gfx_main" >&5 -$as_echo "$ac_cv_lib_SDL_gfx_main" >&6; } -if test "x$ac_cv_lib_SDL_gfx_main" = xyes; then : - as_fn_error $? "*** SDL_gfx library not found!" "$LINENO" 5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $acl_cv_rpath" >&5 +$as_echo "$acl_cv_rpath" >&6; } + wl="$acl_cv_wl" + acl_libext="$acl_cv_libext" + acl_shlibext="$acl_cv_shlibext" + acl_libname_spec="$acl_cv_libname_spec" + acl_library_names_spec="$acl_cv_library_names_spec" + acl_hardcode_libdir_flag_spec="$acl_cv_hardcode_libdir_flag_spec" + acl_hardcode_libdir_separator="$acl_cv_hardcode_libdir_separator" + acl_hardcode_direct="$acl_cv_hardcode_direct" + acl_hardcode_minus_L="$acl_cv_hardcode_minus_L" + # Check whether --enable-rpath was given. +if test "${enable_rpath+set}" = set; then : + enableval=$enable_rpath; : +else + enable_rpath=yes fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for main in -lSDL_mixer" >&5 -$as_echo_n "checking for main in -lSDL_mixer... " >&6; } -if ${ac_cv_lib_SDL_mixer_main+:} false; then : + + + + acl_libdirstem=lib + acl_libdirstem2= + case "$host_os" in + solaris*) + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for 64-bit host" >&5 +$as_echo_n "checking for 64-bit host... " >&6; } +if ${gl_cv_solaris_64bit+:} false; then : $as_echo_n "(cached) " >&6 else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lSDL_mixer $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ +#ifdef _LP64 +sixtyfour bits +#endif -int -main () -{ -return main (); - ; - return 0; -} _ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_SDL_mixer_main=yes +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "sixtyfour bits" >/dev/null 2>&1; then : + gl_cv_solaris_64bit=yes else - ac_cv_lib_SDL_mixer_main=no + gl_cv_solaris_64bit=no fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_SDL_mixer_main" >&5 -$as_echo "$ac_cv_lib_SDL_mixer_main" >&6; } -if test "x$ac_cv_lib_SDL_mixer_main" = xyes; then : - as_fn_error $? "*** SDL_mixer library not found!" "$LINENO" 5 +rm -f conftest* + + fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_solaris_64bit" >&5 +$as_echo "$gl_cv_solaris_64bit" >&6; } + if test $gl_cv_solaris_64bit = yes; then + acl_libdirstem=lib/64 + case "$host_cpu" in + sparc*) acl_libdirstem2=lib/sparcv9 ;; + i*86 | x86_64) acl_libdirstem2=lib/amd64 ;; + esac + fi + ;; + *) + searchpath=`(LC_ALL=C $CC -print-search-dirs) 2>/dev/null | sed -n -e 's,^libraries: ,,p' | sed -e 's,^=,,'` + if test -n "$searchpath"; then + acl_save_IFS="${IFS= }"; IFS=":" + for searchdir in $searchpath; do + if test -d "$searchdir"; then + case "$searchdir" in + */lib64/ | */lib64 ) acl_libdirstem=lib64 ;; + */../ | */.. ) + # Better ignore directories of this form. They are misleading. + ;; + *) searchdir=`cd "$searchdir" && pwd` + case "$searchdir" in + */lib64 ) acl_libdirstem=lib64 ;; + esac ;; + esac + fi + done + IFS="$acl_save_IFS" + fi + ;; + esac + test -n "$acl_libdirstem2" || acl_libdirstem2="$acl_libdirstem" + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking libguile compile flags" >&5 +$as_echo_n "checking libguile compile flags... " >&6; } + GUILE_CFLAGS="`$GUILE_CONFIG compile`" + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $GUILE_CFLAGS" >&5 +$as_echo "$GUILE_CFLAGS" >&6; } + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking libguile link flags" >&5 +$as_echo_n "checking libguile link flags... " >&6; } + GUILE_LDFLAGS="`$GUILE_CONFIG link`" + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $GUILE_LDFLAGS" >&5 +$as_echo "$GUILE_LDFLAGS" >&6; } + + + + + GUILE_LIBS= + if test "$enable_rpath" != no; then + if test -n "$acl_hardcode_libdir_flag_spec" && test "$acl_hardcode_minus_L" = no; then + rpathdirs= + next= + for opt in $GUILE_LDFLAGS; do + if test -n "$next"; then + dir="$next" + if test "X$dir" != "X/usr/$acl_libdirstem" \ + && test "X$dir" != "X/usr/$acl_libdirstem2"; then + rpathdirs="$rpathdirs $dir" + fi + next= + else + case $opt in + -L) next=yes ;; + -L*) dir=`echo "X$opt" | sed -e 's,^X-L,,'` + if test "X$dir" != "X/usr/$acl_libdirstem" \ + && test "X$dir" != "X/usr/$acl_libdirstem2"; then + rpathdirs="$rpathdirs $dir" + fi + next= ;; + *) next= ;; + esac + fi + done + if test "X$rpathdirs" != "X"; then + if test -n """"; then + for dir in $rpathdirs; do + GUILE_LIBS="${GUILE_LIBS}${GUILE_LIBS:+ }-R$dir" + done + else + if test -n "$acl_hardcode_libdir_separator"; then + alldirs= + for dir in $rpathdirs; do + alldirs="${alldirs}${alldirs:+$acl_hardcode_libdir_separator}$dir" + done + acl_save_libdir="$libdir" + libdir="$alldirs" + eval flag=\"$acl_hardcode_libdir_flag_spec\" + libdir="$acl_save_libdir" + GUILE_LIBS="$flag" + else + for dir in $rpathdirs; do + acl_save_libdir="$libdir" + libdir="$dir" + eval flag=\"$acl_hardcode_libdir_flag_spec\" + libdir="$acl_save_libdir" + GUILE_LIBS="${GUILE_LIBS}${GUILE_LIBS:+ }$flag" + done + fi + fi + fi + fi + fi + -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for main in -lGL" >&5 -$as_echo_n "checking for main in -lGL... " >&6; } -if ${ac_cv_lib_GL_main+:} false; then : + GUILE_LIBS="$GUILE_LDFLAGS $GUILE_LIBS" + + + + GUILE_LTLIBS= + if test "$enable_rpath" != no; then + if test -n "$acl_hardcode_libdir_flag_spec" && test "$acl_hardcode_minus_L" = no; then + rpathdirs= + next= + for opt in $GUILE_LDFLAGS; do + if test -n "$next"; then + dir="$next" + if test "X$dir" != "X/usr/$acl_libdirstem" \ + && test "X$dir" != "X/usr/$acl_libdirstem2"; then + rpathdirs="$rpathdirs $dir" + fi + next= + else + case $opt in + -L) next=yes ;; + -L*) dir=`echo "X$opt" | sed -e 's,^X-L,,'` + if test "X$dir" != "X/usr/$acl_libdirstem" \ + && test "X$dir" != "X/usr/$acl_libdirstem2"; then + rpathdirs="$rpathdirs $dir" + fi + next= ;; + *) next= ;; + esac + fi + done + if test "X$rpathdirs" != "X"; then + if test -n ""yes""; then + for dir in $rpathdirs; do + GUILE_LTLIBS="${GUILE_LTLIBS}${GUILE_LTLIBS:+ }-R$dir" + done + else + if test -n "$acl_hardcode_libdir_separator"; then + alldirs= + for dir in $rpathdirs; do + alldirs="${alldirs}${alldirs:+$acl_hardcode_libdir_separator}$dir" + done + acl_save_libdir="$libdir" + libdir="$alldirs" + eval flag=\"$acl_hardcode_libdir_flag_spec\" + libdir="$acl_save_libdir" + GUILE_LTLIBS="$flag" + else + for dir in $rpathdirs; do + acl_save_libdir="$libdir" + libdir="$dir" + eval flag=\"$acl_hardcode_libdir_flag_spec\" + libdir="$acl_save_libdir" + GUILE_LTLIBS="${GUILE_LTLIBS}${GUILE_LTLIBS:+ }$flag" + done + fi + fi + fi + fi + fi + + + GUILE_LTLIBS="$GUILE_LDFLAGS $GUILE_LTLIBS" + + + + + + + +for sdllib in SDL SDL_image SDL_gfx SDL_mixer ; do + as_ac_Lib=`$as_echo "ac_cv_lib_${sdllib}''_main" | $as_tr_sh` +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for main in -l${sdllib}" >&5 +$as_echo_n "checking for main in -l${sdllib}... " >&6; } +if eval \${$as_ac_Lib+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS -LIBS="-lGL $LIBS" +LIBS="-l${sdllib} $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -11514,27 +11681,33 @@ return main (); } _ACEOF if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_GL_main=yes + eval "$as_ac_Lib=yes" else - ac_cv_lib_GL_main=no + eval "$as_ac_Lib=no" fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_GL_main" >&5 -$as_echo "$ac_cv_lib_GL_main" >&6; } -if test "x$ac_cv_lib_GL_main" = xyes; then : - as_fn_error $? "*** GL library not found!" "$LINENO" 5 +eval ac_res=\$$as_ac_Lib + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +if eval test \"x\$"$as_ac_Lib"\" = x"yes"; then : + SDL_LIBS="-l${sdllib} $SDL_LIBS" +else + as_fn_error $? "*** ${sdllib} library not found!" "$LINENO" 5 fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for main in -lGLU" >&5 -$as_echo_n "checking for main in -lGLU... " >&6; } -if ${ac_cv_lib_GLU_main+:} false; then : +done +for gllib in GL GLU ; do + as_ac_Lib=`$as_echo "ac_cv_lib_${gllib}''_main" | $as_tr_sh` +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for main in -l${gllib}" >&5 +$as_echo_n "checking for main in -l${gllib}... " >&6; } +if eval \${$as_ac_Lib+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS -LIBS="-lGLU $LIBS" +LIBS="-l${gllib} $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -11548,20 +11721,24 @@ return main (); } _ACEOF if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_GLU_main=yes + eval "$as_ac_Lib=yes" else - ac_cv_lib_GLU_main=no + eval "$as_ac_Lib=no" fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_GLU_main" >&5 -$as_echo "$ac_cv_lib_GLU_main" >&6; } -if test "x$ac_cv_lib_GLU_main" = xyes; then : - as_fn_error $? "*** GLU library not found!" "$LINENO" 5 +eval ac_res=\$$as_ac_Lib + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +if eval test \"x\$"$as_ac_Lib"\" = x"yes"; then : + GL_LIBS="-l${gllib} $GL_LIBS" +else + as_fn_error $? "*** ${gllib} library not found!" "$LINENO" 5 fi +done { $as_echo "$as_me:${as_lineno-$LINENO}: checking for main in -lftgl" >&5 $as_echo_n "checking for main in -lftgl... " >&6; } if ${ac_cv_lib_ftgl_main+:} false; then : @@ -11593,10 +11770,14 @@ fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ftgl_main" >&5 $as_echo "$ac_cv_lib_ftgl_main" >&6; } if test "x$ac_cv_lib_ftgl_main" = xyes; then : + FTGL_LIBS="-lftgl $FTGL_LIBS" +else as_fn_error $? "*** FTGL library not found!" "$LINENO" 5 fi + + ac_config_headers="$ac_config_headers config.h" ac_config_files="$ac_config_files Makefile src/Makefile" diff --git a/configure.ac b/configure.ac index 039f2e3..a0cf7b9 100644 --- a/configure.ac +++ b/configure.ac @@ -3,15 +3,16 @@ AM_INIT_AUTOMAKE([-Wall -Werror foreign]) AC_PROG_CC AC_PROG_LIBTOOL GUILE_FLAGS -CFLAGS="$CFLAGS -I/usr/include/freetype2" -AC_CHECK_LIB(readline, main, AC_MSG_ERROR([*** readline library not found!])) -AC_CHECK_LIB(SDL, main, AC_MSG_ERROR([*** SDL library not found!])) -AC_CHECK_LIB(SDL_image, main, AC_MSG_ERROR([*** SDL_image library not found!])) -AC_CHECK_LIB(SDL_gfx, main, AC_MSG_ERROR([*** SDL_gfx library not found!])) -AC_CHECK_LIB(SDL_mixer, main, AC_MSG_ERROR([*** SDL_mixer library not found!])) -AC_CHECK_LIB(GL, main, AC_MSG_ERROR([*** GL library not found!])) -AC_CHECK_LIB(GLU, main, AC_MSG_ERROR([*** GLU library not found!])) -AC_CHECK_LIB(ftgl, main, AC_MSG_ERROR([*** FTGL library not found!])) + +for sdllib in SDL SDL_image SDL_gfx SDL_mixer ; do + AC_CHECK_LIB(${sdllib}, main, [SDL_LIBS="-l${sdllib} $SDL_LIBS"], AC_MSG_ERROR([*** ${sdllib} library not found!])) +done +for gllib in GL GLU ; do + AC_CHECK_LIB(${gllib}, main, [GL_LIBS="-l${gllib} $GL_LIBS"], AC_MSG_ERROR([*** ${gllib} library not found!])) +done +AC_CHECK_LIB(ftgl, main, [FTGL_LIBS="-lftgl $FTGL_LIBS"], AC_MSG_ERROR([*** FTGL library not found!])) + +AC_CONFIG_MACRO_DIR([m4]) AC_CONFIG_SRCDIR([src/sdl.c]) AC_CONFIG_HEADERS([config.h]) AC_CONFIG_FILES([ diff --git a/src/Makefile.am b/src/Makefile.am index f9a3e03..c795f39 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -1,2 +1,4 @@ lib_LTLIBRARIES = libguile-gacela-sdl.la libguile_gacela_sdl_la_SOURCES = sdl.c +libguile_gacela_sdl_la_LIBADD = $(SDL_LIBS) +libguile_gacela_sdl_la_CFLAGS = $(GUILE_CFLAGS) -- 2.39.5