comparison configure.in @ 1470:1364f9716d7b

[xemacs-hg @ 2003-05-10 02:57:05 by youngs] 2003-05-10 Steve Youngs <youngs@xemacs.org> * Revert this patch: 2003-05-01 Andrew Begel <abegel@CS.Berkeley.EDU> * configure.in: Move module detection to after src/ is added to MAKE_SUBDIR. On MacOS X, building modules requires xemacs to already be built. * aclocal.m4 (XE_SHLIB_STUFF): Properly define ellcc flags for MacOS X. It was stopping certain libs from making their way into the Makefiles. * configure: Regenerate.
author youngs
date Sat, 10 May 2003 02:57:07 +0000
parents b02bdcffb55f
children d968d4073031
comparison
equal deleted inserted replaced
1469:51cfeb2ed271 1470:1364f9716d7b
3182 dnl o XEMACS_CC environment variable 3182 dnl o XEMACS_CC environment variable
3183 dnl o same as the regular compiler, (determined previously) 3183 dnl o same as the regular compiler, (determined previously)
3184 test -n "$xemacs_compiler" && XEMACS_CC="$xemacs_compiler" 3184 test -n "$xemacs_compiler" && XEMACS_CC="$xemacs_compiler"
3185 : ${XEMACS_CC:="$CC"} 3185 : ${XEMACS_CC:="$CC"}
3186 3186
3187 dnl Autodetect dll support
3188 dnl This must come before the detection code for anything that is in a module
3189 if test "$with_modules" != "no"; then
3190 AC_CHECKING(for module support)
3191
3192 dnl Check for MS-Windows
3193 if test "$with_msw" = "yes"; then
3194 have_dl=yes;
3195 else
3196 case "$opsys" in
3197 darwin ) have_dl=yes; AC_DEFINE(HAVE_DYLD) ;;
3198 * )
3199 dnl Find headers and libraries
3200 AC_CHECK_HEADER(dlfcn.h, [
3201 AC_MSG_CHECKING([for dlopen in -lc])
3202 AC_TRY_LINK([#include <dlfcn.h>],dnl
3203 [dlopen ("", 0);], [ have_dl=yes ], [
3204 AC_MSG_CHECKING([for dlopen in -ldl])
3205 ac_save_LIBS="$LIBS"
3206 LIBS="-ldl $LIBS"
3207 AC_TRY_LINK([#include <dlfcn.h>],dnl
3208 [dlopen ("", 0);], [ have_dl=yes ],
3209 [LIBS="$ac_save_LIBS"])
3210 ac_save_LIBS=])])
3211 if test -n "$have_dl"; then
3212 AC_DEFINE(HAVE_DLOPEN)
3213 else
3214 AC_CHECK_LIB(dld, shl_load, [
3215 libdl=dld have_dl=yes;
3216 AC_DEFINE(HAVE_SHL_LOAD)], [
3217 AC_CHECK_LIB(dld, dld_init, [
3218 libdl=dld have_dl=yes;
3219 AC_DEFINE(HAVE_DLD_INIT)])])
3220 fi
3221 esac dnl end !darwin
3222 fi dnl end !MS-Windows
3223
3224 if test -n "$have_dl"; then
3225 dnl XE_SHLIB_STUFF (in aclocal.m4) defines $can_build_shared
3226 XE_SHLIB_STUFF
3227 fi
3228
3229 if test "$can_build_shared" = "yes"; then
3230 AC_DEFINE(HAVE_SHLIB)
3231 XE_APPEND(src, INSTALL_ARCH_DEP_SUBDIR)
3232 test -n "$libdl" && XE_PREPEND(-l${libdl}, LIBS)
3233 AC_CHECK_FUNCS(dlerror _dlerror)
3234 with_modules=yes
3235 MOD_CC="../../lib-src/ellcc"
3236 MODCFLAGS="\$(CFLAGS) --mode=compile --mod-output=\$@ -I../../src -I\$(srcdir)/../../src"
3237 INSTALLPATH="\$(moduledir)"
3238 MOD_INSTALL_PROGRAM=${INSTALL_PROGRAM}
3239 OBJECT_TO_BUILD="\$(MODNAME).ell"
3240 else
3241 if test "$with_modules" = "yes"; then
3242 XE_DIE("Required module support cannot be provided.")
3243 else
3244 echo " No module support."
3245 fi
3246 with_modules=no
3247 MOD_CC="$XEMACS_CC"
3248 MODCFLAGS="\$(CFLAGS) -I../../src -I\$(srcdir)/../../src"
3249 INSTALLPATH=""
3250 MOD_INSTALL_PROGRAM="true"
3251 OBJECT_TO_BUILD="\$(MODNAME).o"
3252 fi
3253 fi
3254 MODARCHDIR=
3255 MAKE_DOCFILE="../../lib-src/make-docfile"
3256 AC_SUBST(with_modules)
3257 AC_SUBST(MOD_CC)
3258 AC_SUBST(MODARCHDIR)
3259 AC_SUBST(MAKE_DOCFILE)
3260 AC_SUBST(MODCFLAGS)
3261 AC_SUBST(INSTALLPATH)
3262 AC_SUBST(MOD_INSTALL_PROGRAM)
3263 AC_SUBST(OBJECT_TO_BUILD)
3187 3264
3188 dnl Autodetect tooltalk 3265 dnl Autodetect tooltalk
3189 if test "$with_tooltalk" != "no" ; then 3266 if test "$with_tooltalk" != "no" ; then
3190 dnl autodetect the location of tt_c.h 3267 dnl autodetect the location of tt_c.h
3191 dnl tt_c.h might be in Tt or desktop include directories 3268 dnl tt_c.h might be in Tt or desktop include directories
3283 with_dragndrop=no 3360 with_dragndrop=no
3284 AC_MSG_RESULT(no) 3361 AC_MSG_RESULT(no)
3285 fi 3362 fi
3286 fi 3363 fi
3287 3364
3365 dnl Autodetect LDAP
3366 AC_CHECKING(for LDAP)
3367 ldap_libs=
3368 test -z "$with_ldap" && { AC_CHECK_HEADER(ldap.h, ,with_ldap=no) }
3369 test -z "$with_ldap" && { AC_CHECK_HEADER(lber.h, ,with_ldap=no) }
3370 if test "$with_ldap" != "no"; then
3371 AC_CHECK_LIB(ldap, ldap_search, with_ldap_nolber=yes, with_ldap_nolber=no)
3372 test "$with_ldap_nolber" = "no" && { AC_CHECK_LIB(ldap, ldap_open, with_ldap_lber=yes, with_ldap_lber=no, -llber) }
3373 test "$with_ldap_nolber" = "no" -a "$with_ldap_lber" = "no" && { AC_CHECK_LIB(ldap, ldap_open, with_ldap_krb=yes, with_ldap_krb=no, -llber -lkrb) }
3374 test "$with_ldap_nolber" = "no" -a "$with_ldap_lber" = "no" -a "$with_ldap_krb" = "no" && { AC_CHECK_LIB(ldap, ldap_open, with_ldap_krbdes=yes, with_ldap_krbdes=no, -llber -lkrb -ldes) }
3375 test -z "$with_ldap" -a \( "$with_ldap_lber" = "yes" -o "$with_ldap_nolber" = "yes" -o "$with_ldap_krb" = "yes" -o "$with_ldap_krbdes" = "yes" \) && with_ldap=yes
3376 fi
3377 if test "$with_ldap" = "yes"; then
3378 AC_DEFINE(HAVE_LDAP)
3379 if test "$with_ldap_nolber" = "yes" ; then
3380 XE_PREPEND(-lldap, ldap_libs)
3381 else
3382 if test "$with_ldap_krb" = "yes" ; then
3383 XE_PREPEND(-lkrb, ldap_libs)
3384 fi
3385 if test "$with_ldap_krbdes" = "yes" ; then
3386 XE_PREPEND(-ldes, ldap_libs)
3387 XE_PREPEND(-lkrb, ldap_libs)
3388 fi
3389 XE_PREPEND(-llber, ldap_libs)
3390 XE_PREPEND(-lldap, ldap_libs)
3391 fi
3392 save_LIBS="$LIBS" LIBS="$LIBS $ldap_libs"
3393 AC_CHECK_FUNCS(ldap_set_option ldap_get_lderrno ldap_result2error ldap_parse_result)
3394 LIBS="$save_LIBS"
3395 XE_APPEND(modules/ldap, MAKE_SUBDIR)
3396 need_modules_common=yes
3397 if test "$with_modules" = "yes"; then
3398 XE_APPEND(modules/ldap, INSTALL_ARCH_DEP_SUBDIR)
3399 fi
3400 fi
3401 AC_SUBST(ldap_libs)
3402
3403 dnl Autodetect PostgreSQL
3404 dnl On many Linux systems, PostgreSQL is packaged to be installed in /usr;
3405 dnl in this case, configure will easily detect it there.
3406 dnl
3407 dnl If PostgreSQL is installed into a different prefix,
3408 dnl (such as the default /usr/local/pgsql when building from source),
3409 dnl that prefix must be specified using the --site-prefixes flag.
3410 postgresql_libs=
3411 if test "$with_postgresql" != "no"; then
3412 AC_CHECKING(for PostgreSQL)
3413
3414 dnl Look for these standard header file locations, known to be used on Linux
3415 for header_dir in "" "pgsql/" "postgresql/"; do
3416 AC_CHECK_HEADER(${header_dir}libpq-fe.h,
3417 libpq_fe_h_file=${header_dir}libpq-fe.h; break)
3418 done
3419
3420 test -n "$libpq_fe_h_file" && { AC_CHECK_LIB(pq,PQconnectdb,have_libpq=yes) }
3421
3422 if test -n "$libpq_fe_h_file" -a "$have_libpq" = "yes"; then
3423 with_postgresql=yes
3424 AC_DEFINE(HAVE_POSTGRESQL)
3425 AC_CHECK_LIB(pq,PQconnectStart, [
3426 with_postgresqlv7=yes;
3427 AC_DEFINE(HAVE_POSTGRESQLV7)])
3428 AC_DEFINE_UNQUOTED(LIBPQ_FE_H_FILE, "$libpq_fe_h_file")
3429 XE_PREPEND(-lpq, postgresql_libs)
3430 XE_APPEND(modules/postgresql, MAKE_SUBDIR)
3431 need_modules_common=yes
3432 if test "$with_modules" = "yes"; then
3433 XE_APPEND(modules/postgresql, INSTALL_ARCH_DEP_SUBDIR)
3434 fi
3435 elif test "$with_postgresql" = "yes"; then
3436 XE_DIE("Required PostgreSQL support cannot be provided. Check --site-prefixes.")
3437 fi
3438 fi
3439 AC_SUBST(postgresql_libs)
3288 3440
3289 dnl ---------------------- 3441 dnl ----------------------
3290 dnl Graphics libraries 3442 dnl Graphics libraries
3291 dnl ---------------------- 3443 dnl ----------------------
3292 3444
4595 XE_SPACE(ld_switch_all, $ld_switch_general $ld_switch_window_system) 4747 XE_SPACE(ld_switch_all, $ld_switch_general $ld_switch_window_system)
4596 XE_SPACE(ld_libs_general, $LIBS $libs_machine $libs_system $libs_standard) 4748 XE_SPACE(ld_libs_general, $LIBS $libs_machine $libs_system $libs_standard)
4597 XE_SPACE(ld_libs_window_system, $X_EXTRA_LIBS $libs_x $libs_gtk $X_PRE_LIBS) 4749 XE_SPACE(ld_libs_window_system, $X_EXTRA_LIBS $libs_x $libs_gtk $X_PRE_LIBS)
4598 XE_SPACE(ld_libs_all, $ld_libs_window_system $ld_libs_general $ld_libs_module) 4750 XE_SPACE(ld_libs_all, $ld_libs_window_system $ld_libs_general $ld_libs_module)
4599 4751
4600
4601 dnl Compute lists of Makefiles and subdirs 4752 dnl Compute lists of Makefiles and subdirs
4602 AC_SUBST(SRC_SUBDIR_DEPS) 4753 AC_SUBST(SRC_SUBDIR_DEPS)
4603 XE_APPEND(src, MAKE_SUBDIR) 4754 XE_APPEND(src, MAKE_SUBDIR)
4604
4605 dnl Autodetect dll support
4606 dnl This must come before the detection code for anything that is in a module
4607 if test "$with_modules" != "no"; then
4608 AC_CHECKING(for module support)
4609
4610 dnl Check for MS-Windows
4611 if test "$with_msw" = "yes"; then
4612 have_dl=yes;
4613 else
4614 case "$opsys" in
4615 darwin ) have_dl=yes; AC_DEFINE(HAVE_DYLD) ;;
4616 * )
4617 dnl Find headers and libraries
4618 AC_CHECK_HEADER(dlfcn.h, [
4619 AC_MSG_CHECKING([for dlopen in -lc])
4620 AC_TRY_LINK([#include <dlfcn.h>],dnl
4621 [dlopen ("", 0);], [ have_dl=yes ], [
4622 AC_MSG_CHECKING([for dlopen in -ldl])
4623 ac_save_LIBS="$LIBS"
4624 LIBS="-ldl $LIBS"
4625 AC_TRY_LINK([#include <dlfcn.h>],dnl
4626 [dlopen ("", 0);], [ have_dl=yes ],
4627 [LIBS="$ac_save_LIBS"])
4628 ac_save_LIBS=])])
4629 if test -n "$have_dl"; then
4630 AC_DEFINE(HAVE_DLOPEN)
4631 else
4632 AC_CHECK_LIB(dld, shl_load, [
4633 libdl=dld have_dl=yes;
4634 AC_DEFINE(HAVE_SHL_LOAD)], [
4635 AC_CHECK_LIB(dld, dld_init, [
4636 libdl=dld have_dl=yes;
4637 AC_DEFINE(HAVE_DLD_INIT)])])
4638 fi
4639 esac dnl end !darwin
4640 fi dnl end !MS-Windows
4641
4642 if test -n "$have_dl"; then
4643 dnl XE_SHLIB_STUFF (in aclocal.m4) defines $can_build_shared
4644 XE_SHLIB_STUFF
4645 fi
4646
4647 if test "$can_build_shared" = "yes"; then
4648 AC_DEFINE(HAVE_SHLIB)
4649 XE_APPEND(src, INSTALL_ARCH_DEP_SUBDIR)
4650 test -n "$libdl" && XE_PREPEND(-l${libdl}, LIBS)
4651 AC_CHECK_FUNCS(dlerror _dlerror)
4652 with_modules=yes
4653 MOD_CC="../../lib-src/ellcc"
4654 MODCFLAGS="\$(CFLAGS) --mode=compile --mod-output=\$@ -I../../src -I\$(srcdir)/../../src"
4655 INSTALLPATH="\$(moduledir)"
4656 MOD_INSTALL_PROGRAM=${INSTALL_PROGRAM}
4657 OBJECT_TO_BUILD="\$(MODNAME).ell"
4658 else
4659 if test "$with_modules" = "yes"; then
4660 XE_DIE("Required module support cannot be provided.")
4661 else
4662 echo " No module support."
4663 fi
4664 with_modules=no
4665 MOD_CC="$XEMACS_CC"
4666 MODCFLAGS="\$(CFLAGS) -I../../src -I\$(srcdir)/../../src"
4667 INSTALLPATH=""
4668 MOD_INSTALL_PROGRAM="true"
4669 OBJECT_TO_BUILD="\$(MODNAME).o"
4670 fi
4671 fi
4672 MODARCHDIR=
4673 MAKE_DOCFILE="../../lib-src/make-docfile"
4674 AC_SUBST(with_modules)
4675 AC_SUBST(MOD_CC)
4676 AC_SUBST(MODARCHDIR)
4677 AC_SUBST(MAKE_DOCFILE)
4678 AC_SUBST(MODCFLAGS)
4679 AC_SUBST(INSTALLPATH)
4680 AC_SUBST(MOD_INSTALL_PROGRAM)
4681 AC_SUBST(OBJECT_TO_BUILD)
4682
4683
4684 dnl Autodetect LDAP
4685 AC_CHECKING(for LDAP)
4686 ldap_libs=
4687 test -z "$with_ldap" && { AC_CHECK_HEADER(ldap.h, ,with_ldap=no) }
4688 test -z "$with_ldap" && { AC_CHECK_HEADER(lber.h, ,with_ldap=no) }
4689 if test "$with_ldap" != "no"; then
4690 AC_CHECK_LIB(ldap, ldap_search, with_ldap_nolber=yes, with_ldap_nolber=no)
4691 test "$with_ldap_nolber" = "no" && { AC_CHECK_LIB(ldap, ldap_open, with_ldap_lber=yes, with_ldap_lber=no, -llber) }
4692 test "$with_ldap_nolber" = "no" -a "$with_ldap_lber" = "no" && { AC_CHECK_LIB(ldap, ldap_open, with_ldap_krb=yes, with_ldap_krb=no, -llber -lkrb) }
4693 test "$with_ldap_nolber" = "no" -a "$with_ldap_lber" = "no" -a "$with_ldap_krb" = "no" && { AC_CHECK_LIB(ldap, ldap_open, with_ldap_krbdes=yes, with_ldap_krbdes=no, -llber -lkrb -ldes) }
4694 test -z "$with_ldap" -a \( "$with_ldap_lber" = "yes" -o "$with_ldap_nolber" = "yes" -o "$with_ldap_krb" = "yes" -o "$with_ldap_krbdes" = "yes" \) && with_ldap=yes
4695 fi
4696 if test "$with_ldap" = "yes"; then
4697 AC_DEFINE(HAVE_LDAP)
4698 if test "$with_ldap_nolber" = "yes" ; then
4699 XE_PREPEND(-lldap, ldap_libs)
4700 else
4701 if test "$with_ldap_krb" = "yes" ; then
4702 XE_PREPEND(-lkrb, ldap_libs)
4703 fi
4704 if test "$with_ldap_krbdes" = "yes" ; then
4705 XE_PREPEND(-ldes, ldap_libs)
4706 XE_PREPEND(-lkrb, ldap_libs)
4707 fi
4708 XE_PREPEND(-llber, ldap_libs)
4709 XE_PREPEND(-lldap, ldap_libs)
4710 fi
4711 save_LIBS="$LIBS" LIBS="$LIBS $ldap_libs"
4712 AC_CHECK_FUNCS(ldap_set_option ldap_get_lderrno ldap_result2error ldap_parse_result)
4713 LIBS="$save_LIBS"
4714 XE_APPEND(modules/ldap, MAKE_SUBDIR)
4715 need_modules_common=yes
4716 if test "$with_modules" = "yes"; then
4717 XE_APPEND(modules/ldap, INSTALL_ARCH_DEP_SUBDIR)
4718 fi
4719 fi
4720 AC_SUBST(ldap_libs)
4721
4722 dnl Autodetect PostgreSQL
4723 dnl On many Linux systems, PostgreSQL is packaged to be installed in /usr;
4724 dnl in this case, configure will easily detect it there.
4725 dnl
4726 dnl If PostgreSQL is installed into a different prefix,
4727 dnl (such as the default /usr/local/pgsql when building from source),
4728 dnl that prefix must be specified using the --site-prefixes flag.
4729 postgresql_libs=
4730 if test "$with_postgresql" != "no"; then
4731 AC_CHECKING(for PostgreSQL)
4732
4733 dnl Look for these standard header file locations, known to be used on Linux
4734 for header_dir in "" "pgsql/" "postgresql/"; do
4735 AC_CHECK_HEADER(${header_dir}libpq-fe.h,
4736 libpq_fe_h_file=${header_dir}libpq-fe.h; break)
4737 done
4738
4739 test -n "$libpq_fe_h_file" && { AC_CHECK_LIB(pq,PQconnectdb,have_libpq=yes) }
4740
4741 if test -n "$libpq_fe_h_file" -a "$have_libpq" = "yes"; then
4742 with_postgresql=yes
4743 AC_DEFINE(HAVE_POSTGRESQL)
4744 AC_CHECK_LIB(pq,PQconnectStart, [
4745 with_postgresqlv7=yes;
4746 AC_DEFINE(HAVE_POSTGRESQLV7)])
4747 AC_DEFINE_UNQUOTED(LIBPQ_FE_H_FILE, "$libpq_fe_h_file")
4748 XE_PREPEND(-lpq, postgresql_libs)
4749 XE_APPEND(modules/postgresql, MAKE_SUBDIR)
4750 need_modules_common=yes
4751 if test "$with_modules" = "yes"; then
4752 XE_APPEND(modules/postgresql, INSTALL_ARCH_DEP_SUBDIR)
4753 fi
4754 elif test "$with_postgresql" = "yes"; then
4755 XE_DIE("Required PostgreSQL support cannot be provided. Check --site-prefixes.")
4756 fi
4757 fi
4758 AC_SUBST(postgresql_libs)
4759
4760 internal_makefile_list="Makefile.in" 4755 internal_makefile_list="Makefile.in"
4761 SUBDIR_MAKEFILES='' 4756 SUBDIR_MAKEFILES=''
4762 test -d lock || mkdir lock 4757 test -d lock || mkdir lock
4763 for dir in $MAKE_SUBDIR; do 4758 for dir in $MAKE_SUBDIR; do
4764 case "$dir" in */* ) dnl Implement mkdir -p 4759 case "$dir" in */* ) dnl Implement mkdir -p