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=
+ − 42 xehost=$canonical
+ − 43 xealias=$internal_configuration
+ − 44
+ − 45 AC_CHECKING([how to build dynamic libraries for ${xehost}])
+ − 46 # Transform *-*-linux* to *-*-linux-gnu*, to support old configure scripts.
+ − 47 case "$xehost" in
+ − 48 *-*-linux-gnu*) ;;
+ − 49 *-*-linux*) xehost=`echo $xehost | sed 's/^\(.*-.*-linux\)\(.*\)$/\1-gnu\2/'`
+ − 50 esac
+ − 51
+ − 52 changequote(<<, >>)dnl
+ − 53 xehost_cpu=`echo $xehost | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
+ − 54 xehost_vendor=`echo $xehost | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
+ − 55 xehost_os=`echo $xehost | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
+ − 56 changequote([, ])dnl
+ − 57
+ − 58 case "$xehost_os" in
+ − 59 aix3*)
+ − 60 # AIX sometimes has problems with the GCC collect2 program. For some
+ − 61 # reason, if we set the COLLECT_NAMES environment variable, the problems
+ − 62 # vanish in a puff of smoke.
+ − 63 if test "${COLLECT_NAMES+set}" != set; then
+ − 64 COLLECT_NAMES=
+ − 65 export COLLECT_NAMES
+ − 66 fi
+ − 67 ;;
+ − 68 esac
+ − 69
+ − 70 # Now see if the compiler is really GCC.
+ − 71 if test "$GCC" = "yes"; then
+ − 72 XEGCC=yes
+ − 73 else
+ − 74 AC_MSG_CHECKING(checking whether we are using GNU C)
+ − 75 AC_EGREP_CPP(yes,[
+ − 76 #ifdef __GNUC__
+ − 77 yes;
+ − 78 #endif
+ − 79 ],XEGCC=yes, XEGCC=no)
+ − 80 AC_MSG_RESULT([${XEGCC}])
+ − 81 fi
+ − 82
+ − 83 AC_MSG_CHECKING(how to produce PIC code)
+ − 84 wl=
+ − 85
+ − 86 can_build_shared=yes
1111
+ − 87 cygwin_warn=
388
+ − 88 if test "$XEGCC" = yes; then
+ − 89 wl='-Wl,'
+ − 90
+ − 91 case "$xehost_os" in
460
+ − 92 aix[[3-9]]* | irix[[5-9]]* | osf[[3-9]])
388
+ − 93 # PIC is the default for these OSes.
+ − 94 ;;
+ − 95
1452
+ − 96 *darwin*) dll_cflags='-dynamic'
+ − 97 ;;
+ − 98
460
+ − 99 os2*)
388
+ − 100 # We can build DLLs from non-PIC.
+ − 101 ;;
+ − 102 amigaos*)
+ − 103 # FIXME: we need at least 68020 code to build shared libraries, but
+ − 104 # adding the `-m68020' flag to GCC prevents building anything better,
+ − 105 # like `-m68040'.
+ − 106 dll_cflags='-m68020 -resident32 -malways-restore-a4'
+ − 107 ;;
442
+ − 108 *cygwin* | *mingw* )
+ − 109 # PIC is the default
1111
+ − 110 cygwin_warn=yes
+ − 111 # #### Need some trickery involving import libraries that we don't
+ − 112 # currently support.
+ − 113 can_build_shared=no
442
+ − 114 ;;
388
+ − 115 *)
+ − 116 dll_cflags='-fPIC'
+ − 117 ;;
+ − 118 esac
+ − 119 else
+ − 120 # PORTME Check for PIC flags for the system compiler.
+ − 121 case "$xehost_os" in
430
+ − 122 hpux9* | hpux1[[0-9]]*)
388
+ − 123 # Is there a better link_static_flag that works with the bundled CC?
+ − 124 wl='-Wl,'
+ − 125 dll_cflags='+Z'
+ − 126 ;;
+ − 127
460
+ − 128 irix[[5-9]]*)
388
+ − 129 wl='-Wl,'
+ − 130 # PIC (with -KPIC) is the default.
+ − 131 ;;
+ − 132
+ − 133 os2*)
+ − 134 # We can build DLLs from non-PIC.
+ − 135 ;;
+ − 136
460
+ − 137 osf[[3-9]]*)
388
+ − 138 # All OSF/1 code is PIC.
+ − 139 wl='-Wl,'
+ − 140 ;;
+ − 141
460
+ − 142 aix[[3-9]]*)
+ − 143 # All AIX code is PIC.
+ − 144 wl='-Wl,'
+ − 145 ;;
+ − 146
388
+ − 147 sco3.2v5*)
+ − 148 dll_cflags='-belf -Kpic'
+ − 149 wl='-Wl,'
+ − 150 ;;
265
+ − 151
388
+ − 152 unixware*)
+ − 153 dll_cflags="-KPIC"
+ − 154 wl="-Wl,"
+ − 155 ;;
+ − 156
+ − 157 sysv4*)
+ − 158 dll_cflags="-KPIC"
+ − 159 wl="-Wl,"
+ − 160 ;;
+ − 161
+ − 162 sysv5*)
+ − 163 dll_cflags="-KPIC"
+ − 164 wl="-Wl,"
+ − 165 ;;
+ − 166
+ − 167 solaris2*)
+ − 168 dll_cflags='-KPIC'
+ − 169 wl='-Wl,'
+ − 170 ;;
+ − 171
+ − 172 sunos4*)
+ − 173 dll_cflags='-PIC'
+ − 174 wl='-Qoption ld '
+ − 175 ;;
+ − 176
+ − 177 uts4*)
+ − 178 dll_cflags='-pic'
+ − 179 ;;
+ − 180
+ − 181 *)
+ − 182 can_build_shared=no
+ − 183 ;;
+ − 184 esac
+ − 185 fi
+ − 186
+ − 187 if test -n "$dll_cflags"; then
+ − 188 AC_MSG_RESULT([${dll_cflags}])
442
+ − 189
388
+ − 190 # Check to make sure the dll_cflags actually works.
+ − 191 AC_MSG_CHECKING([if PIC flag ${dll_cflags} really works])
+ − 192 save_CFLAGS="$CFLAGS"
+ − 193 CFLAGS="$CFLAGS $dll_cflags -DPIC"
+ − 194 AC_TRY_COMPILE(,[int x=0;],[
+ − 195 # On HP-UX, the stripped-down bundled CC doesn't accept +Z, but also
+ − 196 # reports no error. So, we need to grep stderr for (Bundled).
+ − 197 if grep '(Bundled)' config.log >/dev/null; then
+ − 198 AC_MSG_RESULT(no)
+ − 199 can_build_shared=no
+ − 200 dll_cflags=
+ − 201 else
+ − 202 AC_MSG_RESULT(yes)
+ − 203 fi], [AC_MSG_RESULT(no)
+ − 204 can_build_shared=no
+ − 205 dll_cflags=])
+ − 206 CFLAGS="$save_CFLAGS"
+ − 207 else
+ − 208 AC_MSG_RESULT(none)
+ − 209 fi
+ − 210
1111
+ − 211 if test -n "$cygwin_warn"; then
+ − 212 AC_MSG_WARN([Cannot currently build modules under Cygwin.])
+ − 213 fi
+ − 214
388
+ − 215 dnl
+ − 216 dnl Now comes the LD trickery. We do things differently to libtool here.
+ − 217 dnl I believe that libtool is incorrect in trying to drive the linker
+ − 218 dnl directly. This can cause considerable problems if the module you are
+ − 219 dnl compiling has C++ or other static initializers. If we use ld directly,
442
+ − 220 dnl we don't end up with the crt stuff being linked in, and we don't end up
388
+ − 221 dnl with any .init or .fini sections (or the moral equivalent thereof).
442
+ − 222 dnl gcc takes great care to do this properly when invoked in -shared
+ − 223 dnl mode, and we really do want this behavior. Perhaps the libtool folks
388
+ − 224 dnl are not aware that any SVR4 based dynamic loader will automatically
+ − 225 dnl execute code in the .init section before dlopen() returns. This is
442
+ − 226 dnl vital, as the module may have been compiled to rely on that behavior.
388
+ − 227 dnl
+ − 228 dnl So, having said all of that, we diverge from libtool significantly
+ − 229 dnl here. We want to try and use the C compiler as much as possible. Only
+ − 230 dnl if the C compiler itself cannot create shared libraries to we try to
+ − 231 dnl find the linker.
+ − 232 dnl
+ − 233 dnl The other advantage to my scheme is that it removes the dependancy
+ − 234 dnl on a given compiler version remaining static with relation to the
+ − 235 dnl version of XEmacs. With the libtool way, it picks up the linker that
+ − 236 dnl gcc uses, which can be the internal collect2 that comes with gcc.
+ − 237 dnl If the user ever changes their compiler version, the paths will no
+ − 238 dnl longer be correct, and ellcc will break. This is clearly unacceptable.
442
+ − 239 dnl By using the compiler driver on the path, we don't have this problem.
388
+ − 240 dnl If that is not clear, consider that gcc -print-prog-name=ld can
+ − 241 dnl produce something along the lines of:
+ − 242 dnl /usr/local/lib/gcc-lib/OS-NAME/GCC-VERSION/ld
+ − 243 dnl If you ever change GCC versions, then that path no longer exists.
+ − 244 dnl
+ − 245 dnl So, we change the check order here. We first check to see if we are
+ − 246 dnl using GCC, and if so, we see if -shared works. If it does, great.
+ − 247 dnl If we are not using gcc, but the system C compiler can produce
+ − 248 dnl shared objects, we try that. Only if all of that fails do we revert
+ − 249 dnl back to the libtool ld trickery.
+ − 250 dnl
442
+ − 251 dnl We don't do ANY of this if we can't produce shared objects.
388
+ − 252 dnl
+ − 253 if test "$can_build_shared" = "yes"; then
+ − 254 cc_produces_so=no
+ − 255 xldf=
+ − 256 xcldf=
+ − 257 AC_MSG_CHECKING(if C compiler can produce shared libraries)
+ − 258 if test "$XEGCC" = yes; then
1452
+ − 259 case "$xehost_os" in
+ − 260 *darwin*)
+ − 261 xcldf='-bundle'
+ − 262 xldf='-bundle -bundle_loader ../../src/xemacs'
+ − 263 ;;
+ − 264 * )
+ − 265 xcldf="-shared"
+ − 266 xldf="-shared"
+ − 267 ;;
+ − 268 esac
388
+ − 269 else # Not using GCC
+ − 270 case "$xehost_os" in
460
+ − 271 aix[[3-9]]*)
388
+ − 272 xldf="-bE:ELLSONAME.exp -H512 -T512 -bhalt:4 -bM:SRE -bnoentry -lc"
+ − 273 xcldf="${wl}-bE:ELLSONAME.exp ${wl}-H512 ${wl}-T512 ${wl}-bhalt:4 ${wl}-bM:SRE ${wl}-bnoentry ${wl}-lc"
+ − 274 ;;
+ − 275
+ − 276 freebsd2* | netbsd* | openbsd*)
+ − 277 xldf="-Bshareable"
+ − 278 xcldf="${wl}-Bshareable"
+ − 279 ;;
+ − 280
+ − 281 freebsd3*)
+ − 282 xcldf="-shared"
+ − 283 ;;
+ − 284
+ − 285 hpux*)
+ − 286 xldf="-b +s"
+ − 287 xcldf="${wl}-b ${wl}+s"
+ − 288 ;;
+ − 289
460
+ − 290 irix[[5-9]]* | osf[[3-9]]*)
388
+ − 291 xcldf="${wl}-shared"
+ − 292 xldf="-shared"
+ − 293 ;;
+ − 294
+ − 295 sco3.2v5* | unixware* | sysv5* | sysv4* | solaris2* | solaris7* | uts4*)
+ − 296 xcldf="-G"
+ − 297 xldf="-G"
+ − 298 ;;
+ − 299
+ − 300 sunos4*)
+ − 301 xcldf="${wl}-assert ${wl}pure-text ${wl}-Bstatic"
+ − 302 xldf="-assert pure-text -Bstatic"
+ − 303 ;;
+ − 304 esac
+ − 305 fi # End if if we are using gcc
265
+ − 306
388
+ − 307 if test -n "$xcldf"; then
+ − 308 save_LDFLAGS=$LDFLAGS
+ − 309 save_LIBS=$LIBS
+ − 310 save_xe_libs=$xe_libs
+ − 311 LDFLAGS="$xcldf $LDFLAGS"
+ − 312 LIBS=
+ − 313 xe_libs=
+ − 314 ac_link='${CC-cc} -o conftest $CFLAGS '"$xe_cppflags $xe_ldflags"' conftest.$ac_ext '"$xe_libs"' 1>&AC_FD_CC'
+ − 315 AC_TRY_LINK(,[int x=0;],cc_produces_so=yes,cc_produces_so=no)
+ − 316 LDFLAGS=$save_LDFLAGS
+ − 317 LIBS=$save_LIBS
+ − 318 xe_libs=$save_xe_libs
+ − 319 ac_link='${CC-cc} -o conftest $CFLAGS '"$xe_cppflags $xe_ldflags"' conftest.$ac_ext '"$xe_libs"' 1>&AC_FD_CC'
+ − 320 else
+ − 321 cc_produces_so=no
+ − 322 fi
+ − 323 AC_MSG_RESULT([${cc_produces_so}])
+ − 324
+ − 325 LTLD=$LD
+ − 326 if test -z "$LTLD"; then
+ − 327 ac_prog=ld
+ − 328 if test "$XEGCC" = yes; then
+ − 329 # Check if gcc -print-prog-name=ld gives a path.
+ − 330 AC_MSG_CHECKING(for ld used by GCC)
+ − 331 ac_prog=`($CC -print-prog-name=ld) 2>&5`
+ − 332 case "$ac_prog" in
+ − 333 # Accept absolute paths.
+ − 334 /*)
+ − 335 if test -z "$LTLD"; then
724
+ − 336 # case "$ac_prog" in
+ − 337 # *gcc-lib*) LTLD="$CC"
+ − 338 # ;;
+ − 339 # *)
+ − 340 LTLD="$ac_prog"
+ − 341 # ;;
+ − 342 # esac
388
+ − 343 fi
+ − 344 ;;
+ − 345 "")
+ − 346 # If it fails, then pretend we aren't using GCC.
+ − 347 ac_prog=ld
+ − 348 ;;
+ − 349 *)
+ − 350 # If it is relative, then search for the first ld in PATH.
+ − 351 with_gnu_ld=unknown
+ − 352 ;;
+ − 353 esac
+ − 354 else
+ − 355 AC_MSG_CHECKING(for GNU ld)
+ − 356 fi
+ − 357
+ − 358 if test -z "$LTLD"; then
+ − 359 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
+ − 360 for ac_dir in $PATH; do
+ − 361 test -z "$ac_dir" && ac_dir=.
+ − 362 if test -f "$ac_dir/$ac_prog"; then
+ − 363 LTLD="$ac_dir/$ac_prog"
+ − 364 # Check to see if the program is GNU ld. I'd rather use --version,
+ − 365 # but apparently some GNU ld's only accept -v.
+ − 366 # Break only if it was the GNU/non-GNU ld that we prefer.
+ − 367 if "$LTLD" -v 2>&1 < /dev/null | egrep '(GNU|with BFD)' > /dev/null; then
+ − 368 xe_gnu_ld=yes
+ − 369 else
+ − 370 xe_gnu_ld=no
+ − 371 fi
+ − 372 fi
+ − 373 done
+ − 374 IFS="$ac_save_ifs"
+ − 375 fi
+ − 376
+ − 377 if test -n "$LTLD"; then
+ − 378 AC_MSG_RESULT([${LTLD}])
+ − 379 else
+ − 380 AC_MSG_RESULT(no)
+ − 381 fi
+ − 382
+ − 383 if test -z "$LTLD" -a "$cc_produces_so" = no; then
+ − 384 AC_MSG_ERROR(no acceptable linker found in \$PATH)
+ − 385 exit 1
+ − 386 fi
+ − 387 fi
+ − 388
+ − 389 dnl
+ − 390 dnl Order of the tests changed somewhat to prevent repetition
+ − 391 dnl
+ − 392 ld_dynamic_link_flags=
+ − 393
+ − 394 # Check to see if it really is or isn't GNU ld.
+ − 395 AC_MSG_CHECKING(if the linker is GNU ld)
+ − 396 # I'd rather use --version here, but apparently some GNU ld's only accept -v.
+ − 397 if $LTLD -v 2>&1 </dev/null | egrep '(GNU|with BFD)' 1>&5; then
+ − 398 xe_gnu_ld=yes
+ − 399 else
+ − 400 xe_gnu_ld=no
+ − 401 fi
+ − 402 AC_MSG_RESULT([${xe_gnu_ld}])
+ − 403
+ − 404 case "$xehost_os" in
+ − 405 amigaos* | sunos4*)
+ − 406 # On these operating systems, we should treat GNU ld like the system ld.
+ − 407 gnu_ld_acts_native=yes
+ − 408 ;;
+ − 409 *)
+ − 410 gnu_ld_acts_native=no
+ − 411 ;;
+ − 412 esac
+ − 413
+ − 414 if test "$cc_produces_so" = "yes"; then
+ − 415 dll_ld=$CC
+ − 416 dll_ldflags=$xcldf
+ − 417 can_build_shared=yes
442
+ − 418 ld_shlibs=yes
388
+ − 419 else
+ − 420 # OK - only NOW do we futz about with ld.
+ − 421 # See if the linker supports building shared libraries.
+ − 422 AC_MSG_CHECKING(whether the linker supports shared libraries)
+ − 423 dll_ld=$CC
+ − 424 dll_ldflags=$LDFLAGS
+ − 425 ld_shlibs=yes
+ − 426 can_build_shared=yes
+ − 427 if test "$xe_gnu_ld" = yes && test "$gnu_ld_acts_native" != yes; then
+ − 428 # See if GNU ld supports shared libraries.
+ − 429 if $LTLD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then
+ − 430 dll_ld=$CC
+ − 431 dll_ldflags="-shared"
+ − 432 ld_shlibs=yes
+ − 433 else
+ − 434 ld_shlibs=no
+ − 435 fi
+ − 436 else
+ − 437 # PORTME fill in a description of your system's linker (not GNU ld)
+ − 438 case "$xehost_os" in
+ − 439 aix3*)
+ − 440 dll_ld=$LTLD
+ − 441 dll_ldflags=$xldf
+ − 442 ;;
+ − 443
460
+ − 444 aix[[4-9]]*)
388
+ − 445 dll_ldflags=$xcldf
+ − 446 ;;
+ − 447
+ − 448 # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor
+ − 449 # support. Future versions do this automatically, but an explicit c++rt0.o
+ − 450 # doesn't break anything, and helps significantly (at the cost of a little
+ − 451 # extra space).
+ − 452 freebsd2.2*)
+ − 453 dll_ld=$LTLD
+ − 454 dll_ldflags=$xldf
+ − 455 dll_post="/usr/lib/c++rt0.o"
+ − 456 ;;
+ − 457
+ − 458 # Unfortunately, older versions of FreeBSD 2 don't have this feature.
+ − 459 freebsd2*)
+ − 460 dll_ld=$LTLD
+ − 461 dll_ldflags="-Bshareable"
+ − 462 ;;
265
+ − 463
388
+ − 464 # FreeBSD 3, at last, uses gcc -shared to do shared libraries.
+ − 465 freebsd3*)
+ − 466 dll_ldflags="-shared"
+ − 467 ;;
+ − 468
+ − 469 hpux*)
+ − 470 dll_ld=$LTLD
+ − 471 dll_ldflags=$xldf
+ − 472 ;;
+ − 473
460
+ − 474 irix[[5-9]]*)
388
+ − 475 dll_ld=$LTLD
+ − 476 dll_ldflags=$xldf
+ − 477 ;;
+ − 478
+ − 479 netbsd*)
+ − 480 # Tested with NetBSD 1.2 ld
+ − 481 dll_ld=$LTLD
+ − 482 dll_ldflags=$xldf
+ − 483 ;;
+ − 484
+ − 485 openbsd*)
+ − 486 dll_ld=$LTLD
+ − 487 dll_ldflags=$xldf
+ − 488 ;;
+ − 489
+ − 490 osf3* | osf4*)
+ − 491 dll_ld=$LTLD
+ − 492 dll_ldflags=$xldf
+ − 493 ;;
+ − 494
+ − 495 # For both SCO and Solaris we MAY want to have LDFLAGS include -z text
+ − 496 sco3.2v5* | unixware* | sysv5* | sysv4* | solaris2* | solaris7*)
+ − 497 dll_ld=$LTLD
+ − 498 case "$dll_ld" in
+ − 499 *gcc*) dll_ldflags="-shared"
+ − 500 dll_ld=$CC
+ − 501 ;;
+ − 502 *) dll_ldflags="-G"
+ − 503 ;;
+ − 504 esac
+ − 505 ;;
+ − 506
+ − 507 sunos4*)
+ − 508 if test "$XEGCC" = yes; then
+ − 509 dll_ld=$CC
+ − 510 else
+ − 511 dll_ld=$LTLD
+ − 512 fi
+ − 513 dll_ldflags=$xldf
+ − 514 ;;
+ − 515
+ − 516 uts4*)
+ − 517 dll_ld=$LTLD
+ − 518 dll_ldflags="-G"
+ − 519 ;;
+ − 520
+ − 521 bsdi*)
+ − 522 dll_ldflags="-r"
+ − 523 dll_ld="shlicc2"
+ − 524 ;;
+ − 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
1452
+ − 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