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