|
From: Martin R. <ru...@us...> - 2004-08-05 08:56:21
|
Update of /cvsroot/foo/foo/elkfoo In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15440 Modified Files: configure.ac Log Message: added macro for elk/fooelk extensions dir detection (not yet working) Index: configure.ac =================================================================== RCS file: /cvsroot/foo/foo/elkfoo/configure.ac,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** configure.ac 4 Aug 2004 07:13:08 -0000 1.1 --- configure.ac 5 Aug 2004 08:56:12 -0000 1.2 *************** *** 113,142 **** # check for libelk ! AC_ARG_WITH(elk_library, ! AC_HELP_STRING([--with-elk-library=DIR], [elk scheme library file DIR]), ! , ! with_elk_library=) ! AC_ARG_WITH(elk_include, ! AC_HELP_STRING([--with-elk-include=DIR], [elk scheme include files DIR]), ! , ! with_elk_include=) ! ! if test -n "${with_elk_library}"; then ! with_elk_library="-L${with_elk_library}" ! fi ! if test -n "${with_elk_include}"; then ! with_elk_include="-I${with_elk_include}" ! fi ! ! CPPFLAGS="${CPPFLAGS} ${with_elk_include}" ! LDFLAGS="${LDFLAGS} ${with_elk_library}" ! ! AC_CHECK_HEADERS(fooelk/scheme.h, have_elk=yes, have_elk=no) if test "${have_elk}" = yes; then AC_CHECK_LIB([fooelk], [Elk_Init]) if test "${ac_cv_lib_fooelk_Elk_Init}" = yes; then ! INCLUDES="${INCLUDES} ${with_elk_include}" ! ELKFOO_LIBS="${ELKFOO_LIBS} ${with_elk_library} -lfooelk" ELK_LIBRARY="fooelk" else --- 113,122 ---- # check for libelk ! AC_CHECK_HEADERS([fooelk/scheme.h], [have_elk=yes], [have_elk=no]) if test "${have_elk}" = yes; then AC_CHECK_LIB([fooelk], [Elk_Init]) if test "${ac_cv_lib_fooelk_Elk_Init}" = yes; then ! ELKFOO_LIBS="${ELKFOO_LIBS} -lfooelk" ELK_LIBRARY="fooelk" else *************** *** 146,156 **** if test "${have_elk}" = no; then ! AC_CHECK_HEADERS(elk/scheme.h, have_elk=yes, have_elk=no) if test "${have_elk}" = yes; then AC_CHECK_LIB([elk], [Elk_Init]) if test "${ac_cv_lib_elk_Elk_Init}" = yes; then ! INCLUDES="${INCLUDES} ${with_elk_include}" ! ELKFOO_LIBS="${ELKFOO_LIBS} ${with_elk_library} -lelk" ELK_LIBRARY="elk" else --- 126,135 ---- if test "${have_elk}" = no; then ! AC_CHECK_HEADERS([elk/scheme.h], [have_elk=yes], [have_elk=no]) if test "${have_elk}" = yes; then AC_CHECK_LIB([elk], [Elk_Init]) if test "${ac_cv_lib_elk_Elk_Init}" = yes; then ! ELKFOO_LIBS="${ELKFOO_LIBS} -lelk" ELK_LIBRARY="elk" else *************** *** 161,172 **** if test "${have_elk}" = no; then ! AC_MSG_WARN(Cannot find elk scheme header and/or library) echo "* elkfoo requires the elk scheme interpreter" ! echo "* Use --with-elk-library to specify the elk library" ! echo "* Use --with-elk-include to specify the elk header" ! echo "* directories if they are not in the usual place(s)" AC_MSG_ERROR([elkfoo will not compile without elk]) fi # include dir INCLUDES="${INCLUDES} -I\$(top_srcdir)/include -I\$(top_builddir)/include" --- 140,227 ---- if test "${have_elk}" = no; then ! AC_MSG_WARN([Cannot find elk scheme header and/or library]) echo "* elkfoo requires the elk scheme interpreter" ! echo "* try setting CPPFLAGS/LDFLAGS pointing to the" ! echo "* location of the elk headers/library" ! echo "* if they are not in the usual place(s)" AC_MSG_ERROR([elkfoo will not compile without elk]) fi + # get elk's/fooelk's libdir + AC_MSG_CHECKING([for elk installation dirs]) + AC_TRY_RUN([ + #include <stdio.h> + #include <${ELK_LIBRARY}/scheme.h> + + extern char *Lib_Dir; + extern char *Scm_Dir; + + int + main (int argc, + char **argv) + { + FILE *file; + + Elk_Init(argc, argv, 0, 0); + + if (Lib_Dir == NULL || Scm_Dir == NULL) + { + exit(1); + } + + if (! (file = fopen("conftest.data", "w"))) + { + exit(1); + } + + fputs(Lib_Dir, file); + fputs("\n", file); + fputs(Scm_Dir, file); + fputs("\n", file); + fclose(file); + + exit(0); + } + ], + [AC_MSG_RESULT([done]) + ELK_LIB_DIR=`head -n1 conftest.data` + ELK_SCM_DIR=`tail -n1 conftest.data` + AC_MSG_NOTICE([using elk libdir ${ELK_LIB_DIR}]) + AC_MSG_NOTICE([using elk scmdir ${ELK_SCM_DIR}])], + [AC_MSG_RESULT([failed]) + AC_MSG_ERROR([couldn't determine elk library installation dirs])]) + + # check for libfoo + # we can't meaningfully check for -lfoo unless it depends + # on getCurrentContext(), which will get compiled in this library :-( + # CHECK DEFFERED + if test -z "${RECURSIVE_BUILD}"; then + AC_MSG_WARN([ommitting check for libfoo]) + ELKFOO_LIBS="${ELKFOO_LIBS} -lfoo" + + dnl AC_LANG_PUSH(Objective C) + dnl AC_CHECK_HEADERS([FOO/FOOObject.h], [have_libfoo=yes], [have_libfoo=no]) + + dnl if test "${have_libfoo}" = yes; then + dnl AC_CHECK_LIB([foo], [main]) + dnl if test "${ac_cv_lib_foo_main}" = yes; then + dnl ELKFOO_LIBS="${ELKFOO_LIBS} -lfoo" + dnl else + dnl have_libfoo=no + dnl fi + dnl AC_LANG_POP(Objective C) + + dnl if test "${have_libfoo}" = no; then + dnl AC_MSG_WARN([Cannot find libfoo headers and/or library]) + dnl echo "* elkfoo requires libfoo" + dnl echo "* try setting CPPFLAGS/LDFLAGS pointing to the" + dnl echo "* location of the libfoo headers/library" + dnl echo "* if they are not in the usual place(s)" + dnl AC_MSG_ERROR([elkfoo will not compile without libfoo]) + dnl fi + else + ELKFOO_LIBS="${ELKFOO_LIBS} -lfoo" + fi + # include dir INCLUDES="${INCLUDES} -I\$(top_srcdir)/include -I\$(top_builddir)/include" *************** *** 184,188 **** --- 239,246 ---- AC_SUBST(FOO_GNUSTEP_OBJCFLAGS) AC_SUBST(FOO_GNUSTEP_LDFLAGS) + AC_SUBST(ELK_LIB_DIR) + AC_SUBST(ELK_SCM_DIR) + # output files AC_OUTPUT([ Makefile |