265
+ − 1 dnl aclocal.m4 --- Dynamically linked library support for XEmacs
388
+ − 2 dnl Copyright (C) 1998, 1999 J. Kean Johnston.
+ − 3 dnl Author: J. Kean Johnston <jkj@sco.com>, based on work in libtool.
+ − 4 dnl This file is part of XEmacs.
+ − 5
+ − 6 dnl
+ − 7 dnl There are several things we care about here. First, we need to find
+ − 8 dnl out how we create an executable that has its symbols exported, so
+ − 9 dnl that dynamically loaded modules have access to the internal XEmacs
+ − 10 dnl symbols. This is stored in ``ld_dynamic_link_flags'' and is used
+ − 11 dnl in the main Makefile.
+ − 12 dnl Next, we need to know how we compile actual shared libraries, and
+ − 13 dnl the objects in them. For these purposes, we need to determine the
+ − 14 dnl C compiler flags used to produce shared objects (``dll_cflags''),
+ − 15 dnl what linker to use to create the final shared object that will be
+ − 16 dnl loaded (``dll_ld'') and the flags to pass to that linker
+ − 17 dnl (``dll_ldflags''). This information is used by ellcc to build up
+ − 18 dnl the command line when compiling modules. We build up two other commands
+ − 19 dnl for extremely weird systems where special things need to be done.
+ − 20 dnl The first is ``dll_ldo'', which is the flag used to specify the output
+ − 21 dnl file name, and the second is ``dll_post'' which is inserted after the
+ − 22 dnl list of objects.
+ − 23 dnl After all of this, we should be able to:
+ − 24 dnl $(CC) $(CFLAGS) $(dll_cflags) -c module.c
+ − 25 dnl to produce a single shared object
+ − 26 dnl And then:
+ − 27 dnl $(dll_ld) $(dll_ldflags) $(dll_ldo) module.ell module.o $(dll_post)
+ − 28 dnl to create the loadable shared library.
+ − 29 dnl
+ − 30 dnl NOTE: In the code below, where I have modified things to work with
+ − 31 dnl XEmacs, we use $canonical instead of libtool's $host, and we use
+ − 32 dnl $internal_configuration instead of $host_alias. To make typing
+ − 33 dnl shorter we assign these to $xehost and $xealias
+ − 34
+ − 35 AC_DEFUN(XE_SHLIB_STUFF,[
+ − 36 dll_ld=
+ − 37 dll_ldflags=
+ − 38 dll_cflags=
+ − 39 dll_post=
+ − 40 dll_ldo="-o"
+ − 41 ld_dynamic_link_flags=
2651
+ − 42 xehost=$ac_cv_build
+ − 43 xealias=$ac_cv_build_alias
388
+ − 44
3312
+ − 45 AC_MSG_CHECKING([how to build dynamic libraries for ${xehost}])
+ − 46 AC_MSG_RESULT()
388
+ − 47 # Transform *-*-linux* to *-*-linux-gnu*, to support old configure scripts.
+ − 48 case "$xehost" in
+ − 49 *-*-linux-gnu*) ;;
+ − 50 *-*-linux*) xehost=`echo $xehost | sed 's/^\(.*-.*-linux\)\(.*\)$/\1-gnu\2/'`
+ − 51 esac
+ − 52
2651
+ − 53 xehost_cpu=`echo $xehost | sed 's/^\([[^-]]*\)-\([[^-]]*\)-\(.*\)$/\1/'`
+ − 54 xehost_vendor=`echo $xehost | sed 's/^\([[^-]]*\)-\([[^-]]*\)-\(.*\)$/\2/'`
+ − 55 xehost_os=`echo $xehost | sed 's/^\([[^-]]*\)-\([[^-]]*\)-\(.*\)$/\3/'`
388
+ − 56
+ − 57 case "$xehost_os" in
+ − 58 aix3*)
+ − 59 # AIX sometimes has problems with the GCC collect2 program. For some
+ − 60 # reason, if we set the COLLECT_NAMES environment variable, the problems
+ − 61 # vanish in a puff of smoke.
+ − 62 if test "${COLLECT_NAMES+set}" != set; then
+ − 63 COLLECT_NAMES=
+ − 64 export COLLECT_NAMES
+ − 65 fi
+ − 66 ;;
+ − 67 esac
+ − 68
+ − 69 # Now see if the compiler is really GCC.
+ − 70 if test "$GCC" = "yes"; then
+ − 71 XEGCC=yes
+ − 72 else
2651
+ − 73 AC_MSG_CHECKING([whether we are using GNU C])
388
+ − 74 AC_EGREP_CPP(yes,[
+ − 75 #ifdef __GNUC__
+ − 76 yes;
+ − 77 #endif
+ − 78 ],XEGCC=yes, XEGCC=no)
+ − 79 AC_MSG_RESULT([${XEGCC}])
+ − 80 fi
+ − 81
2651
+ − 82 AC_MSG_CHECKING([how to produce PIC code])
388
+ − 83 wl=
+ − 84
+ − 85 can_build_shared=yes
1756
+ − 86 if test "$XEGCC" = yes -o "$__ICC" = yes; then
388
+ − 87 wl='-Wl,'
+ − 88
+ − 89 case "$xehost_os" in
460
+ − 90 aix[[3-9]]* | irix[[5-9]]* | osf[[3-9]])
388
+ − 91 # PIC is the default for these OSes.
+ − 92 ;;
+ − 93
1678
+ − 94 *darwin*) dll_cflags='-dynamic'
+ − 95 ;;
+ − 96
460
+ − 97 os2*)
388
+ − 98 # We can build DLLs from non-PIC.
+ − 99 ;;
+ − 100 amigaos*)
+ − 101 # FIXME: we need at least 68020 code to build shared libraries, but
+ − 102 # adding the `-m68020' flag to GCC prevents building anything better,
+ − 103 # like `-m68040'.
+ − 104 dll_cflags='-m68020 -resident32 -malways-restore-a4'
+ − 105 ;;
442
+ − 106 *cygwin* | *mingw* )
+ − 107 # PIC is the default
+ − 108 ;;
388
+ − 109 *)
+ − 110 dll_cflags='-fPIC'
+ − 111 ;;
+ − 112 esac
+ − 113 else
+ − 114 # PORTME Check for PIC flags for the system compiler.
+ − 115 case "$xehost_os" in
430
+ − 116 hpux9* | hpux1[[0-9]]*)
388
+ − 117 # Is there a better link_static_flag that works with the bundled CC?
+ − 118 wl='-Wl,'
+ − 119 dll_cflags='+Z'
+ − 120 ;;
+ − 121
460
+ − 122 irix[[5-9]]*)
388
+ − 123 wl='-Wl,'
+ − 124 # PIC (with -KPIC) is the default.
+ − 125 ;;
+ − 126
+ − 127 os2*)
+ − 128 # We can build DLLs from non-PIC.
+ − 129 ;;
+ − 130
460
+ − 131 osf[[3-9]]*)
388
+ − 132 # All OSF/1 code is PIC.
+ − 133 wl='-Wl,'
+ − 134 ;;
+ − 135
460
+ − 136 aix[[3-9]]*)
+ − 137 # All AIX code is PIC.
+ − 138 wl='-Wl,'
+ − 139 ;;
+ − 140
388
+ − 141 sco3.2v5*)
+ − 142 dll_cflags='-belf -Kpic'
+ − 143 wl='-Wl,'
+ − 144 ;;
265
+ − 145
388
+ − 146 unixware*)
+ − 147 dll_cflags="-KPIC"
+ − 148 wl="-Wl,"
+ − 149 ;;
+ − 150
+ − 151 sysv4*)
+ − 152 dll_cflags="-KPIC"
+ − 153 wl="-Wl,"
+ − 154 ;;
+ − 155
+ − 156 sysv5*)
+ − 157 dll_cflags="-KPIC"
+ − 158 wl="-Wl,"
+ − 159 ;;
+ − 160
+ − 161 solaris2*)
+ − 162 dll_cflags='-KPIC'
+ − 163 wl='-Wl,'
+ − 164 ;;
+ − 165
+ − 166 sunos4*)
+ − 167 dll_cflags='-PIC'
+ − 168 wl='-Qoption ld '
+ − 169 ;;
+ − 170
+ − 171 uts4*)
+ − 172 dll_cflags='-pic'
+ − 173 ;;
+ − 174
+ − 175 *)
+ − 176 can_build_shared=no
+ − 177 ;;
+ − 178 esac
+ − 179 fi
+ − 180
+ − 181 if test -n "$dll_cflags"; then
+ − 182 AC_MSG_RESULT([${dll_cflags}])
442
+ − 183
388
+ − 184 # Check to make sure the dll_cflags actually works.
+ − 185 AC_MSG_CHECKING([if PIC flag ${dll_cflags} really works])
+ − 186 save_CFLAGS="$CFLAGS"
+ − 187 CFLAGS="$CFLAGS $dll_cflags -DPIC"
3312
+ − 188 AC_COMPILE_IFELSE([AC_LANG_SOURCE([int x=0;])],[
388
+ − 189 # On HP-UX, the stripped-down bundled CC doesn't accept +Z, but also
+ − 190 # reports no error. So, we need to grep stderr for (Bundled).
+ − 191 if grep '(Bundled)' config.log >/dev/null; then
+ − 192 AC_MSG_RESULT(no)
+ − 193 can_build_shared=no
+ − 194 dll_cflags=
+ − 195 else
+ − 196 AC_MSG_RESULT(yes)
+ − 197 fi], [AC_MSG_RESULT(no)
+ − 198 can_build_shared=no
+ − 199 dll_cflags=])
+ − 200 CFLAGS="$save_CFLAGS"
+ − 201 else
+ − 202 AC_MSG_RESULT(none)
+ − 203 fi
+ − 204
+ − 205 dnl
+ − 206 dnl Now comes the LD trickery. We do things differently to libtool here.
+ − 207 dnl I believe that libtool is incorrect in trying to drive the linker
+ − 208 dnl directly. This can cause considerable problems if the module you are
+ − 209 dnl compiling has C++ or other static initializers. If we use ld directly,
442
+ − 210 dnl we don't end up with the crt stuff being linked in, and we don't end up
388
+ − 211 dnl with any .init or .fini sections (or the moral equivalent thereof).
442
+ − 212 dnl gcc takes great care to do this properly when invoked in -shared
+ − 213 dnl mode, and we really do want this behavior. Perhaps the libtool folks
388
+ − 214 dnl are not aware that any SVR4 based dynamic loader will automatically
+ − 215 dnl execute code in the .init section before dlopen() returns. This is
442
+ − 216 dnl vital, as the module may have been compiled to rely on that behavior.
388
+ − 217 dnl
+ − 218 dnl So, having said all of that, we diverge from libtool significantly
+ − 219 dnl here. We want to try and use the C compiler as much as possible. Only
2079
+ − 220 dnl if the C compiler itself cannot create shared libraries do we try to
388
+ − 221 dnl find the linker.
+ − 222 dnl
+ − 223 dnl The other advantage to my scheme is that it removes the dependancy
+ − 224 dnl on a given compiler version remaining static with relation to the
+ − 225 dnl version of XEmacs. With the libtool way, it picks up the linker that
+ − 226 dnl gcc uses, which can be the internal collect2 that comes with gcc.
+ − 227 dnl If the user ever changes their compiler version, the paths will no
+ − 228 dnl longer be correct, and ellcc will break. This is clearly unacceptable.
442
+ − 229 dnl By using the compiler driver on the path, we don't have this problem.
388
+ − 230 dnl If that is not clear, consider that gcc -print-prog-name=ld can
+ − 231 dnl produce something along the lines of:
+ − 232 dnl /usr/local/lib/gcc-lib/OS-NAME/GCC-VERSION/ld
+ − 233 dnl If you ever change GCC versions, then that path no longer exists.
+ − 234 dnl
+ − 235 dnl So, we change the check order here. We first check to see if we are
+ − 236 dnl using GCC, and if so, we see if -shared works. If it does, great.
+ − 237 dnl If we are not using gcc, but the system C compiler can produce
+ − 238 dnl shared objects, we try that. Only if all of that fails do we revert
+ − 239 dnl back to the libtool ld trickery.
+ − 240 dnl
442
+ − 241 dnl We don't do ANY of this if we can't produce shared objects.
388
+ − 242 dnl
+ − 243 if test "$can_build_shared" = "yes"; then
+ − 244 cc_produces_so=no
+ − 245 xldf=
+ − 246 xcldf=
2651
+ − 247 AC_MSG_CHECKING([if C compiler can produce shared libraries])
1756
+ − 248 if test "$XEGCC" = yes -o "$__ICC" = yes; then
1678
+ − 249 case "$xehost_os" in
+ − 250 *darwin*)
+ − 251 xcldf='-bundle'
+ − 252 xldf='-bundle -bundle_loader ../../src/xemacs'
+ − 253 ;;
+ − 254 *)
+ − 255 xcldf="-shared"
+ − 256 xldf="-shared"
+ − 257 ;;
+ − 258 esac
388
+ − 259 else # Not using GCC
+ − 260 case "$xehost_os" in
460
+ − 261 aix[[3-9]]*)
388
+ − 262 xldf="-bE:ELLSONAME.exp -H512 -T512 -bhalt:4 -bM:SRE -bnoentry -lc"
+ − 263 xcldf="${wl}-bE:ELLSONAME.exp ${wl}-H512 ${wl}-T512 ${wl}-bhalt:4 ${wl}-bM:SRE ${wl}-bnoentry ${wl}-lc"
+ − 264 ;;
+ − 265
+ − 266 freebsd2* | netbsd* | openbsd*)
+ − 267 xldf="-Bshareable"
+ − 268 xcldf="${wl}-Bshareable"
+ − 269 ;;
+ − 270
+ − 271 freebsd3*)
+ − 272 xcldf="-shared"
+ − 273 ;;
+ − 274
+ − 275 hpux*)
+ − 276 xldf="-b +s"
+ − 277 xcldf="${wl}-b ${wl}+s"
+ − 278 ;;
+ − 279
460
+ − 280 irix[[5-9]]* | osf[[3-9]]*)
388
+ − 281 xcldf="${wl}-shared"
+ − 282 xldf="-shared"
+ − 283 ;;
+ − 284
+ − 285 sco3.2v5* | unixware* | sysv5* | sysv4* | solaris2* | solaris7* | uts4*)
+ − 286 xcldf="-G"
+ − 287 xldf="-G"
+ − 288 ;;
+ − 289
+ − 290 sunos4*)
+ − 291 xcldf="${wl}-assert ${wl}pure-text ${wl}-Bstatic"
+ − 292 xldf="-assert pure-text -Bstatic"
+ − 293 ;;
+ − 294 esac
+ − 295 fi # End if if we are using gcc
265
+ − 296
388
+ − 297 if test -n "$xcldf"; then
+ − 298 save_LDFLAGS=$LDFLAGS
+ − 299 save_LIBS=$LIBS
+ − 300 save_xe_libs=$xe_libs
+ − 301 LDFLAGS="$xcldf $LDFLAGS"
+ − 302 LIBS=
+ − 303 xe_libs=
3312
+ − 304 ac_link='${CC-cc} -o conftest $CFLAGS '"$xe_cppflags $xe_ldflags"' conftest.$ac_ext '"$xe_libs"' 1>&AS_MESSAGE_LOG_FD'
+ − 305 AC_LINK_IFELSE([AC_LANG_SOURCE([int x=0;])],
+ − 306 [cc_produces_so=yes],[cc_produces_so=no])
388
+ − 307 LDFLAGS=$save_LDFLAGS
+ − 308 LIBS=$save_LIBS
+ − 309 xe_libs=$save_xe_libs
3312
+ − 310 ac_link='${CC-cc} -o conftest $CFLAGS '"$xe_cppflags $xe_ldflags"' conftest.$ac_ext '"$xe_libs"' 1>&AS_MESSAGE_LOG_FD'
388
+ − 311 else
+ − 312 cc_produces_so=no
+ − 313 fi
+ − 314 AC_MSG_RESULT([${cc_produces_so}])
+ − 315
+ − 316 LTLD=$LD
+ − 317 if test -z "$LTLD"; then
+ − 318 ac_prog=ld
+ − 319 if test "$XEGCC" = yes; then
+ − 320 # Check if gcc -print-prog-name=ld gives a path.
2651
+ − 321 AC_MSG_CHECKING([for ld used by GCC])
388
+ − 322 ac_prog=`($CC -print-prog-name=ld) 2>&5`
+ − 323 case "$ac_prog" in
+ − 324 # Accept absolute paths.
+ − 325 /*)
+ − 326 if test -z "$LTLD"; then
724
+ − 327 # case "$ac_prog" in
+ − 328 # *gcc-lib*) LTLD="$CC"
+ − 329 # ;;
+ − 330 # *)
+ − 331 LTLD="$ac_prog"
+ − 332 # ;;
+ − 333 # esac
388
+ − 334 fi
+ − 335 ;;
+ − 336 "")
+ − 337 # If it fails, then pretend we aren't using GCC.
+ − 338 ac_prog=ld
+ − 339 ;;
+ − 340 *)
+ − 341 # If it is relative, then search for the first ld in PATH.
+ − 342 with_gnu_ld=unknown
+ − 343 ;;
+ − 344 esac
+ − 345 else
2651
+ − 346 AC_MSG_CHECKING([for GNU ld])
388
+ − 347 fi
+ − 348
+ − 349 if test -z "$LTLD"; then
+ − 350 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
+ − 351 for ac_dir in $PATH; do
+ − 352 test -z "$ac_dir" && ac_dir=.
+ − 353 if test -f "$ac_dir/$ac_prog"; then
+ − 354 LTLD="$ac_dir/$ac_prog"
+ − 355 # Check to see if the program is GNU ld. I'd rather use --version,
+ − 356 # but apparently some GNU ld's only accept -v.
+ − 357 # Break only if it was the GNU/non-GNU ld that we prefer.
3773
+ − 358 if "$LTLD" -v 2>&1 < /dev/null | $EGREP '(GNU|with BFD)' > /dev/null; then
388
+ − 359 xe_gnu_ld=yes
+ − 360 else
+ − 361 xe_gnu_ld=no
+ − 362 fi
+ − 363 fi
+ − 364 done
+ − 365 IFS="$ac_save_ifs"
+ − 366 fi
+ − 367
+ − 368 if test -n "$LTLD"; then
+ − 369 AC_MSG_RESULT([${LTLD}])
+ − 370 else
+ − 371 AC_MSG_RESULT(no)
+ − 372 fi
+ − 373
+ − 374 if test -z "$LTLD" -a "$cc_produces_so" = no; then
+ − 375 AC_MSG_ERROR(no acceptable linker found in \$PATH)
+ − 376 exit 1
+ − 377 fi
+ − 378 fi
+ − 379
+ − 380 dnl
+ − 381 dnl Order of the tests changed somewhat to prevent repetition
+ − 382 dnl
+ − 383 ld_dynamic_link_flags=
+ − 384
+ − 385 # Check to see if it really is or isn't GNU ld.
2651
+ − 386 AC_MSG_CHECKING([if the linker is GNU ld])
388
+ − 387 # I'd rather use --version here, but apparently some GNU ld's only accept -v.
3773
+ − 388 if $LTLD -v 2>&1 </dev/null | $EGREP '(GNU|with BFD)' 1>&5; then
388
+ − 389 xe_gnu_ld=yes
+ − 390 else
+ − 391 xe_gnu_ld=no
+ − 392 fi
+ − 393 AC_MSG_RESULT([${xe_gnu_ld}])
+ − 394
+ − 395 case "$xehost_os" in
+ − 396 amigaos* | sunos4*)
+ − 397 # On these operating systems, we should treat GNU ld like the system ld.
+ − 398 gnu_ld_acts_native=yes
+ − 399 ;;
+ − 400 *)
+ − 401 gnu_ld_acts_native=no
+ − 402 ;;
+ − 403 esac
+ − 404
+ − 405 if test "$cc_produces_so" = "yes"; then
+ − 406 dll_ld=$CC
1678
+ − 407 case "$xehost_os" in
+ − 408 *darwin*)
+ − 409 dnl On Darwin, we test with xcldf, but we use xldf
+ − 410 dll_ldflags=$xldf
+ − 411 ;;
+ − 412 *)
+ − 413 dll_ldflags=$xcldf
+ − 414 ;;
+ − 415 esac
388
+ − 416 can_build_shared=yes
442
+ − 417 ld_shlibs=yes
388
+ − 418 else
+ − 419 # OK - only NOW do we futz about with ld.
+ − 420 # See if the linker supports building shared libraries.
2651
+ − 421 AC_MSG_CHECKING([whether the linker supports shared libraries])
388
+ − 422 dll_ld=$CC
+ − 423 dll_ldflags=$LDFLAGS
+ − 424 ld_shlibs=yes
+ − 425 can_build_shared=yes
+ − 426 if test "$xe_gnu_ld" = yes && test "$gnu_ld_acts_native" != yes; then
+ − 427 # See if GNU ld supports shared libraries.
3773
+ − 428 if $LTLD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null; then
388
+ − 429 dll_ld=$CC
+ − 430 dll_ldflags="-shared"
+ − 431 ld_shlibs=yes
+ − 432 else
+ − 433 ld_shlibs=no
+ − 434 fi
+ − 435 else
+ − 436 # PORTME fill in a description of your system's linker (not GNU ld)
+ − 437 case "$xehost_os" in
+ − 438 aix3*)
+ − 439 dll_ld=$LTLD
+ − 440 dll_ldflags=$xldf
+ − 441 ;;
+ − 442
460
+ − 443 aix[[4-9]]*)
388
+ − 444 dll_ldflags=$xcldf
+ − 445 ;;
+ − 446
+ − 447 # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor
+ − 448 # support. Future versions do this automatically, but an explicit c++rt0.o
+ − 449 # doesn't break anything, and helps significantly (at the cost of a little
+ − 450 # extra space).
+ − 451 freebsd2.2*)
+ − 452 dll_ld=$LTLD
+ − 453 dll_ldflags=$xldf
+ − 454 dll_post="/usr/lib/c++rt0.o"
+ − 455 ;;
+ − 456
+ − 457 # Unfortunately, older versions of FreeBSD 2 don't have this feature.
+ − 458 freebsd2*)
+ − 459 dll_ld=$LTLD
+ − 460 dll_ldflags="-Bshareable"
+ − 461 ;;
265
+ − 462
388
+ − 463 # FreeBSD 3, at last, uses gcc -shared to do shared libraries.
+ − 464 freebsd3*)
+ − 465 dll_ldflags="-shared"
+ − 466 ;;
+ − 467
+ − 468 hpux*)
+ − 469 dll_ld=$LTLD
+ − 470 dll_ldflags=$xldf
+ − 471 ;;
+ − 472
460
+ − 473 irix[[5-9]]*)
388
+ − 474 dll_ld=$LTLD
+ − 475 dll_ldflags=$xldf
+ − 476 ;;
+ − 477
+ − 478 netbsd*)
+ − 479 # Tested with NetBSD 1.2 ld
+ − 480 dll_ld=$LTLD
+ − 481 dll_ldflags=$xldf
+ − 482 ;;
+ − 483
+ − 484 openbsd*)
+ − 485 dll_ld=$LTLD
+ − 486 dll_ldflags=$xldf
+ − 487 ;;
+ − 488
+ − 489 osf3* | osf4*)
+ − 490 dll_ld=$LTLD
+ − 491 dll_ldflags=$xldf
+ − 492 ;;
+ − 493
+ − 494 # For both SCO and Solaris we MAY want to have LDFLAGS include -z text
+ − 495 sco3.2v5* | unixware* | sysv5* | sysv4* | solaris2* | solaris7*)
+ − 496 dll_ld=$LTLD
+ − 497 case "$dll_ld" in
+ − 498 *gcc*) dll_ldflags="-shared"
+ − 499 dll_ld=$CC
+ − 500 ;;
+ − 501 *) dll_ldflags="-G"
+ − 502 ;;
+ − 503 esac
+ − 504 ;;
+ − 505
+ − 506 sunos4*)
+ − 507 if test "$XEGCC" = yes; then
+ − 508 dll_ld=$CC
+ − 509 else
+ − 510 dll_ld=$LTLD
+ − 511 fi
+ − 512 dll_ldflags=$xldf
+ − 513 ;;
+ − 514
+ − 515 uts4*)
+ − 516 dll_ld=$LTLD
+ − 517 dll_ldflags="-G"
+ − 518 ;;
+ − 519
+ − 520 bsdi*)
+ − 521 dll_ldflags="-r"
+ − 522 dll_ld="shlicc2"
+ − 523 ;;
1470
+ − 524
388
+ − 525 *)
+ − 526 ld_shlibs=no
+ − 527 can_build_shared=no
+ − 528 ;;
+ − 529 esac
+ − 530 fi
+ − 531 AC_MSG_RESULT([${ld_shlibs}])
+ − 532 if test "$ld_shlibs" = "no"; then
+ − 533 can_build_shared=no
+ − 534 fi
+ − 535 fi # End of if cc_produces_so = no
265
+ − 536
388
+ − 537 dnl
+ − 538 dnl Last thing, check how to get a linked executable to have its symbols
+ − 539 dnl exported, so that the modules have access to them.
+ − 540 dnl
442
+ − 541 dnl XEmacs FIXME - we need to set ld_dynamic_link_flags properly for
388
+ − 542 dnl most of these systems, which was missing from libtool. I know they
+ − 543 dnl all have a way of doing this, but someone needs to look at this
+ − 544 dnl for each OS and make sure it is correct. Remember that the arguments
+ − 545 dnl are passed when temacs is linked, this is NOT for modules. The sole
+ − 546 dnl purpose of the argument is to get the internal XEmacs symbols exposed
+ − 547 dnl for modules to use. This means that the COMPILER (and NOT the linker)
+ − 548 dnl is most often used to create temacs, so arguments to the linker will
+ − 549 dnl usually need to be prefix with ${wl} or some other such thing.
+ − 550 dnl
+ − 551
+ − 552 if test "$xe_gnu_ld" = yes; then
+ − 553 if test "$ld_shlibs" = yes; then
+ − 554 ld_dynamic_link_flags="${wl}-export-dynamic"
+ − 555 fi
+ − 556 fi
+ − 557
+ − 558 if test -z "$ld_dynamic_link_flags"; then
+ − 559 case "$xehost_os" in
460
+ − 560 aix[[3-9]]*)
388
+ − 561 ld_dynamic_link_flags=
+ − 562 ;;
+ − 563
1678
+ − 564 *darwin*)
+ − 565 ld_dynamic_link_flags=
+ − 566 ;;
+ − 567
388
+ − 568 freebsd2.2*)
+ − 569 ld_dynamic_link_flags=
+ − 570 ;;
+ − 571
+ − 572 freebsd2*)
+ − 573 ld_dynamic_link_flags=
+ − 574 ;;
+ − 575
+ − 576 freebsd3*)
+ − 577 ld_dynamic_link_flags=
+ − 578 ;;
+ − 579
+ − 580 hpux*)
+ − 581 ld_dynamic_link_flags="${wl}-E"
+ − 582 ;;
+ − 583
460
+ − 584 irix[[5-9]]*)
388
+ − 585 ld_dynamic_link_flags=
+ − 586 ;;
+ − 587
+ − 588 netbsd*)
+ − 589 ld_dynamic_link_flags=
+ − 590 ;;
+ − 591
+ − 592 openbsd*)
+ − 593 ld_dynamic_link_flags=
+ − 594 ;;
+ − 595
+ − 596 osf3* | osf4*)
+ − 597 ld_dynamic_link_flags=
+ − 598 ;;
+ − 599
398
+ − 600 solaris2* | solaris7*)
426
+ − 601 ld_dynamic_link_flags=
398
+ − 602 ;;
+ − 603
+ − 604 sco3.2v5* | unixware* | sysv5* | sysv4*)
388
+ − 605 ld_dynamic_link_flags="${wl}-Bexport"
+ − 606 ;;
+ − 607
+ − 608 sunos4*)
+ − 609 ld_dynamic_link_flags=
+ − 610 ;;
+ − 611
+ − 612 uts4*)
+ − 613 ld_dynamic_link_flags=
+ − 614 ;;
+ − 615
+ − 616 bsdi*)
+ − 617 ld_dynamic_link_flags=
+ − 618 ;;
+ − 619
+ − 620 esac
+ − 621 fi # End of if -z ld_dynamic_link_flags
+ − 622 fi # End of if test "$can_build_shared" = "yes"
+ − 623
265
+ − 624 AC_SUBST(dll_ld)
+ − 625 AC_SUBST(dll_cflags)
388
+ − 626 AC_SUBST(dll_ldflags)
+ − 627 AC_SUBST(dll_post)
+ − 628 AC_SUBST(dll_ldo)
+ − 629 AC_SUBST(ld_dynamic_link_flags)
265
+ − 630 ])dnl
388
+ − 631