summaryrefslogtreecommitdiff
path: root/driver/xf86-video-mga
diff options
context:
space:
mode:
Diffstat (limited to 'driver/xf86-video-mga')
-rw-r--r--driver/xf86-video-mga/ChangeLog607
-rw-r--r--driver/xf86-video-mga/Makefile.in9
-rw-r--r--driver/xf86-video-mga/aclocal.m4727
-rw-r--r--driver/xf86-video-mga/config.h.in12
-rw-r--r--driver/xf86-video-mga/configure1975
-rw-r--r--driver/xf86-video-mga/configure.ac22
-rw-r--r--driver/xf86-video-mga/ltmain.sh277
-rw-r--r--driver/xf86-video-mga/man/Makefile.in10
-rw-r--r--driver/xf86-video-mga/man/mga.man7
-rw-r--r--driver/xf86-video-mga/mga_PInS.txt28
-rw-r--r--driver/xf86-video-mga/src/Makefile.in9
-rw-r--r--driver/xf86-video-mga/src/clientlx.c16
-rw-r--r--driver/xf86-video-mga/src/mga.h122
-rw-r--r--driver/xf86-video-mga/src/mga_arc.c7
-rw-r--r--driver/xf86-video-mga/src/mga_bios.c130
-rw-r--r--driver/xf86-video-mga/src/mga_dac3026.c34
-rw-r--r--driver/xf86-video-mga/src/mga_dacG.c742
-rw-r--r--driver/xf86-video-mga/src/mga_dga.c3
-rw-r--r--driver/xf86-video-mga/src/mga_dh.c113
-rw-r--r--driver/xf86-video-mga/src/mga_dri.c306
-rw-r--r--driver/xf86-video-mga/src/mga_driver.c1517
-rw-r--r--driver/xf86-video-mga/src/mga_esc.c2
-rw-r--r--driver/xf86-video-mga/src/mga_exa.c140
-rw-r--r--driver/xf86-video-mga/src/mga_g450pll.c7
-rw-r--r--driver/xf86-video-mga/src/mga_halmod.c1
-rw-r--r--driver/xf86-video-mga/src/mga_hwcurs.c2
-rw-r--r--driver/xf86-video-mga/src/mga_macros.h20
-rw-r--r--driver/xf86-video-mga/src/mga_merge.c41
-rw-r--r--driver/xf86-video-mga/src/mga_reg.h82
-rw-r--r--driver/xf86-video-mga/src/mga_shadow.c2
-rw-r--r--driver/xf86-video-mga/src/mga_storm.c281
-rw-r--r--driver/xf86-video-mga/src/mga_vga.c211
-rw-r--r--driver/xf86-video-mga/src/mga_video.c804
-rw-r--r--driver/xf86-video-mga/util/Makefile.in9
-rw-r--r--driver/xf86-video-mga/util/stormdwg.c10
35 files changed, 5983 insertions, 2302 deletions
diff --git a/driver/xf86-video-mga/ChangeLog b/driver/xf86-video-mga/ChangeLog
index 907260c58..a9a2a1b80 100644
--- a/driver/xf86-video-mga/ChangeLog
+++ b/driver/xf86-video-mga/ChangeLog
@@ -1,3 +1,575 @@
+commit 62c8f0ad5bb3dd23226a6b481ed4f260c6770f55
+Author: Yannick Henault <yheneaul@matrox.com>
+Date: Mon Jun 30 17:00:16 2008 -0400
+
+ Bug #16545: Add G200WB support.
+
+commit 32d50fca615af2c49914dd88c9da0f21b868b172
+Author: Adam Jackson <ajax@redhat.com>
+Date: Mon Jun 23 13:06:21 2008 -0400
+
+ Death to RCS tags.
+
+commit 382659741681ad10290c1e01045dfe9e2fde8d3f
+Author: Yannick Henault <yheneaul@matrox.com>
+Date: Mon Jun 23 13:02:43 2008 -0400
+
+ Bug #15836: Fix DDC on G200SE.
+
+commit 9e2ee9403c198da5d79dfb2f4fcafe9b381afd3d
+Author: Ian Romanick <idr@us.ibm.com>
+Date: Mon Jun 9 11:36:46 2008 -0700
+
+ G200EV: Enable support for G200EV
+
+commit fd9732800687b96caa9f81c0cc4b24c6aad04e78
+Author: Ian Romanick <idr@us.ibm.com>
+Date: Fri May 30 19:47:10 2008 -0700
+
+ I2C: Second (and final) round of clean-ups
+
+commit c0711038ac2dcfb28dd4ead784c89615fb3b5844
+Author: Ian Romanick <idr@us.ibm.com>
+Date: Fri May 30 19:39:38 2008 -0700
+
+ I2C: First round of clean-ups
+
+commit 7e28ce7f26fba2acee879c1da41426490034c0a9
+Author: Ian Romanick <idr@us.ibm.com>
+Date: Fri May 30 18:43:27 2008 -0700
+
+ Get memory probe size and stride (offset) values values from a data table instead of from code
+
+commit 074a4aa1985219910a96b022368067e3ed5641e6
+Author: Ian Romanick <idr@us.ibm.com>
+Date: Fri May 30 18:23:59 2008 -0700
+
+ Initialize default BIOS values from a data table instead of from code
+
+commit 9ee7b04b1fe57834a541ef27b4e25acffd3ac1c5
+Author: Ian Romanick <idr@us.ibm.com>
+Date: Fri May 30 17:51:22 2008 -0700
+
+ cfb8_32: Gut a remnants of support for 24-bit with 8-bit overlay
+
+commit 254299d06eba2ede820f1fe2929a4b247ead39b1
+Author: Tiago Vignatti <vignatti@c3sl.ufpr.br>
+Date: Wed May 7 01:07:44 2008 -0300
+
+ For compatibility, accept SWcursor as option.
+
+commit 0c61ccde7857dc7514881636144f95df51edaddf
+Author: Paulo Cesar Pereira de Andrade <pcpa@mandriva.com>
+Date: Fri Feb 1 00:15:27 2008 -0200
+
+ Replace ALLOCATE_LOCAL/DEALLOCATE_LOCAL with xalloc/xfree.
+
+ The other missing symbols is MGAGetClientPointer, that I believe
+ should be provided by matrox's libHAL.a, that I am afraid if someone
+ still has a copy of it, it won't work with X Org's loader.
+
+commit dcad316efe93491fabfe558bcf5331cf0a9402a6
+Author: Matthieu Herrb <matthieu.herrb@laas.fr>
+Date: Sat Mar 8 23:39:28 2008 +0100
+
+ Makefile.am: nuke RCS Id
+
+commit b5e43552f6b2a8ce8f405411a4ba6496e57d5100
+Author: Adam Jackson <ajax@redhat.com>
+Date: Sat Jan 19 15:34:56 2008 -0500
+
+ Disable I2C on G200SE for now.
+
+commit cd2436c57d6b197ce0f58bf39ade903393cea842
+Author: Adam Jackson <ajax@redhat.com>
+Date: Sat Jan 19 15:34:41 2008 -0500
+
+ Change initial memory sizing on G200SE.
+
+commit 40a4c1bdff174c31e6426a2ab3bc7cea5d99a700
+Author: Adam Jackson <ajax@redhat.com>
+Date: Sat Jan 19 15:34:19 2008 -0500
+
+ Adjust memory timings on G200SE-A.
+
+ A bit opaque, but from the vendor:
+
+ "The 0x1E24 check is to verify which pilot card is being used. And is used
+ mainly to setup the hipri value of the card for use in a non hal enabled
+ configuration as well as for when we check the max bandwidth for the latest
+ board version of pilot." (fdo bug #11652)
+
+commit d26b8d50a80b9408565f7daf0ad911bac5f44721
+Author: Adam Jackson <ajax@redhat.com>
+Date: Sat Jan 19 15:33:49 2008 -0500
+
+ Updates to memory sizing on G200SE.
+
+commit e3777cafc07500c733b8569b50ce202e346c94bf
+Author: Adam Jackson <ajax@redhat.com>
+Date: Sat Jan 19 15:33:28 2008 -0500
+
+ No depth 15 on G200SE-A.
+
+commit 6cd7677c41cf59194561225ed521a295e535862f
+Author: Adam Jackson <ajax@redhat.com>
+Date: Sat Jan 19 15:33:13 2008 -0500
+
+ Filter high-bandwidth modes on G200SE.
+
+commit 15ba6d7b79308ff2da8abc9edf67ddc96d7d6b9f
+Author: Adam Jackson <ajax@redhat.com>
+Date: Sat Jan 19 15:32:53 2008 -0500
+
+ Update PInS defaults for G200SE-A.
+
+commit e50a99877b2870746266b799b0a6411b2214a3de
+Author: Tilman Sauerbeck <tilman@code-monkey.de>
+Date: Fri Jan 18 19:31:40 2008 +0100
+
+ Bumped version to 1.4.8.
+
+commit bfee7bf011625079fd79b1bf89198ffeb76096d2
+Author: Tilman Sauerbeck <tilman@code-monkey.de>
+Date: Fri Jan 18 18:05:49 2008 +0100
+
+ Bug #13926: Unbreak Xinerama.
+
+commit 2096022c0757b675d39dea8830125ba800b43160
+Author: Adam Jackson <ajax@redhat.com>
+Date: Wed Dec 12 18:10:52 2007 -0500
+
+ G200SE-A can't cope with bigger than 1600x1200.
+
+commit 81717e5780350665166dd7a0f4d96135609a8764
+Author: Alan Coopersmith <alan.coopersmith@sun.com>
+Date: Tue Oct 30 18:43:30 2007 -0700
+
+ Don't build or call init_dri if XF86DRI is undefined
+
+commit db22b6ef0fa3ae20f46719bd826e16b6580e5213
+Author: Tilman Sauerbeck <tilman@code-monkey.de>
+Date: Wed Oct 3 23:06:48 2007 +0200
+
+ Fixed a typo.
+
+commit 8e971287f60f3a41f2d0d176e4eaaa653e25276b
+Author: Ian Romanick <idr@us.ibm.com>
+Date: Wed Oct 3 12:47:59 2007 -0700
+
+ Unmap the same size that was mapped
+
+ Make sure the same size is used with pci_device_unmap_range as was used with
+ pci_device_map_range. Failing to do so was causing problems with a G450
+ card in a POWER6 box.
+
+ Based on a patch submitted by Anton Blanchard.
+
+commit 10d452ad86b4798f3ded6c4c2446f08aaab6af00
+Author: Tilman Sauerbeck <tilman@code-monkey.de>
+Date: Sat Sep 15 00:16:16 2007 +0200
+
+ Oops, don't access the "memory" field in struct pci_mem_region either.
+
+commit 485fb9aa1e5d90c75d763db4b7bf5a80e51e83e9
+Author: Tilman Sauerbeck <tilman@code-monkey.de>
+Date: Fri Sep 14 23:10:09 2007 +0200
+
+ Use pci_device_map_range() instead of pci_device_map_region().
+
+ Likewise for pci_device_unmap_region().
+
+commit d7f0f657504b2646a94f652baf0f71ff4117fac4
+Author: Tilman Sauerbeck <tilman@code-monkey.de>
+Date: Wed Sep 5 18:06:57 2007 +0200
+
+ Bumped version to 1.4.7.
+
+commit 6fde3fd6d34e7252ee16422b19896d71b1622039
+Merge: 4bfc1e1... 923176f...
+Author: James Cloos <cloos@jhcloos.com>
+Date: Mon Sep 3 06:07:32 2007 -0400
+
+ Merge branch 'master' of ssh://git.freedesktop.org/git/xorg/driver/xf86-video-mga
+
+commit 4bfc1e1ea11604e3af150a4228663cb1cb1bf9f3
+Author: James Cloos <cloos@jhcloos.com>
+Date: Mon Sep 3 05:52:35 2007 -0400
+
+ Add *~ to .gitignore to skip patch/emacs droppings
+
+commit 923176f5aad777b4023003a457bb77da21373389
+Author: Ian Romanick <idr@us.ibm.com>
+Date: Fri Aug 31 11:05:57 2007 -0700
+
+ Use XSERVER_LIBPCIACCESS to detect pci-rework.
+
+commit 90beb8c27b4206b593898d346bf37ab49e75b975
+Author: Ian Romanick <idr@us.ibm.com>
+Date: Wed Aug 22 11:19:46 2007 -0700
+
+ Set pScrn to NULL before calling xf86ConfigPciEntity.
+
+ Why is the interface to xf86ConfigPciEntity so filled with hate?
+
+commit 55d219394ad6af8e25ff604bcbb49d5a551bd348
+Author: Ian Romanick <idr@us.ibm.com>
+Date: Wed Aug 22 10:43:39 2007 -0700
+
+ Merge PCI-rework support and "classic" PCI interface support into one tree
+
+ First pass at merging both trees. So far, this has only been tested
+ on the PCI-rework build on a PCI G450.
+
+commit f4ef39d53d5a67942707507814fef4ad466dc909
+Author: Ian Romanick <idr@us.ibm.com>
+Date: Mon Aug 20 15:36:57 2007 -0700
+
+ Fix compile error introduced by merge.
+
+commit 707d3adbc7d9ee918d6c70083f51ad851ce68852
+Merge: 741c50c... 489e007...
+Author: Ian Romanick <idr@us.ibm.com>
+Date: Mon Aug 20 15:20:39 2007 -0700
+
+ Merge branch 'master' of git+ssh://git.freedesktop.org/git/xorg/driver/xf86-video-mga into pci-rework
+
+commit 489e007a29de63716ab550eacb3e98a91975d1d5
+Author: Tilman Sauerbeck <tilman@code-monkey.de>
+Date: Wed Aug 8 21:32:57 2007 +0200
+
+ Fixed major blending and compositing breakage.
+
+ Do not adjust the destination blend factor if we need source alpha
+ but our source doesn't have an alpha channel. This makes no sense at all,
+ because the intermediate picture will always have alpha bits (either from
+ the original source, or forced to 0xff).
+
+commit 3820f55e3068163f8c3047a25126673e6de2d16e
+Author: Ian Romanick <idr@us.ibm.com>
+Date: Wed Aug 1 09:02:21 2007 -0700
+
+ Add info for offset 116 in PInS version 5.
+
+commit 7d7626f8429e108dd326899d927de4b4c79f71f5
+Author: Tilman Sauerbeck <tilman@code-monkey.de>
+Date: Mon Jul 30 12:36:19 2007 +0200
+
+ Bug #4249: Further increase the minimum dot clock.
+
+commit 1a1fe837bc114b5f741e87f14bef74803e299c8d
+Author: Brice Goglin <Brice.Goglin@ens-lyon.org>
+Date: Fri Jul 27 18:19:21 2007 +0200
+
+ Change minimal frequency guess from 12 to 16MHz
+
+ G550 seems to lock up with frequencies below 16MHz.
+
+ Reported by Benjamin Wong <hackerb9@u.washington.edu> in
+ http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=430112
+ and https://bugs.freedesktop.org/show_bug.cgi?id=11339
+
+commit 041caa230b91a017881394c59d76d663d647529c
+Author: Gabriele Gorla <gorlik@yahoo.com>
+Date: Thu Jul 19 22:14:51 2007 -0400
+
+ Add Xv support for Millennium II chips
+
+ Bug 11537
+
+commit 7b080d993ceda7b181e0611ed0c997c8aecc9ad7
+Author: Tilman Sauerbeck <tilman@code-monkey.de>
+Date: Sun Apr 15 12:47:27 2007 +0200
+
+ Added memcpy-based DownloadFromScreen implementation.
+
+commit 43b79af51b600e98ecac9d57aeb0d686dbc6a50e
+Author: Tilman Sauerbeck <tilman@code-monkey.de>
+Date: Sun Apr 15 12:41:01 2007 +0200
+
+ On G550, do A8 adds in hardware.
+
+commit 69c4ed205afbeb9ad937f079caace6cee19bd7b1
+Author: Tilman Sauerbeck <tilman@code-monkey.de>
+Date: Sun Apr 15 12:28:28 2007 +0200
+
+ Make DRI initialization work when using EXA.
+
+ Still need to implement InitBuffers and MoveBuffers for EXA.
+
+commit 920b84364a374ac8cde9314efc6742c11a72ce4f
+Author: Tilman Sauerbeck <tilman@code-monkey.de>
+Date: Fri Mar 30 20:47:14 2007 +0200
+
+ Removed the debug messages for solid and copy ops.
+
+commit d1696d91d9da79c40b0576b3ce754dc8a6666117
+Author: Tilman Sauerbeck <tilman@code-monkey.de>
+Date: Fri Mar 30 20:45:45 2007 +0200
+
+ Sync after UploadToScreen.
+
+commit 1246f724bfdd44b49091516bf909ecf97c9b82db
+Author: Adam Jackson <ajax@benzedrine.nwnk.net>
+Date: Wed Mar 28 11:14:24 2007 -0400
+
+ Default mode on G200SE of 1024x768 @ 16bpp.
+
+ The poor thing has so little VRAM that you can't do any bigger than 640x480
+ at 32bpp, so in the interest of having a reasonable screen size...
+
+commit 834bdfc2503f64d8f3bff088dc5eaf8f52f828f5
+Author: Adam Jackson <ajax@benzedrine.nwnk.net>
+Date: Wed Mar 28 11:09:56 2007 -0400
+
+ Disable MTRR support for PCIE G200SE cards, as it tickles hardware bugs.
+
+commit 630390dc5b892941ed6609ca5c35b90be53333f7
+Author: Adam Jackson <ajax@benzedrine.nwnk.net>
+Date: Wed Mar 28 11:07:49 2007 -0400
+
+ Fix various timing bugs on the G200SE.
+
+commit 99430f1cf36c07350cdc557dbbb5c0a34c9b9dd0
+Author: Tilman Sauerbeck <tilman@code-monkey.de>
+Date: Sun Mar 18 12:41:06 2007 +0100
+
+ Shut up the compiler.
+
+commit 741c50c162986a14647301c2c5f8e080a7664efd
+Author: Ian Romanick <idr@us.ibm.com>
+Date: Fri Feb 2 15:50:14 2007 -0800
+
+ Code refactoring in MGAScreenInit.
+
+ Rearrange code so that functions that are selected based on MergedFB
+ and SecondCrtc are selected in one place instead of 3. Rearrange some
+ code that selects on FBDev and Primary to flow a little better.
+
+commit 4432091b2597cf4bba09009622d247c0d8ff151f
+Author: Ian Romanick <idr@us.ibm.com>
+Date: Thu Feb 1 13:45:18 2007 -0800
+
+ Ensure the result of MGAMapMem is checked.
+
+ Add GCC warn_unused_result attribute to MGAMapMem. Add a check of the
+ return value to one place that was missing it (in MGACountRam), and
+ check the return of that function.
+
+commit 3a47132af4dfab420e3c35d7d100dd93fb7bf9c6
+Author: Ian Romanick <idr@us.ibm.com>
+Date: Thu Feb 1 13:30:34 2007 -0800
+
+ Refactor memory map / unmap functions.
+
+ MGAMapMem and MGAMapMemFBDev were refactored into a single function.
+ This happens to fix a bug triggered in software XAA paths because
+ MGAMapMem did not set FbStart. MGAUnmapMem and MGAUnmapMemFBDev were
+ also refactored into a single function.
+
+commit 916d41bcf99bbf666bf634edb1c72b90d9b16ea0
+Author: Ian Romanick <idr@us.ibm.com>
+Date: Mon Jan 15 11:42:52 2007 -0800
+
+ Convert to new pci_device_cfg_write_u* interface.
+
+commit b26bfefb7ea107be3949daea0f6beca6d80c09d4
+Author: Ian Romanick <idr@us.ibm.com>
+Date: Mon Jan 15 11:42:07 2007 -0800
+
+ Pass the correct pointer to pci_device_cfg_write_bits.
+
+commit d5b4dbe749e860e4349607c57467f8085dc28c33
+Merge: cb103a1... 876657e...
+Author: Ian Romanick <idr@us.ibm.com>
+Date: Tue Jan 9 16:04:06 2007 -0800
+
+ Merge branch 'master' of git+ssh://git.freedesktop.org/git/xorg/driver/xf86-video-mga into pci-rework
+
+commit 876657e613de6d9dd906c95e05fc590a84d1c322
+Author: Tilman Sauerbeck <tilman@code-monkey.de>
+Date: Tue Dec 26 22:14:57 2006 +0100
+
+ Fixed a typo that caused MGAREG_C2OFFSET to be set to a bad value.
+
+ Unfortunately, this doesn't fix any bugs because afterwards,
+ the correct value would be stored in MGAREG_C2OFFSET anyway.
+
+commit 7d676a830a9b0c5593e144e15a14dc4aa6bc5ab7
+Author: Tilman Sauerbeck <tilman@code-monkey.de>
+Date: Tue Dec 26 19:45:18 2006 +0100
+
+ More boring janitoring work.
+
+commit 787284f420d324821ac31b43f3d915d58533a141
+Author: Tilman Sauerbeck <tilman@code-monkey.de>
+Date: Tue Dec 26 00:30:51 2006 +0100
+
+ Fixed a typo in a debug message.
+
+commit 373bf108414cebdaea8d3febc9120566ef5e4118
+Author: Tilman Sauerbeck <tilman@code-monkey.de>
+Date: Tue Dec 26 00:28:55 2006 +0100
+
+ Bug #9448: Actually write the C2STARTADD0 register.
+
+commit fd91b601ec4dd48cfb6ea5495b595fec6d932ab5
+Merge: f84b138... 0ce8f52...
+Author: Daniel Stone <daniel@fooishbar.org>
+Date: Sun Dec 24 06:32:53 2006 +0200
+
+ Merge branch 'temp'
+
+commit 0ce8f522a207dd0fa21ebf41b82f6af930cd7e54
+Author: Daniel Stone <daniel@fooishbar.org>
+Date: Sun Dec 24 06:24:56 2006 +0200
+
+ bump to 1.4.6.1 (respin)
+ No code changes, just built with a better util-macros.
+
+commit 74d21b74774c81d3d96ff3017763c25e3660dde0
+Author: Daniel Stone <daniel@fooishbar.org>
+Date: Sun Dec 24 06:23:43 2006 +0200
+
+ bump to 1.4.6
+
+commit f84b13871114e6bb486402e00186a319df123f53
+Author: Daniel Stone <daniel@fooishbar.org>
+Date: Sun Dec 24 06:23:19 2006 +0200
+
+ bump to 1.4.6.1
+
+commit 9b2e1381ccda8bb4f4d186c20d5672738adfc04b
+Author: Daniel Stone <daniel@fooishbar.org>
+Date: Sat Dec 16 01:44:49 2006 +0200
+
+ bump to 1.4.6
+
+commit cb103a18067adb3256c0b791255ce8435ff57e06
+Merge: d0e0362... 4bcfca9...
+Author: Ian Romanick <idr@us.ibm.com>
+Date: Mon Dec 11 15:06:19 2006 -0800
+
+ Merge branch 'master' of git+ssh://git.freedesktop.org/git/xorg/driver/xf86-video-mga into pci-rework
+
+commit d0e03622811fd94c830c0b5233ff505392c0d331
+Merge: 8fee907... 1dd6e69...
+Author: Ian Romanick <idr@us.ibm.com>
+Date: Mon Dec 11 15:06:03 2006 -0800
+
+ Merge branch 'master' of git+ssh://git.freedesktop.org/git/xorg/driver/xf86-video-mga into pci-rework
+
+ Conflicts:
+
+ src/mga_macros.h
+
+commit 4bcfca9bcf4a2be8d49a700b1a0d529f4e5ea412
+Author: Tilman Sauerbeck <tilman@code-monkey.de>
+Date: Sun Dec 10 14:33:10 2006 +0100
+
+ Replaced some more magic values with register names.
+
+commit 55d283a8c2347e809dadace3fb9a026bab6d57dd
+Author: Daniel Stone <daniel@fooishbar.org>
+Date: Wed Dec 6 18:46:00 2006 +0200
+
+ Makefile.am: fix ChangeLog hook
+ Make ChangeLog hook safe for all situations I could think of, including
+ carrying the ChangeLog through for distcheck when objdir != srcdir. It's
+ significantly more ugly, but eh.
+
+commit fbbbb853041ae4af36eeffb24188b9a5513ba7d5
+Author: Tilman Sauerbeck <tilman@code-monkey.de>
+Date: Sat Dec 2 12:42:34 2006 +0100
+
+ Removed a duplicated register definition.
+
+commit 447aae84d07cab34987ab08ead9319e176ccd904
+Author: Tilman Sauerbeck <tilman@code-monkey.de>
+Date: Fri Dec 1 20:19:13 2006 +0100
+
+ More janitoring work.
+
+ Moved the XPWRCTRL, XDISPCTRL and C2CTL register definitions
+ to mga_reg.h.
+ Cleaned up the DAC2 routing.
+
+commit 10b2202c254b71b8d0da987a225d5e78a030bca4
+Author: Tilman Sauerbeck <tilman@code-monkey.de>
+Date: Fri Dec 1 19:10:55 2006 +0100
+
+ Use the XORG_RELEASE_VERSION autoconf macro.
+
+commit 00efdc4959a0b240eb2dc7a3188c0ef64b2ad74a
+Author: Daniel Stone <daniel@fooishbar.org>
+Date: Thu Nov 30 19:59:38 2006 +0200
+
+ bump to 1.4.5
+
+commit 5bbafd77678a2b0f82e820aa98337a014d284554
+Author: Tilman Sauerbeck <tilman@code-monkey.de>
+Date: Sun Nov 26 18:06:12 2006 +0100
+
+ Made some XAA function static.
+
+commit 4778901bb13a950285c55ea6f058e94ee7b03652
+Author: Tilman Sauerbeck <tilman@code-monkey.de>
+Date: Sun Nov 26 16:21:34 2006 +0100
+
+ Removed a duplicated register definition.
+
+commit f9d83ad601c8cba197e96f0b907f1dae6134953b
+Author: Tilman Sauerbeck <tilman@code-monkey.de>
+Date: Sun Nov 26 16:17:12 2006 +0100
+
+ Replaced more magic values with register names.
+
+commit 6df85941ce077e1eee8b43945c51ab1b0906c758
+Author: Tilman Sauerbeck <tilman@code-monkey.de>
+Date: Sun Nov 26 15:39:54 2006 +0100
+
+ Use register names in MGASaveScreenMerged() rather than magic numbers.
+
+commit b3ee69f6ac058e52d5175f611090baa76eed49f9
+Author: Tilman Sauerbeck <tilman@code-monkey.de>
+Date: Sun Nov 26 15:24:46 2006 +0100
+
+ Register name tweak.
+
+ The "DAC power down" register powers down the DAC when it's
+ set to zero, and enables it when it's set to one.
+ To avoid confusion, I renamed it.
+
+commit 0f8c42fe75c6da9e7ea4aeb33b71778551c61528
+Author: Tilman Sauerbeck <tilman@code-monkey.de>
+Date: Sat Nov 25 17:08:15 2006 +0100
+
+ Removed some unused defines from mga_reg.h.
+
+commit 334c7237078652722d7dec1c74812af46bfd7c67
+Author: Tilman Sauerbeck <tilman@code-monkey.de>
+Date: Sat Nov 25 16:42:49 2006 +0100
+
+ Removed some duplicated register definitions.
+
+commit be88d58968c604624617f40820dc9a50a92661be
+Author: Tilman Sauerbeck <tilman@code-monkey.de>
+Date: Sun Nov 19 21:04:01 2006 +0100
+
+ Bug #2168: Fix graphics corruptions with Mystique rev 2.
+
+commit daeecb63567fb394654c9e66d64c3c53658f2c7d
+Author: Tilman Sauerbeck <tilman@code-monkey.de>
+Date: Fri Nov 17 23:08:25 2006 +0100
+
+ Enabled the Exa composite hooks on G550.
+
+commit d69607fe8b2dfb6c539dbf9f2b2996d04a4a838a
+Author: David Nusinow <dnusinow@debian.org>
+Date: Mon Nov 6 23:58:06 2006 -0500
+
+ Minor typofix that was causing configure to exit with a syntax error
+
commit 1dd6e6995d7a37338dce6ee5b1aa4ee9dd848e1d
Author: Ian Romanick <idr@us.ibm.com>
Date: Fri Oct 27 11:53:40 2006 -0700
@@ -33,6 +605,13 @@ Date: Fri Oct 13 18:33:39 2006 -0400
Bump to 1.4.3
+commit 8fee907cac7e5924630e3648bfb72ad9bd021ea8
+Merge: 7cecee1... 2fc0ebf...
+Author: Ian Romanick <idr@us.ibm.com>
+Date: Tue Oct 10 11:43:52 2006 -0700
+
+ Merge branch 'master' of git+ssh://git.freedesktop.org/git/xorg/driver/xf86-video-mga into pci-rework
+
commit 2fc0ebfbe850c138e840b6653ed1476623aa04a4
Author: Tilman Sauerbeck <tilman@code-monkey.de>
Date: Thu Sep 28 18:39:20 2006 +0200
@@ -418,6 +997,13 @@ Date: Thu Aug 10 19:49:22 2006 +0200
Based on ajax' mga-exa-2.patch with some straight forward fixes
by myself.
+commit 7cecee186c889902bed9b7fa042f0bd3cc0297ef
+Merge: 160b1f7... bde5920...
+Author: Ian Romanick <idr@umwelt.(none)>
+Date: Thu Aug 10 10:19:55 2006 -0700
+
+ Merge branch 'master' of git+ssh://git.freedesktop.org/git/xorg/driver/xf86-video-mga into pci-rework
+
commit bde592047cd62194d7ef67520a9fdbaf269a8b90
Author: Tilman Sauerbeck <tilman@code-monkey.de>
Date: Wed Aug 9 21:59:42 2006 +0200
@@ -435,6 +1021,27 @@ Date: Wed Aug 9 21:59:42 2006 +0200
I didn't notice any DRI performance drop, but I didn't do serious
benchmarking either.
+commit 160b1f79fab7266a24b7d1a680cdf29bad9707c1
+Author: Ian Romanick <idr@umwelt.(none)>
+Date: Tue Aug 8 16:59:15 2006 -0700
+
+ Store the pci_device pointer passed into MGAPciProbe instead of
+ searching for it in MGAPreInit.
+
+commit 068e3427cfdf3e3b5dc5c97872d5f52f47ff0d68
+Merge: 95e0722... 7170de8...
+Author: Ian Romanick <idr@umwelt.(none)>
+Date: Wed Jul 26 11:47:32 2006 -0700
+
+ Merge branch 'master' of git+ssh://git.freedesktop.org/git/xorg/driver/xf86-video-mga into pci-rework
+
+commit 95e0722ff2e8878cdd6bb0e349eecab042b879db
+Author: Ian Romanick <idr@umwelt.(none)>
+Date: Wed Jul 26 11:46:52 2006 -0700
+
+ Current state of MGA driver modified to work with the xserver
+ pci-rework branch.
+
commit 7170de83762660efebff79be84f763008466ffa7
Author: Tilman Sauerbeck <tilman@code-monkey.de>
Date: Wed Jul 26 17:06:18 2006 +0200
diff --git a/driver/xf86-video-mga/Makefile.in b/driver/xf86-video-mga/Makefile.in
index f0855235d..9631869e5 100644
--- a/driver/xf86-video-mga/Makefile.in
+++ b/driver/xf86-video-mga/Makefile.in
@@ -123,6 +123,7 @@ DRI_CFLAGS = @DRI_CFLAGS@
DRI_FALSE = @DRI_FALSE@
DRI_LIBS = @DRI_LIBS@
DRI_TRUE = @DRI_TRUE@
+DSYMUTIL = @DSYMUTIL@
ECHO = @ECHO@
ECHO_C = @ECHO_C@
ECHO_N = @ECHO_N@
@@ -151,6 +152,7 @@ MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@
MAKEINFO = @MAKEINFO@
MISC_MAN_DIR = @MISC_MAN_DIR@
MISC_MAN_SUFFIX = @MISC_MAN_SUFFIX@
+NMEDIT = @NMEDIT@
OBJEXT = @OBJEXT@
PACKAGE = @PACKAGE@
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
@@ -159,8 +161,11 @@ PACKAGE_STRING = @PACKAGE_STRING@
PACKAGE_TARNAME = @PACKAGE_TARNAME@
PACKAGE_VERSION = @PACKAGE_VERSION@
PATH_SEPARATOR = @PATH_SEPARATOR@
+PCIACCESS_CFLAGS = @PCIACCESS_CFLAGS@
+PCIACCESS_LIBS = @PCIACCESS_LIBS@
PKG_CONFIG = @PKG_CONFIG@
RANLIB = @RANLIB@
+SED = @SED@
SET_MAKE = @SET_MAKE@
SHELL = @SHELL@
STRIP = @STRIP@
@@ -171,10 +176,14 @@ USE_XAA_TRUE = @USE_XAA_TRUE@
VERSION = @VERSION@
XORG_CFLAGS = @XORG_CFLAGS@
XORG_LIBS = @XORG_LIBS@
+XSERVER_LIBPCIACCESS_FALSE = @XSERVER_LIBPCIACCESS_FALSE@
+XSERVER_LIBPCIACCESS_TRUE = @XSERVER_LIBPCIACCESS_TRUE@
ac_ct_AR = @ac_ct_AR@
ac_ct_CC = @ac_ct_CC@
ac_ct_CXX = @ac_ct_CXX@
+ac_ct_DSYMUTIL = @ac_ct_DSYMUTIL@
ac_ct_F77 = @ac_ct_F77@
+ac_ct_NMEDIT = @ac_ct_NMEDIT@
ac_ct_RANLIB = @ac_ct_RANLIB@
ac_ct_STRIP = @ac_ct_STRIP@
ac_pt_PKG_CONFIG = @ac_pt_PKG_CONFIG@
diff --git a/driver/xf86-video-mga/aclocal.m4 b/driver/xf86-video-mga/aclocal.m4
index 6543017d8..a3a3008cb 100644
--- a/driver/xf86-video-mga/aclocal.m4
+++ b/driver/xf86-video-mga/aclocal.m4
@@ -13,7 +13,7 @@
# libtool.m4 - Configure libtool for the host system. -*-Autoconf-*-
-# serial 48 AC_PROG_LIBTOOL
+# serial 52 AC_PROG_LIBTOOL
# AC_PROVIDE_IFELSE(MACRO-NAME, IF-PROVIDED, IF-NOT-PROVIDED)
@@ -101,7 +101,6 @@ AC_REQUIRE([AC_DEPLIBS_CHECK_METHOD])dnl
AC_REQUIRE([AC_OBJEXT])dnl
AC_REQUIRE([AC_EXEEXT])dnl
dnl
-
AC_LIBTOOL_SYS_MAX_CMD_LEN
AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE
AC_LIBTOOL_OBJDIR
@@ -176,7 +175,7 @@ test -z "$STRIP" && STRIP=:
test -z "$ac_objext" && ac_objext=o
# Determine commands to create old-style static archives.
-old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs$old_deplibs'
+old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs'
old_postinstall_cmds='chmod 644 $oldlib'
old_postuninstall_cmds=
@@ -203,6 +202,8 @@ file_magic*)
;;
esac
+_LT_REQUIRED_DARWIN_CHECKS
+
AC_PROVIDE_IFELSE([AC_LIBTOOL_DLOPEN], enable_dlopen=yes, enable_dlopen=no)
AC_PROVIDE_IFELSE([AC_LIBTOOL_WIN32_DLL],
enable_win32_dll=yes, enable_win32_dll=no)
@@ -263,8 +264,9 @@ cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"`
# Check for compiler boilerplate output or warnings with
# the simple compiler test code.
AC_DEFUN([_LT_COMPILER_BOILERPLATE],
-[ac_outfile=conftest.$ac_objext
-printf "$lt_simple_compile_test_code" >conftest.$ac_ext
+[AC_REQUIRE([LT_AC_PROG_SED])dnl
+ac_outfile=conftest.$ac_objext
+echo "$lt_simple_compile_test_code" >conftest.$ac_ext
eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
_lt_compiler_boilerplate=`cat conftest.err`
$rm conftest*
@@ -276,13 +278,85 @@ $rm conftest*
# Check for linker boilerplate output or warnings with
# the simple link test code.
AC_DEFUN([_LT_LINKER_BOILERPLATE],
-[ac_outfile=conftest.$ac_objext
-printf "$lt_simple_link_test_code" >conftest.$ac_ext
+[AC_REQUIRE([LT_AC_PROG_SED])dnl
+ac_outfile=conftest.$ac_objext
+echo "$lt_simple_link_test_code" >conftest.$ac_ext
eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
_lt_linker_boilerplate=`cat conftest.err`
-$rm conftest*
+$rm -r conftest*
])# _LT_LINKER_BOILERPLATE
+# _LT_REQUIRED_DARWIN_CHECKS
+# --------------------------
+# Check for some things on darwin
+AC_DEFUN([_LT_REQUIRED_DARWIN_CHECKS],[
+ case $host_os in
+ rhapsody* | darwin*)
+ AC_CHECK_TOOL([DSYMUTIL], [dsymutil], [:])
+ AC_CHECK_TOOL([NMEDIT], [nmedit], [:])
+
+ AC_CACHE_CHECK([for -single_module linker flag],[lt_cv_apple_cc_single_mod],
+ [lt_cv_apple_cc_single_mod=no
+ if test -z "${LT_MULTI_MODULE}"; then
+ # By default we will add the -single_module flag. You can override
+ # by either setting the environment variable LT_MULTI_MODULE
+ # non-empty at configure time, or by adding -multi_module to the
+ # link flags.
+ echo "int foo(void){return 1;}" > conftest.c
+ $LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \
+ -dynamiclib ${wl}-single_module conftest.c
+ if test -f libconftest.dylib; then
+ lt_cv_apple_cc_single_mod=yes
+ rm -rf libconftest.dylib*
+ fi
+ rm conftest.c
+ fi])
+ AC_CACHE_CHECK([for -exported_symbols_list linker flag],
+ [lt_cv_ld_exported_symbols_list],
+ [lt_cv_ld_exported_symbols_list=no
+ save_LDFLAGS=$LDFLAGS
+ echo "_main" > conftest.sym
+ LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym"
+ AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])],
+ [lt_cv_ld_exported_symbols_list=yes],
+ [lt_cv_ld_exported_symbols_list=no])
+ LDFLAGS="$save_LDFLAGS"
+ ])
+ case $host_os in
+ rhapsody* | darwin1.[[0123]])
+ _lt_dar_allow_undefined='${wl}-undefined ${wl}suppress' ;;
+ darwin1.*)
+ _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;;
+ darwin*)
+ # if running on 10.5 or later, the deployment target defaults
+ # to the OS version, if on x86, and 10.4, the deployment
+ # target defaults to 10.4. Don't you love it?
+ case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in
+ 10.0,*86*-darwin8*|10.0,*-darwin[[91]]*)
+ _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;;
+ 10.[[012]]*)
+ _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;;
+ 10.*)
+ _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;;
+ esac
+ ;;
+ esac
+ if test "$lt_cv_apple_cc_single_mod" = "yes"; then
+ _lt_dar_single_mod='$single_module'
+ fi
+ if test "$lt_cv_ld_exported_symbols_list" = "yes"; then
+ _lt_dar_export_syms=' ${wl}-exported_symbols_list,$output_objdir/${libname}-symbols.expsym'
+ else
+ _lt_dar_export_syms="~$NMEDIT -s \$output_objdir/\${libname}-symbols.expsym \${lib}"
+ fi
+ if test "$DSYMUTIL" != ":"; then
+ _lt_dsymutil="~$DSYMUTIL \$lib || :"
+ else
+ _lt_dsymutil=
+ fi
+ ;;
+ esac
+])
# _LT_AC_SYS_LIBPATH_AIX
# ----------------------
@@ -293,12 +367,20 @@ $rm conftest*
# If we don't find anything, use the default library path according
# to the aix ld manual.
AC_DEFUN([_LT_AC_SYS_LIBPATH_AIX],
-[AC_LINK_IFELSE(AC_LANG_PROGRAM,[
-aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; }
-}'`
+[AC_REQUIRE([LT_AC_PROG_SED])dnl
+AC_LINK_IFELSE(AC_LANG_PROGRAM,[
+lt_aix_libpath_sed='
+ /Import File Strings/,/^$/ {
+ /^0/ {
+ s/^0 *\(.*\)$/\1/
+ p
+ }
+ }'
+aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
# Check for a 64-bit object if we didn't find anything.
-if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; }
-}'`; fi],[])
+if test -z "$aix_libpath"; then
+ aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
+fi],[])
if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
])# _LT_AC_SYS_LIBPATH_AIX
@@ -529,13 +611,17 @@ ia64-*-hpux*)
rm -rf conftest*
;;
-x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*|s390*-*linux*|sparc*-*linux*)
+x86_64-*kfreebsd*-gnu|x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*| \
+s390*-*linux*|sparc*-*linux*)
# Find out which ABI we are using.
echo 'int i;' > conftest.$ac_ext
if AC_TRY_EVAL(ac_compile); then
case `/usr/bin/file conftest.o` in
*32-bit*)
case $host in
+ x86_64-*kfreebsd*-gnu)
+ LD="${LD-ld} -m elf_i386_fbsd"
+ ;;
x86_64-*linux*)
LD="${LD-ld} -m elf_i386"
;;
@@ -552,6 +638,9 @@ x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*|s390*-*linux*|sparc*-*linux*)
;;
*64-bit*)
case $host in
+ x86_64-*kfreebsd*-gnu)
+ LD="${LD-ld} -m elf_x86_64_fbsd"
+ ;;
x86_64-*linux*)
LD="${LD-ld} -m elf_x86_64"
;;
@@ -592,7 +681,11 @@ sparc*-*solaris*)
*64-bit*)
case $lt_cv_prog_gnu_ld in
yes*) LD="${LD-ld} -m elf64_sparc" ;;
- *) LD="${LD-ld} -64" ;;
+ *)
+ if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then
+ LD="${LD-ld} -64"
+ fi
+ ;;
esac
;;
esac
@@ -623,7 +716,7 @@ AC_DEFUN([AC_LIBTOOL_COMPILER_OPTION],
AC_CACHE_CHECK([$1], [$2],
[$2=no
ifelse([$4], , [ac_outfile=conftest.$ac_objext], [ac_outfile=$4])
- printf "$lt_simple_compile_test_code" > conftest.$ac_ext
+ echo "$lt_simple_compile_test_code" > conftest.$ac_ext
lt_compiler_flag="$3"
# Insert the option either (1) after the last *FLAGS variable, or
# (2) before a word containing "conftest.", or (3) at the end.
@@ -664,11 +757,12 @@ fi
# ------------------------------------------------------------
# Check whether the given compiler option works
AC_DEFUN([AC_LIBTOOL_LINKER_OPTION],
-[AC_CACHE_CHECK([$1], [$2],
+[AC_REQUIRE([LT_AC_PROG_SED])dnl
+AC_CACHE_CHECK([$1], [$2],
[$2=no
save_LDFLAGS="$LDFLAGS"
LDFLAGS="$LDFLAGS $3"
- printf "$lt_simple_link_test_code" > conftest.$ac_ext
+ echo "$lt_simple_link_test_code" > conftest.$ac_ext
if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then
# The linker can only warn and ignore the option if not recognized
# So say no if there are warnings
@@ -684,7 +778,7 @@ AC_DEFUN([AC_LIBTOOL_LINKER_OPTION],
$2=yes
fi
fi
- $rm conftest*
+ $rm -r conftest*
LDFLAGS="$save_LDFLAGS"
])
@@ -782,24 +876,27 @@ AC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl
fi
;;
*)
- # If test is not a shell built-in, we'll probably end up computing a
- # maximum length that is only half of the actual maximum length, but
- # we can't tell.
- SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}}
- while (test "X"`$SHELL [$]0 --fallback-echo "X$teststring" 2>/dev/null` \
+ lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null`
+ if test -n "$lt_cv_sys_max_cmd_len"; then
+ lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
+ lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
+ else
+ SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}}
+ while (test "X"`$SHELL [$]0 --fallback-echo "X$teststring" 2>/dev/null` \
= "XX$teststring") >/dev/null 2>&1 &&
- new_result=`expr "X$teststring" : ".*" 2>&1` &&
- lt_cv_sys_max_cmd_len=$new_result &&
- test $i != 17 # 1/2 MB should be enough
- do
- i=`expr $i + 1`
- teststring=$teststring$teststring
- done
- teststring=
- # Add a significant safety factor because C++ compilers can tack on massive
- # amounts of additional arguments before passing them to the linker.
- # It appears as though 1/2 is a usable value.
- lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2`
+ new_result=`expr "X$teststring" : ".*" 2>&1` &&
+ lt_cv_sys_max_cmd_len=$new_result &&
+ test $i != 17 # 1/2 MB should be enough
+ do
+ i=`expr $i + 1`
+ teststring=$teststring$teststring
+ done
+ teststring=
+ # Add a significant safety factor because C++ compilers can tack on massive
+ # amounts of additional arguments before passing them to the linker.
+ # It appears as though 1/2 is a usable value.
+ lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2`
+ fi
;;
esac
])
@@ -952,7 +1049,7 @@ else
AC_CHECK_FUNC([shl_load],
[lt_cv_dlopen="shl_load"],
[AC_CHECK_LIB([dld], [shl_load],
- [lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-dld"],
+ [lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-ldld"],
[AC_CHECK_FUNC([dlopen],
[lt_cv_dlopen="dlopen"],
[AC_CHECK_LIB([dl], [dlopen],
@@ -960,7 +1057,7 @@ else
[AC_CHECK_LIB([svld], [dlopen],
[lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"],
[AC_CHECK_LIB([dld], [dld_link],
- [lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-dld"])
+ [lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-ldld"])
])
])
])
@@ -1026,7 +1123,8 @@ fi
# ---------------------------------
# Check to see if options -c and -o are simultaneously supported by compiler
AC_DEFUN([AC_LIBTOOL_PROG_CC_C_O],
-[AC_REQUIRE([_LT_AC_SYS_COMPILER])dnl
+[AC_REQUIRE([LT_AC_PROG_SED])dnl
+AC_REQUIRE([_LT_AC_SYS_COMPILER])dnl
AC_CACHE_CHECK([if $compiler supports -c -o file.$ac_objext],
[_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)],
[_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)=no
@@ -1034,7 +1132,7 @@ AC_CACHE_CHECK([if $compiler supports -c -o file.$ac_objext],
mkdir conftest
cd conftest
mkdir out
- printf "$lt_simple_compile_test_code" > conftest.$ac_ext
+ echo "$lt_simple_compile_test_code" > conftest.$ac_ext
lt_compiler_flag="-o out/conftest2.$ac_objext"
# Insert the option either (1) after the last *FLAGS variable, or
@@ -1174,6 +1272,7 @@ else
darwin*)
if test -n "$STRIP" ; then
striplib="$STRIP -x"
+ old_striplib="$STRIP -S"
AC_MSG_RESULT([yes])
else
AC_MSG_RESULT([no])
@@ -1191,7 +1290,8 @@ fi
# -----------------------------
# PORTME Fill in your ld.so characteristics
AC_DEFUN([AC_LIBTOOL_SYS_DYNAMIC_LINKER],
-[AC_MSG_CHECKING([dynamic linker characteristics])
+[AC_REQUIRE([LT_AC_PROG_SED])dnl
+AC_MSG_CHECKING([dynamic linker characteristics])
library_names_spec=
libname_spec='lib$name'
soname_spec=
@@ -1205,20 +1305,58 @@ shlibpath_overrides_runpath=unknown
version_type=none
dynamic_linker="$host_os ld.so"
sys_lib_dlsearch_path_spec="/lib /usr/lib"
+m4_if($1,[],[
if test "$GCC" = yes; then
- sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"`
- if echo "$sys_lib_search_path_spec" | grep ';' >/dev/null ; then
+ case $host_os in
+ darwin*) lt_awk_arg="/^libraries:/,/LR/" ;;
+ *) lt_awk_arg="/^libraries:/" ;;
+ esac
+ lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e "s,=/,/,g"`
+ if echo "$lt_search_path_spec" | grep ';' >/dev/null ; then
# if the path contains ";" then we assume it to be the separator
# otherwise default to the standard path separator (i.e. ":") - it is
# assumed that no part of a normal pathname contains ";" but that should
# okay in the real world where ";" in dirpaths is itself problematic.
- sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
+ lt_search_path_spec=`echo "$lt_search_path_spec" | $SED -e 's/;/ /g'`
else
- sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
+ lt_search_path_spec=`echo "$lt_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
fi
+ # Ok, now we have the path, separated by spaces, we can step through it
+ # and add multilib dir if necessary.
+ lt_tmp_lt_search_path_spec=
+ lt_multi_os_dir=`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null`
+ for lt_sys_path in $lt_search_path_spec; do
+ if test -d "$lt_sys_path/$lt_multi_os_dir"; then
+ lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path/$lt_multi_os_dir"
+ else
+ test -d "$lt_sys_path" && \
+ lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path"
+ fi
+ done
+ lt_search_path_spec=`echo $lt_tmp_lt_search_path_spec | awk '
+BEGIN {RS=" "; FS="/|\n";} {
+ lt_foo="";
+ lt_count=0;
+ for (lt_i = NF; lt_i > 0; lt_i--) {
+ if ($lt_i != "" && $lt_i != ".") {
+ if ($lt_i == "..") {
+ lt_count++;
+ } else {
+ if (lt_count == 0) {
+ lt_foo="/" $lt_i lt_foo;
+ } else {
+ lt_count--;
+ }
+ }
+ }
+ }
+ if (lt_foo != "") { lt_freq[[lt_foo]]++; }
+ if (lt_freq[[lt_foo]] == 1) { print lt_foo; }
+}'`
+ sys_lib_search_path_spec=`echo $lt_search_path_spec`
else
sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
-fi
+fi])
need_lib_prefix=unknown
hardcode_into_libs=no
@@ -1236,7 +1374,7 @@ aix3*)
soname_spec='${libname}${release}${shared_ext}$major'
;;
-aix4* | aix5*)
+aix[[4-9]]*)
version_type=linux
need_lib_prefix=no
need_version=no
@@ -1375,12 +1513,8 @@ darwin* | rhapsody*)
shlibpath_overrides_runpath=yes
shlibpath_var=DYLD_LIBRARY_PATH
shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`'
- # Apple's gcc prints 'gcc -print-search-dirs' doesn't operate the same.
- if test "$GCC" = yes; then
- sys_lib_search_path_spec=`$CC -print-search-dirs | tr "\n" "$PATH_SEPARATOR" | sed -e 's/libraries:/@libraries:/' | tr "@" "\n" | grep "^libraries:" | sed -e "s/^libraries://" -e "s,=/,/,g" -e "s,$PATH_SEPARATOR, ,g" -e "s,.*,& /lib /usr/lib /usr/local/lib,g"`
- else
- sys_lib_search_path_spec='/lib /usr/lib /usr/local/lib'
- fi
+ m4_if([$1], [],[
+ sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib"])
sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib'
;;
@@ -1397,18 +1531,6 @@ freebsd1*)
dynamic_linker=no
;;
-kfreebsd*-gnu)
- version_type=linux
- need_lib_prefix=no
- need_version=no
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- shlibpath_var=LD_LIBRARY_PATH
- shlibpath_overrides_runpath=no
- hardcode_into_libs=yes
- dynamic_linker='GNU ld.so'
- ;;
-
freebsd* | dragonfly*)
# DragonFly does not have aout. When/if they implement a new
# versioning mechanism, adjust this.
@@ -1446,7 +1568,7 @@ freebsd* | dragonfly*)
shlibpath_overrides_runpath=no
hardcode_into_libs=yes
;;
- freebsd*) # from 4.6 on
+ *) # from 4.6 on, and DragonFly
shlibpath_overrides_runpath=yes
hardcode_into_libs=yes
;;
@@ -1509,7 +1631,7 @@ hpux9* | hpux10* | hpux11*)
postinstall_cmds='chmod 555 $lib'
;;
-interix3*)
+interix[[3-9]]*)
version_type=linux
need_lib_prefix=no
need_version=no
@@ -1564,7 +1686,7 @@ linux*oldld* | linux*aout* | linux*coff*)
;;
# This must be Linux ELF.
-linux*)
+linux* | k*bsd*-gnu)
version_type=linux
need_lib_prefix=no
need_version=no
@@ -1580,7 +1702,7 @@ linux*)
# Append ld.so.conf contents to the search path
if test -f /etc/ld.so.conf; then
- lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s", \[$]2)); skip = 1; } { if (!skip) print \[$]0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '`
+ lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \[$]2)); skip = 1; } { if (!skip) print \[$]0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '`
sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra"
fi
@@ -1593,18 +1715,6 @@ linux*)
dynamic_linker='GNU/Linux ld.so'
;;
-knetbsd*-gnu)
- version_type=linux
- need_lib_prefix=no
- need_version=no
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- shlibpath_var=LD_LIBRARY_PATH
- shlibpath_overrides_runpath=no
- hardcode_into_libs=yes
- dynamic_linker='GNU ld.so'
- ;;
-
netbsd*)
version_type=sunos
need_lib_prefix=no
@@ -1686,6 +1796,10 @@ osf3* | osf4* | osf5*)
sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec"
;;
+rdos*)
+ dynamic_linker=no
+ ;;
+
solaris*)
version_type=linux
need_lib_prefix=no
@@ -1781,6 +1895,13 @@ esac
AC_MSG_RESULT([$dynamic_linker])
test "$dynamic_linker" = no && can_build_shared=no
+AC_CACHE_VAL([lt_cv_sys_lib_search_path_spec],
+[lt_cv_sys_lib_search_path_spec="$sys_lib_search_path_spec"])
+sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec"
+AC_CACHE_VAL([lt_cv_sys_lib_dlsearch_path_spec],
+[lt_cv_sys_lib_dlsearch_path_spec="$sys_lib_dlsearch_path_spec"])
+sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec"
+
variables_saved_for_relink="PATH $shlibpath_var $runpath_var"
if test "$GCC" = yes; then
variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
@@ -1791,7 +1912,8 @@ fi
# _LT_AC_TAGCONFIG
# ----------------
AC_DEFUN([_LT_AC_TAGCONFIG],
-[AC_ARG_WITH([tags],
+[AC_REQUIRE([LT_AC_PROG_SED])dnl
+AC_ARG_WITH([tags],
[AC_HELP_STRING([--with-tags@<:@=TAGS@:>@],
[include additional configurations @<:@automatic@:>@])],
[tagnames="$withval"])
@@ -2052,7 +2174,7 @@ m4_ifndef([AC_PROG_EGREP], [AC_DEFUN([AC_PROG_EGREP],
# AC_PATH_TOOL_PREFIX
# -------------------
-# find a file program which can recognise shared library
+# find a file program which can recognize shared library
AC_DEFUN([AC_PATH_TOOL_PREFIX],
[AC_REQUIRE([AC_PROG_EGREP])dnl
AC_MSG_CHECKING([for $1])
@@ -2115,7 +2237,7 @@ fi
# AC_PATH_MAGIC
# -------------
-# find a file program which can recognise a shared library
+# find a file program which can recognize a shared library
AC_DEFUN([AC_PATH_MAGIC],
[AC_PATH_TOOL_PREFIX(${ac_tool_prefix}file, /usr/bin$PATH_SEPARATOR$PATH)
if test -z "$lt_cv_path_MAGIC_CMD"; then
@@ -2262,7 +2384,7 @@ esac
# how to check for library dependencies
# -- PORTME fill in with the dynamic library characteristics
AC_DEFUN([AC_DEPLIBS_CHECK_METHOD],
-[AC_CACHE_CHECK([how to recognise dependent libraries],
+[AC_CACHE_CHECK([how to recognize dependent libraries],
lt_cv_deplibs_check_method,
[lt_cv_file_magic_cmd='$MAGIC_CMD'
lt_cv_file_magic_test_file=
@@ -2279,7 +2401,7 @@ lt_cv_deplibs_check_method='unknown'
# whether `pass_all' will *always* work, you probably want this one.
case $host_os in
-aix4* | aix5*)
+aix[[4-9]]*)
lt_cv_deplibs_check_method=pass_all
;;
@@ -2301,16 +2423,22 @@ cygwin*)
mingw* | pw32*)
# Base MSYS/MinGW do not provide the 'file' command needed by
- # func_win32_libid shell function, so use a weaker test based on 'objdump'.
- lt_cv_deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?'
- lt_cv_file_magic_cmd='$OBJDUMP -f'
+ # func_win32_libid shell function, so use a weaker test based on 'objdump',
+ # unless we find 'file', for example because we are cross-compiling.
+ if ( file / ) >/dev/null 2>&1; then
+ lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
+ lt_cv_file_magic_cmd='func_win32_libid'
+ else
+ lt_cv_deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?'
+ lt_cv_file_magic_cmd='$OBJDUMP -f'
+ fi
;;
darwin* | rhapsody*)
lt_cv_deplibs_check_method=pass_all
;;
-freebsd* | kfreebsd*-gnu | dragonfly*)
+freebsd* | dragonfly*)
if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
case $host_cpu in
i*86 )
@@ -2348,7 +2476,7 @@ hpux10.20* | hpux11*)
esac
;;
-interix3*)
+interix[[3-9]]*)
# PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here
lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|\.a)$'
;;
@@ -2364,7 +2492,7 @@ irix5* | irix6* | nonstopux*)
;;
# This must be Linux ELF.
-linux*)
+linux* | k*bsd*-gnu)
lt_cv_deplibs_check_method=pass_all
;;
@@ -2398,6 +2526,10 @@ osf3* | osf4* | osf5*)
lt_cv_deplibs_check_method=pass_all
;;
+rdos*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
solaris*)
lt_cv_deplibs_check_method=pass_all
;;
@@ -2450,7 +2582,7 @@ AC_DEFUN([AC_PROG_NM],
lt_cv_path_NM="$NM"
else
lt_nm_to_check="${ac_tool_prefix}nm"
- if test -n "$ac_tool_prefix" && test "$build" = "$host"; then
+ if test -n "$ac_tool_prefix" && test "$build" = "$host"; then
lt_nm_to_check="$lt_nm_to_check nm"
fi
for lt_tmp_nm in $lt_nm_to_check; do
@@ -2666,10 +2798,10 @@ objext=o
_LT_AC_TAGVAR(objext, $1)=$objext
# Code to be used in simple compile tests
-lt_simple_compile_test_code="int some_variable = 0;\n"
+lt_simple_compile_test_code="int some_variable = 0;"
# Code to be used in simple link tests
-lt_simple_link_test_code='int main(){return(0);}\n'
+lt_simple_link_test_code='int main(){return(0);}'
_LT_AC_SYS_COMPILER
@@ -2705,7 +2837,7 @@ aix3*)
fi
;;
-aix4* | aix5*)
+aix[[4-9]]*)
if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
test "$enable_shared" = yes && enable_static=no
fi
@@ -2762,6 +2894,7 @@ _LT_AC_TAGVAR(postdep_objects, $1)=
_LT_AC_TAGVAR(predeps, $1)=
_LT_AC_TAGVAR(postdeps, $1)=
_LT_AC_TAGVAR(compiler_lib_search_path, $1)=
+_LT_AC_TAGVAR(compiler_lib_search_dirs, $1)=
# Source file extension for C++ test sources.
ac_ext=cpp
@@ -2771,10 +2904,10 @@ objext=o
_LT_AC_TAGVAR(objext, $1)=$objext
# Code to be used in simple compile tests
-lt_simple_compile_test_code="int some_variable = 0;\n"
+lt_simple_compile_test_code="int some_variable = 0;"
# Code to be used in simple link tests
-lt_simple_link_test_code='int main(int, char *[[]]) { return(0); }\n'
+lt_simple_link_test_code='int main(int, char *[[]]) { return(0); }'
# ltmain only uses $CC for tagged configurations so make sure $CC is set.
_LT_AC_SYS_COMPILER
@@ -2871,7 +3004,7 @@ case $host_os in
# FIXME: insert proper C++ library support
_LT_AC_TAGVAR(ld_shlibs, $1)=no
;;
- aix4* | aix5*)
+ aix[[4-9]]*)
if test "$host_cpu" = ia64; then
# On IA64, the linker does run time linking by default, so we don't
# have to do anything special.
@@ -2884,7 +3017,7 @@ case $host_os in
# Test if we are trying to use run time linking or normal
# AIX style linking. If -brtl is somewhere in LDFLAGS, we
# need to do runtime linking.
- case $host_os in aix4.[[23]]|aix4.[[23]].*|aix5*)
+ case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*)
for ld_flag in $LDFLAGS; do
case $ld_flag in
*-brtl*)
@@ -2920,7 +3053,7 @@ case $host_os in
strings "$collect2name" | grep resolve_lib_name >/dev/null
then
# We have reworked collect2
- _LT_AC_TAGVAR(hardcode_direct, $1)=yes
+ :
else
# We have old collect2
_LT_AC_TAGVAR(hardcode_direct, $1)=unsupported
@@ -3030,59 +3163,31 @@ case $host_os in
fi
;;
darwin* | rhapsody*)
- case $host_os in
- rhapsody* | darwin1.[[012]])
- _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-undefined ${wl}suppress'
- ;;
- *) # Darwin 1.3 on
- if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then
- _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-flat_namespace ${wl}-undefined ${wl}suppress'
- else
- case ${MACOSX_DEPLOYMENT_TARGET} in
- 10.[[012]])
- _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-flat_namespace ${wl}-undefined ${wl}suppress'
- ;;
- 10.*)
- _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-undefined ${wl}dynamic_lookup'
- ;;
- esac
- fi
- ;;
- esac
_LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
_LT_AC_TAGVAR(hardcode_direct, $1)=no
_LT_AC_TAGVAR(hardcode_automatic, $1)=yes
_LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
_LT_AC_TAGVAR(whole_archive_flag_spec, $1)=''
_LT_AC_TAGVAR(link_all_deplibs, $1)=yes
-
- if test "$GXX" = yes ; then
- lt_int_apple_cc_single_mod=no
+ _LT_AC_TAGVAR(allow_undefined_flag, $1)="$_lt_dar_allow_undefined"
+ if test "$GXX" = yes ; then
output_verbose_link_cmd='echo'
- if $CC -dumpspecs 2>&1 | $EGREP 'single_module' >/dev/null ; then
- lt_int_apple_cc_single_mod=yes
+ _LT_AC_TAGVAR(archive_cmds, $1)="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}"
+ _LT_AC_TAGVAR(module_cmds, $1)="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}"
+ _LT_AC_TAGVAR(archive_expsym_cmds, $1)="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}"
+ _LT_AC_TAGVAR(module_expsym_cmds, $1)="sed -e 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dar_export_syms}${_lt_dsymutil}"
+ if test "$lt_cv_apple_cc_single_mod" != "yes"; then
+ _LT_AC_TAGVAR(archive_cmds, $1)="\$CC -r -keep_private_externs -nostdlib -o \${lib}-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \${lib}-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring${_lt_dsymutil}"
+ _LT_AC_TAGVAR(archive_expsym_cmds, $1)="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -r -keep_private_externs -nostdlib -o \${lib}-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \${lib}-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring${_lt_dar_export_syms}${_lt_dsymutil}"
fi
- if test "X$lt_int_apple_cc_single_mod" = Xyes ; then
- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring'
- else
- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -r -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $deplibs $compiler_flags -install_name $rpath/$soname $verstring'
- fi
- _LT_AC_TAGVAR(module_cmds, $1)='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags'
- # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds
- if test "X$lt_int_apple_cc_single_mod" = Xyes ; then
- _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
- else
- _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -r -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
- fi
- _LT_AC_TAGVAR(module_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
else
case $cc_basename in
xlc*)
output_verbose_link_cmd='echo'
- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj ${wl}-single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $verstring'
+ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj ${wl}-single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $xlcverstring'
_LT_AC_TAGVAR(module_cmds, $1)='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags'
# Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds
- _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj ${wl}-single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+ _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj ${wl}-single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $xlcverstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
_LT_AC_TAGVAR(module_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
;;
*)
@@ -3116,7 +3221,7 @@ case $host_os in
freebsd-elf*)
_LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
;;
- freebsd* | kfreebsd*-gnu | dragonfly*)
+ freebsd* | dragonfly*)
# FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF
# conventions
_LT_AC_TAGVAR(ld_shlibs, $1)=yes
@@ -3165,9 +3270,7 @@ case $host_os in
_LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
case $host_cpu in
- hppa*64*|ia64*)
- _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='+b $libdir'
- ;;
+ hppa*64*|ia64*) ;;
*)
_LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
;;
@@ -3235,7 +3338,7 @@ case $host_os in
;;
esac
;;
- interix3*)
+ interix[[3-9]]*)
_LT_AC_TAGVAR(hardcode_direct, $1)=no
_LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
@@ -3275,7 +3378,7 @@ case $host_os in
_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
_LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
;;
- linux*)
+ linux* | k*bsd*-gnu)
case $cc_basename in
KCC*)
# Kuck and Associates, Inc. (KAI) C++ Compiler
@@ -3327,7 +3430,7 @@ case $host_os in
_LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
_LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive'
;;
- pgCC*)
+ pgCC* | pgcpp*)
# Portland Group C++ compiler
_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib'
_LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib'
@@ -3355,6 +3458,29 @@ case $host_os in
# dependencies.
output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list'
;;
+ *)
+ case `$CC -V 2>&1 | sed 5q` in
+ *Sun\ C*)
+ # Sun C++ 5.9
+ _LT_AC_TAGVAR(no_undefined_flag, $1)=' -zdefs'
+ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+ _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file ${wl}$export_symbols'
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
+ _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive'
+
+ # Not sure whether something based on
+ # $CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1
+ # would be better.
+ output_verbose_link_cmd='echo'
+
+ # Archives containing C++ object files must be created using
+ # "CC -xar", where "CC" is the Sun C++ compiler. This is
+ # necessary to make sure instantiated templates are included
+ # in the archive.
+ _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs'
+ ;;
+ esac
+ ;;
esac
;;
lynxos*)
@@ -3399,9 +3525,9 @@ case $host_os in
_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'
_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
- _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file,$export_symbols -o $lib'
- _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
- _LT_AC_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
+ _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file,$export_symbols -o $lib'
+ _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
+ _LT_AC_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
fi
output_verbose_link_cmd='echo'
else
@@ -3568,15 +3694,10 @@ case $host_os in
case $host_os in
solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
*)
- # The C++ compiler is used as linker so we must use $wl
- # flag to pass the commands to the underlying system
- # linker. We must also pass each convience library through
- # to the system linker between allextract/defaultextract.
- # The C++ compiler will combine linker options so we
- # cannot just pass the convience library names through
- # without $wl.
+ # The compiler driver will combine and reorder linker options,
+ # but understands `-z linker_flag'.
# Supported since Solaris 2.6 (maybe 2.5.1?)
- _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}-z ${wl}defaultextract'
+ _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract'
;;
esac
_LT_AC_TAGVAR(link_all_deplibs, $1)=yes
@@ -3623,6 +3744,12 @@ case $host_os in
fi
_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $wl$libdir'
+ case $host_os in
+ solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
+ *)
+ _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract'
+ ;;
+ esac
fi
;;
esac
@@ -3738,7 +3865,8 @@ lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld
# compiler output when linking a shared library.
# Parse the compiler output and extract the necessary
# objects, libraries and library flags.
-AC_DEFUN([AC_LIBTOOL_POSTDEP_PREDEP],[
+AC_DEFUN([AC_LIBTOOL_POSTDEP_PREDEP],
+[AC_REQUIRE([LT_AC_PROG_SED])dnl
dnl we can't use the lt_simple_compile_test_code here,
dnl because it contains code intended for an executable,
dnl not a library. It's possible we should let each
@@ -3863,10 +3991,15 @@ fi
$rm -f confest.$objext
+_LT_AC_TAGVAR(compiler_lib_search_dirs, $1)=
+if test -n "$_LT_AC_TAGVAR(compiler_lib_search_path, $1)"; then
+ _LT_AC_TAGVAR(compiler_lib_search_dirs, $1)=`echo " ${_LT_AC_TAGVAR(compiler_lib_search_path, $1)}" | ${SED} -e 's! -L! !g' -e 's!^ !!'`
+fi
+
# PORTME: override above test on systems where it is broken
ifelse([$1],[CXX],
[case $host_os in
-interix3*)
+interix[[3-9]]*)
# Interix 3.5 installs completely hosed .la files for C++, so rather than
# hack all around it, let's just trust "g++" to DTRT.
_LT_AC_TAGVAR(predep_objects,$1)=
@@ -3874,19 +4007,51 @@ interix3*)
_LT_AC_TAGVAR(postdeps,$1)=
;;
+linux*)
+ case `$CC -V 2>&1 | sed 5q` in
+ *Sun\ C*)
+ # Sun C++ 5.9
+ #
+ # The more standards-conforming stlport4 library is
+ # incompatible with the Cstd library. Avoid specifying
+ # it if it's in CXXFLAGS. Ignore libCrun as
+ # -library=stlport4 depends on it.
+ case " $CXX $CXXFLAGS " in
+ *" -library=stlport4 "*)
+ solaris_use_stlport4=yes
+ ;;
+ esac
+ if test "$solaris_use_stlport4" != yes; then
+ _LT_AC_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun'
+ fi
+ ;;
+ esac
+ ;;
+
solaris*)
case $cc_basename in
CC*)
+ # The more standards-conforming stlport4 library is
+ # incompatible with the Cstd library. Avoid specifying
+ # it if it's in CXXFLAGS. Ignore libCrun as
+ # -library=stlport4 depends on it.
+ case " $CXX $CXXFLAGS " in
+ *" -library=stlport4 "*)
+ solaris_use_stlport4=yes
+ ;;
+ esac
+
# Adding this requires a known-good setup of shared libraries for
# Sun compiler versions before 5.6, else PIC objects from an old
# archive will be linked into the output, leading to subtle bugs.
- _LT_AC_TAGVAR(postdeps,$1)='-lCstd -lCrun'
+ if test "$solaris_use_stlport4" != yes; then
+ _LT_AC_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun'
+ fi
;;
esac
;;
esac
])
-
case " $_LT_AC_TAGVAR(postdeps, $1) " in
*" -lc "*) _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no ;;
esac
@@ -3929,10 +4094,17 @@ objext=o
_LT_AC_TAGVAR(objext, $1)=$objext
# Code to be used in simple compile tests
-lt_simple_compile_test_code=" subroutine t\n return\n end\n"
+lt_simple_compile_test_code="\
+ subroutine t
+ return
+ end
+"
# Code to be used in simple link tests
-lt_simple_link_test_code=" program t\n end\n"
+lt_simple_link_test_code="\
+ program t
+ end
+"
# ltmain only uses $CC for tagged configurations so make sure $CC is set.
_LT_AC_SYS_COMPILER
@@ -3964,7 +4136,7 @@ aix3*)
postinstall_cmds='$RANLIB $lib'
fi
;;
-aix4* | aix5*)
+aix[[4-9]]*)
if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
test "$enable_shared" = yes && enable_static=no
fi
@@ -4011,10 +4183,10 @@ objext=o
_LT_AC_TAGVAR(objext, $1)=$objext
# Code to be used in simple compile tests
-lt_simple_compile_test_code="class foo {}\n"
+lt_simple_compile_test_code="class foo {}"
# Code to be used in simple link tests
-lt_simple_link_test_code='public class conftest { public static void main(String[[]] argv) {}; }\n'
+lt_simple_link_test_code='public class conftest { public static void main(String[[]] argv) {}; }'
# ltmain only uses $CC for tagged configurations so make sure $CC is set.
_LT_AC_SYS_COMPILER
@@ -4067,7 +4239,7 @@ objext=o
_LT_AC_TAGVAR(objext, $1)=$objext
# Code to be used in simple compile tests
-lt_simple_compile_test_code='sample MENU { MENUITEM "&Soup", 100, CHECKED }\n'
+lt_simple_compile_test_code='sample MENU { MENUITEM "&Soup", 100, CHECKED }'
# Code to be used in simple link tests
lt_simple_link_test_code="$lt_simple_compile_test_code"
@@ -4141,6 +4313,7 @@ if test -f "$ltmain"; then
_LT_AC_TAGVAR(predeps, $1) \
_LT_AC_TAGVAR(postdeps, $1) \
_LT_AC_TAGVAR(compiler_lib_search_path, $1) \
+ _LT_AC_TAGVAR(compiler_lib_search_dirs, $1) \
_LT_AC_TAGVAR(archive_cmds, $1) \
_LT_AC_TAGVAR(archive_expsym_cmds, $1) \
_LT_AC_TAGVAR(postinstall_cmds, $1) \
@@ -4156,6 +4329,7 @@ if test -f "$ltmain"; then
_LT_AC_TAGVAR(module_cmds, $1) \
_LT_AC_TAGVAR(module_expsym_cmds, $1) \
_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1) \
+ _LT_AC_TAGVAR(fix_srcfile_path, $1) \
_LT_AC_TAGVAR(exclude_expsyms, $1) \
_LT_AC_TAGVAR(include_expsyms, $1); do
@@ -4202,7 +4376,7 @@ ifelse([$1], [],
# Generated automatically by $PROGRAM (GNU $PACKAGE $VERSION$TIMESTAMP)
# NOTE: Changes made to this file will be lost: look at ltmain.sh.
#
-# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001
+# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008
# Free Software Foundation, Inc.
#
# This file is part of GNU Libtool:
@@ -4439,6 +4613,10 @@ predeps=$lt_[]_LT_AC_TAGVAR(predeps, $1)
# shared library.
postdeps=$lt_[]_LT_AC_TAGVAR(postdeps, $1)
+# The directories searched by this compiler when creating a shared
+# library
+compiler_lib_search_dirs=$lt_[]_LT_AC_TAGVAR(compiler_lib_search_dirs, $1)
+
# The library search path used internally by the compiler when linking
# a shared library.
compiler_lib_search_path=$lt_[]_LT_AC_TAGVAR(compiler_lib_search_path, $1)
@@ -4527,7 +4705,7 @@ sys_lib_search_path_spec=$lt_sys_lib_search_path_spec
sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec
# Fix the shell variable \$srcfile for the compiler.
-fix_srcfile_path="$_LT_AC_TAGVAR(fix_srcfile_path, $1)"
+fix_srcfile_path=$lt_fix_srcfile_path
# Set to yes if exported symbols are required.
always_export_symbols=$_LT_AC_TAGVAR(always_export_symbols, $1)
@@ -4610,6 +4788,7 @@ fi
# ---------------------------------
AC_DEFUN([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE],
[AC_REQUIRE([AC_CANONICAL_HOST])
+AC_REQUIRE([LT_AC_PROG_SED])
AC_REQUIRE([AC_PROG_NM])
AC_REQUIRE([AC_OBJEXT])
# Check for command to grab the raw symbol name followed by C symbol from nm.
@@ -4646,7 +4825,7 @@ hpux*) # Its linker distinguishes data from code symbols
lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'"
lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\) $/ {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/ {\"\2\", (lt_ptr) \&\2},/p'"
;;
-linux*)
+linux* | k*bsd*-gnu)
if test "$host_cpu" = ia64; then
symcode='[[ABCDGIRSTW]]'
lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'"
@@ -4787,7 +4966,7 @@ EOF
echo "$progname: failed program was:" >&AS_MESSAGE_LOG_FD
cat conftest.$ac_ext >&5
fi
- rm -f conftest* conftst*
+ rm -rf conftest* conftst*
# Do not use the global_symbol_pipe unless it works.
if test "$pipe_works" = yes; then
@@ -4836,13 +5015,16 @@ AC_MSG_CHECKING([for $compiler option to produce PIC])
# like `-m68040'.
_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4'
;;
- beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
+ beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
# PIC is the default for these OSes.
;;
- mingw* | os2* | pw32*)
+ mingw* | cygwin* | os2* | pw32*)
# This hack is so that the source file can tell whether it is being
# built for inclusion in a dll (and should export symbols for example).
- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'
+ # Although the cygwin gcc ignores -fPIC, still need this for old-style
+ # (--disable-auto-import) libraries
+ m4_if([$1], [GCJ], [],
+ [_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
;;
darwin* | rhapsody*)
# PIC is the default on this platform
@@ -4853,7 +5035,7 @@ AC_MSG_CHECKING([for $compiler option to produce PIC])
# DJGPP does not support shared libraries at all
_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=
;;
- interix3*)
+ interix[[3-9]]*)
# Interix 3.x gcc -fpic/-fPIC options generate broken code.
# Instead, we relocate shared libraries at runtime.
;;
@@ -4879,7 +5061,7 @@ AC_MSG_CHECKING([for $compiler option to produce PIC])
esac
else
case $host_os in
- aix4* | aix5*)
+ aix[[4-9]]*)
# All AIX code is PIC.
if test "$host_cpu" = ia64; then
# AIX 5 now supports IA64 processor
@@ -4919,7 +5101,7 @@ AC_MSG_CHECKING([for $compiler option to produce PIC])
;;
esac
;;
- freebsd* | kfreebsd*-gnu | dragonfly*)
+ freebsd* | dragonfly*)
# FreeBSD uses GNU C++
;;
hpux9* | hpux10* | hpux11*)
@@ -4962,7 +5144,7 @@ AC_MSG_CHECKING([for $compiler option to produce PIC])
;;
esac
;;
- linux*)
+ linux* | k*bsd*-gnu)
case $cc_basename in
KCC*)
# KAI C++ Compiler
@@ -4975,7 +5157,7 @@ AC_MSG_CHECKING([for $compiler option to produce PIC])
_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
_LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static'
;;
- pgCC*)
+ pgCC* | pgcpp*)
# Portland Group C++ compiler.
_LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fpic'
@@ -4989,6 +5171,14 @@ AC_MSG_CHECKING([for $compiler option to produce PIC])
_LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
;;
*)
+ case `$CC -V 2>&1 | sed 5q` in
+ *Sun\ C*)
+ # Sun C++ 5.9
+ _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+ _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
+ ;;
+ esac
;;
esac
;;
@@ -5109,14 +5299,17 @@ AC_MSG_CHECKING([for $compiler option to produce PIC])
_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4'
;;
- beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
+ beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
# PIC is the default for these OSes.
;;
- mingw* | pw32* | os2*)
+ mingw* | cygwin* | pw32* | os2*)
# This hack is so that the source file can tell whether it is being
# built for inclusion in a dll (and should export symbols for example).
- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'
+ # Although the cygwin gcc ignores -fPIC, still need this for old-style
+ # (--disable-auto-import) libraries
+ m4_if([$1], [GCJ], [],
+ [_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
;;
darwin* | rhapsody*)
@@ -5125,7 +5318,7 @@ AC_MSG_CHECKING([for $compiler option to produce PIC])
_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common'
;;
- interix3*)
+ interix[[3-9]]*)
# Interix 3.x gcc -fpic/-fPIC options generate broken code.
# Instead, we relocate shared libraries at runtime.
;;
@@ -5183,10 +5376,11 @@ AC_MSG_CHECKING([for $compiler option to produce PIC])
esac
;;
- mingw* | pw32* | os2*)
+ mingw* | cygwin* | pw32* | os2*)
# This hack is so that the source file can tell whether it is being
# built for inclusion in a dll (and should export symbols for example).
- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'
+ m4_if([$1], [GCJ], [],
+ [_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
;;
hpux9* | hpux10* | hpux11*)
@@ -5216,7 +5410,7 @@ AC_MSG_CHECKING([for $compiler option to produce PIC])
_LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
;;
- linux*)
+ linux* | k*bsd*-gnu)
case $cc_basename in
icc* | ecc*)
_LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
@@ -5235,6 +5429,22 @@ AC_MSG_CHECKING([for $compiler option to produce PIC])
# All Alpha code is PIC.
_LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
;;
+ *)
+ case `$CC -V 2>&1 | sed 5q` in
+ *Sun\ C*)
+ # Sun C 5.9
+ _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+ _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ ;;
+ *Sun\ F*)
+ # Sun Fortran 8.3 passes all unrecognized flags to the linker
+ _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+ _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)=''
+ ;;
+ esac
+ ;;
esac
;;
@@ -5244,6 +5454,10 @@ AC_MSG_CHECKING([for $compiler option to produce PIC])
_LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
;;
+ rdos*)
+ _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
+ ;;
+
solaris*)
_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
_LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
@@ -5303,7 +5517,7 @@ AC_MSG_RESULT([$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)])
#
if test -n "$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)"; then
AC_LIBTOOL_COMPILER_OPTION([if $compiler PIC flag $_LT_AC_TAGVAR(lt_prog_compiler_pic, $1) works],
- _LT_AC_TAGVAR(lt_prog_compiler_pic_works, $1),
+ _LT_AC_TAGVAR(lt_cv_prog_compiler_pic_works, $1),
[$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)ifelse([$1],[],[ -DPIC],[ifelse([$1],[CXX],[ -DPIC],[])])], [],
[case $_LT_AC_TAGVAR(lt_prog_compiler_pic, $1) in
"" | " "*) ;;
@@ -5327,7 +5541,7 @@ esac
#
wl=$_LT_AC_TAGVAR(lt_prog_compiler_wl, $1) eval lt_tmp_static_flag=\"$_LT_AC_TAGVAR(lt_prog_compiler_static, $1)\"
AC_LIBTOOL_LINKER_OPTION([if $compiler static flag $lt_tmp_static_flag works],
- _LT_AC_TAGVAR(lt_prog_compiler_static_works, $1),
+ _LT_AC_TAGVAR(lt_cv_prog_compiler_static_works, $1),
$lt_tmp_static_flag,
[],
[_LT_AC_TAGVAR(lt_prog_compiler_static, $1)=])
@@ -5338,11 +5552,12 @@ AC_LIBTOOL_LINKER_OPTION([if $compiler static flag $lt_tmp_static_flag works],
# ------------------------------------
# See if the linker supports building shared libraries.
AC_DEFUN([AC_LIBTOOL_PROG_LD_SHLIBS],
-[AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries])
+[AC_REQUIRE([LT_AC_PROG_SED])dnl
+AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries])
ifelse([$1],[CXX],[
_LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
case $host_os in
- aix4* | aix5*)
+ aix[[4-9]]*)
# If we're using GNU nm, then we don't want the "-C" option.
# -C means demangle to AIX nm, but means don't demangle with GNU nm
if $NM -V 2>&1 | grep 'GNU' > /dev/null; then
@@ -5355,12 +5570,13 @@ ifelse([$1],[CXX],[
_LT_AC_TAGVAR(export_symbols_cmds, $1)="$ltdll_cmds"
;;
cygwin* | mingw*)
- _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]] /s/.* \([[^ ]]*\)/\1 DATA/;/^.* __nm__/s/^.* __nm__\([[^ ]]*\) [[^ ]]*/\1 DATA/;/^I /d;/^[[AITW]] /s/.* //'\'' | sort | uniq > $export_symbols'
+ _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/;/^.*[[ ]]__nm__/s/^.*[[ ]]__nm__\([[^ ]]*\)[[ ]][[^ ]]*/\1 DATA/;/^I[[ ]]/d;/^[[AITW]][[ ]]/s/.*[[ ]]//'\'' | sort | uniq > $export_symbols'
;;
*)
_LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
;;
esac
+ _LT_AC_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*']
],[
runpath_var=
_LT_AC_TAGVAR(allow_undefined_flag, $1)=
@@ -5391,12 +5607,14 @@ ifelse([$1],[CXX],[
# it will be wrapped by ` (' and `)$', so one must not match beginning or
# end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc',
# as well as any symbol that contains `d'.
- _LT_AC_TAGVAR(exclude_expsyms, $1)="_GLOBAL_OFFSET_TABLE_"
+ _LT_AC_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*']
# Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out
# platforms (ab)use it in PIC code, but their linkers get confused if
# the symbol is explicitly referenced. Since portable code cannot
# rely on this symbol name, it's probably fine to never include it in
# preloaded symbol tables.
+ # Exclude shared library initialization/finalization symbols.
+dnl Note also adjust exclude_expsyms for C++ above.
extract_expsyms_cmds=
# Just being paranoid about ensuring that cc_basename is set.
_LT_CC_BASENAME([$compiler])
@@ -5446,7 +5664,7 @@ ifelse([$1],[CXX],[
# See if GNU ld supports shared libraries.
case $host_os in
- aix3* | aix4* | aix5*)
+ aix[[3-9]]*)
# On AIX/PPC, the GNU linker is very broken
if test "$host_cpu" != ia64; then
_LT_AC_TAGVAR(ld_shlibs, $1)=no
@@ -5494,7 +5712,7 @@ EOF
_LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported
_LT_AC_TAGVAR(always_export_symbols, $1)=no
_LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
- _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]] /s/.* \([[^ ]]*\)/\1 DATA/'\'' | $SED -e '\''/^[[AITW]] /s/.* //'\'' | sort | uniq > $export_symbols'
+ _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/'\'' -e '\''/^[[AITW]][[ ]]/s/.*[[ ]]//'\'' | sort | uniq > $export_symbols'
if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then
_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
@@ -5512,7 +5730,7 @@ EOF
fi
;;
- interix3*)
+ interix[[3-9]]*)
_LT_AC_TAGVAR(hardcode_direct, $1)=no
_LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
@@ -5527,7 +5745,7 @@ EOF
_LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
;;
- linux*)
+ gnu* | linux* | k*bsd*-gnu)
if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
tmp_addflag=
case $cc_basename,$host_cpu in
@@ -5545,13 +5763,22 @@ EOF
ifc* | ifort*) # Intel Fortran compiler
tmp_addflag=' -nofor_main' ;;
esac
- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ case `$CC -V 2>&1 | sed 5q` in
+ *Sun\ C*) # Sun C 5.9
+ _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive'
+ tmp_sharedflag='-G' ;;
+ *Sun\ F*) # Sun Fortran 8.3
+ tmp_sharedflag='-G' ;;
+ *)
+ tmp_sharedflag='-shared' ;;
+ esac
+ _LT_AC_TAGVAR(archive_cmds, $1)='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
if test $supports_anon_versioning = yes; then
_LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $output_objdir/$libname.ver~
cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
$echo "local: *; };" >> $output_objdir/$libname.ver~
- $CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
+ $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
fi
else
_LT_AC_TAGVAR(ld_shlibs, $1)=no
@@ -5591,7 +5818,7 @@ EOF
sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*)
case `$LD -v 2>&1` in
- *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.1[[0-5]].*)
+ *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.1[[0-5]].*)
_LT_AC_TAGVAR(ld_shlibs, $1)=no
cat <<_LT_EOF 1>&2
@@ -5656,7 +5883,7 @@ _LT_EOF
fi
;;
- aix4* | aix5*)
+ aix[[4-9]]*)
if test "$host_cpu" = ia64; then
# On IA64, the linker does run time linking by default, so we don't
# have to do anything special.
@@ -5676,7 +5903,7 @@ _LT_EOF
# Test if we are trying to use run time linking or normal
# AIX style linking. If -brtl is somewhere in LDFLAGS, we
# need to do runtime linking.
- case $host_os in aix4.[[23]]|aix4.[[23]].*|aix5*)
+ case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*)
for ld_flag in $LDFLAGS; do
if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then
aix_use_runtimelinking=yes
@@ -5710,7 +5937,7 @@ _LT_EOF
strings "$collect2name" | grep resolve_lib_name >/dev/null
then
# We have reworked collect2
- _LT_AC_TAGVAR(hardcode_direct, $1)=yes
+ :
else
# We have old collect2
_LT_AC_TAGVAR(hardcode_direct, $1)=unsupported
@@ -5803,7 +6030,7 @@ _LT_EOF
# The linker will automatically build a .lib file if we build a DLL.
_LT_AC_TAGVAR(old_archive_From_new_cmds, $1)='true'
# FIXME: Should let the user specify the lib program.
- _LT_AC_TAGVAR(old_archive_cmds, $1)='lib /OUT:$oldlib$oldobjs$old_deplibs'
+ _LT_AC_TAGVAR(old_archive_cmds, $1)='lib -OUT:$oldlib$oldobjs$old_deplibs'
_LT_AC_TAGVAR(fix_srcfile_path, $1)='`cygpath -w "$srcfile"`'
_LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
;;
@@ -5836,19 +6063,18 @@ _LT_EOF
_LT_AC_TAGVAR(link_all_deplibs, $1)=yes
if test "$GCC" = yes ; then
output_verbose_link_cmd='echo'
- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring'
- _LT_AC_TAGVAR(module_cmds, $1)='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags'
- # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds
- _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
- _LT_AC_TAGVAR(module_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+ _LT_AC_TAGVAR(archive_cmds, $1)="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}"
+ _LT_AC_TAGVAR(module_cmds, $1)="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}"
+ _LT_AC_TAGVAR(archive_expsym_cmds, $1)="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}"
+ _LT_AC_TAGVAR(module_expsym_cmds, $1)="sed -e 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dar_export_syms}${_lt_dsymutil}"
else
case $cc_basename in
xlc*)
output_verbose_link_cmd='echo'
- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $verstring'
+ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $xlcverstring'
_LT_AC_TAGVAR(module_cmds, $1)='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags'
# Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds
- _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+ _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $xlcverstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
_LT_AC_TAGVAR(module_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
;;
*)
@@ -5888,7 +6114,7 @@ _LT_EOF
;;
# FreeBSD 3 and greater uses gcc -shared to do shared libraries.
- freebsd* | kfreebsd*-gnu | dragonfly*)
+ freebsd* | dragonfly*)
_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -o $lib $libobjs $deplibs $compiler_flags'
_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
_LT_AC_TAGVAR(hardcode_direct, $1)=yes
@@ -6011,15 +6237,15 @@ _LT_EOF
openbsd*)
if test -f /usr/libexec/ld.so; then
- _LT_AC_TAGVAR(hardcode_direct, $1)=yes
- _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
- if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+ _LT_AC_TAGVAR(hardcode_direct, $1)=yes
+ _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+ if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
_LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols'
_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
_LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
- else
- case $host_os in
+ else
+ case $host_os in
openbsd[[01]].* | openbsd2.[[0-7]] | openbsd2.[[0-7]].*)
_LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
@@ -6028,10 +6254,10 @@ _LT_EOF
_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
;;
- esac
+ esac
fi
else
- _LT_AC_TAGVAR(ld_shlibs, $1)=no
+ _LT_AC_TAGVAR(ld_shlibs, $1)=no
fi
;;
@@ -6090,17 +6316,16 @@ _LT_EOF
case $host_os in
solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
*)
- # The compiler driver will combine linker options so we
- # cannot just pass the convience library names through
- # without $wl, iff we do not link with $LD.
- # Luckily, gcc supports the same syntax we need for Sun Studio.
+ # The compiler driver will combine and reorder linker options,
+ # but understands `-z linker_flag'. GCC discards it without `$wl',
+ # but is careful enough not to reorder.
# Supported since Solaris 2.6 (maybe 2.5.1?)
- case $wlarc in
- '')
- _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract' ;;
- *)
- _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}-z ${wl}defaultextract' ;;
- esac ;;
+ if test "$GCC" = yes; then
+ _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract'
+ else
+ _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract'
+ fi
+ ;;
esac
_LT_AC_TAGVAR(link_all_deplibs, $1)=yes
;;
@@ -6157,7 +6382,7 @@ _LT_EOF
fi
;;
- sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7*)
+ sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*)
_LT_AC_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
_LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
_LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
@@ -6232,7 +6457,7 @@ x|xyes)
# to ld, don't add -lc before -lgcc.
AC_MSG_CHECKING([whether -lc should be explicitly linked in])
$rm conftest*
- printf "$lt_simple_compile_test_code" > conftest.$ac_ext
+ echo "$lt_simple_compile_test_code" > conftest.$ac_ext
if AC_TRY_EVAL(ac_compile) 2>conftest.err; then
soname=conftest
@@ -6335,6 +6560,30 @@ AC_DEFUN([LT_AC_PROG_RC],
[AC_CHECK_TOOL(RC, windres, no)
])
+
+# Cheap backport of AS_EXECUTABLE_P and required macros
+# from Autoconf 2.59; we should not use $as_executable_p directly.
+
+# _AS_TEST_PREPARE
+# ----------------
+m4_ifndef([_AS_TEST_PREPARE],
+[m4_defun([_AS_TEST_PREPARE],
+[if test -x / >/dev/null 2>&1; then
+ as_executable_p='test -x'
+else
+ as_executable_p='test -f'
+fi
+])])# _AS_TEST_PREPARE
+
+# AS_EXECUTABLE_P
+# ---------------
+# Check whether a file is executable.
+m4_ifndef([AS_EXECUTABLE_P],
+[m4_defun([AS_EXECUTABLE_P],
+[AS_REQUIRE([_AS_TEST_PREPARE])dnl
+$as_executable_p $1[]dnl
+])])# AS_EXECUTABLE_P
+
# NOTE: This macro has been submitted for inclusion into #
# GNU Autoconf as AC_PROG_SED. When it is available in #
# a released version of Autoconf we should remove this #
@@ -6355,12 +6604,13 @@ do
test -z "$as_dir" && as_dir=.
for lt_ac_prog in sed gsed; do
for ac_exec_ext in '' $ac_executable_extensions; do
- if $as_executable_p "$as_dir/$lt_ac_prog$ac_exec_ext"; then
+ if AS_EXECUTABLE_P(["$as_dir/$lt_ac_prog$ac_exec_ext"]); then
lt_ac_sed_list="$lt_ac_sed_list $as_dir/$lt_ac_prog$ac_exec_ext"
fi
done
done
done
+IFS=$as_save_IFS
lt_ac_max=0
lt_ac_count=0
# Add /usr/xpg4/bin/sed as it is typically found on Solaris
@@ -6393,6 +6643,7 @@ for lt_ac_sed in $lt_ac_sed_list /usr/xpg4/bin/sed; do
done
])
SED=$lt_cv_path_SED
+AC_SUBST([SED])
AC_MSG_RESULT([$SED])
])
@@ -7427,7 +7678,7 @@ AC_DEFUN([XORG_MACROS_VERSION],[
XORG_MACROS_needed_major=`echo $XORG_MACROS_needed_version | sed 's/\..*$//'`
XORG_MACROS_needed_minor=`echo $XORG_MACROS_needed_version | sed -e 's/^[0-9]*\.//' -e 's/\..*$//'`]
AC_MSG_CHECKING([if xorg-macros used to generate configure is at least ${XORG_MACROS_needed_major}.${XORG_MACROS_needed_minor}])
- [XORG_MACROS_version=1.1.5
+ [XORG_MACROS_version=1.1.6
XORG_MACROS_major=`echo $XORG_MACROS_version | sed 's/\..*$//'`
XORG_MACROS_minor=`echo $XORG_MACROS_version | sed -e 's/^[0-9]*\.//' -e 's/\..*$//'`]
if test $XORG_MACROS_major -ne $XORG_MACROS_needed_major ; then
@@ -7576,7 +7827,11 @@ AC_DEFUN([XORG_CHECK_LINUXDOC],[
XORG_SGML_PATH=$prefix/share/sgml
HAVE_DEFS_ENT=
-AC_CHECK_FILE([$XORG_SGML_PATH/X11/defs.ent], [HAVE_DEFS_ENT=yes])
+if test x"$cross_compiling" = x"yes" ; then
+ HAVE_DEFS_ENT=no
+else
+ AC_CHECK_FILE([$XORG_SGML_PATH/X11/defs.ent], [HAVE_DEFS_ENT=yes])
+fi
AC_PATH_PROG(LINUXDOC, linuxdoc)
AC_PATH_PROG(PS2PDF, ps2pdf)
@@ -7897,14 +8152,14 @@ AC_DEFUN([XORG_RELEASE_VERSION],[
AC_DEFINE_UNQUOTED([PACKAGE_VERSION_MAJOR],
[`echo $PACKAGE_VERSION | cut -d . -f 1`],
[Major version of this package])
- PVM=`echo $PACKAGE_VERSION | cut -d . -f 2`
+ PVM=`echo $PACKAGE_VERSION | cut -d . -f 2 | cut -d - -f 1`
if test "x$PVM" = "x"; then
PVM="0"
fi
AC_DEFINE_UNQUOTED([PACKAGE_VERSION_MINOR],
[$PVM],
[Minor version of this package])
- PVP=`echo $PACKAGE_VERSION | cut -d . -f 3`
+ PVP=`echo $PACKAGE_VERSION | cut -d . -f 3 | cut -d - -f 1`
if test "x$PVP" = "x"; then
PVP="0"
fi
diff --git a/driver/xf86-video-mga/config.h.in b/driver/xf86-video-mga/config.h.in
index 0e275e709..e3da88b26 100644
--- a/driver/xf86-video-mga/config.h.in
+++ b/driver/xf86-video-mga/config.h.in
@@ -32,6 +32,9 @@
/* Define to 1 if you have the <unistd.h> header file. */
#undef HAVE_UNISTD_H
+/* Have xf86ModeBandwidth */
+#undef HAVE_XF86MODEBANDWIDTH
+
/* Name of package */
#undef PACKAGE
@@ -50,6 +53,15 @@
/* Define to the version of this package. */
#undef PACKAGE_VERSION
+/* Major version of this package */
+#undef PACKAGE_VERSION_MAJOR
+
+/* Minor version of this package */
+#undef PACKAGE_VERSION_MINOR
+
+/* Patch version of this package */
+#undef PACKAGE_VERSION_PATCHLEVEL
+
/* Define to 1 if you have the ANSI C header files. */
#undef STDC_HEADERS
diff --git a/driver/xf86-video-mga/configure b/driver/xf86-video-mga/configure
index 12dfc5c22..78aa9bbaa 100644
--- a/driver/xf86-video-mga/configure
+++ b/driver/xf86-video-mga/configure
@@ -1,6 +1,6 @@
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.59 for xf86-video-mga 1.4.6.1.
+# Generated by GNU Autoconf 2.59 for xf86-video-mga 1.4.9.
#
# Report bugs to <https://bugs.freedesktop.org/enter_bug.cgi?product=xorg>.
#
@@ -423,8 +423,8 @@ SHELL=${CONFIG_SHELL-/bin/sh}
# Identity of this package.
PACKAGE_NAME='xf86-video-mga'
PACKAGE_TARNAME='xf86-video-mga'
-PACKAGE_VERSION='1.4.6.1'
-PACKAGE_STRING='xf86-video-mga 1.4.6.1'
+PACKAGE_VERSION='1.4.9'
+PACKAGE_STRING='xf86-video-mga 1.4.9'
PACKAGE_BUGREPORT='https://bugs.freedesktop.org/enter_bug.cgi?product=xorg'
ac_unique_file="Makefile.am"
@@ -465,7 +465,7 @@ ac_includes_default="\
# include <unistd.h>
#endif"
-ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA CYGPATH_W PACKAGE VERSION ACLOCAL AUTOCONF AUTOMAKE AUTOHEADER MAKEINFO install_sh STRIP ac_ct_STRIP INSTALL_STRIP_PROGRAM mkdir_p AWK SET_MAKE am__leading_dot AMTAR am__tar am__untar MAINTAINER_MODE_TRUE MAINTAINER_MODE_FALSE MAINT build build_cpu build_vendor build_os host host_cpu host_vendor host_os CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT DEPDIR am__include am__quote AMDEP_TRUE AMDEP_FALSE AMDEPBACKSLASH CCDEPMODE am__fastdepCC_TRUE am__fastdepCC_FALSE EGREP LN_S ECHO AR ac_ct_AR RANLIB ac_ct_RANLIB CPP CXX CXXFLAGS ac_ct_CXX CXXDEPMODE am__fastdepCXX_TRUE am__fastdepCXX_FALSE CXXCPP F77 FFLAGS ac_ct_F77 LIBTOOL PKG_CONFIG ac_pt_PKG_CONFIG XORG_CFLAGS XORG_LIBS DRI_TRUE DRI_FALSE DRI_CFLAGS DRI_LIBS USE_XAA_TRUE USE_XAA_FALSE USE_EXA_TRUE USE_EXA_FALSE moduledir DRIVER_NAME APP_MAN_SUFFIX LIB_MAN_SUFFIX FILE_MAN_SUFFIX MISC_MAN_SUFFIX DRIVER_MAN_SUFFIX ADMIN_MAN_SUFFIX APP_MAN_DIR LIB_MAN_DIR FILE_MAN_DIR MISC_MAN_DIR DRIVER_MAN_DIR ADMIN_MAN_DIR LIBOBJS LTLIBOBJS'
+ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA CYGPATH_W PACKAGE VERSION ACLOCAL AUTOCONF AUTOMAKE AUTOHEADER MAKEINFO install_sh STRIP ac_ct_STRIP INSTALL_STRIP_PROGRAM mkdir_p AWK SET_MAKE am__leading_dot AMTAR am__tar am__untar MAINTAINER_MODE_TRUE MAINTAINER_MODE_FALSE MAINT build build_cpu build_vendor build_os host host_cpu host_vendor host_os CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT DEPDIR am__include am__quote AMDEP_TRUE AMDEP_FALSE AMDEPBACKSLASH CCDEPMODE am__fastdepCC_TRUE am__fastdepCC_FALSE SED EGREP LN_S ECHO AR ac_ct_AR RANLIB ac_ct_RANLIB DSYMUTIL ac_ct_DSYMUTIL NMEDIT ac_ct_NMEDIT CPP CXX CXXFLAGS ac_ct_CXX CXXDEPMODE am__fastdepCXX_TRUE am__fastdepCXX_FALSE CXXCPP F77 FFLAGS ac_ct_F77 LIBTOOL PKG_CONFIG ac_pt_PKG_CONFIG XORG_CFLAGS XORG_LIBS DRI_TRUE DRI_FALSE DRI_CFLAGS DRI_LIBS PCIACCESS_CFLAGS PCIACCESS_LIBS XSERVER_LIBPCIACCESS_TRUE XSERVER_LIBPCIACCESS_FALSE USE_XAA_TRUE USE_XAA_FALSE USE_EXA_TRUE USE_EXA_FALSE moduledir DRIVER_NAME APP_MAN_SUFFIX LIB_MAN_SUFFIX FILE_MAN_SUFFIX MISC_MAN_SUFFIX DRIVER_MAN_SUFFIX ADMIN_MAN_SUFFIX APP_MAN_DIR LIB_MAN_DIR FILE_MAN_DIR MISC_MAN_DIR DRIVER_MAN_DIR ADMIN_MAN_DIR LIBOBJS LTLIBOBJS'
ac_subst_files=''
# Initialize some variables set by options.
@@ -966,6 +966,14 @@ ac_env_DRI_LIBS_set=${DRI_LIBS+set}
ac_env_DRI_LIBS_value=$DRI_LIBS
ac_cv_env_DRI_LIBS_set=${DRI_LIBS+set}
ac_cv_env_DRI_LIBS_value=$DRI_LIBS
+ac_env_PCIACCESS_CFLAGS_set=${PCIACCESS_CFLAGS+set}
+ac_env_PCIACCESS_CFLAGS_value=$PCIACCESS_CFLAGS
+ac_cv_env_PCIACCESS_CFLAGS_set=${PCIACCESS_CFLAGS+set}
+ac_cv_env_PCIACCESS_CFLAGS_value=$PCIACCESS_CFLAGS
+ac_env_PCIACCESS_LIBS_set=${PCIACCESS_LIBS+set}
+ac_env_PCIACCESS_LIBS_value=$PCIACCESS_LIBS
+ac_cv_env_PCIACCESS_LIBS_set=${PCIACCESS_LIBS+set}
+ac_cv_env_PCIACCESS_LIBS_value=$PCIACCESS_LIBS
#
# Report the --help message.
@@ -974,7 +982,7 @@ if test "$ac_init_help" = "long"; then
# Omit some internal or obsolete options to make the list less imposing.
# This message is too long to be a string in the A/UX 3.1 sh.
cat <<_ACEOF
-\`configure' configures xf86-video-mga 1.4.6.1 to adapt to many kinds of systems.
+\`configure' configures xf86-video-mga 1.4.9 to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]...
@@ -1040,7 +1048,7 @@ fi
if test -n "$ac_init_help"; then
case $ac_init_help in
- short | recursive ) echo "Configuration of xf86-video-mga 1.4.6.1:";;
+ short | recursive ) echo "Configuration of xf86-video-mga 1.4.9:";;
esac
cat <<\_ACEOF
@@ -1093,6 +1101,10 @@ Some influential environment variables:
XORG_LIBS linker flags for XORG, overriding pkg-config
DRI_CFLAGS C compiler flags for DRI, overriding pkg-config
DRI_LIBS linker flags for DRI, overriding pkg-config
+ PCIACCESS_CFLAGS
+ C compiler flags for PCIACCESS, overriding pkg-config
+ PCIACCESS_LIBS
+ linker flags for PCIACCESS, overriding pkg-config
Use these variables to override the choices made by `configure' or to help
it to find libraries and programs with nonstandard names/locations.
@@ -1193,7 +1205,7 @@ fi
test -n "$ac_init_help" && exit 0
if $ac_init_version; then
cat <<\_ACEOF
-xf86-video-mga configure 1.4.6.1
+xf86-video-mga configure 1.4.9
generated by GNU Autoconf 2.59
Copyright (C) 2003 Free Software Foundation, Inc.
@@ -1207,7 +1219,7 @@ cat >&5 <<_ACEOF
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
-It was created by xf86-video-mga $as_me 1.4.6.1, which was
+It was created by xf86-video-mga $as_me 1.4.9, which was
generated by GNU Autoconf 2.59. Invocation command line was
$ $0 $@
@@ -1564,7 +1576,7 @@ cat >>confdefs.h <<_ACEOF
#define PACKAGE_VERSION_MAJOR `echo $PACKAGE_VERSION | cut -d . -f 1`
_ACEOF
- PVM=`echo $PACKAGE_VERSION | cut -d . -f 2`
+ PVM=`echo $PACKAGE_VERSION | cut -d . -f 2 | cut -d - -f 1`
if test "x$PVM" = "x"; then
PVM="0"
fi
@@ -1573,7 +1585,7 @@ cat >>confdefs.h <<_ACEOF
#define PACKAGE_VERSION_MINOR $PVM
_ACEOF
- PVP=`echo $PACKAGE_VERSION | cut -d . -f 3`
+ PVP=`echo $PACKAGE_VERSION | cut -d . -f 3 | cut -d - -f 1`
if test "x$PVP" = "x"; then
PVP="0"
fi
@@ -1850,7 +1862,7 @@ fi
# Define the identity of the package.
PACKAGE='xf86-video-mga'
- VERSION='1.4.6.1'
+ VERSION='1.4.9'
cat >>confdefs.h <<_ACEOF
@@ -3258,6 +3270,7 @@ do
done
done
done
+IFS=$as_save_IFS
lt_ac_max=0
lt_ac_count=0
# Add /usr/xpg4/bin/sed as it is typically found on Solaris
@@ -3292,6 +3305,7 @@ done
fi
SED=$lt_cv_path_SED
+
echo "$as_me:$LINENO: result: $SED" >&5
echo "${ECHO_T}$SED" >&6
@@ -3506,8 +3520,8 @@ else
echo "${ECHO_T}no, using $LN_S" >&6
fi
-echo "$as_me:$LINENO: checking how to recognise dependent libraries" >&5
-echo $ECHO_N "checking how to recognise dependent libraries... $ECHO_C" >&6
+echo "$as_me:$LINENO: checking how to recognize dependent libraries" >&5
+echo $ECHO_N "checking how to recognize dependent libraries... $ECHO_C" >&6
if test "${lt_cv_deplibs_check_method+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
@@ -3526,7 +3540,7 @@ lt_cv_deplibs_check_method='unknown'
# whether `pass_all' will *always* work, you probably want this one.
case $host_os in
-aix4* | aix5*)
+aix[4-9]*)
lt_cv_deplibs_check_method=pass_all
;;
@@ -3548,16 +3562,22 @@ cygwin*)
mingw* | pw32*)
# Base MSYS/MinGW do not provide the 'file' command needed by
- # func_win32_libid shell function, so use a weaker test based on 'objdump'.
- lt_cv_deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?'
- lt_cv_file_magic_cmd='$OBJDUMP -f'
+ # func_win32_libid shell function, so use a weaker test based on 'objdump',
+ # unless we find 'file', for example because we are cross-compiling.
+ if ( file / ) >/dev/null 2>&1; then
+ lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
+ lt_cv_file_magic_cmd='func_win32_libid'
+ else
+ lt_cv_deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?'
+ lt_cv_file_magic_cmd='$OBJDUMP -f'
+ fi
;;
darwin* | rhapsody*)
lt_cv_deplibs_check_method=pass_all
;;
-freebsd* | kfreebsd*-gnu | dragonfly*)
+freebsd* | dragonfly*)
if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
case $host_cpu in
i*86 )
@@ -3595,7 +3615,7 @@ hpux10.20* | hpux11*)
esac
;;
-interix3*)
+interix[3-9]*)
# PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here
lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so|\.a)$'
;;
@@ -3611,7 +3631,7 @@ irix5* | irix6* | nonstopux*)
;;
# This must be Linux ELF.
-linux*)
+linux* | k*bsd*-gnu)
lt_cv_deplibs_check_method=pass_all
;;
@@ -3645,6 +3665,10 @@ osf3* | osf4* | osf5*)
lt_cv_deplibs_check_method=pass_all
;;
+rdos*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
solaris*)
lt_cv_deplibs_check_method=pass_all
;;
@@ -3732,7 +3756,7 @@ ia64-*-hpux*)
;;
*-*-irix6*)
# Find out which ABI we are using.
- echo '#line 3735 "configure"' > conftest.$ac_ext
+ echo '#line 3759 "configure"' > conftest.$ac_ext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
(eval $ac_compile) 2>&5
ac_status=$?
@@ -3767,7 +3791,8 @@ ia64-*-hpux*)
rm -rf conftest*
;;
-x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*|s390*-*linux*|sparc*-*linux*)
+x86_64-*kfreebsd*-gnu|x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*| \
+s390*-*linux*|sparc*-*linux*)
# Find out which ABI we are using.
echo 'int i;' > conftest.$ac_ext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
@@ -3778,6 +3803,9 @@ x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*|s390*-*linux*|sparc*-*linux*)
case `/usr/bin/file conftest.o` in
*32-bit*)
case $host in
+ x86_64-*kfreebsd*-gnu)
+ LD="${LD-ld} -m elf_i386_fbsd"
+ ;;
x86_64-*linux*)
LD="${LD-ld} -m elf_i386"
;;
@@ -3794,6 +3822,9 @@ x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*|s390*-*linux*|sparc*-*linux*)
;;
*64-bit*)
case $host in
+ x86_64-*kfreebsd*-gnu)
+ LD="${LD-ld} -m elf_x86_64_fbsd"
+ ;;
x86_64-*linux*)
LD="${LD-ld} -m elf_x86_64"
;;
@@ -3900,7 +3931,11 @@ sparc*-*solaris*)
*64-bit*)
case $lt_cv_prog_gnu_ld in
yes*) LD="${LD-ld} -m elf64_sparc" ;;
- *) LD="${LD-ld} -64" ;;
+ *)
+ if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then
+ LD="${LD-ld} -64"
+ fi
+ ;;
esac
;;
esac
@@ -5331,7 +5366,7 @@ fi
# Provide some information about the compiler.
-echo "$as_me:5334:" \
+echo "$as_me:5369:" \
"checking for Fortran 77 compiler version" >&5
ac_compiler=`set X $ac_compile; echo $2`
{ (eval echo "$as_me:$LINENO: \"$ac_compiler --version </dev/null >&5\"") >&5
@@ -5478,7 +5513,6 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu
# Autoconf 2.13's AC_OBJEXT and AC_EXEEXT macros only works for C compilers!
-
# find the maximum length of command line arguments
echo "$as_me:$LINENO: checking the maximum length of command line arguments" >&5
echo $ECHO_N "checking the maximum length of command line arguments... $ECHO_C" >&6
@@ -5565,24 +5599,27 @@ else
fi
;;
*)
- # If test is not a shell built-in, we'll probably end up computing a
- # maximum length that is only half of the actual maximum length, but
- # we can't tell.
- SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}}
- while (test "X"`$SHELL $0 --fallback-echo "X$teststring" 2>/dev/null` \
+ lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null`
+ if test -n "$lt_cv_sys_max_cmd_len"; then
+ lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
+ lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
+ else
+ SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}}
+ while (test "X"`$SHELL $0 --fallback-echo "X$teststring" 2>/dev/null` \
= "XX$teststring") >/dev/null 2>&1 &&
- new_result=`expr "X$teststring" : ".*" 2>&1` &&
- lt_cv_sys_max_cmd_len=$new_result &&
- test $i != 17 # 1/2 MB should be enough
- do
- i=`expr $i + 1`
- teststring=$teststring$teststring
- done
- teststring=
- # Add a significant safety factor because C++ compilers can tack on massive
- # amounts of additional arguments before passing them to the linker.
- # It appears as though 1/2 is a usable value.
- lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2`
+ new_result=`expr "X$teststring" : ".*" 2>&1` &&
+ lt_cv_sys_max_cmd_len=$new_result &&
+ test $i != 17 # 1/2 MB should be enough
+ do
+ i=`expr $i + 1`
+ teststring=$teststring$teststring
+ done
+ teststring=
+ # Add a significant safety factor because C++ compilers can tack on massive
+ # amounts of additional arguments before passing them to the linker.
+ # It appears as though 1/2 is a usable value.
+ lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2`
+ fi
;;
esac
@@ -5599,6 +5636,7 @@ fi
+
# Check for command to grab the raw symbol name followed by C symbol from nm.
echo "$as_me:$LINENO: checking command to parse $NM output from $compiler object" >&5
echo $ECHO_N "checking command to parse $NM output from $compiler object... $ECHO_C" >&6
@@ -5636,7 +5674,7 @@ hpux*) # Its linker distinguishes data from code symbols
lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'"
lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\) $/ {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"\2\", (lt_ptr) \&\2},/p'"
;;
-linux*)
+linux* | k*bsd*-gnu)
if test "$host_cpu" = ia64; then
symcode='[ABCDGIRSTW]'
lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'"
@@ -5789,7 +5827,7 @@ EOF
echo "$progname: failed program was:" >&5
cat conftest.$ac_ext >&5
fi
- rm -f conftest* conftst*
+ rm -rf conftest* conftst*
# Do not use the global_symbol_pipe unless it works.
if test "$pipe_works" = yes; then
@@ -6139,7 +6177,7 @@ test -z "$STRIP" && STRIP=:
test -z "$ac_objext" && ac_objext=o
# Determine commands to create old-style static archives.
-old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs$old_deplibs'
+old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs'
old_postinstall_cmds='chmod 644 $oldlib'
old_postuninstall_cmds=
@@ -6301,6 +6339,289 @@ fi
;;
esac
+
+ case $host_os in
+ rhapsody* | darwin*)
+ if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "${ac_tool_prefix}dsymutil", so it can be a program name with args.
+set dummy ${ac_tool_prefix}dsymutil; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_DSYMUTIL+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ if test -n "$DSYMUTIL"; then
+ ac_cv_prog_DSYMUTIL="$DSYMUTIL" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_DSYMUTIL="${ac_tool_prefix}dsymutil"
+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+
+fi
+fi
+DSYMUTIL=$ac_cv_prog_DSYMUTIL
+if test -n "$DSYMUTIL"; then
+ echo "$as_me:$LINENO: result: $DSYMUTIL" >&5
+echo "${ECHO_T}$DSYMUTIL" >&6
+else
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+fi
+if test -z "$ac_cv_prog_DSYMUTIL"; then
+ ac_ct_DSYMUTIL=$DSYMUTIL
+ # Extract the first word of "dsymutil", so it can be a program name with args.
+set dummy dsymutil; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_ac_ct_DSYMUTIL+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ if test -n "$ac_ct_DSYMUTIL"; then
+ ac_cv_prog_ac_ct_DSYMUTIL="$ac_ct_DSYMUTIL" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_ac_ct_DSYMUTIL="dsymutil"
+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+
+ test -z "$ac_cv_prog_ac_ct_DSYMUTIL" && ac_cv_prog_ac_ct_DSYMUTIL=":"
+fi
+fi
+ac_ct_DSYMUTIL=$ac_cv_prog_ac_ct_DSYMUTIL
+if test -n "$ac_ct_DSYMUTIL"; then
+ echo "$as_me:$LINENO: result: $ac_ct_DSYMUTIL" >&5
+echo "${ECHO_T}$ac_ct_DSYMUTIL" >&6
+else
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+ DSYMUTIL=$ac_ct_DSYMUTIL
+else
+ DSYMUTIL="$ac_cv_prog_DSYMUTIL"
+fi
+
+ if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "${ac_tool_prefix}nmedit", so it can be a program name with args.
+set dummy ${ac_tool_prefix}nmedit; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_NMEDIT+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ if test -n "$NMEDIT"; then
+ ac_cv_prog_NMEDIT="$NMEDIT" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_NMEDIT="${ac_tool_prefix}nmedit"
+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+
+fi
+fi
+NMEDIT=$ac_cv_prog_NMEDIT
+if test -n "$NMEDIT"; then
+ echo "$as_me:$LINENO: result: $NMEDIT" >&5
+echo "${ECHO_T}$NMEDIT" >&6
+else
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+fi
+if test -z "$ac_cv_prog_NMEDIT"; then
+ ac_ct_NMEDIT=$NMEDIT
+ # Extract the first word of "nmedit", so it can be a program name with args.
+set dummy nmedit; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_ac_ct_NMEDIT+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ if test -n "$ac_ct_NMEDIT"; then
+ ac_cv_prog_ac_ct_NMEDIT="$ac_ct_NMEDIT" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_ac_ct_NMEDIT="nmedit"
+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+
+ test -z "$ac_cv_prog_ac_ct_NMEDIT" && ac_cv_prog_ac_ct_NMEDIT=":"
+fi
+fi
+ac_ct_NMEDIT=$ac_cv_prog_ac_ct_NMEDIT
+if test -n "$ac_ct_NMEDIT"; then
+ echo "$as_me:$LINENO: result: $ac_ct_NMEDIT" >&5
+echo "${ECHO_T}$ac_ct_NMEDIT" >&6
+else
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+ NMEDIT=$ac_ct_NMEDIT
+else
+ NMEDIT="$ac_cv_prog_NMEDIT"
+fi
+
+
+ echo "$as_me:$LINENO: checking for -single_module linker flag" >&5
+echo $ECHO_N "checking for -single_module linker flag... $ECHO_C" >&6
+if test "${lt_cv_apple_cc_single_mod+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ lt_cv_apple_cc_single_mod=no
+ if test -z "${LT_MULTI_MODULE}"; then
+ # By default we will add the -single_module flag. You can override
+ # by either setting the environment variable LT_MULTI_MODULE
+ # non-empty at configure time, or by adding -multi_module to the
+ # link flags.
+ echo "int foo(void){return 1;}" > conftest.c
+ $LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \
+ -dynamiclib ${wl}-single_module conftest.c
+ if test -f libconftest.dylib; then
+ lt_cv_apple_cc_single_mod=yes
+ rm -rf libconftest.dylib*
+ fi
+ rm conftest.c
+ fi
+fi
+echo "$as_me:$LINENO: result: $lt_cv_apple_cc_single_mod" >&5
+echo "${ECHO_T}$lt_cv_apple_cc_single_mod" >&6
+ echo "$as_me:$LINENO: checking for -exported_symbols_list linker flag" >&5
+echo $ECHO_N "checking for -exported_symbols_list linker flag... $ECHO_C" >&6
+if test "${lt_cv_ld_exported_symbols_list+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ lt_cv_ld_exported_symbols_list=no
+ save_LDFLAGS=$LDFLAGS
+ echo "_main" > conftest.sym
+ LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym"
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ lt_cv_ld_exported_symbols_list=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+lt_cv_ld_exported_symbols_list=no
+fi
+rm -f conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+ LDFLAGS="$save_LDFLAGS"
+
+fi
+echo "$as_me:$LINENO: result: $lt_cv_ld_exported_symbols_list" >&5
+echo "${ECHO_T}$lt_cv_ld_exported_symbols_list" >&6
+ case $host_os in
+ rhapsody* | darwin1.[0123])
+ _lt_dar_allow_undefined='${wl}-undefined ${wl}suppress' ;;
+ darwin1.*)
+ _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;;
+ darwin*)
+ # if running on 10.5 or later, the deployment target defaults
+ # to the OS version, if on x86, and 10.4, the deployment
+ # target defaults to 10.4. Don't you love it?
+ case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in
+ 10.0,*86*-darwin8*|10.0,*-darwin[91]*)
+ _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;;
+ 10.[012]*)
+ _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;;
+ 10.*)
+ _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;;
+ esac
+ ;;
+ esac
+ if test "$lt_cv_apple_cc_single_mod" = "yes"; then
+ _lt_dar_single_mod='$single_module'
+ fi
+ if test "$lt_cv_ld_exported_symbols_list" = "yes"; then
+ _lt_dar_export_syms=' ${wl}-exported_symbols_list,$output_objdir/${libname}-symbols.expsym'
+ else
+ _lt_dar_export_syms="~$NMEDIT -s \$output_objdir/\${libname}-symbols.expsym \${lib}"
+ fi
+ if test "$DSYMUTIL" != ":"; then
+ _lt_dsymutil="~$DSYMUTIL \$lib || :"
+ else
+ _lt_dsymutil=
+ fi
+ ;;
+ esac
+
+
enable_dlopen=no
enable_win32_dll=no
@@ -6339,10 +6660,10 @@ objext=o
objext=$objext
# Code to be used in simple compile tests
-lt_simple_compile_test_code="int some_variable = 0;\n"
+lt_simple_compile_test_code="int some_variable = 0;"
# Code to be used in simple link tests
-lt_simple_link_test_code='int main(){return(0);}\n'
+lt_simple_link_test_code='int main(){return(0);}'
# If no C compiler was specified, use CC.
@@ -6357,16 +6678,16 @@ compiler=$CC
# save warnings/boilerplate of simple test code
ac_outfile=conftest.$ac_objext
-printf "$lt_simple_compile_test_code" >conftest.$ac_ext
+echo "$lt_simple_compile_test_code" >conftest.$ac_ext
eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
_lt_compiler_boilerplate=`cat conftest.err`
$rm conftest*
ac_outfile=conftest.$ac_objext
-printf "$lt_simple_link_test_code" >conftest.$ac_ext
+echo "$lt_simple_link_test_code" >conftest.$ac_ext
eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
_lt_linker_boilerplate=`cat conftest.err`
-$rm conftest*
+$rm -r conftest*
@@ -6383,7 +6704,7 @@ if test "${lt_cv_prog_compiler_rtti_exceptions+set}" = set; then
else
lt_cv_prog_compiler_rtti_exceptions=no
ac_outfile=conftest.$ac_objext
- printf "$lt_simple_compile_test_code" > conftest.$ac_ext
+ echo "$lt_simple_compile_test_code" > conftest.$ac_ext
lt_compiler_flag="-fno-rtti -fno-exceptions"
# Insert the option either (1) after the last *FLAGS variable, or
# (2) before a word containing "conftest.", or (3) at the end.
@@ -6394,11 +6715,11 @@ else
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
- (eval echo "\"\$as_me:6397: $lt_compile\"" >&5)
+ (eval echo "\"\$as_me:6718: $lt_compile\"" >&5)
(eval "$lt_compile" 2>conftest.err)
ac_status=$?
cat conftest.err >&5
- echo "$as_me:6401: \$? = $ac_status" >&5
+ echo "$as_me:6722: \$? = $ac_status" >&5
if (exit $ac_status) && test -s "$ac_outfile"; then
# The compiler can only warn and ignore the option if not recognized
# So say no if there are warnings other than the usual output.
@@ -6449,13 +6770,15 @@ echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6
lt_prog_compiler_pic='-m68020 -resident32 -malways-restore-a4'
;;
- beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
+ beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
# PIC is the default for these OSes.
;;
- mingw* | pw32* | os2*)
+ mingw* | cygwin* | pw32* | os2*)
# This hack is so that the source file can tell whether it is being
# built for inclusion in a dll (and should export symbols for example).
+ # Although the cygwin gcc ignores -fPIC, still need this for old-style
+ # (--disable-auto-import) libraries
lt_prog_compiler_pic='-DDLL_EXPORT'
;;
@@ -6465,7 +6788,7 @@ echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6
lt_prog_compiler_pic='-fno-common'
;;
- interix3*)
+ interix[3-9]*)
# Interix 3.x gcc -fpic/-fPIC options generate broken code.
# Instead, we relocate shared libraries at runtime.
;;
@@ -6523,7 +6846,7 @@ echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6
esac
;;
- mingw* | pw32* | os2*)
+ mingw* | cygwin* | pw32* | os2*)
# This hack is so that the source file can tell whether it is being
# built for inclusion in a dll (and should export symbols for example).
lt_prog_compiler_pic='-DDLL_EXPORT'
@@ -6556,7 +6879,7 @@ echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6
lt_prog_compiler_static='-Bstatic'
;;
- linux*)
+ linux* | k*bsd*-gnu)
case $cc_basename in
icc* | ecc*)
lt_prog_compiler_wl='-Wl,'
@@ -6575,6 +6898,22 @@ echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6
# All Alpha code is PIC.
lt_prog_compiler_static='-non_shared'
;;
+ *)
+ case `$CC -V 2>&1 | sed 5q` in
+ *Sun\ C*)
+ # Sun C 5.9
+ lt_prog_compiler_pic='-KPIC'
+ lt_prog_compiler_static='-Bstatic'
+ lt_prog_compiler_wl='-Wl,'
+ ;;
+ *Sun\ F*)
+ # Sun Fortran 8.3 passes all unrecognized flags to the linker
+ lt_prog_compiler_pic='-KPIC'
+ lt_prog_compiler_static='-Bstatic'
+ lt_prog_compiler_wl=''
+ ;;
+ esac
+ ;;
esac
;;
@@ -6584,6 +6923,10 @@ echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6
lt_prog_compiler_static='-non_shared'
;;
+ rdos*)
+ lt_prog_compiler_static='-non_shared'
+ ;;
+
solaris*)
lt_prog_compiler_pic='-KPIC'
lt_prog_compiler_static='-Bstatic'
@@ -6646,12 +6989,12 @@ if test -n "$lt_prog_compiler_pic"; then
echo "$as_me:$LINENO: checking if $compiler PIC flag $lt_prog_compiler_pic works" >&5
echo $ECHO_N "checking if $compiler PIC flag $lt_prog_compiler_pic works... $ECHO_C" >&6
-if test "${lt_prog_compiler_pic_works+set}" = set; then
+if test "${lt_cv_prog_compiler_pic_works+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
- lt_prog_compiler_pic_works=no
+ lt_cv_prog_compiler_pic_works=no
ac_outfile=conftest.$ac_objext
- printf "$lt_simple_compile_test_code" > conftest.$ac_ext
+ echo "$lt_simple_compile_test_code" > conftest.$ac_ext
lt_compiler_flag="$lt_prog_compiler_pic -DPIC"
# Insert the option either (1) after the last *FLAGS variable, or
# (2) before a word containing "conftest.", or (3) at the end.
@@ -6662,27 +7005,27 @@ else
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
- (eval echo "\"\$as_me:6665: $lt_compile\"" >&5)
+ (eval echo "\"\$as_me:7008: $lt_compile\"" >&5)
(eval "$lt_compile" 2>conftest.err)
ac_status=$?
cat conftest.err >&5
- echo "$as_me:6669: \$? = $ac_status" >&5
+ echo "$as_me:7012: \$? = $ac_status" >&5
if (exit $ac_status) && test -s "$ac_outfile"; then
# The compiler can only warn and ignore the option if not recognized
# So say no if there are warnings other than the usual output.
$echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp
$SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then
- lt_prog_compiler_pic_works=yes
+ lt_cv_prog_compiler_pic_works=yes
fi
fi
$rm conftest*
fi
-echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_works" >&5
-echo "${ECHO_T}$lt_prog_compiler_pic_works" >&6
+echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_pic_works" >&5
+echo "${ECHO_T}$lt_cv_prog_compiler_pic_works" >&6
-if test x"$lt_prog_compiler_pic_works" = xyes; then
+if test x"$lt_cv_prog_compiler_pic_works" = xyes; then
case $lt_prog_compiler_pic in
"" | " "*) ;;
*) lt_prog_compiler_pic=" $lt_prog_compiler_pic" ;;
@@ -6709,13 +7052,13 @@ esac
wl=$lt_prog_compiler_wl eval lt_tmp_static_flag=\"$lt_prog_compiler_static\"
echo "$as_me:$LINENO: checking if $compiler static flag $lt_tmp_static_flag works" >&5
echo $ECHO_N "checking if $compiler static flag $lt_tmp_static_flag works... $ECHO_C" >&6
-if test "${lt_prog_compiler_static_works+set}" = set; then
+if test "${lt_cv_prog_compiler_static_works+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
- lt_prog_compiler_static_works=no
+ lt_cv_prog_compiler_static_works=no
save_LDFLAGS="$LDFLAGS"
LDFLAGS="$LDFLAGS $lt_tmp_static_flag"
- printf "$lt_simple_link_test_code" > conftest.$ac_ext
+ echo "$lt_simple_link_test_code" > conftest.$ac_ext
if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then
# The linker can only warn and ignore the option if not recognized
# So say no if there are warnings
@@ -6725,20 +7068,20 @@ else
$echo "X$_lt_linker_boilerplate" | $Xsed -e '/^$/d' > conftest.exp
$SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
if diff conftest.exp conftest.er2 >/dev/null; then
- lt_prog_compiler_static_works=yes
+ lt_cv_prog_compiler_static_works=yes
fi
else
- lt_prog_compiler_static_works=yes
+ lt_cv_prog_compiler_static_works=yes
fi
fi
- $rm conftest*
+ $rm -r conftest*
LDFLAGS="$save_LDFLAGS"
fi
-echo "$as_me:$LINENO: result: $lt_prog_compiler_static_works" >&5
-echo "${ECHO_T}$lt_prog_compiler_static_works" >&6
+echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_static_works" >&5
+echo "${ECHO_T}$lt_cv_prog_compiler_static_works" >&6
-if test x"$lt_prog_compiler_static_works" = xyes; then
+if test x"$lt_cv_prog_compiler_static_works" = xyes; then
:
else
lt_prog_compiler_static=
@@ -6755,7 +7098,7 @@ else
mkdir conftest
cd conftest
mkdir out
- printf "$lt_simple_compile_test_code" > conftest.$ac_ext
+ echo "$lt_simple_compile_test_code" > conftest.$ac_ext
lt_compiler_flag="-o out/conftest2.$ac_objext"
# Insert the option either (1) after the last *FLAGS variable, or
@@ -6766,11 +7109,11 @@ else
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
- (eval echo "\"\$as_me:6769: $lt_compile\"" >&5)
+ (eval echo "\"\$as_me:7112: $lt_compile\"" >&5)
(eval "$lt_compile" 2>out/conftest.err)
ac_status=$?
cat out/conftest.err >&5
- echo "$as_me:6773: \$? = $ac_status" >&5
+ echo "$as_me:7116: \$? = $ac_status" >&5
if (exit $ac_status) && test -s out/conftest2.$ac_objext
then
# The compiler can only warn and ignore the option if not recognized
@@ -6850,12 +7193,13 @@ echo $ECHO_N "checking whether the $compiler linker ($LD) supports shared librar
# it will be wrapped by ` (' and `)$', so one must not match beginning or
# end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc',
# as well as any symbol that contains `d'.
- exclude_expsyms="_GLOBAL_OFFSET_TABLE_"
+ exclude_expsyms='_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*'
# Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out
# platforms (ab)use it in PIC code, but their linkers get confused if
# the symbol is explicitly referenced. Since portable code cannot
# rely on this symbol name, it's probably fine to never include it in
# preloaded symbol tables.
+ # Exclude shared library initialization/finalization symbols.
extract_expsyms_cmds=
# Just being paranoid about ensuring that cc_basename is set.
for cc_temp in $compiler""; do
@@ -6914,7 +7258,7 @@ cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"`
# See if GNU ld supports shared libraries.
case $host_os in
- aix3* | aix4* | aix5*)
+ aix[3-9]*)
# On AIX/PPC, the GNU linker is very broken
if test "$host_cpu" != ia64; then
ld_shlibs=no
@@ -6962,7 +7306,7 @@ EOF
allow_undefined_flag=unsupported
always_export_symbols=no
enable_shared_with_static_runtimes=yes
- export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS] /s/.* \([^ ]*\)/\1 DATA/'\'' | $SED -e '\''/^[AITW] /s/.* //'\'' | sort | uniq > $export_symbols'
+ export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/'\'' -e '\''/^[AITW][ ]/s/.*[ ]//'\'' | sort | uniq > $export_symbols'
if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then
archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
@@ -6980,7 +7324,7 @@ EOF
fi
;;
- interix3*)
+ interix[3-9]*)
hardcode_direct=no
hardcode_shlibpath_var=no
hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
@@ -6995,7 +7339,7 @@ EOF
archive_expsym_cmds='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
;;
- linux*)
+ gnu* | linux* | k*bsd*-gnu)
if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
tmp_addflag=
case $cc_basename,$host_cpu in
@@ -7013,13 +7357,22 @@ EOF
ifc* | ifort*) # Intel Fortran compiler
tmp_addflag=' -nofor_main' ;;
esac
- archive_cmds='$CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ case `$CC -V 2>&1 | sed 5q` in
+ *Sun\ C*) # Sun C 5.9
+ whole_archive_flag_spec='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive'
+ tmp_sharedflag='-G' ;;
+ *Sun\ F*) # Sun Fortran 8.3
+ tmp_sharedflag='-G' ;;
+ *)
+ tmp_sharedflag='-shared' ;;
+ esac
+ archive_cmds='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
if test $supports_anon_versioning = yes; then
archive_expsym_cmds='$echo "{ global:" > $output_objdir/$libname.ver~
cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
$echo "local: *; };" >> $output_objdir/$libname.ver~
- $CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
+ $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
fi
else
ld_shlibs=no
@@ -7124,7 +7477,7 @@ _LT_EOF
fi
;;
- aix4* | aix5*)
+ aix[4-9]*)
if test "$host_cpu" = ia64; then
# On IA64, the linker does run time linking by default, so we don't
# have to do anything special.
@@ -7144,7 +7497,7 @@ _LT_EOF
# Test if we are trying to use run time linking or normal
# AIX style linking. If -brtl is somewhere in LDFLAGS, we
# need to do runtime linking.
- case $host_os in aix4.[23]|aix4.[23].*|aix5*)
+ case $host_os in aix4.[23]|aix4.[23].*|aix[5-9]*)
for ld_flag in $LDFLAGS; do
if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then
aix_use_runtimelinking=yes
@@ -7178,7 +7531,7 @@ _LT_EOF
strings "$collect2name" | grep resolve_lib_name >/dev/null
then
# We have reworked collect2
- hardcode_direct=yes
+ :
else
# We have old collect2
hardcode_direct=unsupported
@@ -7256,11 +7609,18 @@ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
-aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; }
-}'`
+lt_aix_libpath_sed='
+ /Import File Strings/,/^$/ {
+ /^0/ {
+ s/^0 *\(.*\)$/\1/
+ p
+ }
+ }'
+aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
# Check for a 64-bit object if we didn't find anything.
-if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; }
-}'`; fi
+if test -z "$aix_libpath"; then
+ aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
+fi
else
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
@@ -7317,11 +7677,18 @@ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
-aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; }
-}'`
+lt_aix_libpath_sed='
+ /Import File Strings/,/^$/ {
+ /^0/ {
+ s/^0 *\(.*\)$/\1/
+ p
+ }
+ }'
+aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
# Check for a 64-bit object if we didn't find anything.
-if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; }
-}'`; fi
+if test -z "$aix_libpath"; then
+ aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
+fi
else
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
@@ -7373,7 +7740,7 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
# The linker will automatically build a .lib file if we build a DLL.
old_archive_From_new_cmds='true'
# FIXME: Should let the user specify the lib program.
- old_archive_cmds='lib /OUT:$oldlib$oldobjs$old_deplibs'
+ old_archive_cmds='lib -OUT:$oldlib$oldobjs$old_deplibs'
fix_srcfile_path='`cygpath -w "$srcfile"`'
enable_shared_with_static_runtimes=yes
;;
@@ -7406,19 +7773,18 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
link_all_deplibs=yes
if test "$GCC" = yes ; then
output_verbose_link_cmd='echo'
- archive_cmds='$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring'
- module_cmds='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags'
- # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds
- archive_expsym_cmds='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
- module_expsym_cmds='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+ archive_cmds="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}"
+ module_cmds="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}"
+ archive_expsym_cmds="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}"
+ module_expsym_cmds="sed -e 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dar_export_syms}${_lt_dsymutil}"
else
case $cc_basename in
xlc*)
output_verbose_link_cmd='echo'
- archive_cmds='$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $verstring'
+ archive_cmds='$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $xlcverstring'
module_cmds='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags'
# Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds
- archive_expsym_cmds='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+ archive_expsym_cmds='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $xlcverstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
module_expsym_cmds='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
;;
*)
@@ -7458,7 +7824,7 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
;;
# FreeBSD 3 and greater uses gcc -shared to do shared libraries.
- freebsd* | kfreebsd*-gnu | dragonfly*)
+ freebsd* | dragonfly*)
archive_cmds='$CC -shared -o $lib $libobjs $deplibs $compiler_flags'
hardcode_libdir_flag_spec='-R$libdir'
hardcode_direct=yes
@@ -7581,15 +7947,15 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
openbsd*)
if test -f /usr/libexec/ld.so; then
- hardcode_direct=yes
- hardcode_shlibpath_var=no
- if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+ hardcode_direct=yes
+ hardcode_shlibpath_var=no
+ if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
archive_expsym_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols'
hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
export_dynamic_flag_spec='${wl}-E'
- else
- case $host_os in
+ else
+ case $host_os in
openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*)
archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
hardcode_libdir_flag_spec='-R$libdir'
@@ -7598,10 +7964,10 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
;;
- esac
+ esac
fi
else
- ld_shlibs=no
+ ld_shlibs=no
fi
;;
@@ -7660,17 +8026,16 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
case $host_os in
solaris2.[0-5] | solaris2.[0-5].*) ;;
*)
- # The compiler driver will combine linker options so we
- # cannot just pass the convience library names through
- # without $wl, iff we do not link with $LD.
- # Luckily, gcc supports the same syntax we need for Sun Studio.
+ # The compiler driver will combine and reorder linker options,
+ # but understands `-z linker_flag'. GCC discards it without `$wl',
+ # but is careful enough not to reorder.
# Supported since Solaris 2.6 (maybe 2.5.1?)
- case $wlarc in
- '')
- whole_archive_flag_spec='-z allextract$convenience -z defaultextract' ;;
- *)
- whole_archive_flag_spec='${wl}-z ${wl}allextract`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}-z ${wl}defaultextract' ;;
- esac ;;
+ if test "$GCC" = yes; then
+ whole_archive_flag_spec='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract'
+ else
+ whole_archive_flag_spec='-z allextract$convenience -z defaultextract'
+ fi
+ ;;
esac
link_all_deplibs=yes
;;
@@ -7727,7 +8092,7 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
fi
;;
- sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7*)
+ sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*)
no_undefined_flag='${wl}-z,text'
archive_cmds_need_lc=no
hardcode_shlibpath_var=no
@@ -7804,7 +8169,7 @@ x|xyes)
echo "$as_me:$LINENO: checking whether -lc should be explicitly linked in" >&5
echo $ECHO_N "checking whether -lc should be explicitly linked in... $ECHO_C" >&6
$rm conftest*
- printf "$lt_simple_compile_test_code" > conftest.$ac_ext
+ echo "$lt_simple_compile_test_code" > conftest.$ac_ext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
(eval $ac_compile) 2>&5
@@ -7862,17 +8227,55 @@ shlibpath_overrides_runpath=unknown
version_type=none
dynamic_linker="$host_os ld.so"
sys_lib_dlsearch_path_spec="/lib /usr/lib"
+
if test "$GCC" = yes; then
- sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"`
- if echo "$sys_lib_search_path_spec" | grep ';' >/dev/null ; then
+ case $host_os in
+ darwin*) lt_awk_arg="/^libraries:/,/LR/" ;;
+ *) lt_awk_arg="/^libraries:/" ;;
+ esac
+ lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e "s,=/,/,g"`
+ if echo "$lt_search_path_spec" | grep ';' >/dev/null ; then
# if the path contains ";" then we assume it to be the separator
# otherwise default to the standard path separator (i.e. ":") - it is
# assumed that no part of a normal pathname contains ";" but that should
# okay in the real world where ";" in dirpaths is itself problematic.
- sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
+ lt_search_path_spec=`echo "$lt_search_path_spec" | $SED -e 's/;/ /g'`
else
- sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
+ lt_search_path_spec=`echo "$lt_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
fi
+ # Ok, now we have the path, separated by spaces, we can step through it
+ # and add multilib dir if necessary.
+ lt_tmp_lt_search_path_spec=
+ lt_multi_os_dir=`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null`
+ for lt_sys_path in $lt_search_path_spec; do
+ if test -d "$lt_sys_path/$lt_multi_os_dir"; then
+ lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path/$lt_multi_os_dir"
+ else
+ test -d "$lt_sys_path" && \
+ lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path"
+ fi
+ done
+ lt_search_path_spec=`echo $lt_tmp_lt_search_path_spec | awk '
+BEGIN {RS=" "; FS="/|\n";} {
+ lt_foo="";
+ lt_count=0;
+ for (lt_i = NF; lt_i > 0; lt_i--) {
+ if ($lt_i != "" && $lt_i != ".") {
+ if ($lt_i == "..") {
+ lt_count++;
+ } else {
+ if (lt_count == 0) {
+ lt_foo="/" $lt_i lt_foo;
+ } else {
+ lt_count--;
+ }
+ }
+ }
+ }
+ if (lt_foo != "") { lt_freq[lt_foo]++; }
+ if (lt_freq[lt_foo] == 1) { print lt_foo; }
+}'`
+ sys_lib_search_path_spec=`echo $lt_search_path_spec`
else
sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
fi
@@ -7893,7 +8296,7 @@ aix3*)
soname_spec='${libname}${release}${shared_ext}$major'
;;
-aix4* | aix5*)
+aix[4-9]*)
version_type=linux
need_lib_prefix=no
need_version=no
@@ -8032,12 +8435,8 @@ darwin* | rhapsody*)
shlibpath_overrides_runpath=yes
shlibpath_var=DYLD_LIBRARY_PATH
shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`'
- # Apple's gcc prints 'gcc -print-search-dirs' doesn't operate the same.
- if test "$GCC" = yes; then
- sys_lib_search_path_spec=`$CC -print-search-dirs | tr "\n" "$PATH_SEPARATOR" | sed -e 's/libraries:/@libraries:/' | tr "@" "\n" | grep "^libraries:" | sed -e "s/^libraries://" -e "s,=/,/,g" -e "s,$PATH_SEPARATOR, ,g" -e "s,.*,& /lib /usr/lib /usr/local/lib,g"`
- else
- sys_lib_search_path_spec='/lib /usr/lib /usr/local/lib'
- fi
+
+ sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib"
sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib'
;;
@@ -8054,18 +8453,6 @@ freebsd1*)
dynamic_linker=no
;;
-kfreebsd*-gnu)
- version_type=linux
- need_lib_prefix=no
- need_version=no
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- shlibpath_var=LD_LIBRARY_PATH
- shlibpath_overrides_runpath=no
- hardcode_into_libs=yes
- dynamic_linker='GNU ld.so'
- ;;
-
freebsd* | dragonfly*)
# DragonFly does not have aout. When/if they implement a new
# versioning mechanism, adjust this.
@@ -8103,7 +8490,7 @@ freebsd* | dragonfly*)
shlibpath_overrides_runpath=no
hardcode_into_libs=yes
;;
- freebsd*) # from 4.6 on
+ *) # from 4.6 on, and DragonFly
shlibpath_overrides_runpath=yes
hardcode_into_libs=yes
;;
@@ -8166,7 +8553,7 @@ hpux9* | hpux10* | hpux11*)
postinstall_cmds='chmod 555 $lib'
;;
-interix3*)
+interix[3-9]*)
version_type=linux
need_lib_prefix=no
need_version=no
@@ -8221,7 +8608,7 @@ linux*oldld* | linux*aout* | linux*coff*)
;;
# This must be Linux ELF.
-linux*)
+linux* | k*bsd*-gnu)
version_type=linux
need_lib_prefix=no
need_version=no
@@ -8237,7 +8624,7 @@ linux*)
# Append ld.so.conf contents to the search path
if test -f /etc/ld.so.conf; then
- lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '`
+ lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '`
sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra"
fi
@@ -8250,18 +8637,6 @@ linux*)
dynamic_linker='GNU/Linux ld.so'
;;
-knetbsd*-gnu)
- version_type=linux
- need_lib_prefix=no
- need_version=no
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- shlibpath_var=LD_LIBRARY_PATH
- shlibpath_overrides_runpath=no
- hardcode_into_libs=yes
- dynamic_linker='GNU ld.so'
- ;;
-
netbsd*)
version_type=sunos
need_lib_prefix=no
@@ -8343,6 +8718,10 @@ osf3* | osf4* | osf5*)
sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec"
;;
+rdos*)
+ dynamic_linker=no
+ ;;
+
solaris*)
version_type=linux
need_lib_prefix=no
@@ -8439,6 +8818,21 @@ echo "$as_me:$LINENO: result: $dynamic_linker" >&5
echo "${ECHO_T}$dynamic_linker" >&6
test "$dynamic_linker" = no && can_build_shared=no
+if test "${lt_cv_sys_lib_search_path_spec+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ lt_cv_sys_lib_search_path_spec="$sys_lib_search_path_spec"
+fi
+
+sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec"
+if test "${lt_cv_sys_lib_dlsearch_path_spec+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ lt_cv_sys_lib_dlsearch_path_spec="$sys_lib_dlsearch_path_spec"
+fi
+
+sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec"
+
variables_saved_for_relink="PATH $shlibpath_var $runpath_var"
if test "$GCC" = yes; then
variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
@@ -8496,6 +8890,7 @@ else
darwin*)
if test -n "$STRIP" ; then
striplib="$STRIP -x"
+ old_striplib="$STRIP -S"
echo "$as_me:$LINENO: result: yes" >&5
echo "${ECHO_T}yes" >&6
else
@@ -8772,7 +9167,7 @@ fi
echo "$as_me:$LINENO: result: $ac_cv_lib_dld_shl_load" >&5
echo "${ECHO_T}$ac_cv_lib_dld_shl_load" >&6
if test $ac_cv_lib_dld_shl_load = yes; then
- lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-dld"
+ lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-ldld"
else
echo "$as_me:$LINENO: checking for dlopen" >&5
echo $ECHO_N "checking for dlopen... $ECHO_C" >&6
@@ -9066,7 +9461,7 @@ fi
echo "$as_me:$LINENO: result: $ac_cv_lib_dld_dld_link" >&5
echo "${ECHO_T}$ac_cv_lib_dld_dld_link" >&6
if test $ac_cv_lib_dld_dld_link = yes; then
- lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-dld"
+ lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-ldld"
fi
@@ -9115,7 +9510,7 @@ else
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<EOF
-#line 9118 "configure"
+#line 9513 "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
@@ -9215,7 +9610,7 @@ else
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<EOF
-#line 9218 "configure"
+#line 9613 "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
@@ -9342,7 +9737,7 @@ aix3*)
fi
;;
-aix4* | aix5*)
+aix[4-9]*)
if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
test "$enable_shared" = yes && enable_static=no
fi
@@ -9398,6 +9793,7 @@ if test -f "$ltmain"; then
predeps \
postdeps \
compiler_lib_search_path \
+ compiler_lib_search_dirs \
archive_cmds \
archive_expsym_cmds \
postinstall_cmds \
@@ -9413,6 +9809,7 @@ if test -f "$ltmain"; then
module_cmds \
module_expsym_cmds \
lt_cv_prog_compiler_c_o \
+ fix_srcfile_path \
exclude_expsyms \
include_expsyms; do
@@ -9457,7 +9854,7 @@ echo "$as_me: creating $ofile" >&6;}
# Generated automatically by $PROGRAM (GNU $PACKAGE $VERSION$TIMESTAMP)
# NOTE: Changes made to this file will be lost: look at ltmain.sh.
#
-# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001
+# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008
# Free Software Foundation, Inc.
#
# This file is part of GNU Libtool:
@@ -9693,6 +10090,10 @@ predeps=$lt_predeps
# shared library.
postdeps=$lt_postdeps
+# The directories searched by this compiler when creating a shared
+# library
+compiler_lib_search_dirs=$lt_compiler_lib_search_dirs
+
# The library search path used internally by the compiler when linking
# a shared library.
compiler_lib_search_path=$lt_compiler_lib_search_path
@@ -9781,7 +10182,7 @@ sys_lib_search_path_spec=$lt_sys_lib_search_path_spec
sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec
# Fix the shell variable \$srcfile for the compiler.
-fix_srcfile_path="$fix_srcfile_path"
+fix_srcfile_path=$lt_fix_srcfile_path
# Set to yes if exported symbols are required.
always_export_symbols=$always_export_symbols
@@ -9941,6 +10342,7 @@ postdep_objects_CXX=
predeps_CXX=
postdeps_CXX=
compiler_lib_search_path_CXX=
+compiler_lib_search_dirs_CXX=
# Source file extension for C++ test sources.
ac_ext=cpp
@@ -9950,10 +10352,10 @@ objext=o
objext_CXX=$objext
# Code to be used in simple compile tests
-lt_simple_compile_test_code="int some_variable = 0;\n"
+lt_simple_compile_test_code="int some_variable = 0;"
# Code to be used in simple link tests
-lt_simple_link_test_code='int main(int, char *[]) { return(0); }\n'
+lt_simple_link_test_code='int main(int, char *[]) { return(0); }'
# ltmain only uses $CC for tagged configurations so make sure $CC is set.
@@ -9969,16 +10371,16 @@ compiler=$CC
# save warnings/boilerplate of simple test code
ac_outfile=conftest.$ac_objext
-printf "$lt_simple_compile_test_code" >conftest.$ac_ext
+echo "$lt_simple_compile_test_code" >conftest.$ac_ext
eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
_lt_compiler_boilerplate=`cat conftest.err`
$rm conftest*
ac_outfile=conftest.$ac_objext
-printf "$lt_simple_link_test_code" >conftest.$ac_ext
+echo "$lt_simple_link_test_code" >conftest.$ac_ext
eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
_lt_linker_boilerplate=`cat conftest.err`
-$rm conftest*
+$rm -r conftest*
# Allow CC to be a program name with arguments.
@@ -10185,7 +10587,7 @@ case $host_os in
# FIXME: insert proper C++ library support
ld_shlibs_CXX=no
;;
- aix4* | aix5*)
+ aix[4-9]*)
if test "$host_cpu" = ia64; then
# On IA64, the linker does run time linking by default, so we don't
# have to do anything special.
@@ -10198,7 +10600,7 @@ case $host_os in
# Test if we are trying to use run time linking or normal
# AIX style linking. If -brtl is somewhere in LDFLAGS, we
# need to do runtime linking.
- case $host_os in aix4.[23]|aix4.[23].*|aix5*)
+ case $host_os in aix4.[23]|aix4.[23].*|aix[5-9]*)
for ld_flag in $LDFLAGS; do
case $ld_flag in
*-brtl*)
@@ -10234,7 +10636,7 @@ case $host_os in
strings "$collect2name" | grep resolve_lib_name >/dev/null
then
# We have reworked collect2
- hardcode_direct_CXX=yes
+ :
else
# We have old collect2
hardcode_direct_CXX=unsupported
@@ -10312,11 +10714,18 @@ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
-aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; }
-}'`
+lt_aix_libpath_sed='
+ /Import File Strings/,/^$/ {
+ /^0/ {
+ s/^0 *\(.*\)$/\1/
+ p
+ }
+ }'
+aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
# Check for a 64-bit object if we didn't find anything.
-if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; }
-}'`; fi
+if test -z "$aix_libpath"; then
+ aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
+fi
else
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
@@ -10374,11 +10783,18 @@ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
-aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; }
-}'`
+lt_aix_libpath_sed='
+ /Import File Strings/,/^$/ {
+ /^0/ {
+ s/^0 *\(.*\)$/\1/
+ p
+ }
+ }'
+aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
# Check for a 64-bit object if we didn't find anything.
-if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; }
-}'`; fi
+if test -z "$aix_libpath"; then
+ aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
+fi
else
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
@@ -10446,59 +10862,31 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
fi
;;
darwin* | rhapsody*)
- case $host_os in
- rhapsody* | darwin1.[012])
- allow_undefined_flag_CXX='${wl}-undefined ${wl}suppress'
- ;;
- *) # Darwin 1.3 on
- if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then
- allow_undefined_flag_CXX='${wl}-flat_namespace ${wl}-undefined ${wl}suppress'
- else
- case ${MACOSX_DEPLOYMENT_TARGET} in
- 10.[012])
- allow_undefined_flag_CXX='${wl}-flat_namespace ${wl}-undefined ${wl}suppress'
- ;;
- 10.*)
- allow_undefined_flag_CXX='${wl}-undefined ${wl}dynamic_lookup'
- ;;
- esac
- fi
- ;;
- esac
archive_cmds_need_lc_CXX=no
hardcode_direct_CXX=no
hardcode_automatic_CXX=yes
hardcode_shlibpath_var_CXX=unsupported
whole_archive_flag_spec_CXX=''
link_all_deplibs_CXX=yes
-
- if test "$GXX" = yes ; then
- lt_int_apple_cc_single_mod=no
+ allow_undefined_flag_CXX="$_lt_dar_allow_undefined"
+ if test "$GXX" = yes ; then
output_verbose_link_cmd='echo'
- if $CC -dumpspecs 2>&1 | $EGREP 'single_module' >/dev/null ; then
- lt_int_apple_cc_single_mod=yes
+ archive_cmds_CXX="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}"
+ module_cmds_CXX="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}"
+ archive_expsym_cmds_CXX="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}"
+ module_expsym_cmds_CXX="sed -e 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dar_export_syms}${_lt_dsymutil}"
+ if test "$lt_cv_apple_cc_single_mod" != "yes"; then
+ archive_cmds_CXX="\$CC -r -keep_private_externs -nostdlib -o \${lib}-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \${lib}-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring${_lt_dsymutil}"
+ archive_expsym_cmds_CXX="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -r -keep_private_externs -nostdlib -o \${lib}-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \${lib}-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring${_lt_dar_export_syms}${_lt_dsymutil}"
fi
- if test "X$lt_int_apple_cc_single_mod" = Xyes ; then
- archive_cmds_CXX='$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring'
- else
- archive_cmds_CXX='$CC -r -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $deplibs $compiler_flags -install_name $rpath/$soname $verstring'
- fi
- module_cmds_CXX='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags'
- # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds
- if test "X$lt_int_apple_cc_single_mod" = Xyes ; then
- archive_expsym_cmds_CXX='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
- else
- archive_expsym_cmds_CXX='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -r -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
- fi
- module_expsym_cmds_CXX='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
else
case $cc_basename in
xlc*)
output_verbose_link_cmd='echo'
- archive_cmds_CXX='$CC -qmkshrobj ${wl}-single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $verstring'
+ archive_cmds_CXX='$CC -qmkshrobj ${wl}-single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $xlcverstring'
module_cmds_CXX='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags'
# Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds
- archive_expsym_cmds_CXX='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj ${wl}-single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+ archive_expsym_cmds_CXX='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj ${wl}-single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $xlcverstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
module_expsym_cmds_CXX='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
;;
*)
@@ -10532,7 +10920,7 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
freebsd-elf*)
archive_cmds_need_lc_CXX=no
;;
- freebsd* | kfreebsd*-gnu | dragonfly*)
+ freebsd* | dragonfly*)
# FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF
# conventions
ld_shlibs_CXX=yes
@@ -10581,9 +10969,7 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
hardcode_libdir_separator_CXX=:
case $host_cpu in
- hppa*64*|ia64*)
- hardcode_libdir_flag_spec_ld_CXX='+b $libdir'
- ;;
+ hppa*64*|ia64*) ;;
*)
export_dynamic_flag_spec_CXX='${wl}-E'
;;
@@ -10651,7 +11037,7 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
;;
esac
;;
- interix3*)
+ interix[3-9]*)
hardcode_direct_CXX=no
hardcode_shlibpath_var_CXX=no
hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir'
@@ -10691,7 +11077,7 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir'
hardcode_libdir_separator_CXX=:
;;
- linux*)
+ linux* | k*bsd*-gnu)
case $cc_basename in
KCC*)
# Kuck and Associates, Inc. (KAI) C++ Compiler
@@ -10743,7 +11129,7 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
export_dynamic_flag_spec_CXX='${wl}--export-dynamic'
whole_archive_flag_spec_CXX='${wl}--whole-archive$convenience ${wl}--no-whole-archive'
;;
- pgCC*)
+ pgCC* | pgcpp*)
# Portland Group C++ compiler
archive_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib'
archive_expsym_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib'
@@ -10771,6 +11157,29 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
# dependencies.
output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list'
;;
+ *)
+ case `$CC -V 2>&1 | sed 5q` in
+ *Sun\ C*)
+ # Sun C++ 5.9
+ no_undefined_flag_CXX=' -zdefs'
+ archive_cmds_CXX='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+ archive_expsym_cmds_CXX='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file ${wl}$export_symbols'
+ hardcode_libdir_flag_spec_CXX='-R$libdir'
+ whole_archive_flag_spec_CXX='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive'
+
+ # Not sure whether something based on
+ # $CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1
+ # would be better.
+ output_verbose_link_cmd='echo'
+
+ # Archives containing C++ object files must be created using
+ # "CC -xar", where "CC" is the Sun C++ compiler. This is
+ # necessary to make sure instantiated templates are included
+ # in the archive.
+ old_archive_cmds_CXX='$CC -xar -o $oldlib $oldobjs'
+ ;;
+ esac
+ ;;
esac
;;
lynxos*)
@@ -10815,9 +11224,9 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
archive_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'
hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir'
if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
- archive_expsym_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file,$export_symbols -o $lib'
- export_dynamic_flag_spec_CXX='${wl}-E'
- whole_archive_flag_spec_CXX="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
+ archive_expsym_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file,$export_symbols -o $lib'
+ export_dynamic_flag_spec_CXX='${wl}-E'
+ whole_archive_flag_spec_CXX="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
fi
output_verbose_link_cmd='echo'
else
@@ -10984,15 +11393,10 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
case $host_os in
solaris2.[0-5] | solaris2.[0-5].*) ;;
*)
- # The C++ compiler is used as linker so we must use $wl
- # flag to pass the commands to the underlying system
- # linker. We must also pass each convience library through
- # to the system linker between allextract/defaultextract.
- # The C++ compiler will combine linker options so we
- # cannot just pass the convience library names through
- # without $wl.
+ # The compiler driver will combine and reorder linker options,
+ # but understands `-z linker_flag'.
# Supported since Solaris 2.6 (maybe 2.5.1?)
- whole_archive_flag_spec_CXX='${wl}-z ${wl}allextract`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}-z ${wl}defaultextract'
+ whole_archive_flag_spec_CXX='-z allextract$convenience -z defaultextract'
;;
esac
link_all_deplibs_CXX=yes
@@ -11039,6 +11443,12 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
fi
hardcode_libdir_flag_spec_CXX='${wl}-R $wl$libdir'
+ case $host_os in
+ solaris2.[0-5] | solaris2.[0-5].*) ;;
+ *)
+ whole_archive_flag_spec_CXX='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract'
+ ;;
+ esac
fi
;;
esac
@@ -11126,7 +11536,6 @@ test "$ld_shlibs_CXX" = no && can_build_shared=no
GCC_CXX="$GXX"
LD_CXX="$LD"
-
cat > conftest.$ac_ext <<EOF
class Foo
{
@@ -11228,9 +11637,14 @@ fi
$rm -f confest.$objext
+compiler_lib_search_dirs_CXX=
+if test -n "$compiler_lib_search_path_CXX"; then
+ compiler_lib_search_dirs_CXX=`echo " ${compiler_lib_search_path_CXX}" | ${SED} -e 's! -L! !g' -e 's!^ !!'`
+fi
+
# PORTME: override above test on systems where it is broken
case $host_os in
-interix3*)
+interix[3-9]*)
# Interix 3.5 installs completely hosed .la files for C++, so rather than
# hack all around it, let's just trust "g++" to DTRT.
predep_objects_CXX=
@@ -11238,19 +11652,51 @@ interix3*)
postdeps_CXX=
;;
+linux*)
+ case `$CC -V 2>&1 | sed 5q` in
+ *Sun\ C*)
+ # Sun C++ 5.9
+ #
+ # The more standards-conforming stlport4 library is
+ # incompatible with the Cstd library. Avoid specifying
+ # it if it's in CXXFLAGS. Ignore libCrun as
+ # -library=stlport4 depends on it.
+ case " $CXX $CXXFLAGS " in
+ *" -library=stlport4 "*)
+ solaris_use_stlport4=yes
+ ;;
+ esac
+ if test "$solaris_use_stlport4" != yes; then
+ postdeps_CXX='-library=Cstd -library=Crun'
+ fi
+ ;;
+ esac
+ ;;
+
solaris*)
case $cc_basename in
CC*)
+ # The more standards-conforming stlport4 library is
+ # incompatible with the Cstd library. Avoid specifying
+ # it if it's in CXXFLAGS. Ignore libCrun as
+ # -library=stlport4 depends on it.
+ case " $CXX $CXXFLAGS " in
+ *" -library=stlport4 "*)
+ solaris_use_stlport4=yes
+ ;;
+ esac
+
# Adding this requires a known-good setup of shared libraries for
# Sun compiler versions before 5.6, else PIC objects from an old
# archive will be linked into the output, leading to subtle bugs.
- postdeps_CXX='-lCstd -lCrun'
+ if test "$solaris_use_stlport4" != yes; then
+ postdeps_CXX='-library=Cstd -library=Crun'
+ fi
;;
esac
;;
esac
-
case " $postdeps_CXX " in
*" -lc "*) archive_cmds_need_lc_CXX=no ;;
esac
@@ -11281,12 +11727,14 @@ echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6
# like `-m68040'.
lt_prog_compiler_pic_CXX='-m68020 -resident32 -malways-restore-a4'
;;
- beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
+ beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
# PIC is the default for these OSes.
;;
- mingw* | os2* | pw32*)
+ mingw* | cygwin* | os2* | pw32*)
# This hack is so that the source file can tell whether it is being
# built for inclusion in a dll (and should export symbols for example).
+ # Although the cygwin gcc ignores -fPIC, still need this for old-style
+ # (--disable-auto-import) libraries
lt_prog_compiler_pic_CXX='-DDLL_EXPORT'
;;
darwin* | rhapsody*)
@@ -11298,7 +11746,7 @@ echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6
# DJGPP does not support shared libraries at all
lt_prog_compiler_pic_CXX=
;;
- interix3*)
+ interix[3-9]*)
# Interix 3.x gcc -fpic/-fPIC options generate broken code.
# Instead, we relocate shared libraries at runtime.
;;
@@ -11324,7 +11772,7 @@ echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6
esac
else
case $host_os in
- aix4* | aix5*)
+ aix[4-9]*)
# All AIX code is PIC.
if test "$host_cpu" = ia64; then
# AIX 5 now supports IA64 processor
@@ -11364,7 +11812,7 @@ echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6
;;
esac
;;
- freebsd* | kfreebsd*-gnu | dragonfly*)
+ freebsd* | dragonfly*)
# FreeBSD uses GNU C++
;;
hpux9* | hpux10* | hpux11*)
@@ -11407,7 +11855,7 @@ echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6
;;
esac
;;
- linux*)
+ linux* | k*bsd*-gnu)
case $cc_basename in
KCC*)
# KAI C++ Compiler
@@ -11420,7 +11868,7 @@ echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6
lt_prog_compiler_pic_CXX='-KPIC'
lt_prog_compiler_static_CXX='-static'
;;
- pgCC*)
+ pgCC* | pgcpp*)
# Portland Group C++ compiler.
lt_prog_compiler_wl_CXX='-Wl,'
lt_prog_compiler_pic_CXX='-fpic'
@@ -11434,6 +11882,14 @@ echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6
lt_prog_compiler_static_CXX='-non_shared'
;;
*)
+ case `$CC -V 2>&1 | sed 5q` in
+ *Sun\ C*)
+ # Sun C++ 5.9
+ lt_prog_compiler_pic_CXX='-KPIC'
+ lt_prog_compiler_static_CXX='-Bstatic'
+ lt_prog_compiler_wl_CXX='-Qoption ld '
+ ;;
+ esac
;;
esac
;;
@@ -11543,12 +11999,12 @@ if test -n "$lt_prog_compiler_pic_CXX"; then
echo "$as_me:$LINENO: checking if $compiler PIC flag $lt_prog_compiler_pic_CXX works" >&5
echo $ECHO_N "checking if $compiler PIC flag $lt_prog_compiler_pic_CXX works... $ECHO_C" >&6
-if test "${lt_prog_compiler_pic_works_CXX+set}" = set; then
+if test "${lt_cv_prog_compiler_pic_works_CXX+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
- lt_prog_compiler_pic_works_CXX=no
+ lt_cv_prog_compiler_pic_works_CXX=no
ac_outfile=conftest.$ac_objext
- printf "$lt_simple_compile_test_code" > conftest.$ac_ext
+ echo "$lt_simple_compile_test_code" > conftest.$ac_ext
lt_compiler_flag="$lt_prog_compiler_pic_CXX -DPIC"
# Insert the option either (1) after the last *FLAGS variable, or
# (2) before a word containing "conftest.", or (3) at the end.
@@ -11559,27 +12015,27 @@ else
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
- (eval echo "\"\$as_me:11562: $lt_compile\"" >&5)
+ (eval echo "\"\$as_me:12018: $lt_compile\"" >&5)
(eval "$lt_compile" 2>conftest.err)
ac_status=$?
cat conftest.err >&5
- echo "$as_me:11566: \$? = $ac_status" >&5
+ echo "$as_me:12022: \$? = $ac_status" >&5
if (exit $ac_status) && test -s "$ac_outfile"; then
# The compiler can only warn and ignore the option if not recognized
# So say no if there are warnings other than the usual output.
$echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp
$SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then
- lt_prog_compiler_pic_works_CXX=yes
+ lt_cv_prog_compiler_pic_works_CXX=yes
fi
fi
$rm conftest*
fi
-echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_works_CXX" >&5
-echo "${ECHO_T}$lt_prog_compiler_pic_works_CXX" >&6
+echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_pic_works_CXX" >&5
+echo "${ECHO_T}$lt_cv_prog_compiler_pic_works_CXX" >&6
-if test x"$lt_prog_compiler_pic_works_CXX" = xyes; then
+if test x"$lt_cv_prog_compiler_pic_works_CXX" = xyes; then
case $lt_prog_compiler_pic_CXX in
"" | " "*) ;;
*) lt_prog_compiler_pic_CXX=" $lt_prog_compiler_pic_CXX" ;;
@@ -11606,13 +12062,13 @@ esac
wl=$lt_prog_compiler_wl_CXX eval lt_tmp_static_flag=\"$lt_prog_compiler_static_CXX\"
echo "$as_me:$LINENO: checking if $compiler static flag $lt_tmp_static_flag works" >&5
echo $ECHO_N "checking if $compiler static flag $lt_tmp_static_flag works... $ECHO_C" >&6
-if test "${lt_prog_compiler_static_works_CXX+set}" = set; then
+if test "${lt_cv_prog_compiler_static_works_CXX+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
- lt_prog_compiler_static_works_CXX=no
+ lt_cv_prog_compiler_static_works_CXX=no
save_LDFLAGS="$LDFLAGS"
LDFLAGS="$LDFLAGS $lt_tmp_static_flag"
- printf "$lt_simple_link_test_code" > conftest.$ac_ext
+ echo "$lt_simple_link_test_code" > conftest.$ac_ext
if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then
# The linker can only warn and ignore the option if not recognized
# So say no if there are warnings
@@ -11622,20 +12078,20 @@ else
$echo "X$_lt_linker_boilerplate" | $Xsed -e '/^$/d' > conftest.exp
$SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
if diff conftest.exp conftest.er2 >/dev/null; then
- lt_prog_compiler_static_works_CXX=yes
+ lt_cv_prog_compiler_static_works_CXX=yes
fi
else
- lt_prog_compiler_static_works_CXX=yes
+ lt_cv_prog_compiler_static_works_CXX=yes
fi
fi
- $rm conftest*
+ $rm -r conftest*
LDFLAGS="$save_LDFLAGS"
fi
-echo "$as_me:$LINENO: result: $lt_prog_compiler_static_works_CXX" >&5
-echo "${ECHO_T}$lt_prog_compiler_static_works_CXX" >&6
+echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_static_works_CXX" >&5
+echo "${ECHO_T}$lt_cv_prog_compiler_static_works_CXX" >&6
-if test x"$lt_prog_compiler_static_works_CXX" = xyes; then
+if test x"$lt_cv_prog_compiler_static_works_CXX" = xyes; then
:
else
lt_prog_compiler_static_CXX=
@@ -11652,7 +12108,7 @@ else
mkdir conftest
cd conftest
mkdir out
- printf "$lt_simple_compile_test_code" > conftest.$ac_ext
+ echo "$lt_simple_compile_test_code" > conftest.$ac_ext
lt_compiler_flag="-o out/conftest2.$ac_objext"
# Insert the option either (1) after the last *FLAGS variable, or
@@ -11663,11 +12119,11 @@ else
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
- (eval echo "\"\$as_me:11666: $lt_compile\"" >&5)
+ (eval echo "\"\$as_me:12122: $lt_compile\"" >&5)
(eval "$lt_compile" 2>out/conftest.err)
ac_status=$?
cat out/conftest.err >&5
- echo "$as_me:11670: \$? = $ac_status" >&5
+ echo "$as_me:12126: \$? = $ac_status" >&5
if (exit $ac_status) && test -s out/conftest2.$ac_objext
then
# The compiler can only warn and ignore the option if not recognized
@@ -11720,7 +12176,7 @@ echo $ECHO_N "checking whether the $compiler linker ($LD) supports shared librar
export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
case $host_os in
- aix4* | aix5*)
+ aix[4-9]*)
# If we're using GNU nm, then we don't want the "-C" option.
# -C means demangle to AIX nm, but means don't demangle with GNU nm
if $NM -V 2>&1 | grep 'GNU' > /dev/null; then
@@ -11733,12 +12189,13 @@ echo $ECHO_N "checking whether the $compiler linker ($LD) supports shared librar
export_symbols_cmds_CXX="$ltdll_cmds"
;;
cygwin* | mingw*)
- export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS] /s/.* \([^ ]*\)/\1 DATA/;/^.* __nm__/s/^.* __nm__\([^ ]*\) [^ ]*/\1 DATA/;/^I /d;/^[AITW] /s/.* //'\'' | sort | uniq > $export_symbols'
+ export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/;/^.*[ ]__nm__/s/^.*[ ]__nm__\([^ ]*\)[ ][^ ]*/\1 DATA/;/^I[ ]/d;/^[AITW][ ]/s/.*[ ]//'\'' | sort | uniq > $export_symbols'
;;
*)
export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
;;
esac
+ exclude_expsyms_CXX='_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*'
echo "$as_me:$LINENO: result: $ld_shlibs_CXX" >&5
echo "${ECHO_T}$ld_shlibs_CXX" >&6
@@ -11764,7 +12221,7 @@ x|xyes)
echo "$as_me:$LINENO: checking whether -lc should be explicitly linked in" >&5
echo $ECHO_N "checking whether -lc should be explicitly linked in... $ECHO_C" >&6
$rm conftest*
- printf "$lt_simple_compile_test_code" > conftest.$ac_ext
+ echo "$lt_simple_compile_test_code" > conftest.$ac_ext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
(eval $ac_compile) 2>&5
@@ -11822,20 +12279,7 @@ shlibpath_overrides_runpath=unknown
version_type=none
dynamic_linker="$host_os ld.so"
sys_lib_dlsearch_path_spec="/lib /usr/lib"
-if test "$GCC" = yes; then
- sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"`
- if echo "$sys_lib_search_path_spec" | grep ';' >/dev/null ; then
- # if the path contains ";" then we assume it to be the separator
- # otherwise default to the standard path separator (i.e. ":") - it is
- # assumed that no part of a normal pathname contains ";" but that should
- # okay in the real world where ";" in dirpaths is itself problematic.
- sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
- else
- sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
- fi
-else
- sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
-fi
+
need_lib_prefix=unknown
hardcode_into_libs=no
@@ -11853,7 +12297,7 @@ aix3*)
soname_spec='${libname}${release}${shared_ext}$major'
;;
-aix4* | aix5*)
+aix[4-9]*)
version_type=linux
need_lib_prefix=no
need_version=no
@@ -11992,12 +12436,7 @@ darwin* | rhapsody*)
shlibpath_overrides_runpath=yes
shlibpath_var=DYLD_LIBRARY_PATH
shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`'
- # Apple's gcc prints 'gcc -print-search-dirs' doesn't operate the same.
- if test "$GCC" = yes; then
- sys_lib_search_path_spec=`$CC -print-search-dirs | tr "\n" "$PATH_SEPARATOR" | sed -e 's/libraries:/@libraries:/' | tr "@" "\n" | grep "^libraries:" | sed -e "s/^libraries://" -e "s,=/,/,g" -e "s,$PATH_SEPARATOR, ,g" -e "s,.*,& /lib /usr/lib /usr/local/lib,g"`
- else
- sys_lib_search_path_spec='/lib /usr/lib /usr/local/lib'
- fi
+
sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib'
;;
@@ -12014,18 +12453,6 @@ freebsd1*)
dynamic_linker=no
;;
-kfreebsd*-gnu)
- version_type=linux
- need_lib_prefix=no
- need_version=no
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- shlibpath_var=LD_LIBRARY_PATH
- shlibpath_overrides_runpath=no
- hardcode_into_libs=yes
- dynamic_linker='GNU ld.so'
- ;;
-
freebsd* | dragonfly*)
# DragonFly does not have aout. When/if they implement a new
# versioning mechanism, adjust this.
@@ -12063,7 +12490,7 @@ freebsd* | dragonfly*)
shlibpath_overrides_runpath=no
hardcode_into_libs=yes
;;
- freebsd*) # from 4.6 on
+ *) # from 4.6 on, and DragonFly
shlibpath_overrides_runpath=yes
hardcode_into_libs=yes
;;
@@ -12126,7 +12553,7 @@ hpux9* | hpux10* | hpux11*)
postinstall_cmds='chmod 555 $lib'
;;
-interix3*)
+interix[3-9]*)
version_type=linux
need_lib_prefix=no
need_version=no
@@ -12181,7 +12608,7 @@ linux*oldld* | linux*aout* | linux*coff*)
;;
# This must be Linux ELF.
-linux*)
+linux* | k*bsd*-gnu)
version_type=linux
need_lib_prefix=no
need_version=no
@@ -12197,7 +12624,7 @@ linux*)
# Append ld.so.conf contents to the search path
if test -f /etc/ld.so.conf; then
- lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '`
+ lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '`
sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra"
fi
@@ -12210,18 +12637,6 @@ linux*)
dynamic_linker='GNU/Linux ld.so'
;;
-knetbsd*-gnu)
- version_type=linux
- need_lib_prefix=no
- need_version=no
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- shlibpath_var=LD_LIBRARY_PATH
- shlibpath_overrides_runpath=no
- hardcode_into_libs=yes
- dynamic_linker='GNU ld.so'
- ;;
-
netbsd*)
version_type=sunos
need_lib_prefix=no
@@ -12303,6 +12718,10 @@ osf3* | osf4* | osf5*)
sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec"
;;
+rdos*)
+ dynamic_linker=no
+ ;;
+
solaris*)
version_type=linux
need_lib_prefix=no
@@ -12399,6 +12818,21 @@ echo "$as_me:$LINENO: result: $dynamic_linker" >&5
echo "${ECHO_T}$dynamic_linker" >&6
test "$dynamic_linker" = no && can_build_shared=no
+if test "${lt_cv_sys_lib_search_path_spec+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ lt_cv_sys_lib_search_path_spec="$sys_lib_search_path_spec"
+fi
+
+sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec"
+if test "${lt_cv_sys_lib_dlsearch_path_spec+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ lt_cv_sys_lib_dlsearch_path_spec="$sys_lib_dlsearch_path_spec"
+fi
+
+sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec"
+
variables_saved_for_relink="PATH $shlibpath_var $runpath_var"
if test "$GCC" = yes; then
variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
@@ -12482,6 +12916,7 @@ if test -f "$ltmain"; then
predeps_CXX \
postdeps_CXX \
compiler_lib_search_path_CXX \
+ compiler_lib_search_dirs_CXX \
archive_cmds_CXX \
archive_expsym_cmds_CXX \
postinstall_cmds_CXX \
@@ -12497,6 +12932,7 @@ if test -f "$ltmain"; then
module_cmds_CXX \
module_expsym_cmds_CXX \
lt_cv_prog_compiler_c_o_CXX \
+ fix_srcfile_path_CXX \
exclude_expsyms_CXX \
include_expsyms_CXX; do
@@ -12729,6 +13165,10 @@ predeps=$lt_predeps_CXX
# shared library.
postdeps=$lt_postdeps_CXX
+# The directories searched by this compiler when creating a shared
+# library
+compiler_lib_search_dirs=$lt_compiler_lib_search_dirs_CXX
+
# The library search path used internally by the compiler when linking
# a shared library.
compiler_lib_search_path=$lt_compiler_lib_search_path_CXX
@@ -12817,7 +13257,7 @@ sys_lib_search_path_spec=$lt_sys_lib_search_path_spec
sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec
# Fix the shell variable \$srcfile for the compiler.
-fix_srcfile_path="$fix_srcfile_path_CXX"
+fix_srcfile_path=$lt_fix_srcfile_path
# Set to yes if exported symbols are required.
always_export_symbols=$always_export_symbols_CXX
@@ -12908,10 +13348,17 @@ objext=o
objext_F77=$objext
# Code to be used in simple compile tests
-lt_simple_compile_test_code=" subroutine t\n return\n end\n"
+lt_simple_compile_test_code="\
+ subroutine t
+ return
+ end
+"
# Code to be used in simple link tests
-lt_simple_link_test_code=" program t\n end\n"
+lt_simple_link_test_code="\
+ program t
+ end
+"
# ltmain only uses $CC for tagged configurations so make sure $CC is set.
@@ -12927,16 +13374,16 @@ compiler=$CC
# save warnings/boilerplate of simple test code
ac_outfile=conftest.$ac_objext
-printf "$lt_simple_compile_test_code" >conftest.$ac_ext
+echo "$lt_simple_compile_test_code" >conftest.$ac_ext
eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
_lt_compiler_boilerplate=`cat conftest.err`
$rm conftest*
ac_outfile=conftest.$ac_objext
-printf "$lt_simple_link_test_code" >conftest.$ac_ext
+echo "$lt_simple_link_test_code" >conftest.$ac_ext
eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
_lt_linker_boilerplate=`cat conftest.err`
-$rm conftest*
+$rm -r conftest*
# Allow CC to be a program name with arguments.
@@ -12974,7 +13421,7 @@ aix3*)
postinstall_cmds='$RANLIB $lib'
fi
;;
-aix4* | aix5*)
+aix[4-9]*)
if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
test "$enable_shared" = yes && enable_static=no
fi
@@ -13020,13 +13467,15 @@ echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6
lt_prog_compiler_pic_F77='-m68020 -resident32 -malways-restore-a4'
;;
- beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
+ beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
# PIC is the default for these OSes.
;;
- mingw* | pw32* | os2*)
+ mingw* | cygwin* | pw32* | os2*)
# This hack is so that the source file can tell whether it is being
# built for inclusion in a dll (and should export symbols for example).
+ # Although the cygwin gcc ignores -fPIC, still need this for old-style
+ # (--disable-auto-import) libraries
lt_prog_compiler_pic_F77='-DDLL_EXPORT'
;;
@@ -13036,7 +13485,7 @@ echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6
lt_prog_compiler_pic_F77='-fno-common'
;;
- interix3*)
+ interix[3-9]*)
# Interix 3.x gcc -fpic/-fPIC options generate broken code.
# Instead, we relocate shared libraries at runtime.
;;
@@ -13094,7 +13543,7 @@ echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6
esac
;;
- mingw* | pw32* | os2*)
+ mingw* | cygwin* | pw32* | os2*)
# This hack is so that the source file can tell whether it is being
# built for inclusion in a dll (and should export symbols for example).
lt_prog_compiler_pic_F77='-DDLL_EXPORT'
@@ -13127,7 +13576,7 @@ echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6
lt_prog_compiler_static_F77='-Bstatic'
;;
- linux*)
+ linux* | k*bsd*-gnu)
case $cc_basename in
icc* | ecc*)
lt_prog_compiler_wl_F77='-Wl,'
@@ -13146,6 +13595,22 @@ echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6
# All Alpha code is PIC.
lt_prog_compiler_static_F77='-non_shared'
;;
+ *)
+ case `$CC -V 2>&1 | sed 5q` in
+ *Sun\ C*)
+ # Sun C 5.9
+ lt_prog_compiler_pic_F77='-KPIC'
+ lt_prog_compiler_static_F77='-Bstatic'
+ lt_prog_compiler_wl_F77='-Wl,'
+ ;;
+ *Sun\ F*)
+ # Sun Fortran 8.3 passes all unrecognized flags to the linker
+ lt_prog_compiler_pic_F77='-KPIC'
+ lt_prog_compiler_static_F77='-Bstatic'
+ lt_prog_compiler_wl_F77=''
+ ;;
+ esac
+ ;;
esac
;;
@@ -13155,6 +13620,10 @@ echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6
lt_prog_compiler_static_F77='-non_shared'
;;
+ rdos*)
+ lt_prog_compiler_static_F77='-non_shared'
+ ;;
+
solaris*)
lt_prog_compiler_pic_F77='-KPIC'
lt_prog_compiler_static_F77='-Bstatic'
@@ -13217,12 +13686,12 @@ if test -n "$lt_prog_compiler_pic_F77"; then
echo "$as_me:$LINENO: checking if $compiler PIC flag $lt_prog_compiler_pic_F77 works" >&5
echo $ECHO_N "checking if $compiler PIC flag $lt_prog_compiler_pic_F77 works... $ECHO_C" >&6
-if test "${lt_prog_compiler_pic_works_F77+set}" = set; then
+if test "${lt_cv_prog_compiler_pic_works_F77+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
- lt_prog_compiler_pic_works_F77=no
+ lt_cv_prog_compiler_pic_works_F77=no
ac_outfile=conftest.$ac_objext
- printf "$lt_simple_compile_test_code" > conftest.$ac_ext
+ echo "$lt_simple_compile_test_code" > conftest.$ac_ext
lt_compiler_flag="$lt_prog_compiler_pic_F77"
# Insert the option either (1) after the last *FLAGS variable, or
# (2) before a word containing "conftest.", or (3) at the end.
@@ -13233,27 +13702,27 @@ else
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
- (eval echo "\"\$as_me:13236: $lt_compile\"" >&5)
+ (eval echo "\"\$as_me:13705: $lt_compile\"" >&5)
(eval "$lt_compile" 2>conftest.err)
ac_status=$?
cat conftest.err >&5
- echo "$as_me:13240: \$? = $ac_status" >&5
+ echo "$as_me:13709: \$? = $ac_status" >&5
if (exit $ac_status) && test -s "$ac_outfile"; then
# The compiler can only warn and ignore the option if not recognized
# So say no if there are warnings other than the usual output.
$echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp
$SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then
- lt_prog_compiler_pic_works_F77=yes
+ lt_cv_prog_compiler_pic_works_F77=yes
fi
fi
$rm conftest*
fi
-echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_works_F77" >&5
-echo "${ECHO_T}$lt_prog_compiler_pic_works_F77" >&6
+echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_pic_works_F77" >&5
+echo "${ECHO_T}$lt_cv_prog_compiler_pic_works_F77" >&6
-if test x"$lt_prog_compiler_pic_works_F77" = xyes; then
+if test x"$lt_cv_prog_compiler_pic_works_F77" = xyes; then
case $lt_prog_compiler_pic_F77 in
"" | " "*) ;;
*) lt_prog_compiler_pic_F77=" $lt_prog_compiler_pic_F77" ;;
@@ -13280,13 +13749,13 @@ esac
wl=$lt_prog_compiler_wl_F77 eval lt_tmp_static_flag=\"$lt_prog_compiler_static_F77\"
echo "$as_me:$LINENO: checking if $compiler static flag $lt_tmp_static_flag works" >&5
echo $ECHO_N "checking if $compiler static flag $lt_tmp_static_flag works... $ECHO_C" >&6
-if test "${lt_prog_compiler_static_works_F77+set}" = set; then
+if test "${lt_cv_prog_compiler_static_works_F77+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
- lt_prog_compiler_static_works_F77=no
+ lt_cv_prog_compiler_static_works_F77=no
save_LDFLAGS="$LDFLAGS"
LDFLAGS="$LDFLAGS $lt_tmp_static_flag"
- printf "$lt_simple_link_test_code" > conftest.$ac_ext
+ echo "$lt_simple_link_test_code" > conftest.$ac_ext
if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then
# The linker can only warn and ignore the option if not recognized
# So say no if there are warnings
@@ -13296,20 +13765,20 @@ else
$echo "X$_lt_linker_boilerplate" | $Xsed -e '/^$/d' > conftest.exp
$SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
if diff conftest.exp conftest.er2 >/dev/null; then
- lt_prog_compiler_static_works_F77=yes
+ lt_cv_prog_compiler_static_works_F77=yes
fi
else
- lt_prog_compiler_static_works_F77=yes
+ lt_cv_prog_compiler_static_works_F77=yes
fi
fi
- $rm conftest*
+ $rm -r conftest*
LDFLAGS="$save_LDFLAGS"
fi
-echo "$as_me:$LINENO: result: $lt_prog_compiler_static_works_F77" >&5
-echo "${ECHO_T}$lt_prog_compiler_static_works_F77" >&6
+echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_static_works_F77" >&5
+echo "${ECHO_T}$lt_cv_prog_compiler_static_works_F77" >&6
-if test x"$lt_prog_compiler_static_works_F77" = xyes; then
+if test x"$lt_cv_prog_compiler_static_works_F77" = xyes; then
:
else
lt_prog_compiler_static_F77=
@@ -13326,7 +13795,7 @@ else
mkdir conftest
cd conftest
mkdir out
- printf "$lt_simple_compile_test_code" > conftest.$ac_ext
+ echo "$lt_simple_compile_test_code" > conftest.$ac_ext
lt_compiler_flag="-o out/conftest2.$ac_objext"
# Insert the option either (1) after the last *FLAGS variable, or
@@ -13337,11 +13806,11 @@ else
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
- (eval echo "\"\$as_me:13340: $lt_compile\"" >&5)
+ (eval echo "\"\$as_me:13809: $lt_compile\"" >&5)
(eval "$lt_compile" 2>out/conftest.err)
ac_status=$?
cat out/conftest.err >&5
- echo "$as_me:13344: \$? = $ac_status" >&5
+ echo "$as_me:13813: \$? = $ac_status" >&5
if (exit $ac_status) && test -s out/conftest2.$ac_objext
then
# The compiler can only warn and ignore the option if not recognized
@@ -13421,12 +13890,13 @@ echo $ECHO_N "checking whether the $compiler linker ($LD) supports shared librar
# it will be wrapped by ` (' and `)$', so one must not match beginning or
# end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc',
# as well as any symbol that contains `d'.
- exclude_expsyms_F77="_GLOBAL_OFFSET_TABLE_"
+ exclude_expsyms_F77='_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*'
# Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out
# platforms (ab)use it in PIC code, but their linkers get confused if
# the symbol is explicitly referenced. Since portable code cannot
# rely on this symbol name, it's probably fine to never include it in
# preloaded symbol tables.
+ # Exclude shared library initialization/finalization symbols.
extract_expsyms_cmds=
# Just being paranoid about ensuring that cc_basename is set.
for cc_temp in $compiler""; do
@@ -13485,7 +13955,7 @@ cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"`
# See if GNU ld supports shared libraries.
case $host_os in
- aix3* | aix4* | aix5*)
+ aix[3-9]*)
# On AIX/PPC, the GNU linker is very broken
if test "$host_cpu" != ia64; then
ld_shlibs_F77=no
@@ -13533,7 +14003,7 @@ EOF
allow_undefined_flag_F77=unsupported
always_export_symbols_F77=no
enable_shared_with_static_runtimes_F77=yes
- export_symbols_cmds_F77='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS] /s/.* \([^ ]*\)/\1 DATA/'\'' | $SED -e '\''/^[AITW] /s/.* //'\'' | sort | uniq > $export_symbols'
+ export_symbols_cmds_F77='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/'\'' -e '\''/^[AITW][ ]/s/.*[ ]//'\'' | sort | uniq > $export_symbols'
if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then
archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
@@ -13551,7 +14021,7 @@ EOF
fi
;;
- interix3*)
+ interix[3-9]*)
hardcode_direct_F77=no
hardcode_shlibpath_var_F77=no
hardcode_libdir_flag_spec_F77='${wl}-rpath,$libdir'
@@ -13566,7 +14036,7 @@ EOF
archive_expsym_cmds_F77='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
;;
- linux*)
+ gnu* | linux* | k*bsd*-gnu)
if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
tmp_addflag=
case $cc_basename,$host_cpu in
@@ -13584,13 +14054,22 @@ EOF
ifc* | ifort*) # Intel Fortran compiler
tmp_addflag=' -nofor_main' ;;
esac
- archive_cmds_F77='$CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ case `$CC -V 2>&1 | sed 5q` in
+ *Sun\ C*) # Sun C 5.9
+ whole_archive_flag_spec_F77='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive'
+ tmp_sharedflag='-G' ;;
+ *Sun\ F*) # Sun Fortran 8.3
+ tmp_sharedflag='-G' ;;
+ *)
+ tmp_sharedflag='-shared' ;;
+ esac
+ archive_cmds_F77='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
if test $supports_anon_versioning = yes; then
archive_expsym_cmds_F77='$echo "{ global:" > $output_objdir/$libname.ver~
cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
$echo "local: *; };" >> $output_objdir/$libname.ver~
- $CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
+ $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
fi
else
ld_shlibs_F77=no
@@ -13695,7 +14174,7 @@ _LT_EOF
fi
;;
- aix4* | aix5*)
+ aix[4-9]*)
if test "$host_cpu" = ia64; then
# On IA64, the linker does run time linking by default, so we don't
# have to do anything special.
@@ -13715,7 +14194,7 @@ _LT_EOF
# Test if we are trying to use run time linking or normal
# AIX style linking. If -brtl is somewhere in LDFLAGS, we
# need to do runtime linking.
- case $host_os in aix4.[23]|aix4.[23].*|aix5*)
+ case $host_os in aix4.[23]|aix4.[23].*|aix[5-9]*)
for ld_flag in $LDFLAGS; do
if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then
aix_use_runtimelinking=yes
@@ -13749,7 +14228,7 @@ _LT_EOF
strings "$collect2name" | grep resolve_lib_name >/dev/null
then
# We have reworked collect2
- hardcode_direct_F77=yes
+ :
else
# We have old collect2
hardcode_direct_F77=unsupported
@@ -13817,11 +14296,18 @@ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
-aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; }
-}'`
+lt_aix_libpath_sed='
+ /Import File Strings/,/^$/ {
+ /^0/ {
+ s/^0 *\(.*\)$/\1/
+ p
+ }
+ }'
+aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
# Check for a 64-bit object if we didn't find anything.
-if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; }
-}'`; fi
+if test -z "$aix_libpath"; then
+ aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
+fi
else
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
@@ -13868,11 +14354,18 @@ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
-aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; }
-}'`
+lt_aix_libpath_sed='
+ /Import File Strings/,/^$/ {
+ /^0/ {
+ s/^0 *\(.*\)$/\1/
+ p
+ }
+ }'
+aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
# Check for a 64-bit object if we didn't find anything.
-if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; }
-}'`; fi
+if test -z "$aix_libpath"; then
+ aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
+fi
else
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
@@ -13924,7 +14417,7 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
# The linker will automatically build a .lib file if we build a DLL.
old_archive_From_new_cmds_F77='true'
# FIXME: Should let the user specify the lib program.
- old_archive_cmds_F77='lib /OUT:$oldlib$oldobjs$old_deplibs'
+ old_archive_cmds_F77='lib -OUT:$oldlib$oldobjs$old_deplibs'
fix_srcfile_path_F77='`cygpath -w "$srcfile"`'
enable_shared_with_static_runtimes_F77=yes
;;
@@ -13957,19 +14450,18 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
link_all_deplibs_F77=yes
if test "$GCC" = yes ; then
output_verbose_link_cmd='echo'
- archive_cmds_F77='$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring'
- module_cmds_F77='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags'
- # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds
- archive_expsym_cmds_F77='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
- module_expsym_cmds_F77='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+ archive_cmds_F77="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}"
+ module_cmds_F77="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}"
+ archive_expsym_cmds_F77="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}"
+ module_expsym_cmds_F77="sed -e 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dar_export_syms}${_lt_dsymutil}"
else
case $cc_basename in
xlc*)
output_verbose_link_cmd='echo'
- archive_cmds_F77='$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $verstring'
+ archive_cmds_F77='$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $xlcverstring'
module_cmds_F77='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags'
# Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds
- archive_expsym_cmds_F77='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+ archive_expsym_cmds_F77='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $xlcverstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
module_expsym_cmds_F77='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
;;
*)
@@ -14009,7 +14501,7 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
;;
# FreeBSD 3 and greater uses gcc -shared to do shared libraries.
- freebsd* | kfreebsd*-gnu | dragonfly*)
+ freebsd* | dragonfly*)
archive_cmds_F77='$CC -shared -o $lib $libobjs $deplibs $compiler_flags'
hardcode_libdir_flag_spec_F77='-R$libdir'
hardcode_direct_F77=yes
@@ -14132,15 +14624,15 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
openbsd*)
if test -f /usr/libexec/ld.so; then
- hardcode_direct_F77=yes
- hardcode_shlibpath_var_F77=no
- if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+ hardcode_direct_F77=yes
+ hardcode_shlibpath_var_F77=no
+ if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
archive_cmds_F77='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
archive_expsym_cmds_F77='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols'
hardcode_libdir_flag_spec_F77='${wl}-rpath,$libdir'
export_dynamic_flag_spec_F77='${wl}-E'
- else
- case $host_os in
+ else
+ case $host_os in
openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*)
archive_cmds_F77='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
hardcode_libdir_flag_spec_F77='-R$libdir'
@@ -14149,10 +14641,10 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
archive_cmds_F77='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
hardcode_libdir_flag_spec_F77='${wl}-rpath,$libdir'
;;
- esac
+ esac
fi
else
- ld_shlibs_F77=no
+ ld_shlibs_F77=no
fi
;;
@@ -14211,17 +14703,16 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
case $host_os in
solaris2.[0-5] | solaris2.[0-5].*) ;;
*)
- # The compiler driver will combine linker options so we
- # cannot just pass the convience library names through
- # without $wl, iff we do not link with $LD.
- # Luckily, gcc supports the same syntax we need for Sun Studio.
+ # The compiler driver will combine and reorder linker options,
+ # but understands `-z linker_flag'. GCC discards it without `$wl',
+ # but is careful enough not to reorder.
# Supported since Solaris 2.6 (maybe 2.5.1?)
- case $wlarc in
- '')
- whole_archive_flag_spec_F77='-z allextract$convenience -z defaultextract' ;;
- *)
- whole_archive_flag_spec_F77='${wl}-z ${wl}allextract`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}-z ${wl}defaultextract' ;;
- esac ;;
+ if test "$GCC" = yes; then
+ whole_archive_flag_spec_F77='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract'
+ else
+ whole_archive_flag_spec_F77='-z allextract$convenience -z defaultextract'
+ fi
+ ;;
esac
link_all_deplibs_F77=yes
;;
@@ -14278,7 +14769,7 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
fi
;;
- sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7*)
+ sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*)
no_undefined_flag_F77='${wl}-z,text'
archive_cmds_need_lc_F77=no
hardcode_shlibpath_var_F77=no
@@ -14355,7 +14846,7 @@ x|xyes)
echo "$as_me:$LINENO: checking whether -lc should be explicitly linked in" >&5
echo $ECHO_N "checking whether -lc should be explicitly linked in... $ECHO_C" >&6
$rm conftest*
- printf "$lt_simple_compile_test_code" > conftest.$ac_ext
+ echo "$lt_simple_compile_test_code" > conftest.$ac_ext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
(eval $ac_compile) 2>&5
@@ -14413,20 +14904,7 @@ shlibpath_overrides_runpath=unknown
version_type=none
dynamic_linker="$host_os ld.so"
sys_lib_dlsearch_path_spec="/lib /usr/lib"
-if test "$GCC" = yes; then
- sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"`
- if echo "$sys_lib_search_path_spec" | grep ';' >/dev/null ; then
- # if the path contains ";" then we assume it to be the separator
- # otherwise default to the standard path separator (i.e. ":") - it is
- # assumed that no part of a normal pathname contains ";" but that should
- # okay in the real world where ";" in dirpaths is itself problematic.
- sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
- else
- sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
- fi
-else
- sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
-fi
+
need_lib_prefix=unknown
hardcode_into_libs=no
@@ -14444,7 +14922,7 @@ aix3*)
soname_spec='${libname}${release}${shared_ext}$major'
;;
-aix4* | aix5*)
+aix[4-9]*)
version_type=linux
need_lib_prefix=no
need_version=no
@@ -14583,12 +15061,7 @@ darwin* | rhapsody*)
shlibpath_overrides_runpath=yes
shlibpath_var=DYLD_LIBRARY_PATH
shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`'
- # Apple's gcc prints 'gcc -print-search-dirs' doesn't operate the same.
- if test "$GCC" = yes; then
- sys_lib_search_path_spec=`$CC -print-search-dirs | tr "\n" "$PATH_SEPARATOR" | sed -e 's/libraries:/@libraries:/' | tr "@" "\n" | grep "^libraries:" | sed -e "s/^libraries://" -e "s,=/,/,g" -e "s,$PATH_SEPARATOR, ,g" -e "s,.*,& /lib /usr/lib /usr/local/lib,g"`
- else
- sys_lib_search_path_spec='/lib /usr/lib /usr/local/lib'
- fi
+
sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib'
;;
@@ -14605,18 +15078,6 @@ freebsd1*)
dynamic_linker=no
;;
-kfreebsd*-gnu)
- version_type=linux
- need_lib_prefix=no
- need_version=no
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- shlibpath_var=LD_LIBRARY_PATH
- shlibpath_overrides_runpath=no
- hardcode_into_libs=yes
- dynamic_linker='GNU ld.so'
- ;;
-
freebsd* | dragonfly*)
# DragonFly does not have aout. When/if they implement a new
# versioning mechanism, adjust this.
@@ -14654,7 +15115,7 @@ freebsd* | dragonfly*)
shlibpath_overrides_runpath=no
hardcode_into_libs=yes
;;
- freebsd*) # from 4.6 on
+ *) # from 4.6 on, and DragonFly
shlibpath_overrides_runpath=yes
hardcode_into_libs=yes
;;
@@ -14717,7 +15178,7 @@ hpux9* | hpux10* | hpux11*)
postinstall_cmds='chmod 555 $lib'
;;
-interix3*)
+interix[3-9]*)
version_type=linux
need_lib_prefix=no
need_version=no
@@ -14772,7 +15233,7 @@ linux*oldld* | linux*aout* | linux*coff*)
;;
# This must be Linux ELF.
-linux*)
+linux* | k*bsd*-gnu)
version_type=linux
need_lib_prefix=no
need_version=no
@@ -14788,7 +15249,7 @@ linux*)
# Append ld.so.conf contents to the search path
if test -f /etc/ld.so.conf; then
- lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '`
+ lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '`
sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra"
fi
@@ -14801,18 +15262,6 @@ linux*)
dynamic_linker='GNU/Linux ld.so'
;;
-knetbsd*-gnu)
- version_type=linux
- need_lib_prefix=no
- need_version=no
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- shlibpath_var=LD_LIBRARY_PATH
- shlibpath_overrides_runpath=no
- hardcode_into_libs=yes
- dynamic_linker='GNU ld.so'
- ;;
-
netbsd*)
version_type=sunos
need_lib_prefix=no
@@ -14894,6 +15343,10 @@ osf3* | osf4* | osf5*)
sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec"
;;
+rdos*)
+ dynamic_linker=no
+ ;;
+
solaris*)
version_type=linux
need_lib_prefix=no
@@ -14990,6 +15443,21 @@ echo "$as_me:$LINENO: result: $dynamic_linker" >&5
echo "${ECHO_T}$dynamic_linker" >&6
test "$dynamic_linker" = no && can_build_shared=no
+if test "${lt_cv_sys_lib_search_path_spec+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ lt_cv_sys_lib_search_path_spec="$sys_lib_search_path_spec"
+fi
+
+sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec"
+if test "${lt_cv_sys_lib_dlsearch_path_spec+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ lt_cv_sys_lib_dlsearch_path_spec="$sys_lib_dlsearch_path_spec"
+fi
+
+sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec"
+
variables_saved_for_relink="PATH $shlibpath_var $runpath_var"
if test "$GCC" = yes; then
variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
@@ -15073,6 +15541,7 @@ if test -f "$ltmain"; then
predeps_F77 \
postdeps_F77 \
compiler_lib_search_path_F77 \
+ compiler_lib_search_dirs_F77 \
archive_cmds_F77 \
archive_expsym_cmds_F77 \
postinstall_cmds_F77 \
@@ -15088,6 +15557,7 @@ if test -f "$ltmain"; then
module_cmds_F77 \
module_expsym_cmds_F77 \
lt_cv_prog_compiler_c_o_F77 \
+ fix_srcfile_path_F77 \
exclude_expsyms_F77 \
include_expsyms_F77; do
@@ -15320,6 +15790,10 @@ predeps=$lt_predeps_F77
# shared library.
postdeps=$lt_postdeps_F77
+# The directories searched by this compiler when creating a shared
+# library
+compiler_lib_search_dirs=$lt_compiler_lib_search_dirs_F77
+
# The library search path used internally by the compiler when linking
# a shared library.
compiler_lib_search_path=$lt_compiler_lib_search_path_F77
@@ -15408,7 +15882,7 @@ sys_lib_search_path_spec=$lt_sys_lib_search_path_spec
sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec
# Fix the shell variable \$srcfile for the compiler.
-fix_srcfile_path="$fix_srcfile_path_F77"
+fix_srcfile_path=$lt_fix_srcfile_path
# Set to yes if exported symbols are required.
always_export_symbols=$always_export_symbols_F77
@@ -15467,10 +15941,10 @@ objext=o
objext_GCJ=$objext
# Code to be used in simple compile tests
-lt_simple_compile_test_code="class foo {}\n"
+lt_simple_compile_test_code="class foo {}"
# Code to be used in simple link tests
-lt_simple_link_test_code='public class conftest { public static void main(String[] argv) {}; }\n'
+lt_simple_link_test_code='public class conftest { public static void main(String[] argv) {}; }'
# ltmain only uses $CC for tagged configurations so make sure $CC is set.
@@ -15486,16 +15960,16 @@ compiler=$CC
# save warnings/boilerplate of simple test code
ac_outfile=conftest.$ac_objext
-printf "$lt_simple_compile_test_code" >conftest.$ac_ext
+echo "$lt_simple_compile_test_code" >conftest.$ac_ext
eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
_lt_compiler_boilerplate=`cat conftest.err`
$rm conftest*
ac_outfile=conftest.$ac_objext
-printf "$lt_simple_link_test_code" >conftest.$ac_ext
+echo "$lt_simple_link_test_code" >conftest.$ac_ext
eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
_lt_linker_boilerplate=`cat conftest.err`
-$rm conftest*
+$rm -r conftest*
# Allow CC to be a program name with arguments.
@@ -15533,7 +16007,7 @@ if test "${lt_cv_prog_compiler_rtti_exceptions+set}" = set; then
else
lt_cv_prog_compiler_rtti_exceptions=no
ac_outfile=conftest.$ac_objext
- printf "$lt_simple_compile_test_code" > conftest.$ac_ext
+ echo "$lt_simple_compile_test_code" > conftest.$ac_ext
lt_compiler_flag="-fno-rtti -fno-exceptions"
# Insert the option either (1) after the last *FLAGS variable, or
# (2) before a word containing "conftest.", or (3) at the end.
@@ -15544,11 +16018,11 @@ else
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
- (eval echo "\"\$as_me:15547: $lt_compile\"" >&5)
+ (eval echo "\"\$as_me:16021: $lt_compile\"" >&5)
(eval "$lt_compile" 2>conftest.err)
ac_status=$?
cat conftest.err >&5
- echo "$as_me:15551: \$? = $ac_status" >&5
+ echo "$as_me:16025: \$? = $ac_status" >&5
if (exit $ac_status) && test -s "$ac_outfile"; then
# The compiler can only warn and ignore the option if not recognized
# So say no if there are warnings other than the usual output.
@@ -15599,14 +16073,16 @@ echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6
lt_prog_compiler_pic_GCJ='-m68020 -resident32 -malways-restore-a4'
;;
- beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
+ beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
# PIC is the default for these OSes.
;;
- mingw* | pw32* | os2*)
+ mingw* | cygwin* | pw32* | os2*)
# This hack is so that the source file can tell whether it is being
# built for inclusion in a dll (and should export symbols for example).
- lt_prog_compiler_pic_GCJ='-DDLL_EXPORT'
+ # Although the cygwin gcc ignores -fPIC, still need this for old-style
+ # (--disable-auto-import) libraries
+
;;
darwin* | rhapsody*)
@@ -15615,7 +16091,7 @@ echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6
lt_prog_compiler_pic_GCJ='-fno-common'
;;
- interix3*)
+ interix[3-9]*)
# Interix 3.x gcc -fpic/-fPIC options generate broken code.
# Instead, we relocate shared libraries at runtime.
;;
@@ -15673,10 +16149,10 @@ echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6
esac
;;
- mingw* | pw32* | os2*)
+ mingw* | cygwin* | pw32* | os2*)
# This hack is so that the source file can tell whether it is being
# built for inclusion in a dll (and should export symbols for example).
- lt_prog_compiler_pic_GCJ='-DDLL_EXPORT'
+
;;
hpux9* | hpux10* | hpux11*)
@@ -15706,7 +16182,7 @@ echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6
lt_prog_compiler_static_GCJ='-Bstatic'
;;
- linux*)
+ linux* | k*bsd*-gnu)
case $cc_basename in
icc* | ecc*)
lt_prog_compiler_wl_GCJ='-Wl,'
@@ -15725,6 +16201,22 @@ echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6
# All Alpha code is PIC.
lt_prog_compiler_static_GCJ='-non_shared'
;;
+ *)
+ case `$CC -V 2>&1 | sed 5q` in
+ *Sun\ C*)
+ # Sun C 5.9
+ lt_prog_compiler_pic_GCJ='-KPIC'
+ lt_prog_compiler_static_GCJ='-Bstatic'
+ lt_prog_compiler_wl_GCJ='-Wl,'
+ ;;
+ *Sun\ F*)
+ # Sun Fortran 8.3 passes all unrecognized flags to the linker
+ lt_prog_compiler_pic_GCJ='-KPIC'
+ lt_prog_compiler_static_GCJ='-Bstatic'
+ lt_prog_compiler_wl_GCJ=''
+ ;;
+ esac
+ ;;
esac
;;
@@ -15734,6 +16226,10 @@ echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6
lt_prog_compiler_static_GCJ='-non_shared'
;;
+ rdos*)
+ lt_prog_compiler_static_GCJ='-non_shared'
+ ;;
+
solaris*)
lt_prog_compiler_pic_GCJ='-KPIC'
lt_prog_compiler_static_GCJ='-Bstatic'
@@ -15796,12 +16292,12 @@ if test -n "$lt_prog_compiler_pic_GCJ"; then
echo "$as_me:$LINENO: checking if $compiler PIC flag $lt_prog_compiler_pic_GCJ works" >&5
echo $ECHO_N "checking if $compiler PIC flag $lt_prog_compiler_pic_GCJ works... $ECHO_C" >&6
-if test "${lt_prog_compiler_pic_works_GCJ+set}" = set; then
+if test "${lt_cv_prog_compiler_pic_works_GCJ+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
- lt_prog_compiler_pic_works_GCJ=no
+ lt_cv_prog_compiler_pic_works_GCJ=no
ac_outfile=conftest.$ac_objext
- printf "$lt_simple_compile_test_code" > conftest.$ac_ext
+ echo "$lt_simple_compile_test_code" > conftest.$ac_ext
lt_compiler_flag="$lt_prog_compiler_pic_GCJ"
# Insert the option either (1) after the last *FLAGS variable, or
# (2) before a word containing "conftest.", or (3) at the end.
@@ -15812,27 +16308,27 @@ else
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
- (eval echo "\"\$as_me:15815: $lt_compile\"" >&5)
+ (eval echo "\"\$as_me:16311: $lt_compile\"" >&5)
(eval "$lt_compile" 2>conftest.err)
ac_status=$?
cat conftest.err >&5
- echo "$as_me:15819: \$? = $ac_status" >&5
+ echo "$as_me:16315: \$? = $ac_status" >&5
if (exit $ac_status) && test -s "$ac_outfile"; then
# The compiler can only warn and ignore the option if not recognized
# So say no if there are warnings other than the usual output.
$echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp
$SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then
- lt_prog_compiler_pic_works_GCJ=yes
+ lt_cv_prog_compiler_pic_works_GCJ=yes
fi
fi
$rm conftest*
fi
-echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_works_GCJ" >&5
-echo "${ECHO_T}$lt_prog_compiler_pic_works_GCJ" >&6
+echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_pic_works_GCJ" >&5
+echo "${ECHO_T}$lt_cv_prog_compiler_pic_works_GCJ" >&6
-if test x"$lt_prog_compiler_pic_works_GCJ" = xyes; then
+if test x"$lt_cv_prog_compiler_pic_works_GCJ" = xyes; then
case $lt_prog_compiler_pic_GCJ in
"" | " "*) ;;
*) lt_prog_compiler_pic_GCJ=" $lt_prog_compiler_pic_GCJ" ;;
@@ -15859,13 +16355,13 @@ esac
wl=$lt_prog_compiler_wl_GCJ eval lt_tmp_static_flag=\"$lt_prog_compiler_static_GCJ\"
echo "$as_me:$LINENO: checking if $compiler static flag $lt_tmp_static_flag works" >&5
echo $ECHO_N "checking if $compiler static flag $lt_tmp_static_flag works... $ECHO_C" >&6
-if test "${lt_prog_compiler_static_works_GCJ+set}" = set; then
+if test "${lt_cv_prog_compiler_static_works_GCJ+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
- lt_prog_compiler_static_works_GCJ=no
+ lt_cv_prog_compiler_static_works_GCJ=no
save_LDFLAGS="$LDFLAGS"
LDFLAGS="$LDFLAGS $lt_tmp_static_flag"
- printf "$lt_simple_link_test_code" > conftest.$ac_ext
+ echo "$lt_simple_link_test_code" > conftest.$ac_ext
if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then
# The linker can only warn and ignore the option if not recognized
# So say no if there are warnings
@@ -15875,20 +16371,20 @@ else
$echo "X$_lt_linker_boilerplate" | $Xsed -e '/^$/d' > conftest.exp
$SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
if diff conftest.exp conftest.er2 >/dev/null; then
- lt_prog_compiler_static_works_GCJ=yes
+ lt_cv_prog_compiler_static_works_GCJ=yes
fi
else
- lt_prog_compiler_static_works_GCJ=yes
+ lt_cv_prog_compiler_static_works_GCJ=yes
fi
fi
- $rm conftest*
+ $rm -r conftest*
LDFLAGS="$save_LDFLAGS"
fi
-echo "$as_me:$LINENO: result: $lt_prog_compiler_static_works_GCJ" >&5
-echo "${ECHO_T}$lt_prog_compiler_static_works_GCJ" >&6
+echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_static_works_GCJ" >&5
+echo "${ECHO_T}$lt_cv_prog_compiler_static_works_GCJ" >&6
-if test x"$lt_prog_compiler_static_works_GCJ" = xyes; then
+if test x"$lt_cv_prog_compiler_static_works_GCJ" = xyes; then
:
else
lt_prog_compiler_static_GCJ=
@@ -15905,7 +16401,7 @@ else
mkdir conftest
cd conftest
mkdir out
- printf "$lt_simple_compile_test_code" > conftest.$ac_ext
+ echo "$lt_simple_compile_test_code" > conftest.$ac_ext
lt_compiler_flag="-o out/conftest2.$ac_objext"
# Insert the option either (1) after the last *FLAGS variable, or
@@ -15916,11 +16412,11 @@ else
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
- (eval echo "\"\$as_me:15919: $lt_compile\"" >&5)
+ (eval echo "\"\$as_me:16415: $lt_compile\"" >&5)
(eval "$lt_compile" 2>out/conftest.err)
ac_status=$?
cat out/conftest.err >&5
- echo "$as_me:15923: \$? = $ac_status" >&5
+ echo "$as_me:16419: \$? = $ac_status" >&5
if (exit $ac_status) && test -s out/conftest2.$ac_objext
then
# The compiler can only warn and ignore the option if not recognized
@@ -16000,12 +16496,13 @@ echo $ECHO_N "checking whether the $compiler linker ($LD) supports shared librar
# it will be wrapped by ` (' and `)$', so one must not match beginning or
# end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc',
# as well as any symbol that contains `d'.
- exclude_expsyms_GCJ="_GLOBAL_OFFSET_TABLE_"
+ exclude_expsyms_GCJ='_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*'
# Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out
# platforms (ab)use it in PIC code, but their linkers get confused if
# the symbol is explicitly referenced. Since portable code cannot
# rely on this symbol name, it's probably fine to never include it in
# preloaded symbol tables.
+ # Exclude shared library initialization/finalization symbols.
extract_expsyms_cmds=
# Just being paranoid about ensuring that cc_basename is set.
for cc_temp in $compiler""; do
@@ -16064,7 +16561,7 @@ cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"`
# See if GNU ld supports shared libraries.
case $host_os in
- aix3* | aix4* | aix5*)
+ aix[3-9]*)
# On AIX/PPC, the GNU linker is very broken
if test "$host_cpu" != ia64; then
ld_shlibs_GCJ=no
@@ -16112,7 +16609,7 @@ EOF
allow_undefined_flag_GCJ=unsupported
always_export_symbols_GCJ=no
enable_shared_with_static_runtimes_GCJ=yes
- export_symbols_cmds_GCJ='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS] /s/.* \([^ ]*\)/\1 DATA/'\'' | $SED -e '\''/^[AITW] /s/.* //'\'' | sort | uniq > $export_symbols'
+ export_symbols_cmds_GCJ='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/'\'' -e '\''/^[AITW][ ]/s/.*[ ]//'\'' | sort | uniq > $export_symbols'
if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then
archive_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
@@ -16130,7 +16627,7 @@ EOF
fi
;;
- interix3*)
+ interix[3-9]*)
hardcode_direct_GCJ=no
hardcode_shlibpath_var_GCJ=no
hardcode_libdir_flag_spec_GCJ='${wl}-rpath,$libdir'
@@ -16145,7 +16642,7 @@ EOF
archive_expsym_cmds_GCJ='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
;;
- linux*)
+ gnu* | linux* | k*bsd*-gnu)
if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
tmp_addflag=
case $cc_basename,$host_cpu in
@@ -16163,13 +16660,22 @@ EOF
ifc* | ifort*) # Intel Fortran compiler
tmp_addflag=' -nofor_main' ;;
esac
- archive_cmds_GCJ='$CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ case `$CC -V 2>&1 | sed 5q` in
+ *Sun\ C*) # Sun C 5.9
+ whole_archive_flag_spec_GCJ='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive'
+ tmp_sharedflag='-G' ;;
+ *Sun\ F*) # Sun Fortran 8.3
+ tmp_sharedflag='-G' ;;
+ *)
+ tmp_sharedflag='-shared' ;;
+ esac
+ archive_cmds_GCJ='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
if test $supports_anon_versioning = yes; then
archive_expsym_cmds_GCJ='$echo "{ global:" > $output_objdir/$libname.ver~
cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
$echo "local: *; };" >> $output_objdir/$libname.ver~
- $CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
+ $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
fi
else
ld_shlibs_GCJ=no
@@ -16274,7 +16780,7 @@ _LT_EOF
fi
;;
- aix4* | aix5*)
+ aix[4-9]*)
if test "$host_cpu" = ia64; then
# On IA64, the linker does run time linking by default, so we don't
# have to do anything special.
@@ -16294,7 +16800,7 @@ _LT_EOF
# Test if we are trying to use run time linking or normal
# AIX style linking. If -brtl is somewhere in LDFLAGS, we
# need to do runtime linking.
- case $host_os in aix4.[23]|aix4.[23].*|aix5*)
+ case $host_os in aix4.[23]|aix4.[23].*|aix[5-9]*)
for ld_flag in $LDFLAGS; do
if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then
aix_use_runtimelinking=yes
@@ -16328,7 +16834,7 @@ _LT_EOF
strings "$collect2name" | grep resolve_lib_name >/dev/null
then
# We have reworked collect2
- hardcode_direct_GCJ=yes
+ :
else
# We have old collect2
hardcode_direct_GCJ=unsupported
@@ -16406,11 +16912,18 @@ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
-aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; }
-}'`
+lt_aix_libpath_sed='
+ /Import File Strings/,/^$/ {
+ /^0/ {
+ s/^0 *\(.*\)$/\1/
+ p
+ }
+ }'
+aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
# Check for a 64-bit object if we didn't find anything.
-if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; }
-}'`; fi
+if test -z "$aix_libpath"; then
+ aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
+fi
else
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
@@ -16467,11 +16980,18 @@ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
-aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; }
-}'`
+lt_aix_libpath_sed='
+ /Import File Strings/,/^$/ {
+ /^0/ {
+ s/^0 *\(.*\)$/\1/
+ p
+ }
+ }'
+aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
# Check for a 64-bit object if we didn't find anything.
-if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; }
-}'`; fi
+if test -z "$aix_libpath"; then
+ aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
+fi
else
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
@@ -16523,7 +17043,7 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
# The linker will automatically build a .lib file if we build a DLL.
old_archive_From_new_cmds_GCJ='true'
# FIXME: Should let the user specify the lib program.
- old_archive_cmds_GCJ='lib /OUT:$oldlib$oldobjs$old_deplibs'
+ old_archive_cmds_GCJ='lib -OUT:$oldlib$oldobjs$old_deplibs'
fix_srcfile_path_GCJ='`cygpath -w "$srcfile"`'
enable_shared_with_static_runtimes_GCJ=yes
;;
@@ -16556,19 +17076,18 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
link_all_deplibs_GCJ=yes
if test "$GCC" = yes ; then
output_verbose_link_cmd='echo'
- archive_cmds_GCJ='$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring'
- module_cmds_GCJ='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags'
- # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds
- archive_expsym_cmds_GCJ='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
- module_expsym_cmds_GCJ='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+ archive_cmds_GCJ="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}"
+ module_cmds_GCJ="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}"
+ archive_expsym_cmds_GCJ="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}"
+ module_expsym_cmds_GCJ="sed -e 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dar_export_syms}${_lt_dsymutil}"
else
case $cc_basename in
xlc*)
output_verbose_link_cmd='echo'
- archive_cmds_GCJ='$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $verstring'
+ archive_cmds_GCJ='$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $xlcverstring'
module_cmds_GCJ='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags'
# Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds
- archive_expsym_cmds_GCJ='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+ archive_expsym_cmds_GCJ='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $xlcverstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
module_expsym_cmds_GCJ='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
;;
*)
@@ -16608,7 +17127,7 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
;;
# FreeBSD 3 and greater uses gcc -shared to do shared libraries.
- freebsd* | kfreebsd*-gnu | dragonfly*)
+ freebsd* | dragonfly*)
archive_cmds_GCJ='$CC -shared -o $lib $libobjs $deplibs $compiler_flags'
hardcode_libdir_flag_spec_GCJ='-R$libdir'
hardcode_direct_GCJ=yes
@@ -16731,15 +17250,15 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
openbsd*)
if test -f /usr/libexec/ld.so; then
- hardcode_direct_GCJ=yes
- hardcode_shlibpath_var_GCJ=no
- if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+ hardcode_direct_GCJ=yes
+ hardcode_shlibpath_var_GCJ=no
+ if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
archive_cmds_GCJ='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
archive_expsym_cmds_GCJ='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols'
hardcode_libdir_flag_spec_GCJ='${wl}-rpath,$libdir'
export_dynamic_flag_spec_GCJ='${wl}-E'
- else
- case $host_os in
+ else
+ case $host_os in
openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*)
archive_cmds_GCJ='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
hardcode_libdir_flag_spec_GCJ='-R$libdir'
@@ -16748,10 +17267,10 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
archive_cmds_GCJ='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
hardcode_libdir_flag_spec_GCJ='${wl}-rpath,$libdir'
;;
- esac
+ esac
fi
else
- ld_shlibs_GCJ=no
+ ld_shlibs_GCJ=no
fi
;;
@@ -16810,17 +17329,16 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
case $host_os in
solaris2.[0-5] | solaris2.[0-5].*) ;;
*)
- # The compiler driver will combine linker options so we
- # cannot just pass the convience library names through
- # without $wl, iff we do not link with $LD.
- # Luckily, gcc supports the same syntax we need for Sun Studio.
+ # The compiler driver will combine and reorder linker options,
+ # but understands `-z linker_flag'. GCC discards it without `$wl',
+ # but is careful enough not to reorder.
# Supported since Solaris 2.6 (maybe 2.5.1?)
- case $wlarc in
- '')
- whole_archive_flag_spec_GCJ='-z allextract$convenience -z defaultextract' ;;
- *)
- whole_archive_flag_spec_GCJ='${wl}-z ${wl}allextract`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}-z ${wl}defaultextract' ;;
- esac ;;
+ if test "$GCC" = yes; then
+ whole_archive_flag_spec_GCJ='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract'
+ else
+ whole_archive_flag_spec_GCJ='-z allextract$convenience -z defaultextract'
+ fi
+ ;;
esac
link_all_deplibs_GCJ=yes
;;
@@ -16877,7 +17395,7 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
fi
;;
- sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7*)
+ sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*)
no_undefined_flag_GCJ='${wl}-z,text'
archive_cmds_need_lc_GCJ=no
hardcode_shlibpath_var_GCJ=no
@@ -16954,7 +17472,7 @@ x|xyes)
echo "$as_me:$LINENO: checking whether -lc should be explicitly linked in" >&5
echo $ECHO_N "checking whether -lc should be explicitly linked in... $ECHO_C" >&6
$rm conftest*
- printf "$lt_simple_compile_test_code" > conftest.$ac_ext
+ echo "$lt_simple_compile_test_code" > conftest.$ac_ext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
(eval $ac_compile) 2>&5
@@ -17012,20 +17530,7 @@ shlibpath_overrides_runpath=unknown
version_type=none
dynamic_linker="$host_os ld.so"
sys_lib_dlsearch_path_spec="/lib /usr/lib"
-if test "$GCC" = yes; then
- sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"`
- if echo "$sys_lib_search_path_spec" | grep ';' >/dev/null ; then
- # if the path contains ";" then we assume it to be the separator
- # otherwise default to the standard path separator (i.e. ":") - it is
- # assumed that no part of a normal pathname contains ";" but that should
- # okay in the real world where ";" in dirpaths is itself problematic.
- sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
- else
- sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
- fi
-else
- sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
-fi
+
need_lib_prefix=unknown
hardcode_into_libs=no
@@ -17043,7 +17548,7 @@ aix3*)
soname_spec='${libname}${release}${shared_ext}$major'
;;
-aix4* | aix5*)
+aix[4-9]*)
version_type=linux
need_lib_prefix=no
need_version=no
@@ -17182,12 +17687,7 @@ darwin* | rhapsody*)
shlibpath_overrides_runpath=yes
shlibpath_var=DYLD_LIBRARY_PATH
shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`'
- # Apple's gcc prints 'gcc -print-search-dirs' doesn't operate the same.
- if test "$GCC" = yes; then
- sys_lib_search_path_spec=`$CC -print-search-dirs | tr "\n" "$PATH_SEPARATOR" | sed -e 's/libraries:/@libraries:/' | tr "@" "\n" | grep "^libraries:" | sed -e "s/^libraries://" -e "s,=/,/,g" -e "s,$PATH_SEPARATOR, ,g" -e "s,.*,& /lib /usr/lib /usr/local/lib,g"`
- else
- sys_lib_search_path_spec='/lib /usr/lib /usr/local/lib'
- fi
+
sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib'
;;
@@ -17204,18 +17704,6 @@ freebsd1*)
dynamic_linker=no
;;
-kfreebsd*-gnu)
- version_type=linux
- need_lib_prefix=no
- need_version=no
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- shlibpath_var=LD_LIBRARY_PATH
- shlibpath_overrides_runpath=no
- hardcode_into_libs=yes
- dynamic_linker='GNU ld.so'
- ;;
-
freebsd* | dragonfly*)
# DragonFly does not have aout. When/if they implement a new
# versioning mechanism, adjust this.
@@ -17253,7 +17741,7 @@ freebsd* | dragonfly*)
shlibpath_overrides_runpath=no
hardcode_into_libs=yes
;;
- freebsd*) # from 4.6 on
+ *) # from 4.6 on, and DragonFly
shlibpath_overrides_runpath=yes
hardcode_into_libs=yes
;;
@@ -17316,7 +17804,7 @@ hpux9* | hpux10* | hpux11*)
postinstall_cmds='chmod 555 $lib'
;;
-interix3*)
+interix[3-9]*)
version_type=linux
need_lib_prefix=no
need_version=no
@@ -17371,7 +17859,7 @@ linux*oldld* | linux*aout* | linux*coff*)
;;
# This must be Linux ELF.
-linux*)
+linux* | k*bsd*-gnu)
version_type=linux
need_lib_prefix=no
need_version=no
@@ -17387,7 +17875,7 @@ linux*)
# Append ld.so.conf contents to the search path
if test -f /etc/ld.so.conf; then
- lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '`
+ lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '`
sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra"
fi
@@ -17400,18 +17888,6 @@ linux*)
dynamic_linker='GNU/Linux ld.so'
;;
-knetbsd*-gnu)
- version_type=linux
- need_lib_prefix=no
- need_version=no
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- shlibpath_var=LD_LIBRARY_PATH
- shlibpath_overrides_runpath=no
- hardcode_into_libs=yes
- dynamic_linker='GNU ld.so'
- ;;
-
netbsd*)
version_type=sunos
need_lib_prefix=no
@@ -17493,6 +17969,10 @@ osf3* | osf4* | osf5*)
sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec"
;;
+rdos*)
+ dynamic_linker=no
+ ;;
+
solaris*)
version_type=linux
need_lib_prefix=no
@@ -17589,6 +18069,21 @@ echo "$as_me:$LINENO: result: $dynamic_linker" >&5
echo "${ECHO_T}$dynamic_linker" >&6
test "$dynamic_linker" = no && can_build_shared=no
+if test "${lt_cv_sys_lib_search_path_spec+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ lt_cv_sys_lib_search_path_spec="$sys_lib_search_path_spec"
+fi
+
+sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec"
+if test "${lt_cv_sys_lib_dlsearch_path_spec+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ lt_cv_sys_lib_dlsearch_path_spec="$sys_lib_dlsearch_path_spec"
+fi
+
+sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec"
+
variables_saved_for_relink="PATH $shlibpath_var $runpath_var"
if test "$GCC" = yes; then
variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
@@ -17672,6 +18167,7 @@ if test -f "$ltmain"; then
predeps_GCJ \
postdeps_GCJ \
compiler_lib_search_path_GCJ \
+ compiler_lib_search_dirs_GCJ \
archive_cmds_GCJ \
archive_expsym_cmds_GCJ \
postinstall_cmds_GCJ \
@@ -17687,6 +18183,7 @@ if test -f "$ltmain"; then
module_cmds_GCJ \
module_expsym_cmds_GCJ \
lt_cv_prog_compiler_c_o_GCJ \
+ fix_srcfile_path_GCJ \
exclude_expsyms_GCJ \
include_expsyms_GCJ; do
@@ -17919,6 +18416,10 @@ predeps=$lt_predeps_GCJ
# shared library.
postdeps=$lt_postdeps_GCJ
+# The directories searched by this compiler when creating a shared
+# library
+compiler_lib_search_dirs=$lt_compiler_lib_search_dirs_GCJ
+
# The library search path used internally by the compiler when linking
# a shared library.
compiler_lib_search_path=$lt_compiler_lib_search_path_GCJ
@@ -18007,7 +18508,7 @@ sys_lib_search_path_spec=$lt_sys_lib_search_path_spec
sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec
# Fix the shell variable \$srcfile for the compiler.
-fix_srcfile_path="$fix_srcfile_path_GCJ"
+fix_srcfile_path=$lt_fix_srcfile_path
# Set to yes if exported symbols are required.
always_export_symbols=$always_export_symbols_GCJ
@@ -18065,7 +18566,7 @@ objext=o
objext_RC=$objext
# Code to be used in simple compile tests
-lt_simple_compile_test_code='sample MENU { MENUITEM "&Soup", 100, CHECKED }\n'
+lt_simple_compile_test_code='sample MENU { MENUITEM "&Soup", 100, CHECKED }'
# Code to be used in simple link tests
lt_simple_link_test_code="$lt_simple_compile_test_code"
@@ -18084,16 +18585,16 @@ compiler=$CC
# save warnings/boilerplate of simple test code
ac_outfile=conftest.$ac_objext
-printf "$lt_simple_compile_test_code" >conftest.$ac_ext
+echo "$lt_simple_compile_test_code" >conftest.$ac_ext
eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
_lt_compiler_boilerplate=`cat conftest.err`
$rm conftest*
ac_outfile=conftest.$ac_objext
-printf "$lt_simple_link_test_code" >conftest.$ac_ext
+echo "$lt_simple_link_test_code" >conftest.$ac_ext
eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
_lt_linker_boilerplate=`cat conftest.err`
-$rm conftest*
+$rm -r conftest*
# Allow CC to be a program name with arguments.
@@ -18153,6 +18654,7 @@ if test -f "$ltmain"; then
predeps_RC \
postdeps_RC \
compiler_lib_search_path_RC \
+ compiler_lib_search_dirs_RC \
archive_cmds_RC \
archive_expsym_cmds_RC \
postinstall_cmds_RC \
@@ -18168,6 +18670,7 @@ if test -f "$ltmain"; then
module_cmds_RC \
module_expsym_cmds_RC \
lt_cv_prog_compiler_c_o_RC \
+ fix_srcfile_path_RC \
exclude_expsyms_RC \
include_expsyms_RC; do
@@ -18400,6 +18903,10 @@ predeps=$lt_predeps_RC
# shared library.
postdeps=$lt_postdeps_RC
+# The directories searched by this compiler when creating a shared
+# library
+compiler_lib_search_dirs=$lt_compiler_lib_search_dirs_RC
+
# The library search path used internally by the compiler when linking
# a shared library.
compiler_lib_search_path=$lt_compiler_lib_search_path_RC
@@ -18488,7 +18995,7 @@ sys_lib_search_path_spec=$lt_sys_lib_search_path_spec
sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec
# Fix the shell variable \$srcfile for the compiler.
-fix_srcfile_path="$fix_srcfile_path_RC"
+fix_srcfile_path=$lt_fix_srcfile_path
# Set to yes if exported symbols are required.
always_export_symbols=$always_export_symbols_RC
@@ -20315,6 +20822,262 @@ _ACEOF
fi
+save_CFLAGS="$CFLAGS"
+CFLAGS="$XORG_CFLAGS"
+echo "$as_me:$LINENO: checking whether XSERVER_LIBPCIACCESS is declared" >&5
+echo $ECHO_N "checking whether XSERVER_LIBPCIACCESS is declared... $ECHO_C" >&6
+if test "${ac_cv_have_decl_XSERVER_LIBPCIACCESS+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include "xorg-server.h"
+
+int
+main ()
+{
+#ifndef XSERVER_LIBPCIACCESS
+ char *p = (char *) XSERVER_LIBPCIACCESS;
+#endif
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_have_decl_XSERVER_LIBPCIACCESS=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_have_decl_XSERVER_LIBPCIACCESS=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: $ac_cv_have_decl_XSERVER_LIBPCIACCESS" >&5
+echo "${ECHO_T}$ac_cv_have_decl_XSERVER_LIBPCIACCESS" >&6
+if test $ac_cv_have_decl_XSERVER_LIBPCIACCESS = yes; then
+ XSERVER_LIBPCIACCESS=yes
+else
+ XSERVER_LIBPCIACCESS=no
+fi
+
+echo "$as_me:$LINENO: checking whether xf86ModeBandwidth is declared" >&5
+echo $ECHO_N "checking whether xf86ModeBandwidth is declared... $ECHO_C" >&6
+if test "${ac_cv_have_decl_xf86ModeBandwidth+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include "xf86Modes.h"
+
+int
+main ()
+{
+#ifndef xf86ModeBandwidth
+ char *p = (char *) xf86ModeBandwidth;
+#endif
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_have_decl_xf86ModeBandwidth=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_have_decl_xf86ModeBandwidth=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: $ac_cv_have_decl_xf86ModeBandwidth" >&5
+echo "${ECHO_T}$ac_cv_have_decl_xf86ModeBandwidth" >&6
+if test $ac_cv_have_decl_xf86ModeBandwidth = yes; then
+
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_XF86MODEBANDWIDTH 1
+_ACEOF
+
+fi
+
+CFLAGS="$save_CFLAGS"
+
+if test "x$XSERVER_LIBPCIACCESS" = xyes; then
+
+pkg_failed=no
+echo "$as_me:$LINENO: checking for PCIACCESS" >&5
+echo $ECHO_N "checking for PCIACCESS... $ECHO_C" >&6
+
+if test -n "$PKG_CONFIG"; then
+ if test -n "$PCIACCESS_CFLAGS"; then
+ pkg_cv_PCIACCESS_CFLAGS="$PCIACCESS_CFLAGS"
+ else
+ if test -n "$PKG_CONFIG" && \
+ { (echo "$as_me:$LINENO: \$PKG_CONFIG --exists --print-errors \"pciaccess >= 0.8.0\"") >&5
+ ($PKG_CONFIG --exists --print-errors "pciaccess >= 0.8.0") 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; then
+ pkg_cv_PCIACCESS_CFLAGS=`$PKG_CONFIG --cflags "pciaccess >= 0.8.0" 2>/dev/null`
+else
+ pkg_failed=yes
+fi
+ fi
+else
+ pkg_failed=untried
+fi
+if test -n "$PKG_CONFIG"; then
+ if test -n "$PCIACCESS_LIBS"; then
+ pkg_cv_PCIACCESS_LIBS="$PCIACCESS_LIBS"
+ else
+ if test -n "$PKG_CONFIG" && \
+ { (echo "$as_me:$LINENO: \$PKG_CONFIG --exists --print-errors \"pciaccess >= 0.8.0\"") >&5
+ ($PKG_CONFIG --exists --print-errors "pciaccess >= 0.8.0") 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; then
+ pkg_cv_PCIACCESS_LIBS=`$PKG_CONFIG --libs "pciaccess >= 0.8.0" 2>/dev/null`
+else
+ pkg_failed=yes
+fi
+ fi
+else
+ pkg_failed=untried
+fi
+
+
+
+if test $pkg_failed = yes; then
+
+if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
+ _pkg_short_errors_supported=yes
+else
+ _pkg_short_errors_supported=no
+fi
+ if test $_pkg_short_errors_supported = yes; then
+ PCIACCESS_PKG_ERRORS=`$PKG_CONFIG --short-errors --errors-to-stdout --print-errors "pciaccess >= 0.8.0"`
+ else
+ PCIACCESS_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "pciaccess >= 0.8.0"`
+ fi
+ # Put the nasty error message in config.log where it belongs
+ echo "$PCIACCESS_PKG_ERRORS" >&5
+
+ { { echo "$as_me:$LINENO: error: Package requirements (pciaccess >= 0.8.0) were not met:
+
+$PCIACCESS_PKG_ERRORS
+
+Consider adjusting the PKG_CONFIG_PATH environment variable if you
+installed software in a non-standard prefix.
+
+Alternatively, you may set the environment variables PCIACCESS_CFLAGS
+and PCIACCESS_LIBS to avoid the need to call pkg-config.
+See the pkg-config man page for more details.
+" >&5
+echo "$as_me: error: Package requirements (pciaccess >= 0.8.0) were not met:
+
+$PCIACCESS_PKG_ERRORS
+
+Consider adjusting the PKG_CONFIG_PATH environment variable if you
+installed software in a non-standard prefix.
+
+Alternatively, you may set the environment variables PCIACCESS_CFLAGS
+and PCIACCESS_LIBS to avoid the need to call pkg-config.
+See the pkg-config man page for more details.
+" >&2;}
+ { (exit 1); exit 1; }; }
+elif test $pkg_failed = untried; then
+ { { echo "$as_me:$LINENO: error: The pkg-config script could not be found or is too old. Make sure it
+is in your PATH or set the PKG_CONFIG environment variable to the full
+path to pkg-config.
+
+Alternatively, you may set the environment variables PCIACCESS_CFLAGS
+and PCIACCESS_LIBS to avoid the need to call pkg-config.
+See the pkg-config man page for more details.
+
+To get pkg-config, see <http://www.freedesktop.org/software/pkgconfig>.
+See \`config.log' for more details." >&5
+echo "$as_me: error: The pkg-config script could not be found or is too old. Make sure it
+is in your PATH or set the PKG_CONFIG environment variable to the full
+path to pkg-config.
+
+Alternatively, you may set the environment variables PCIACCESS_CFLAGS
+and PCIACCESS_LIBS to avoid the need to call pkg-config.
+See the pkg-config man page for more details.
+
+To get pkg-config, see <http://www.freedesktop.org/software/pkgconfig>.
+See \`config.log' for more details." >&2;}
+ { (exit 1); exit 1; }; }
+else
+ PCIACCESS_CFLAGS=$pkg_cv_PCIACCESS_CFLAGS
+ PCIACCESS_LIBS=$pkg_cv_PCIACCESS_LIBS
+ echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6
+ :
+fi
+fi
+
+
+if test "x$XSERVER_LIBPCIACCESS" = xyes; then
+ XSERVER_LIBPCIACCESS_TRUE=
+ XSERVER_LIBPCIACCESS_FALSE='#'
+else
+ XSERVER_LIBPCIACCESS_TRUE='#'
+ XSERVER_LIBPCIACCESS_FALSE=
+fi
+
+
if true; then
@@ -20663,7 +21426,7 @@ cat >>confdefs.h <<_ACEOF
#define PACKAGE_VERSION_MAJOR `echo $PACKAGE_VERSION | cut -d . -f 1`
_ACEOF
- PVM=`echo $PACKAGE_VERSION | cut -d . -f 2`
+ PVM=`echo $PACKAGE_VERSION | cut -d . -f 2 | cut -d - -f 1`
if test "x$PVM" = "x"; then
PVM="0"
fi
@@ -20672,7 +21435,7 @@ cat >>confdefs.h <<_ACEOF
#define PACKAGE_VERSION_MINOR $PVM
_ACEOF
- PVP=`echo $PACKAGE_VERSION | cut -d . -f 3`
+ PVP=`echo $PACKAGE_VERSION | cut -d . -f 3 | cut -d - -f 1`
if test "x$PVP" = "x"; then
PVP="0"
fi
@@ -20817,6 +21580,13 @@ echo "$as_me: error: conditional \"DRI\" was never defined.
Usually this means the macro was only invoked conditionally." >&2;}
{ (exit 1); exit 1; }; }
fi
+if test -z "${XSERVER_LIBPCIACCESS_TRUE}" && test -z "${XSERVER_LIBPCIACCESS_FALSE}"; then
+ { { echo "$as_me:$LINENO: error: conditional \"XSERVER_LIBPCIACCESS\" was never defined.
+Usually this means the macro was only invoked conditionally." >&5
+echo "$as_me: error: conditional \"XSERVER_LIBPCIACCESS\" was never defined.
+Usually this means the macro was only invoked conditionally." >&2;}
+ { (exit 1); exit 1; }; }
+fi
if test -z "${USE_XAA_TRUE}" && test -z "${USE_XAA_FALSE}"; then
{ { echo "$as_me:$LINENO: error: conditional \"USE_XAA\" was never defined.
Usually this means the macro was only invoked conditionally." >&5
@@ -21102,7 +21872,7 @@ _ASBOX
} >&5
cat >&5 <<_CSEOF
-This file was extended by xf86-video-mga $as_me 1.4.6.1, which was
+This file was extended by xf86-video-mga $as_me 1.4.9, which was
generated by GNU Autoconf 2.59. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
@@ -21165,7 +21935,7 @@ _ACEOF
cat >>$CONFIG_STATUS <<_ACEOF
ac_cs_version="\\
-xf86-video-mga config.status 1.4.6.1
+xf86-video-mga config.status 1.4.9
configured by $0, generated by GNU Autoconf 2.59,
with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\"
@@ -21415,6 +22185,7 @@ s,@AMDEPBACKSLASH@,$AMDEPBACKSLASH,;t t
s,@CCDEPMODE@,$CCDEPMODE,;t t
s,@am__fastdepCC_TRUE@,$am__fastdepCC_TRUE,;t t
s,@am__fastdepCC_FALSE@,$am__fastdepCC_FALSE,;t t
+s,@SED@,$SED,;t t
s,@EGREP@,$EGREP,;t t
s,@LN_S@,$LN_S,;t t
s,@ECHO@,$ECHO,;t t
@@ -21422,6 +22193,10 @@ s,@AR@,$AR,;t t
s,@ac_ct_AR@,$ac_ct_AR,;t t
s,@RANLIB@,$RANLIB,;t t
s,@ac_ct_RANLIB@,$ac_ct_RANLIB,;t t
+s,@DSYMUTIL@,$DSYMUTIL,;t t
+s,@ac_ct_DSYMUTIL@,$ac_ct_DSYMUTIL,;t t
+s,@NMEDIT@,$NMEDIT,;t t
+s,@ac_ct_NMEDIT@,$ac_ct_NMEDIT,;t t
s,@CPP@,$CPP,;t t
s,@CXX@,$CXX,;t t
s,@CXXFLAGS@,$CXXFLAGS,;t t
@@ -21442,6 +22217,10 @@ s,@DRI_TRUE@,$DRI_TRUE,;t t
s,@DRI_FALSE@,$DRI_FALSE,;t t
s,@DRI_CFLAGS@,$DRI_CFLAGS,;t t
s,@DRI_LIBS@,$DRI_LIBS,;t t
+s,@PCIACCESS_CFLAGS@,$PCIACCESS_CFLAGS,;t t
+s,@PCIACCESS_LIBS@,$PCIACCESS_LIBS,;t t
+s,@XSERVER_LIBPCIACCESS_TRUE@,$XSERVER_LIBPCIACCESS_TRUE,;t t
+s,@XSERVER_LIBPCIACCESS_FALSE@,$XSERVER_LIBPCIACCESS_FALSE,;t t
s,@USE_XAA_TRUE@,$USE_XAA_TRUE,;t t
s,@USE_XAA_FALSE@,$USE_XAA_FALSE,;t t
s,@USE_EXA_TRUE@,$USE_EXA_TRUE,;t t
diff --git a/driver/xf86-video-mga/configure.ac b/driver/xf86-video-mga/configure.ac
index 88c22cdac..923b434a8 100644
--- a/driver/xf86-video-mga/configure.ac
+++ b/driver/xf86-video-mga/configure.ac
@@ -24,10 +24,12 @@ AC_PREREQ(2.57)
# When the version number is modified here, also modify it in src/mga.h.
AC_INIT([xf86-video-mga],
- 1.4.4,
+ 1.4.9,
[https://bugs.freedesktop.org/enter_bug.cgi?product=xorg],
xf86-video-mga)
+XORG_RELEASE_VERSION
+
AC_CONFIG_SRCDIR([Makefile.am])
AM_CONFIG_HEADER([config.h])
AC_CONFIG_AUX_DIR(.)
@@ -55,7 +57,7 @@ AC_ARG_ENABLE(dri, AC_HELP_STRING([--disable-dri],
[DRI=auto])
AC_ARG_ENABLE(exa,
AC_HELP_STRING([--disable-exa],
- [Disable EXA support [[default enabled]]]),
+ [Disable EXA support [[default=enabled]]]),
[EXA="$enableval"],
[EXA=yes])
@@ -102,6 +104,22 @@ if test "x$DRI" = xyes; then
AC_DEFINE(XF86DRI_DEVEL,1,[Enable developmental DRI driver support])
fi
+save_CFLAGS="$CFLAGS"
+CFLAGS="$XORG_CFLAGS"
+AC_CHECK_DECL(XSERVER_LIBPCIACCESS,
+ [XSERVER_LIBPCIACCESS=yes], [XSERVER_LIBPCIACCESS=no],
+ [#include "xorg-server.h"])
+AC_CHECK_DECL(xf86ModeBandwidth,
+ [AC_DEFINE(HAVE_XF86MODEBANDWIDTH, 1, [Have xf86ModeBandwidth])],
+ [],
+ [#include "xf86Modes.h"])
+CFLAGS="$save_CFLAGS"
+
+if test "x$XSERVER_LIBPCIACCESS" = xyes; then
+ PKG_CHECK_MODULES([PCIACCESS], [pciaccess >= 0.8.0])
+fi
+AM_CONDITIONAL(XSERVER_LIBPCIACCESS, test "x$XSERVER_LIBPCIACCESS" = xyes)
+
AM_CONDITIONAL(USE_XAA, true)
AC_DEFINE(USE_XAA, 1, [Build support for XAA])
diff --git a/driver/xf86-video-mga/ltmain.sh b/driver/xf86-video-mga/ltmain.sh
index 85faf0734..248cd4047 100644
--- a/driver/xf86-video-mga/ltmain.sh
+++ b/driver/xf86-video-mga/ltmain.sh
@@ -1,8 +1,8 @@
# ltmain.sh - Provide generalized library-building support services.
# NOTE: Changing this file will not affect anything until you rerun configure.
#
-# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005
-# Free Software Foundation, Inc.
+# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, 2006,
+# 2007, 2008 Free Software Foundation, Inc.
# Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
#
# This program is free software; you can redistribute it and/or modify
@@ -43,14 +43,22 @@ EXIT_FAILURE=1
PROGRAM=ltmain.sh
PACKAGE=libtool
-VERSION=1.5.22
-TIMESTAMP=" (1.1220.2.365 2005/12/18 22:14:06)"
-
-# See if we are running on zsh, and set the options which allow our
-# commands through without removal of \ escapes.
-if test -n "${ZSH_VERSION+set}" ; then
+VERSION=1.5.26
+TIMESTAMP=" (1.1220.2.493 2008/02/01 16:58:18)"
+
+# Be Bourne compatible (taken from Autoconf:_AS_BOURNE_COMPATIBLE).
+if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
+ emulate sh
+ NULLCMD=:
+ # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which
+ # is contrary to our usage. Disable this feature.
+ alias -g '${1+"$@"}'='"$@"'
setopt NO_GLOB_SUBST
+else
+ case `(set -o) 2>/dev/null` in *posix*) set -o posix;; esac
fi
+BIN_SH=xpg4; export BIN_SH # for Tru64
+DUALCASE=1; export DUALCASE # for MKS sh
# Check that we have a working $echo.
if test "X$1" = X--no-reexec; then
@@ -105,11 +113,19 @@ esac
# These must not be set unconditionally because not all systems understand
# e.g. LANG=C (notably SCO).
# We save the old values to restore during execute mode.
-if test "${LC_ALL+set}" = set; then
- save_LC_ALL="$LC_ALL"; LC_ALL=C; export LC_ALL
-fi
-if test "${LANG+set}" = set; then
- save_LANG="$LANG"; LANG=C; export LANG
+lt_env=
+for lt_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES
+do
+ eval "if test \"\${$lt_var+set}\" = set; then
+ save_$lt_var=\$$lt_var
+ lt_env=\"$lt_var=\$$lt_var \$lt_env\"
+ $lt_var=C
+ export $lt_var
+ fi"
+done
+
+if test -n "$lt_env"; then
+ lt_env="env $lt_env"
fi
# Make sure IFS has a sensible default
@@ -136,6 +152,8 @@ duplicate_deps=no
preserve_args=
lo2o="s/\\.lo\$/.${objext}/"
o2lo="s/\\.${objext}\$/.lo/"
+extracted_archives=
+extracted_serial=0
#####################################
# Shell function definitions:
@@ -196,7 +214,13 @@ func_win32_libid ()
if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null | \
$EGREP -e 'file format pe-i386(.*architecture: i386)?' >/dev/null ; then
win32_nmres=`eval $NM -f posix -A $1 | \
- $SED -n -e '1,100{/ I /{s,.*,import,;p;q;};}'`
+ $SED -n -e '1,100{
+ / I /{
+ s,.*,import,
+ p
+ q
+ }
+ }'`
case $win32_nmres in
import*) win32_libid_type="x86 archive import";;
*) win32_libid_type="x86 archive static";;
@@ -327,7 +351,17 @@ func_extract_archives ()
*) my_xabs=`pwd`"/$my_xlib" ;;
esac
my_xlib=`$echo "X$my_xlib" | $Xsed -e 's%^.*/%%'`
- my_xdir="$my_gentop/$my_xlib"
+ my_xlib_u=$my_xlib
+ while :; do
+ case " $extracted_archives " in
+ *" $my_xlib_u "*)
+ extracted_serial=`expr $extracted_serial + 1`
+ my_xlib_u=lt$extracted_serial-$my_xlib ;;
+ *) break ;;
+ esac
+ done
+ extracted_archives="$extracted_archives $my_xlib_u"
+ my_xdir="$my_gentop/$my_xlib_u"
$show "${rm}r $my_xdir"
$run ${rm}r "$my_xdir"
@@ -454,11 +488,12 @@ do
;;
--version)
- $echo "$PROGRAM (GNU $PACKAGE) $VERSION$TIMESTAMP"
- $echo
- $echo "Copyright (C) 2005 Free Software Foundation, Inc."
- $echo "This is free software; see the source for copying conditions. There is NO"
- $echo "warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
+ echo "\
+$PROGRAM (GNU $PACKAGE) $VERSION$TIMESTAMP
+
+Copyright (C) 2008 Free Software Foundation, Inc.
+This is free software; see the source for copying conditions. There is NO
+warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
exit $?
;;
@@ -755,9 +790,11 @@ if test -z "$show_help"; then
*.class) xform=class ;;
*.cpp) xform=cpp ;;
*.cxx) xform=cxx ;;
- *.f90) xform=f90 ;;
+ *.[fF][09]?) xform=[fF][09]. ;;
*.for) xform=for ;;
*.java) xform=java ;;
+ *.obj) xform=obj ;;
+ *.sx) xform=sx ;;
esac
libobj=`$echo "X$libobj" | $Xsed -e "s/\.$xform$/.lo/"`
@@ -926,7 +963,7 @@ EOF
$run $rm "$lobj" "$output_obj"
$show "$command"
- if $run eval "$command"; then :
+ if $run eval $lt_env "$command"; then :
else
test -n "$output_obj" && $run $rm $removelist
exit $EXIT_FAILURE
@@ -998,7 +1035,7 @@ EOF
command="$command$suppress_output"
$run $rm "$obj" "$output_obj"
$show "$command"
- if $run eval "$command"; then :
+ if $run eval $lt_env "$command"; then :
else
$run $rm $removelist
exit $EXIT_FAILURE
@@ -1131,6 +1168,7 @@ EOF
thread_safe=no
vinfo=
vinfo_number=no
+ single_module="${wl}-single_module"
func_infer_tag $base_compile
@@ -1138,8 +1176,9 @@ EOF
for arg
do
case $arg in
- -all-static | -static)
- if test "X$arg" = "X-all-static"; then
+ -all-static | -static | -static-libtool-libs)
+ case $arg in
+ -all-static)
if test "$build_libtool_libs" = yes && test -z "$link_static_flag"; then
$echo "$modename: warning: complete static linking is impossible in this configuration" 1>&2
fi
@@ -1147,12 +1186,20 @@ EOF
dlopen_self=$dlopen_self_static
fi
prefer_static_libs=yes
- else
+ ;;
+ -static)
if test -z "$pic_flag" && test -n "$link_static_flag"; then
dlopen_self=$dlopen_self_static
fi
prefer_static_libs=built
- fi
+ ;;
+ -static-libtool-libs)
+ if test -z "$pic_flag" && test -n "$link_static_flag"; then
+ dlopen_self=$dlopen_self_static
+ fi
+ prefer_static_libs=yes
+ ;;
+ esac
build_libtool_libs=no
build_old_libs=yes
break
@@ -1600,7 +1647,7 @@ EOF
continue
;;
- -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe)
+ -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe|-threads)
compiler_flags="$compiler_flags $arg"
compile_command="$compile_command $arg"
finalize_command="$finalize_command $arg"
@@ -1608,6 +1655,11 @@ EOF
continue
;;
+ -multi_module)
+ single_module="${wl}-multi_module"
+ continue
+ ;;
+
-module)
module=yes
continue
@@ -1621,10 +1673,11 @@ EOF
# -m* pass through architecture-specific compiler args for GCC
# -m*, -t[45]*, -txscale* pass through architecture-specific
# compiler args for GCC
- # -pg pass through profiling flag for GCC
+ # -p, -pg, --coverage, -fprofile-* pass through profiling flag for GCC
+ # -F/path gives path to uninstalled frameworks, gcc on darwin
# @file GCC response files
- -64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*|-pg| \
- -t[45]*|-txscale*|@*)
+ -64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*| \
+ -t[45]*|-txscale*|-p|-pg|--coverage|-fprofile-*|-F*|@*)
# Unknown arguments in both finalize_command and compile_command need
# to be aesthetically quoted because they are evaled later.
@@ -1652,9 +1705,9 @@ EOF
-no-install)
case $host in
- *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
+ *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-darwin*)
# The PATH hackery in wrapper scripts is required on Windows
- # in order for the loader to find any dlls it needs.
+ # and Darwin in order for the loader to find any dlls it needs.
$echo "$modename: warning: \`-no-install' is ignored for $host" 1>&2
$echo "$modename: warning: assuming \`-no-fast-install' instead" 1>&2
fast_install=no
@@ -1713,7 +1766,7 @@ EOF
continue
;;
- -static)
+ -static | -static-libtool-libs)
# The effects of -static are defined in a previous loop.
# We used to do the same as -all-static on platforms that
# didn't have a PIC flag, but the assumption that the effects
@@ -2106,7 +2159,7 @@ EOF
lib=
found=no
case $deplib in
- -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe)
+ -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe|-threads)
if test "$linkmode,$pass" = "prog,link"; then
compile_deplibs="$deplib $compile_deplibs"
finalize_deplibs="$deplib $finalize_deplibs"
@@ -2122,7 +2175,12 @@ EOF
continue
fi
name=`$echo "X$deplib" | $Xsed -e 's/^-l//'`
- for searchdir in $newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path; do
+ if test "$linkmode" = lib; then
+ searchdirs="$newlib_search_path $lib_search_path $compiler_lib_search_dirs $sys_lib_search_path $shlib_search_path"
+ else
+ searchdirs="$newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path"
+ fi
+ for searchdir in $searchdirs; do
for search_ext in .la $std_shrext .so .a; do
# Search the libtool library
lib="$searchdir/lib${name}${search_ext}"
@@ -2503,7 +2561,9 @@ EOF
if test "$linkmode,$pass" = "prog,link"; then
if test -n "$library_names" &&
- { test "$prefer_static_libs" = no || test -z "$old_library"; }; then
+ { { test "$prefer_static_libs" = no ||
+ test "$prefer_static_libs,$installed" = "built,yes"; } ||
+ test -z "$old_library"; }; then
# We need to hardcode the library path
if test -n "$shlibpath_var" && test -z "$avoidtemprpath" ; then
# Make sure the rpath contains only unique directories.
@@ -2916,12 +2976,18 @@ EOF
# we do not want to link against static libs,
# but need to link against shared
eval deplibrary_names=`${SED} -n -e 's/^library_names=\(.*\)$/\1/p' $deplib`
+ eval deplibdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
if test -n "$deplibrary_names" ; then
for tmp in $deplibrary_names ; do
depdepl=$tmp
done
- if test -f "$path/$depdepl" ; then
+ if test -f "$deplibdir/$depdepl" ; then
+ depdepl="$deplibdir/$depdepl"
+ elif test -f "$path/$depdepl" ; then
depdepl="$path/$depdepl"
+ else
+ # Can't find it, oh well...
+ depdepl=
fi
# do not add paths which are already there
case " $newlib_search_path " in
@@ -3069,9 +3135,10 @@ EOF
case $linkmode in
oldlib)
- if test -n "$deplibs"; then
- $echo "$modename: warning: \`-l' and \`-L' are ignored for archives" 1>&2
- fi
+ case " $deplibs" in
+ *\ -l* | *\ -L*)
+ $echo "$modename: warning: \`-l' and \`-L' are ignored for archives" 1>&2 ;;
+ esac
if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
$echo "$modename: warning: \`-dlopen' is ignored for archives" 1>&2
@@ -3199,7 +3266,7 @@ EOF
# which has an extra 1 added just for fun
#
case $version_type in
- darwin|linux|osf|windows)
+ darwin|linux|osf|windows|none)
current=`expr $number_major + $number_minor`
age="$number_minor"
revision="$number_revision"
@@ -3210,9 +3277,10 @@ EOF
age="0"
;;
irix|nonstopux)
- current=`expr $number_major + $number_minor - 1`
+ current=`expr $number_major + $number_minor`
age="$number_minor"
revision="$number_minor"
+ lt_irix_increment=no
;;
esac
;;
@@ -3271,7 +3339,8 @@ EOF
versuffix="$major.$age.$revision"
# Darwin ld doesn't like 0 for these options...
minor_current=`expr $current + 1`
- verstring="${wl}-compatibility_version ${wl}$minor_current ${wl}-current_version ${wl}$minor_current.$revision"
+ xlcverstring="${wl}-compatibility_version ${wl}$minor_current ${wl}-current_version ${wl}$minor_current.$revision"
+ verstring="-compatibility_version $minor_current -current_version $minor_current.$revision"
;;
freebsd-aout)
@@ -3285,8 +3354,11 @@ EOF
;;
irix | nonstopux)
- major=`expr $current - $age + 1`
-
+ if test "X$lt_irix_increment" = "Xno"; then
+ major=`expr $current - $age`
+ else
+ major=`expr $current - $age + 1`
+ fi
case $version_type in
nonstopux) verstring_prefix=nonstopux ;;
*) verstring_prefix=sgi ;;
@@ -3437,11 +3509,11 @@ EOF
fi
# Eliminate all temporary directories.
- for path in $notinst_path; do
- lib_search_path=`$echo "$lib_search_path " | ${SED} -e "s% $path % %g"`
- deplibs=`$echo "$deplibs " | ${SED} -e "s% -L$path % %g"`
- dependency_libs=`$echo "$dependency_libs " | ${SED} -e "s% -L$path % %g"`
- done
+ #for path in $notinst_path; do
+ # lib_search_path=`$echo "$lib_search_path " | ${SED} -e "s% $path % %g"`
+ # deplibs=`$echo "$deplibs " | ${SED} -e "s% -L$path % %g"`
+ # dependency_libs=`$echo "$dependency_libs " | ${SED} -e "s% -L$path % %g"`
+ #done
if test -n "$xrpath"; then
# If the user specified any rpath flags, then add them.
@@ -3542,13 +3614,12 @@ EOF
int main() { return 0; }
EOF
$rm conftest
- $LTCC $LTCFLAGS -o conftest conftest.c $deplibs
- if test "$?" -eq 0 ; then
+ if $LTCC $LTCFLAGS -o conftest conftest.c $deplibs; then
ldd_output=`ldd conftest`
for i in $deplibs; do
name=`expr $i : '-l\(.*\)'`
# If $name is empty we are operating on a -L argument.
- if test "$name" != "" && test "$name" -ne "0"; then
+ if test "$name" != "" && test "$name" != "0"; then
if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
case " $predeps $postdeps " in
*" $i "*)
@@ -3587,9 +3658,7 @@ EOF
# If $name is empty we are operating on a -L argument.
if test "$name" != "" && test "$name" != "0"; then
$rm conftest
- $LTCC $LTCFLAGS -o conftest conftest.c $i
- # Did it work?
- if test "$?" -eq 0 ; then
+ if $LTCC $LTCFLAGS -o conftest conftest.c $i; then
ldd_output=`ldd conftest`
if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
case " $predeps $postdeps " in
@@ -3621,7 +3690,7 @@ EOF
droppeddeps=yes
$echo
$echo "*** Warning! Library $i is needed by this library but I was not able to"
- $echo "*** make it link in! You will probably need to install it or some"
+ $echo "*** make it link in! You will probably need to install it or some"
$echo "*** library that it depends on before this library will be fully"
$echo "*** functional. Installing it before continuing would be even better."
fi
@@ -3907,7 +3976,10 @@ EOF
test -n "$hardcode_libdirs"; then
libdir="$hardcode_libdirs"
if test -n "$hardcode_libdir_flag_spec_ld"; then
- eval dep_rpath=\"$hardcode_libdir_flag_spec_ld\"
+ case $archive_cmds in
+ *\$LD*) eval dep_rpath=\"$hardcode_libdir_flag_spec_ld\" ;;
+ *) eval dep_rpath=\"$hardcode_libdir_flag_spec\" ;;
+ esac
else
eval dep_rpath=\"$hardcode_libdir_flag_spec\"
fi
@@ -4217,9 +4289,10 @@ EOF
;;
obj)
- if test -n "$deplibs"; then
- $echo "$modename: warning: \`-l' and \`-L' are ignored for objects" 1>&2
- fi
+ case " $deplibs" in
+ *\ -l* | *\ -L*)
+ $echo "$modename: warning: \`-l' and \`-L' are ignored for objects" 1>&2 ;;
+ esac
if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
$echo "$modename: warning: \`-dlopen' is ignored for objects" 1>&2
@@ -4266,12 +4339,14 @@ EOF
reload_conv_objs=
gentop=
# reload_cmds runs $LD directly, so let us get rid of
- # -Wl from whole_archive_flag_spec
+ # -Wl from whole_archive_flag_spec and hope we can get by with
+ # turning comma into space..
wl=
if test -n "$convenience"; then
if test -n "$whole_archive_flag_spec"; then
- eval reload_conv_objs=\"\$reload_objs $whole_archive_flag_spec\"
+ eval tmp_whole_archive_flags=\"$whole_archive_flag_spec\"
+ reload_conv_objs=$reload_objs\ `$echo "X$tmp_whole_archive_flags" | $Xsed -e 's|,| |g'`
else
gentop="$output_objdir/${obj}x"
generated="$generated $gentop"
@@ -4719,16 +4794,16 @@ static const void *lt_preloaded_setup() {
case $host in
*cygwin* | *mingw* )
if test -f "$output_objdir/${outputname}.def" ; then
- compile_command=`$echo "X$compile_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}.def $output_objdir/${outputname}S.${objext}%"`
- finalize_command=`$echo "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}.def $output_objdir/${outputname}S.${objext}%"`
+ compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}.def $output_objdir/${outputname}S.${objext}%" | $NL2SP`
+ finalize_command=`$echo "X$finalize_command" | $SP2NL | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}.def $output_objdir/${outputname}S.${objext}%" | $NL2SP`
else
- compile_command=`$echo "X$compile_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"`
- finalize_command=`$echo "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"`
+ compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%" | $NL2SP`
+ finalize_command=`$echo "X$finalize_command" | $SP2NL | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%" | $NL2SP`
fi
;;
* )
- compile_command=`$echo "X$compile_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"`
- finalize_command=`$echo "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"`
+ compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%" | $NL2SP`
+ finalize_command=`$echo "X$finalize_command" | $SP2NL | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%" | $NL2SP`
;;
esac
;;
@@ -4743,13 +4818,13 @@ static const void *lt_preloaded_setup() {
# really was required.
# Nullify the symbol file.
- compile_command=`$echo "X$compile_command" | $Xsed -e "s% @SYMFILE@%%"`
- finalize_command=`$echo "X$finalize_command" | $Xsed -e "s% @SYMFILE@%%"`
+ compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e "s% @SYMFILE@%%" | $NL2SP`
+ finalize_command=`$echo "X$finalize_command" | $SP2NL | $Xsed -e "s% @SYMFILE@%%" | $NL2SP`
fi
if test "$need_relink" = no || test "$build_libtool_libs" != yes; then
# Replace the output file specification.
- compile_command=`$echo "X$compile_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'`
+ compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e 's%@OUTPUT@%'"$output"'%g' | $NL2SP`
link_command="$compile_command$compile_rpath"
# We have no uninstalled library dependencies, so finalize right now.
@@ -4836,7 +4911,7 @@ static const void *lt_preloaded_setup() {
if test "$fast_install" != no; then
link_command="$finalize_var$compile_command$finalize_rpath"
if test "$fast_install" = yes; then
- relink_command=`$echo "X$compile_var$compile_command$compile_rpath" | $Xsed -e 's%@OUTPUT@%\$progdir/\$file%g'`
+ relink_command=`$echo "X$compile_var$compile_command$compile_rpath" | $SP2NL | $Xsed -e 's%@OUTPUT@%\$progdir/\$file%g' | $NL2SP`
else
# fast_install is set to needless
relink_command=
@@ -4873,7 +4948,7 @@ static const void *lt_preloaded_setup() {
fi
done
relink_command="(cd `pwd`; $relink_command)"
- relink_command=`$echo "X$relink_command" | $Xsed -e "$sed_quote_subst"`
+ relink_command=`$echo "X$relink_command" | $SP2NL | $Xsed -e "$sed_quote_subst" | $NL2SP`
fi
# Quote $echo for shipping.
@@ -5280,6 +5355,20 @@ EOF
Xsed='${SED} -e 1s/^X//'
sed_quote_subst='$sed_quote_subst'
+# Be Bourne compatible (taken from Autoconf:_AS_BOURNE_COMPATIBLE).
+if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then
+ emulate sh
+ NULLCMD=:
+ # Zsh 3.x and 4.x performs word splitting on \${1+\"\$@\"}, which
+ # is contrary to our usage. Disable this feature.
+ alias -g '\${1+\"\$@\"}'='\"\$@\"'
+ setopt NO_GLOB_SUBST
+else
+ case \`(set -o) 2>/dev/null\` in *posix*) set -o posix;; esac
+fi
+BIN_SH=xpg4; export BIN_SH # for Tru64
+DUALCASE=1; export DUALCASE # for MKS sh
+
# The HP-UX ksh and POSIX shell print the target directory to stdout
# if CDPATH is set.
(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
@@ -5422,7 +5511,7 @@ else
;;
esac
$echo >> $output "\
- \$echo \"\$0: cannot exec \$program \${1+\"\$@\"}\"
+ \$echo \"\$0: cannot exec \$program \$*\"
exit $EXIT_FAILURE
fi
else
@@ -5608,7 +5697,7 @@ fi\
done
# Quote the link command for shipping.
relink_command="(cd `pwd`; $SHELL $progpath $preserve_args --mode=relink $libtool_args @inst_prefix_dir@)"
- relink_command=`$echo "X$relink_command" | $Xsed -e "$sed_quote_subst"`
+ relink_command=`$echo "X$relink_command" | $SP2NL | $Xsed -e "$sed_quote_subst" | $NL2SP`
if test "$hardcode_automatic" = yes ; then
relink_command=
fi
@@ -5957,9 +6046,9 @@ relink_command=\"$relink_command\""
if test -n "$inst_prefix_dir"; then
# Stick the inst_prefix_dir data into the link command.
- relink_command=`$echo "$relink_command" | $SED "s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%"`
+ relink_command=`$echo "$relink_command" | $SP2NL | $SED "s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%" | $NL2SP`
else
- relink_command=`$echo "$relink_command" | $SED "s%@inst_prefix_dir@%%"`
+ relink_command=`$echo "$relink_command" | $SP2NL | $SED "s%@inst_prefix_dir@%%" | $NL2SP`
fi
$echo "$modename: warning: relinking \`$file'" 1>&2
@@ -6168,7 +6257,7 @@ relink_command=\"$relink_command\""
file=`$echo "X$file$stripped_ext" | $Xsed -e 's%^.*/%%'`
outputname="$tmpdir/$file"
# Replace the output file specification.
- relink_command=`$echo "X$relink_command" | $Xsed -e 's%@OUTPUT@%'"$outputname"'%g'`
+ relink_command=`$echo "X$relink_command" | $SP2NL | $Xsed -e 's%@OUTPUT@%'"$outputname"'%g' | $NL2SP`
$show "$relink_command"
if $run eval "$relink_command"; then :
@@ -6345,8 +6434,10 @@ relink_command=\"$relink_command\""
if test -f "$dir/$objdir/$dlname"; then
dir="$dir/$objdir"
else
- $echo "$modename: cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'" 1>&2
- exit $EXIT_FAILURE
+ if test ! -f "$dir/$dlname"; then
+ $echo "$modename: cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'" 1>&2
+ exit $EXIT_FAILURE
+ fi
fi
;;
@@ -6410,12 +6501,12 @@ relink_command=\"$relink_command\""
fi
# Restore saved environment variables
- if test "${save_LC_ALL+set}" = set; then
- LC_ALL="$save_LC_ALL"; export LC_ALL
- fi
- if test "${save_LANG+set}" = set; then
- LANG="$save_LANG"; export LANG
- fi
+ for lt_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES
+ do
+ eval "if test \"\${save_$lt_var+set}\" = set; then
+ $lt_var=\$save_$lt_var; export $lt_var
+ fi"
+ done
# Now prepare to actually exec the command.
exec_cmd="\$cmd$args"
@@ -6772,9 +6863,9 @@ The following components of LINK-COMMAND are treated specially:
-dlpreopen FILE link in FILE and add its symbols to lt_preloaded_symbols
-export-dynamic allow symbols from OUTPUT-FILE to be resolved with dlsym(3)
-export-symbols SYMFILE
- try to export only the symbols listed in SYMFILE
+ try to export only the symbols listed in SYMFILE
-export-symbols-regex REGEX
- try to export only the symbols matching REGEX
+ try to export only the symbols matching REGEX
-LLIBDIR search LIBDIR for required installed libraries
-lNAME OUTPUT-FILE requires the installed library libNAME
-module build a library that can dlopened
@@ -6788,9 +6879,11 @@ The following components of LINK-COMMAND are treated specially:
-release RELEASE specify package release information
-rpath LIBDIR the created library will eventually be installed in LIBDIR
-R[ ]LIBDIR add LIBDIR to the runtime path of programs and libraries
- -static do not do any dynamic linking of libtool libraries
+ -static do not do any dynamic linking of uninstalled libtool libraries
+ -static-libtool-libs
+ do not do any dynamic linking of libtool libraries
-version-info CURRENT[:REVISION[:AGE]]
- specify library version info [each variable defaults to 0]
+ specify library version info [each variable defaults to 0]
All other options (arguments beginning with \`-') are ignored.
diff --git a/driver/xf86-video-mga/man/Makefile.in b/driver/xf86-video-mga/man/Makefile.in
index bd664bcc1..4dd2b2179 100644
--- a/driver/xf86-video-mga/man/Makefile.in
+++ b/driver/xf86-video-mga/man/Makefile.in
@@ -115,6 +115,7 @@ DRI_CFLAGS = @DRI_CFLAGS@
DRI_FALSE = @DRI_FALSE@
DRI_LIBS = @DRI_LIBS@
DRI_TRUE = @DRI_TRUE@
+DSYMUTIL = @DSYMUTIL@
ECHO = @ECHO@
ECHO_C = @ECHO_C@
ECHO_N = @ECHO_N@
@@ -143,6 +144,7 @@ MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@
MAKEINFO = @MAKEINFO@
MISC_MAN_DIR = @MISC_MAN_DIR@
MISC_MAN_SUFFIX = @MISC_MAN_SUFFIX@
+NMEDIT = @NMEDIT@
OBJEXT = @OBJEXT@
PACKAGE = @PACKAGE@
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
@@ -151,8 +153,11 @@ PACKAGE_STRING = @PACKAGE_STRING@
PACKAGE_TARNAME = @PACKAGE_TARNAME@
PACKAGE_VERSION = @PACKAGE_VERSION@
PATH_SEPARATOR = @PATH_SEPARATOR@
+PCIACCESS_CFLAGS = @PCIACCESS_CFLAGS@
+PCIACCESS_LIBS = @PCIACCESS_LIBS@
PKG_CONFIG = @PKG_CONFIG@
RANLIB = @RANLIB@
+SED = sed
SET_MAKE = @SET_MAKE@
SHELL = @SHELL@
STRIP = @STRIP@
@@ -163,10 +168,14 @@ USE_XAA_TRUE = @USE_XAA_TRUE@
VERSION = @VERSION@
XORG_CFLAGS = @XORG_CFLAGS@
XORG_LIBS = @XORG_LIBS@
+XSERVER_LIBPCIACCESS_FALSE = @XSERVER_LIBPCIACCESS_FALSE@
+XSERVER_LIBPCIACCESS_TRUE = @XSERVER_LIBPCIACCESS_TRUE@
ac_ct_AR = @ac_ct_AR@
ac_ct_CC = @ac_ct_CC@
ac_ct_CXX = @ac_ct_CXX@
+ac_ct_DSYMUTIL = @ac_ct_DSYMUTIL@
ac_ct_F77 = @ac_ct_F77@
+ac_ct_NMEDIT = @ac_ct_NMEDIT@
ac_ct_RANLIB = @ac_ct_RANLIB@
ac_ct_STRIP = @ac_ct_STRIP@
ac_pt_PKG_CONFIG = @ac_pt_PKG_CONFIG@
@@ -213,7 +222,6 @@ driverman_PRE = @DRIVER_NAME@.man
driverman_DATA = $(driverman_PRE:man=@DRIVER_MAN_SUFFIX@)
EXTRA_DIST = @DRIVER_NAME@.man
CLEANFILES = $(driverman_DATA)
-SED = sed
# Strings to replace in man pages
XORGRELSTRING = @PACKAGE_STRING@
diff --git a/driver/xf86-video-mga/man/mga.man b/driver/xf86-video-mga/man/mga.man
index 2ad75bc9c..64c54fd3c 100644
--- a/driver/xf86-video-mga/man/mga.man
+++ b/driver/xf86-video-mga/man/mga.man
@@ -126,13 +126,6 @@ loaded when available and when using hardware that it supports.
Set clocks to values used by some commercial X Servers (G100, G200 and G400
only). Default: off.
.TP
-.BI "Option \*qOverlay\*q \*q" value \*q
-Enable 8+24 overlay mode. Only appropriate for depth 24.
-Recognized values are: "8,24", "24,8". Default: off.
-.RB ( Note:
-the G100 is unaccelerated in the 8+24 overlay mode due to a missing
-hardware feature.)
-.TP
.BI "Option \*qPciRetry\*q \*q" boolean \*q
Enable or disable PCI retries. Default: off.
.TP
diff --git a/driver/xf86-video-mga/mga_PInS.txt b/driver/xf86-video-mga/mga_PInS.txt
index bd2ec805f..eda6cf958 100644
--- a/driver/xf86-video-mga/mga_PInS.txt
+++ b/driver/xf86-video-mga/mga_PInS.txt
@@ -221,7 +221,33 @@ Offset Type Description
9 Has DLL?
10 Core uses MCTLWTST?
11 - 15 MCTLWTST values for core?
-116 char[5] Unknown?
+116 uint16_t Display Info.
+ Bits Meaning
+ 0-3 Primary display info (see below)
+ 4-7 Secondary display info (see below)
+ 8-10 Primary modes (see below)
+ 13 Default output
+ 0 = default output is secondary connector
+ 1 = default output is primary connector
+ 12-14 Secondary modes (see below)
+ 15 Primary hardware dectect
+ 0 = hardware detection is off
+ 1 = use hardware detection to determine main output
+
+ Display info values:
+ 0000 None
+ 0001 HD15
+ 0010 DVI
+ 0011 TV
+ x1xx Reserved
+ 1xxx Reserved
+
+ Modes values:
+ xx1 Analog
+ x1x Digital
+ 1xx TV
+
+118 char[3] Unknown?
121 uint8_t VCO min for system PLL. Stored using standard clock
encoding (see above).
122 uint8_t VCO min for video PLL. Stored using standard clock
diff --git a/driver/xf86-video-mga/src/Makefile.in b/driver/xf86-video-mga/src/Makefile.in
index 9f6046932..9ed7d9023 100644
--- a/driver/xf86-video-mga/src/Makefile.in
+++ b/driver/xf86-video-mga/src/Makefile.in
@@ -150,6 +150,7 @@ DRI_CFLAGS = @DRI_CFLAGS@
DRI_FALSE = @DRI_FALSE@
DRI_LIBS = @DRI_LIBS@
DRI_TRUE = @DRI_TRUE@
+DSYMUTIL = @DSYMUTIL@
ECHO = @ECHO@
ECHO_C = @ECHO_C@
ECHO_N = @ECHO_N@
@@ -178,6 +179,7 @@ MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@
MAKEINFO = @MAKEINFO@
MISC_MAN_DIR = @MISC_MAN_DIR@
MISC_MAN_SUFFIX = @MISC_MAN_SUFFIX@
+NMEDIT = @NMEDIT@
OBJEXT = @OBJEXT@
PACKAGE = @PACKAGE@
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
@@ -186,8 +188,11 @@ PACKAGE_STRING = @PACKAGE_STRING@
PACKAGE_TARNAME = @PACKAGE_TARNAME@
PACKAGE_VERSION = @PACKAGE_VERSION@
PATH_SEPARATOR = @PATH_SEPARATOR@
+PCIACCESS_CFLAGS = @PCIACCESS_CFLAGS@
+PCIACCESS_LIBS = @PCIACCESS_LIBS@
PKG_CONFIG = @PKG_CONFIG@
RANLIB = @RANLIB@
+SED = @SED@
SET_MAKE = @SET_MAKE@
SHELL = @SHELL@
STRIP = @STRIP@
@@ -198,10 +203,14 @@ USE_XAA_TRUE = @USE_XAA_TRUE@
VERSION = @VERSION@
XORG_CFLAGS = @XORG_CFLAGS@
XORG_LIBS = @XORG_LIBS@
+XSERVER_LIBPCIACCESS_FALSE = @XSERVER_LIBPCIACCESS_FALSE@
+XSERVER_LIBPCIACCESS_TRUE = @XSERVER_LIBPCIACCESS_TRUE@
ac_ct_AR = @ac_ct_AR@
ac_ct_CC = @ac_ct_CC@
ac_ct_CXX = @ac_ct_CXX@
+ac_ct_DSYMUTIL = @ac_ct_DSYMUTIL@
ac_ct_F77 = @ac_ct_F77@
+ac_ct_NMEDIT = @ac_ct_NMEDIT@
ac_ct_RANLIB = @ac_ct_RANLIB@
ac_ct_STRIP = @ac_ct_STRIP@
ac_pt_PKG_CONFIG = @ac_pt_PKG_CONFIG@
diff --git a/driver/xf86-video-mga/src/clientlx.c b/driver/xf86-video-mga/src/clientlx.c
index 306d3ed34..9c6ab5007 100644
--- a/driver/xf86-video-mga/src/clientlx.c
+++ b/driver/xf86-video-mga/src/clientlx.c
@@ -67,7 +67,11 @@ ULONG ClientReadConfigSpaceByte(LPBOARDHANDLE pBoard, ULONG ulOffset,
ASSERT_HANDLER(pBoard);
+#ifdef XSERVER_LIBPCIACCESS
+ pci_device_cfg_read_u8(pMga->PciInfo, pucByte, ulOffset);
+#else
*pucByte = pciReadByte(pMga->PciTag,ulOffset);
+#endif
return 0;
}
@@ -95,7 +99,11 @@ ULONG ClientReadConfigSpaceDword(LPBOARDHANDLE pBoard, ULONG ulOffset,
ASSERT_HANDLER(pBoard);
+#ifdef XSERVER_LIBPCIACCESS
+ pci_device_cfg_read_u32(pMga->PciInfo, (uint32_t *) pulDword, ulOffset);
+#else
*pulDword = pciReadLong(pMga->PciTag,ulOffset);
+#endif
return 0;
}
@@ -123,7 +131,11 @@ ULONG ClientWriteConfigSpaceByte(LPBOARDHANDLE pBoard, ULONG ulOffset,
ASSERT_HANDLER(pBoard);
+#ifdef XSERVER_LIBPCIACCESS
+ pci_device_cfg_write_u8(pMga->PciInfo, ucByte, ulOffset);
+#else
pciWriteByte(pMga->PciTag,ulOffset, ucByte);
+#endif
return 0;
}
@@ -151,7 +163,11 @@ ULONG ClientWriteConfigSpaceDword(LPBOARDHANDLE pBoard, ULONG ulOffset,
ASSERT_HANDLER(pBoard);
+#ifdef XSERVER_LIBPCIACCESS
+ pci_device_cfg_write_u32(pMga->PciInfo, (uint32_t) ulDword, ulOffset);
+#else
pciWriteLong(pMga->PciTag,ulOffset, ulDword);
+#endif
return 0;
}
diff --git a/driver/xf86-video-mga/src/mga.h b/driver/xf86-video-mga/src/mga.h
index 04624a9ce..a831862c4 100644
--- a/driver/xf86-video-mga/src/mga.h
+++ b/driver/xf86-video-mga/src/mga.h
@@ -14,6 +14,9 @@
#ifndef MGA_H
#define MGA_H
+#ifdef XSERVER_LIBPCIACCESS
+#include <pciaccess.h>
+#endif
#include <string.h>
#include <stdio.h>
@@ -82,7 +85,8 @@ typedef enum {
OPTION_METAMODES,
OPTION_OLDDMA,
OPTION_PCIDMA,
- OPTION_ACCELMETHOD
+ OPTION_ACCELMETHOD,
+ OPTION_KVM
} MGAOpts;
@@ -121,6 +125,14 @@ void MGAdbg_outreg32(ScrnInfoPtr, int,int, char*);
#define PCI_CHIP_MGAG200_SE_B_PCI 0x0524
#endif
+#ifndef PCI_CHIP_MGAG200_WINBOND_PCI
+#define PCI_CHIP_MGAG200_WINBOND_PCI 0x0532
+#endif
+
+#ifndef PCI_CHIP_MGAG200_EV_PCI
+#define PCI_CHIP_MGAG200_EV_PCI 0x0530
+#endif
+
/*
* Read/write to the DAC via MMIO
*/
@@ -147,6 +159,32 @@ void MGAdbg_outreg32(ScrnInfoPtr, int,int, char*);
outMGAdreg(MGA1064_DATA, tmp | (val)); \
} while (0)
+#define MGAWAITVSYNC() \
+ do { \
+ unsigned int count = 0; \
+ unsigned int status = 0; \
+ do { \
+ status = INREG( MGAREG_Status ); \
+ count++; \
+ } while( ( status & 0x08 ) && (count < 250000) );\
+ count = 0; \
+ status = 0; \
+ do { \
+ status = INREG( MGAREG_Status ); \
+ count++; \
+ } while( !( status & 0x08 ) && (count < 250000) );\
+ } while (0)
+
+#define MGAWAITBUSY() \
+ do { \
+ unsigned int count = 0; \
+ unsigned int status = 0; \
+ do { \
+ status = INREG8( MGAREG_Status + 2 ); \
+ count++; \
+ } while( ( status & 0x01 ) && (count < 500000) ); \
+ } while (0)
+
#define PORT_OFFSET (0x1F00 - 0x300)
#define MGA_VERSION 4000
@@ -154,9 +192,6 @@ void MGAdbg_outreg32(ScrnInfoPtr, int,int, char*);
#define MGA_C_NAME MGA
#define MGA_MODULE_DATA mgaModuleData
#define MGA_DRIVER_NAME "mga"
-#define MGA_MAJOR_VERSION 1
-#define MGA_MINOR_VERSION 4
-#define MGA_PATCHLEVEL 4
typedef struct {
unsigned char ExtVga[6];
@@ -169,6 +204,9 @@ typedef struct {
CARD32 Option3;
long Clock;
Bool PIXPLLCSaved;
+ unsigned char PllM;
+ unsigned char PllN;
+ unsigned char PllP;
} MGARegRec, *MGARegPtr;
/* For programming the second CRTC */
@@ -240,7 +278,6 @@ typedef struct {
int depth;
int displayWidth;
rgb weight;
- Bool Overlay8Plus24;
DisplayModePtr mode;
} MGAFBLayout;
@@ -263,7 +300,11 @@ typedef struct {
#ifdef DISABLE_VGA_IO
typedef struct mgaSave {
+#ifdef XSERVER_LIBPCIACCESS
+ struct pci_device * pvp;
+#else
pciVideoPtr pvp;
+#endif
Bool enable;
} MgaSave, *MgaSavePtr;
#endif
@@ -376,6 +417,38 @@ struct mga_bios_values {
};
+/**
+ * Attributes that of an MGA device that can be derrived purely from its
+ * PCI ID.
+ */
+struct mga_device_attributes {
+ unsigned has_sdram:1;
+ unsigned probe_for_sdram:1;
+ unsigned dual_head_possible:1;
+ unsigned fb_4mb_quirk:1;
+ unsigned hwcursor_1064:1;
+
+ unsigned dri_capable:1;
+ unsigned dri_chipset:3;
+
+ unsigned HAL_chipset:1;
+
+ enum {
+ old_BARs = 0,
+ probe_BARs,
+ new_BARs
+ } BARs:2;
+
+ uint32_t accel_flags;
+
+ /** Default BIOS values. */
+ struct mga_bios_values default_bios_values;
+
+ /** Default memory probe offset / size values. */
+ unsigned probe_size;
+ unsigned probe_offset;
+};
+
typedef struct {
#ifdef USEMGAHAL
LPCLIENTDATA pClientStruct;
@@ -386,15 +459,25 @@ typedef struct {
EntityInfoPtr pEnt;
struct mga_bios_values bios;
CARD8 BiosOutputMode;
+#ifdef XSERVER_LIBPCIACCESS
+ struct pci_device * PciInfo;
+#else
pciVideoPtr PciInfo;
PCITAG PciTag;
+#endif
+ const struct mga_device_attributes * chip_attribs;
xf86AccessRec Access;
int Chipset;
int ChipRev;
int is_Gx50:1;
int is_G200SE:1;
- int is_HAL_chipset:1;
+ int is_G200WB:1;
+ int is_G200EV:1;
+
+ int KVM;
+
+ CARD32 reg_1e24; /* model revision on g200se */
Bool Primary;
Bool Interleave;
@@ -406,12 +489,30 @@ typedef struct {
int YDstOrg;
int DstOrg;
int SrcOrg;
+
+ /**
+ * Which BAR corresponds to the framebuffer on this chip?
+ */
+ unsigned framebuffer_bar;
+
+ /**
+ * Which BAR corresponds to IO space on this chip?
+ */
+ unsigned io_bar;
+
+ /**
+ * Which BAR corresponds to ILOAD space on this chip? If the value is
+ * -1, then this chip does not have an ILOAD region.
+ */
+ int iload_bar;
+
+#ifndef XSERVER_LIBPCIACCESS
unsigned long IOAddress;
- unsigned long FbAddress;
unsigned long ILOADAddress;
- int FbBaseReg;
unsigned long BiosAddress;
MessageType BiosFrom;
+#endif
+ unsigned long FbAddress;
unsigned char * IOBase;
unsigned char * FbBase;
unsigned char * ILOADBase;
@@ -425,11 +526,9 @@ typedef struct {
Bool Exa;
ExaDriverPtr ExaDriver;
Bool SyncOnGreen;
- Bool Dac6Bit;
Bool HWCursor;
Bool UsePCIRetry;
Bool ShowCache;
- Bool Overlay8Plus24;
Bool ShadowFB;
unsigned char * ShadowPtr;
int ShadowPitch;
@@ -696,6 +795,9 @@ long MGAG450SavePLLFreq(ScrnInfoPtr pScrn);
void MGAprintDac(ScrnInfoPtr pScrn);
void MGAG200SESaveFonts(ScrnInfoPtr, vgaRegPtr);
void MGAG200SERestoreFonts(ScrnInfoPtr, vgaRegPtr);
+void MGAG200SESaveMode(ScrnInfoPtr, vgaRegPtr);
+void MGAG200SERestoreMode(ScrnInfoPtr, vgaRegPtr);
+void MGAG200SEHWProtect(ScrnInfoPtr, Bool);
#ifdef USEMGAHAL
/************ ESC Call Definition ***************/
diff --git a/driver/xf86-video-mga/src/mga_arc.c b/driver/xf86-video-mga/src/mga_arc.c
index 00b0e54e0..5263f1f97 100644
--- a/driver/xf86-video-mga/src/mga_arc.c
+++ b/driver/xf86-video-mga/src/mga_arc.c
@@ -23,7 +23,6 @@ used in advertising or otherwise to promote the sale, use or other dealings
in this Software without prior written authorization from The Open Group.
********************************************************/
-/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/mga/mga_arc.c,v 1.12tsi Exp $ */
#ifdef HAVE_CONFIG_H
#include "config.h"
@@ -52,12 +51,6 @@ in this Software without prior written authorization from The Open Group.
#include "mga_macros.h"
-/*
- This is only faster than cfb for stuff other than GXcopy.
- And even then, only when pci_retries are on.
-*/
-
-
#define DRAW_POINT(x, y) { \
tmp = x; \
OUTREG(MGAREG_FXBNDRY, (tmp) | (((tmp) + 1) << 16)); \
diff --git a/driver/xf86-video-mga/src/mga_bios.c b/driver/xf86-video-mga/src/mga_bios.c
index dd75f3f4d..b78890ea9 100644
--- a/driver/xf86-video-mga/src/mga_bios.c
+++ b/driver/xf86-video-mga/src/mga_bios.c
@@ -96,117 +96,6 @@ static __inline__ CARD32 get_u32( const CARD8 * data )
/**
- * Initialize reasonable defaults for values that normally come form the BIOS.
- *
- * For each generation of hardware, provide reasonable default values, based
- * on the type of hardware and chipset revision, for various values that are
- * normally read from the PInS structure in the BIOS. This provides a backup
- * in case the PInS structure cannot be found.
- *
- * \param pMga Pointer to the MGA-private data.
- * \param bios Pointer to the structure that holds values read from the BIOS.
- *
- * \todo
- * Determine if different default values should be used for G400 and G450
- * cards. These cards have the same PCI ID, but can be identified by a
- * different chip revision. The G450 cards have a revision of 3 or higher.
- */
-
-static void mga_initialize_bios_values( MGAPtr pMga,
- struct mga_bios_values * bios )
-{
- (void) memset( bios, 0, sizeof( *bios ) );
-
- bios->pixel.min_freq = 50000;
-
- switch( pMga->Chipset ) {
- case PCI_CHIP_MGA2064:
- case PCI_CHIP_MGA2164:
- case PCI_CHIP_MGA2164_AGP:
- bios->pixel.max_freq = 220000;
-
- bios->pll_ref_freq = 14318;
- bios->mem_clock = 50000;
-
- bios->host_interface = (pMga->Chipset == PCI_CHIP_MGA2164_AGP)
- ? MGA_HOST_AGP_1x : MGA_HOST_PCI;
- break;
-
- case PCI_CHIP_MGA1064:
- /* There used to be code in MGARamdacInit (mga_dacG.c) that would
- * set this to 170000 if the chip revision was less than 3. Is that
- * needed here?
- */
-
- bios->system.max_freq = 230000;
- bios->pixel.max_freq = 230000;
-
- bios->pll_ref_freq = 14318;
- bios->mem_clock = 50000;
- bios->host_interface = MGA_HOST_PCI;
- break;
-
- case PCI_CHIP_MGAG200_SE_A_PCI:
- case PCI_CHIP_MGAG200_SE_B_PCI:
- bios->system.max_freq = 114000;
- bios->system.min_freq = 50000;
- bios->pixel.max_freq = 114000;
- bios->pll_ref_freq = 27050;
- bios->mem_clock = 45000;
- bios->host_interface = MGA_HOST_PCI;
- break;
-
- case PCI_CHIP_MGAG100_PCI:
- case PCI_CHIP_MGAG100:
- case PCI_CHIP_MGAG200_PCI:
- case PCI_CHIP_MGAG200:
- bios->system.max_freq = 230000;
- bios->pixel.max_freq = 230000;
-
- bios->system.min_freq = 50000;
-
- bios->pll_ref_freq = 27050;
- bios->mem_clock = 50000;
-
- if ( pMga->Chipset == PCI_CHIP_MGAG100 ) {
- bios->host_interface = MGA_HOST_AGP_1x;
- }
- else if ( pMga->Chipset == PCI_CHIP_MGAG200 ) {
- bios->host_interface = MGA_HOST_AGP_2x;
- }
- else {
- bios->host_interface = MGA_HOST_PCI;
- }
- break;
-
- case PCI_CHIP_MGAG400:
- bios->system.max_freq = 252000;
- bios->pixel.max_freq = 252000;
-
- bios->system.min_freq = 50000;
-
- bios->pll_ref_freq = 27050;
- bios->mem_clock = 200000;
- bios->host_interface = MGA_HOST_AGP_4x;
- break;
-
- case PCI_CHIP_MGAG550:
- bios->system.min_freq = 256000;
- bios->pixel.min_freq = 256000;
- bios->video.min_freq = 256000;
- bios->system.max_freq = 600000;
- bios->pixel.max_freq = 600000;
- bios->video.max_freq = 600000;
-
- bios->pll_ref_freq = 27050;
- bios->mem_clock = 284000;
- bios->host_interface = MGA_HOST_AGP_4x;
- break;
- }
-}
-
-
-/**
* Parse version 0x01XX of the BIOS PInS structure.
*
* Version 0x01XX of the BIOS PInS structure is only found in Millenium cards.
@@ -406,15 +295,18 @@ static void mga_parse_bios_ver_5( struct mga_bios_values * bios,
Bool mga_read_and_process_bios( ScrnInfoPtr pScrn )
{
- CARD8 bios_data[0x10000];
+ CARD8 bios_data[0x20000];
unsigned offset;
MGAPtr pMga = MGAPTR(pScrn);
+#ifndef XSERVER_LIBPCIACCESS
Bool pciBIOS = TRUE;
+#endif
int rlen;
static const unsigned expected_length[] = { 0, 64, 64, 64, 128, 128 };
unsigned version;
unsigned pins_len;
const CARD8 * pins_data;
+ int err;
#ifdef BIOS_DEBUG
static const char * const host_interface_strings[8] = {
"Reserved",
@@ -434,8 +326,8 @@ Bool mga_read_and_process_bios( ScrnInfoPtr pScrn )
* isn't found or can't be read we'll still have some reasonable values
* to use.
*/
-
- mga_initialize_bios_values( pMga, & pMga->bios );
+ (void) memcpy(& pMga->bios, & pMga->chip_attribs->default_bios_values,
+ sizeof(struct mga_bios_values));
/* If the BIOS address was probed, it was found from the PCI config space
@@ -443,6 +335,9 @@ Bool mga_read_and_process_bios( ScrnInfoPtr pScrn )
* might be controlled by the PCI config space.
*/
+#ifdef XSERVER_LIBPCIACCESS
+ err = pci_device_read_rom(pMga->PciInfo, bios_data);
+#else
if (pMga->BiosFrom == X_DEFAULT) {
pciBIOS = FALSE;
}
@@ -451,7 +346,7 @@ Bool mga_read_and_process_bios( ScrnInfoPtr pScrn )
}
if (pciBIOS) {
- rlen = xf86ReadPciBIOS(0, pMga->PciTag, pMga->FbBaseReg,
+ rlen = xf86ReadPciBIOS(0, pMga->PciTag, pMga->framebuffer_bar,
bios_data, sizeof(bios_data));
}
else {
@@ -459,7 +354,10 @@ Bool mga_read_and_process_bios( ScrnInfoPtr pScrn )
sizeof(bios_data), bios_data);
}
- if (rlen < (bios_data[2] << 9)) {
+ err = rlen < (bios_data[2] << 9);
+#endif
+
+ if (err) {
xf86DrvMsg(pScrn->scrnIndex, X_WARNING,
"Could not retrieve video BIOS!\n");
return FALSE;
diff --git a/driver/xf86-video-mga/src/mga_dac3026.c b/driver/xf86-video-mga/src/mga_dac3026.c
index 1eddefdad..35bd9a389 100644
--- a/driver/xf86-video-mga/src/mga_dac3026.c
+++ b/driver/xf86-video-mga/src/mga_dac3026.c
@@ -1,4 +1,3 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/mga/mga_dac3026.c,v 1.58tsi Exp $ */
/*
* Copyright 1994 by Robin Cutshaw <robin@XFree86.org>
*
@@ -136,14 +135,6 @@ const static unsigned char MGADACbpp32[DACREGSIZE] = {
0x00
};
-/* on at least some 2064Ws, the PSEL line flips at 4MB or so, so PSEL keying
- has to be off in register 0x1e -> bit4 clear */
-
-const static unsigned char MGADACbpp8plus24[DACREGSIZE] = {
- 0x07, 0x06, 0x5b, 0x05, 0x00, 0x00, 0x2C, 0x00, 0x1E, 0xFF,
- 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x01, 0x00, 0x00,
- 0x00
-};
/*
* Read/write to the DAC via MMIO
@@ -517,11 +508,8 @@ MGA3026Init(ScrnInfoPtr pScrn, DisplayModePtr mode)
initDAC = MGADACbpp24;
break;
case 32:
- if(pLayout->Overlay8Plus24)
- initDAC = MGADACbpp8plus24;
- else
- initDAC = MGADACbpp32;
- break;
+ initDAC = MGADACbpp32;
+ break;
default:
FatalError("MGA: unsupported bits per pixel\n");
}
@@ -536,11 +524,6 @@ MGA3026Init(ScrnInfoPtr pScrn, DisplayModePtr mode)
index_1d = i;
}
- if((pLayout->bitsPerPixel == 32) && pLayout->Overlay8Plus24) {
- pReg->DacRegs[9] = pMga->colorKey;
- pReg->DacRegs[10] = pMga->colorKey;
- }
-
if ( (pLayout->bitsPerPixel == 16) && (pLayout->weight.red == 5)
&& (pLayout->weight.green == 5) && (pLayout->weight.blue == 5) ) {
pReg->DacRegs[1] &= ~0x01;
@@ -746,8 +729,13 @@ MGA3026Restore(ScrnInfoPtr pScrn, vgaRegPtr vgaReg, MGARegPtr mgaReg,
for (i = 0; i < 6; i++)
OUTREG16(0x1FDE, (mgaReg->ExtVga[i] << 8) | i);
+#ifdef XSERVER_LIBPCIACCESS
+ pci_device_cfg_write_bits(pMga->PciInfo, OPTION_MASK, mgaReg->Option,
+ PCI_OPTION_REG);
+#else
pciSetBitsLong(pMga->PciTag, PCI_OPTION_REG, OPTION_MASK,
mgaReg->Option);
+#endif
MGA_NOT_HAL(
/* select pixel clock PLL as clock source */
@@ -866,7 +854,12 @@ MGA3026Save(ScrnInfoPtr pScrn, vgaRegPtr vgaReg, MGARegPtr mgaReg,
for (i = 0; i < DACREGSIZE; i++)
mgaReg->DacRegs[i] = inTi3026(MGADACregs[i]);
+#ifdef XSERVER_LIBPCIACCESS
+ pci_device_cfg_read_u32(pMga->PciInfo, & mgaReg->Option,
+ PCI_OPTION_REG);
+#else
mgaReg->Option = pciReadLong(pMga->PciTag, PCI_OPTION_REG);
+#endif
#ifdef DEBUG
ErrorF("read: %02X %02X %02X %02X %02X %02X %08lX\n",
@@ -1128,9 +1121,6 @@ void MGA3026LoadPalette(
MGAPtr pMga = MGAPTR(pScrn);
int i, index;
- if(pMga->CurrentLayout.Overlay8Plus24 && (pVisual->nplanes != 8))
- return;
-
if (pVisual->nplanes == 16) {
for(i = 0; i < numColors; i++) {
index = indices[i];
diff --git a/driver/xf86-video-mga/src/mga_dacG.c b/driver/xf86-video-mga/src/mga_dacG.c
index df29b4890..af5d1d984 100644
--- a/driver/xf86-video-mga/src/mga_dacG.c
+++ b/driver/xf86-video-mga/src/mga_dacG.c
@@ -2,13 +2,6 @@
* MGA-1064, MGA-G100, MGA-G200, MGA-G400, MGA-G550 RAMDAC driver
*/
-/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/mga/mga_dacG.c,v 1.54tsi Exp $ */
-
-/*
- * This is a first cut at a non-accelerated version to work with the
- * new server design (DHD).
- */
-
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
@@ -62,8 +55,9 @@ static void MGAGLoadPalette(ScrnInfoPtr, int, int*, LOCO*, VisualPtr);
static Bool MGAG_i2cInit(ScrnInfoPtr pScrn);
static void
-MGAG200SEComputePLLParam(ScrnInfoPtr pScrn, long lFo, int *M, int *N, int *P)
+MGAG200IPComputePLLParam(ScrnInfoPtr pScrn, long lFo, int *M, int *N, int *P)
{
+ MGAPtr pMga = MGAPTR(pScrn);
unsigned int ulComputedFo;
unsigned int ulFDelta;
unsigned int ulFPermitedDelta;
@@ -73,22 +67,52 @@ MGAG200SEComputePLLParam(ScrnInfoPtr pScrn, long lFo, int *M, int *N, int *P)
unsigned int ulTestM;
unsigned int ulTestN;
unsigned int ulPLLFreqRef;
-
- ulVCOMax = 320000;
- ulVCOMin = 160000;
- ulPLLFreqRef = 25000;
+ unsigned int ulTestPStart;
+ unsigned int ulTestNStart;
+ unsigned int ulTestNEnd;
+ unsigned int ulTestMStart;
+ unsigned int ulTestMEnd;
+
+ if (pMga->is_G200SE) {
+ ulVCOMax = 320000;
+ ulVCOMin = 160000;
+ ulPLLFreqRef = 25000;
+ ulTestPStart = 8;
+ ulTestNStart = 17;
+ ulTestNEnd = 32;
+ ulTestMStart = 1;
+ ulTestMEnd = 32;
+ } else if (pMga->is_G200EV) {
+ ulVCOMax = 550000;
+ ulVCOMin = 150000;
+ ulPLLFreqRef = 50000;
+ ulTestPStart = 16;
+ ulTestNStart = 1;
+ ulTestNEnd = 256;
+ ulTestMStart = 1;
+ ulTestMEnd = 16;
+ } else if (pMga->is_G200WB) {
+ ulVCOMax = 680000;
+ ulVCOMin = 150000;
+ ulPLLFreqRef = 48000;
+ ulTestPStart = 8;
+ ulTestNStart = 1;
+ ulTestNEnd = 512;
+ ulTestMStart = 3;
+ ulTestMEnd = 25;
+ }
ulFDelta = 0xFFFFFFFF;
/* Permited delta is 0.5% as VESA Specification */
ulFPermitedDelta = lFo * 5 / 1000;
/* Then we need to minimize the M while staying within 0.5% */
- for (ulTestP = 8; ulTestP > 0; ulTestP >>= 1) {
+ for (ulTestP = ulTestPStart; ulTestP > 0; ulTestP--) {
if ((lFo * ulTestP) > ulVCOMax) continue;
if ((lFo * ulTestP) < ulVCOMin) continue;
- for (ulTestN = 17; ulTestN <= 256; ulTestN++) {
- for (ulTestM = 1; ulTestM <= 32; ulTestM++) {
+ for (ulTestN = ulTestNStart; ulTestN <= ulTestNEnd; ulTestN++) {
+ for (ulTestM = ulTestMStart; ulTestM <= ulTestMEnd; ulTestM++) {
ulComputedFo = (ulPLLFreqRef * ulTestN) / (ulTestM * ulTestP);
if (ulComputedFo > lFo)
ulFTmpDelta = ulComputedFo - lFo;
@@ -96,16 +120,287 @@ MGAG200SEComputePLLParam(ScrnInfoPtr pScrn, long lFo, int *M, int *N, int *P)
ulFTmpDelta = lFo - ulComputedFo;
if (ulFTmpDelta < ulFDelta) {
- ulFDelta = ulFTmpDelta;
- *M = ulTestM - 1;
+ ulFDelta = ulFTmpDelta;
+ if (pMga->is_G200WB) {
+ *M = (ulTestM - 1) | (((ulTestN -1) >> 1) & 0x80);
+ } else {
+ *M = ulTestM - 1;
+ }
*N = ulTestN - 1;
*P = ulTestP - 1;
}
}
}
}
+#if DEBUG
+ xf86DrvMsg(pScrn->scrnIndex, X_INFO,
+ "lFo=%ld n=0x%x m=0x%x p=0x%x \n",
+ lFo, *N, *M, *P );
+#endif
+}
+
+static void
+MGAG200EVPIXPLLSET(ScrnInfoPtr pScrn, MGARegPtr mgaReg)
+{
+ MGAPtr pMga = MGAPTR(pScrn);
+
+ unsigned long ulFallBackCounter;
+ unsigned char ucTempByte, ucPixCtrl;
+ unsigned char ucM;
+ unsigned char ucN;
+ unsigned char ucP;
+ unsigned char ucS;
+
+ // Set pixclkdis to 1
+ ucPixCtrl = inMGAdac(MGA1064_PIX_CLK_CTL);
+ ucPixCtrl |= MGA1064_PIX_CLK_CTL_CLK_DIS;
+ outMGAdac(MGA1064_PIX_CLK_CTL, ucPixCtrl);
+
+ // Select PLL Set C
+ ucTempByte = INREG8(MGAREG_MISC_READ);
+ ucTempByte |= 0x3<<2; //select MGA pixel clock
+ OUTREG8(MGAREG_MISC_WRITE, ucTempByte);
+
+ // Set pixlock to 0
+ ucTempByte = inMGAdac(MGA1064_PIX_PLL_STAT);
+ outMGAdac(MGA1064_PIX_PLL_STAT, ucTempByte & ~0x40);
+
+ // Set pix_stby to 1
+ ucPixCtrl |= MGA1064_PIX_CLK_CTL_CLK_POW_DOWN;
+ outMGAdac(MGA1064_PIX_CLK_CTL, ucPixCtrl);
+
+ // Program the Pixel PLL Register
+ outMGAdac(MGA1064_EV_PIX_PLLC_M, mgaReg->PllM);
+ outMGAdac(MGA1064_EV_PIX_PLLC_N, mgaReg->PllN);
+ outMGAdac(MGA1064_EV_PIX_PLLC_P, mgaReg->PllP);
+
+ // Wait 50 us
+ usleep(50);
+
+ // Set pix_stby to 0
+ ucPixCtrl &= ~MGA1064_PIX_CLK_CTL_CLK_POW_DOWN;
+ outMGAdac(MGA1064_PIX_CLK_CTL, ucPixCtrl);
+
+ // Wait 500 us
+ usleep(500);
+
+ // Select the pixel PLL by setting pixclksel to 1
+ ucTempByte = inMGAdac(MGA1064_PIX_CLK_CTL);
+ ucTempByte &= ~MGA1064_PIX_CLK_CTL_SEL_MSK;
+ ucTempByte |= MGA1064_PIX_CLK_CTL_SEL_PLL;
+ outMGAdac(MGA1064_PIX_CLK_CTL, ucTempByte);
+
+ // Set pixlock to 1
+ ucTempByte = inMGAdac(MGA1064_PIX_PLL_STAT);
+ outMGAdac(MGA1064_PIX_CLK_CTL, ucTempByte | 0x40);
+
+ // Reset dotclock rate bit.
+ ucTempByte = INREG8(MGAREG_MEM_MISC_READ);
+ ucTempByte |= 0x3<<2; //select MGA pixel clock
+ OUTREG8(MGAREG_MEM_MISC_WRITE, ucTempByte);
+
+ OUTREG8(MGAREG_SEQ_INDEX, 1);
+ ucTempByte = INREG8(MGAREG_SEQ_DATA);
+ OUTREG8(MGAREG_SEQ_DATA, ucTempByte & ~0x8);
+
+ // Set pixclkdis to 0
+ ucTempByte = inMGAdac(MGA1064_PIX_CLK_CTL);
+ ucTempByte &= ~MGA1064_PIX_CLK_CTL_CLK_DIS;
+ outMGAdac(MGA1064_PIX_CLK_CTL, ucTempByte);
+}
+
+static void
+MGAG200WBPIXPLLSET(ScrnInfoPtr pScrn, MGARegPtr mgaReg)
+{
+ MGAPtr pMga = MGAPTR(pScrn);
+
+ unsigned long ulFallBackCounter;
+ unsigned char ucTempByte, ucPixCtrl;
+ unsigned char ucM;
+ unsigned char ucN;
+ unsigned char ucP;
+ unsigned char ucS;
+
+ // Set pixclkdis to 1
+ ucPixCtrl = inMGAdac(MGA1064_PIX_CLK_CTL);
+ ucPixCtrl |= MGA1064_PIX_CLK_CTL_CLK_DIS;
+ outMGAdac(MGA1064_PIX_CLK_CTL, ucPixCtrl);
+
+ ucTempByte = inMGAdac(MGA1064_REMHEADCTL);
+ ucTempByte |= MGA1064_REMHEADCTL_CLKDIS;
+ outMGAdac(MGA1064_REMHEADCTL, ucTempByte);
+
+ // Select PLL Set C
+ ucTempByte = INREG8(MGAREG_MISC_READ);
+ ucTempByte |= 0x3<<2; //select MGA pixel clock
+ OUTREG8(MGAREG_MISC_WRITE, ucTempByte);
+
+ // Set pixlock to 0
+ ucTempByte = inMGAdac(MGA1064_PIX_PLL_STAT);
+ outMGAdac(MGA1064_PIX_PLL_STAT, ucTempByte & ~0x40);
+
+ ucPixCtrl |= MGA1064_PIX_CLK_CTL_CLK_POW_DOWN | 0x80;
+ outMGAdac(MGA1064_PIX_CLK_CTL, ucPixCtrl);
+
+ // Wait 500 us
+ usleep(500);
+
+ // Reset the PLL
+ // When we are varying the output frequency by more than
+ // 10%, we must reset the PLL. However to be prudent, we
+ // will reset it each time that we are changing it.
+ ucTempByte = inMGAdac(MGA1064_VREF_CTL);
+ ucTempByte &= ~0x04;
+ outMGAdac(MGA1064_VREF_CTL, ucTempByte );
+
+ // Wait 50 us
+ usleep(50);
+
+ // Program the Pixel PLL Register
+ outMGAdac(MGA1064_WB_PIX_PLLC_M, mgaReg->PllM);
+ outMGAdac(MGA1064_WB_PIX_PLLC_N, mgaReg->PllN);
+ outMGAdac(MGA1064_WB_PIX_PLLC_P, mgaReg->PllP);
+
+ // Wait 50 us
+ usleep(50);
+
+ ucTempByte = INREG8(MGAREG_MISC_READ);
+ OUTREG8(MGAREG_MISC_WRITE, ucTempByte & ~0x08);
+
+ // Wait 50 us
+ usleep(50);
+
+ OUTREG8(MGAREG_MISC_WRITE, ucTempByte);
+
+ // Wait 500 us
+ usleep(500);
+
+ // Turning the PLL on
+ ucTempByte = inMGAdac(MGA1064_VREF_CTL);
+ ucTempByte |= 0x04;
+ outMGAdac(MGA1064_VREF_CTL, ucTempByte );
+
+ // Wait 500 us
+ usleep(500);
+
+ // Select the pixel PLL by setting pixclksel to 1
+ ucTempByte = inMGAdac(MGA1064_PIX_CLK_CTL);
+ ucTempByte &= ~MGA1064_PIX_CLK_CTL_SEL_MSK;
+ ucTempByte |= MGA1064_PIX_CLK_CTL_SEL_PLL;
+ outMGAdac(MGA1064_PIX_CLK_CTL, ucTempByte);
+
+ ucTempByte = inMGAdac(MGA1064_REMHEADCTL);
+ ucTempByte &= ~MGA1064_REMHEADCTL_CLKSL_MSK;
+ ucTempByte |= MGA1064_REMHEADCTL_CLKSL_PLL;
+ outMGAdac(MGA1064_REMHEADCTL, ucTempByte);
+
+ // Set pixlock to 1
+ ucTempByte = inMGAdac(MGA1064_PIX_PLL_STAT);
+ outMGAdac(MGA1064_PIX_PLL_STAT, ucTempByte | 0x40);
+
+ // Reset dotclock rate bit.
+ OUTREG8(MGAREG_SEQ_INDEX, 1);
+ ucTempByte = INREG8(MGAREG_SEQ_DATA);
+ OUTREG8(MGAREG_SEQ_DATA, ucTempByte & ~0x8);
+
+ // Set pixclkdis to 0
+ ucTempByte = inMGAdac(MGA1064_PIX_CLK_CTL);
+ ucTempByte &= ~MGA1064_PIX_CLK_CTL_CLK_DIS;
+ outMGAdac(MGA1064_PIX_CLK_CTL, ucTempByte);
+
+ // Set remclkdis to 0
+ ucTempByte = inMGAdac(MGA1064_REMHEADCTL);
+ ucTempByte &= ~MGA1064_REMHEADCTL_CLKDIS;
+ outMGAdac(MGA1064_REMHEADCTL, ucTempByte);
+}
+
+static void
+MGAG200WBPrepareForModeSwitch(ScrnInfoPtr pScrn)
+{
+ MGAPtr pMga = MGAPTR(pScrn);
+
+ unsigned char ucTmpData = 0;
+ int ulIterationMax = 0;
+ // 1- The first step is to warn the BMC of an upcoming mode change.
+ // We are putting the misc<0> to output.
+ ucTmpData = inMGAdac(MGA1064_GEN_IO_CTL);
+ ucTmpData |= 0x10;
+ outMGAdac(MGA1064_GEN_IO_CTL, ucTmpData);
+
+ // We are putting a 1 on the misc<0> line.
+ ucTmpData = inMGAdac(MGA1064_GEN_IO_DATA);
+ ucTmpData |= 0x10;
+ outMGAdac(MGA1064_GEN_IO_DATA, ucTmpData);
+
+ // 2- The second step is to mask any further scan request
+ // This will be done by asserting the remfreqmsk bit (XSPAREREG<7>)
+ ucTmpData = inMGAdac(MGA1064_SPAREREG);
+ ucTmpData |= 0x80;
+ outMGAdac(MGA1064_SPAREREG, ucTmpData);
+
+ // 3a- The third step is to verify if there is an active scan
+ // We are searching for a 0 on remhsyncsts (XSPAREREG<0>)
+ ulIterationMax = 300;
+ while (!(ucTmpData & 0x01) && ulIterationMax)
+ {
+ ucTmpData = inMGAdac(MGA1064_SPAREREG);
+ usleep(1000);
+ ulIterationMax--;
+ }
+
+ // 3b- This step occurs only if the remote is actually scanning
+ // We are waiting for the end of the frame which is a 1 on
+ // remvsyncsts (XSPAREREG<1>)
+ if (ulIterationMax)
+ {
+ ulIterationMax = 300;
+ while ((ucTmpData & 0x02) && ulIterationMax)
+ {
+ ucTmpData = inMGAdac(MGA1064_SPAREREG);
+ usleep(1000);
+ ulIterationMax--;
+ }
+ }
}
+static void
+MGAG200WBRestoreFromModeSwitch(ScrnInfoPtr pScrn)
+{
+ MGAPtr pMga = MGAPTR(pScrn);
+
+ unsigned char ucTmpData = 0;
+
+ // 1- The first step is to ensure that the vrsten and hrsten are set
+ OUTREG8(MGAREG_CRTCEXT_INDEX, 0x01);
+ ucTmpData = INREG8(MGAREG_CRTCEXT_DATA);
+ OUTREG8(MGAREG_CRTCEXT_DATA, ucTmpData | 0x88);
+
+ // 2- The second step is is to assert the rstlvl2
+ ucTmpData = inMGAdac(MGA1064_REMHEADCTL2);
+ ucTmpData |= 0x08;
+ outMGAdac(MGA1064_REMHEADCTL2, ucTmpData);
+
+ // - Wait for 10 us
+ usleep(10);
+
+ // 3- The next step is is to deassert the rstlvl2
+ ucTmpData &= ~0x08;
+ outMGAdac(MGA1064_REMHEADCTL2, ucTmpData);
+
+ // - Wait for 10 us
+ usleep(10);
+
+ // 4- The fourth step is to remove the mask of scan request
+ // This will be done by deasserting the remfreqmsk bit (XSPAREREG<7>)
+ ucTmpData = inMGAdac(MGA1064_SPAREREG);
+ ucTmpData &= ~0x80;
+ outMGAdac(MGA1064_SPAREREG, ucTmpData);
+
+ // 5- Finally, we are putting back a 0 on the misc<0> line.
+ ucTmpData = inMGAdac(MGA1064_GEN_IO_DATA);
+ ucTmpData &= ~0x10;
+ outMGAdac(MGA1064_GEN_IO_DATA, ucTmpData);
+}
/**
* Calculate the PLL settings (m, n, p, s).
@@ -130,26 +425,23 @@ MGAGCalcClock ( ScrnInfoPtr pScrn, long f_out,
double f_vco;
double m_err, calc_f;
const double ref_freq = (double) pMga->bios.pll_ref_freq;
- int feed_div_min, feed_div_max;
- int in_div_min, in_div_max;
- int post_div_max;
-
+ const int feed_div_max = 127;
+ const int in_div_min = 1;
+ const int post_div_max = 7;
+ int feed_div_min;
+ int in_div_max;
+
+
switch( pMga->Chipset )
{
case PCI_CHIP_MGA1064:
feed_div_min = 100;
- feed_div_max = 127;
- in_div_min = 1;
in_div_max = 31;
- post_div_max = 7;
break;
case PCI_CHIP_MGAG400:
case PCI_CHIP_MGAG550:
feed_div_min = 7;
- feed_div_max = 127;
- in_div_min = 1;
in_div_max = 31;
- post_div_max = 7;
break;
case PCI_CHIP_MGAG200_SE_A_PCI:
case PCI_CHIP_MGAG200_SE_B_PCI:
@@ -159,10 +451,7 @@ MGAGCalcClock ( ScrnInfoPtr pScrn, long f_out,
case PCI_CHIP_MGAG200_PCI:
default:
feed_div_min = 7;
- feed_div_max = 127;
- in_div_min = 1;
in_div_max = 6;
- post_div_max = 7;
break;
}
@@ -243,11 +532,16 @@ MGAGSetPCLK( ScrnInfoPtr pScrn, long f_out )
}
if (pMga->is_G200SE) {
- MGAG200SEComputePLLParam(pScrn, f_out, &m, &n, &p);
+ MGAG200IPComputePLLParam(pScrn, f_out, &m, &n, &p);
pReg->DacRegs[ MGA1064_PIX_PLLC_M ] = m;
pReg->DacRegs[ MGA1064_PIX_PLLC_N ] = n;
pReg->DacRegs[ MGA1064_PIX_PLLC_P ] = p;
+ } else if (pMga->is_G200EV || pMga->is_G200WB) {
+ MGAG200IPComputePLLParam(pScrn, f_out, &m, &n, &p);
+ pReg->PllM = m;
+ pReg->PllN = n;
+ pReg->PllP = p;
} else {
/* Do the calculations for m, n, p and s */
MGAGCalcClock( pScrn, f_out, &m, &n, &p, &s );
@@ -332,7 +626,8 @@ MGAGInit(ScrnInfoPtr pScrn, DisplayModePtr mode)
break;
case PCI_CHIP_MGAG100:
case PCI_CHIP_MGAG100_PCI:
- pReg->DacRegs[ MGAGDAC_XVREFCTRL ] = 0x03;
+ pReg->DacRegs[MGA1064_VREF_CTL] = 0x03;
+
if(pMga->HasSDRAM) {
if(pMga->OverclockMem) {
/* 220 Mhz */
@@ -413,14 +708,37 @@ MGAGInit(ScrnInfoPtr pScrn, DisplayModePtr mode)
MGA_HAL(break;);
#endif
pReg->DacRegs[ MGA1064_VREF_CTL ] = 0x03;
- pReg->DacRegs[ MGA1064_PIX_CLK_CTL ] = 0x01;
- pReg->DacRegs[ MGA1064_MISC_CTL ] = 0x19;
- if(pMga->HasSDRAM)
- pReg->Option = 0x40499121;
- else
- pReg->Option = 0x4049cd21;
- pReg->Option2 = 0x00008000;
+ pReg->DacRegs[MGA1064_PIX_CLK_CTL] =
+ MGA1064_PIX_CLK_CTL_SEL_PLL;
+
+ pReg->DacRegs[MGA1064_MISC_CTL] =
+ MGA1064_MISC_CTL_DAC_EN |
+ MGA1064_MISC_CTL_VGA8 |
+ MGA1064_MISC_CTL_DAC_RAM_CS;
+
+ if (pMga->HasSDRAM)
+ pReg->Option = 0x40049120;
+ pReg->Option2 = 0x00008000;
break;
+
+ case PCI_CHIP_MGAG200_WINBOND_PCI:
+ pReg->DacRegs[MGA1064_VREF_CTL] = 0x07;
+ pReg->Option = 0x41049120;
+ pReg->Option2 = 0x0000b000;
+ break;
+
+ case PCI_CHIP_MGAG200_EV_PCI:
+ pReg->DacRegs[MGA1064_PIX_CLK_CTL] =
+ MGA1064_PIX_CLK_CTL_SEL_PLL;
+
+ pReg->DacRegs[MGA1064_MISC_CTL] =
+ MGA1064_MISC_CTL_VGA8 |
+ MGA1064_MISC_CTL_DAC_RAM_CS;
+
+ pReg->Option = 0x00000120;
+ pReg->Option2 = 0x0000b000;
+ break;
+
case PCI_CHIP_MGAG200:
case PCI_CHIP_MGAG200_PCI:
default:
@@ -467,13 +785,8 @@ MGAGInit(ScrnInfoPtr pScrn, DisplayModePtr mode)
pReg->DacRegs[ MGA1064_MUL_CTL ] = MGA1064_MUL_CTL_24bits;
break;
case 32:
- if(pLayout->Overlay8Plus24) {
- pReg->DacRegs[ MGA1064_MUL_CTL ] = MGA1064_MUL_CTL_32bits;
- pReg->DacRegs[ MGA1064_COL_KEY_MSK_LSB ] = 0xFF;
- pReg->DacRegs[ MGA1064_COL_KEY_LSB ] = pMga->colorKey;
- } else
- pReg->DacRegs[ MGA1064_MUL_CTL ] = MGA1064_MUL_CTL_32_24bits;
- break;
+ pReg->DacRegs[ MGA1064_MUL_CTL ] = MGA1064_MUL_CTL_32_24bits;
+ break;
default:
FatalError("MGA: unsupported depth\n");
}
@@ -534,7 +847,11 @@ MGAGInit(ScrnInfoPtr pScrn, DisplayModePtr mode)
else
pReg->ExtVga[3] = ((1 << BppShift) - 1) | 0x80;
- pReg->ExtVga[4] = 0;
+ pReg->ExtVga[4] = 0;
+
+ if (pMga->is_G200WB){
+ pReg->ExtVga[1] |= 0x88;
+ }
pVga->CRTC[0] = ht - 4;
pVga->CRTC[1] = hd;
@@ -565,7 +882,11 @@ MGAGInit(ScrnInfoPtr pScrn, DisplayModePtr mode)
MGA_NOT_HAL(pReg->DacRegs[MGA1064_CURSOR_BASE_ADR_HI] = pMga->FbCursorOffset >> 18);
if (pMga->SyncOnGreen) {
- MGA_NOT_HAL(pReg->DacRegs[MGA1064_GEN_CTL] &= ~0x20);
+ MGA_NOT_HAL(
+ pReg->DacRegs[MGA1064_GEN_CTL] &=
+ ~MGA1064_GEN_CTL_SYNC_ON_GREEN_DIS;
+ );
+
pReg->ExtVga[3] |= 0x40;
}
@@ -646,9 +967,6 @@ void MGAGLoadPalette(
){
MGAPtr pMga = MGAPTR(pScrn);
- if((pMga->CurrentLayout.Overlay8Plus24) && (pVisual->nplanes != 8))
- return;
-
if(pMga->Chipset == PCI_CHIP_MGAG400 || pMga->Chipset == PCI_CHIP_MGAG550){
/* load them at the retrace in the block handler instead to
work around some problems with static on the screen */
@@ -715,6 +1033,13 @@ MGAGRestore(ScrnInfoPtr pScrn, vgaRegPtr vgaReg, MGARegPtr mgaReg,
MGAPtr pMga = MGAPTR(pScrn);
CARD32 optionMask;
+MGA_NOT_HAL(
+ if (pMga->is_G200WB)
+ {
+ MGAG200WBPrepareForModeSwitch(pScrn);
+ }
+);
+
/*
* Pixel Clock needs to be restored regardless if we use
* HALLib or not. HALlib doesn't do a good job restoring
@@ -763,10 +1088,31 @@ MGA_NOT_HAL(
if (pMga->is_G200SE
&& ((i == 0x2C) || (i == 0x2D) || (i == 0x2E)))
continue;
+ if ( (pMga->is_G200EV || pMga->is_G200WB) &&
+ (i >= 0x44) && (i <= 0x4E))
+ continue;
+
outMGAdac(i, mgaReg->DacRegs[i]);
}
if (!MGAISGx50(pMga)) {
+ /* restore pci_option register */
+#ifdef XSERVER_LIBPCIACCESS
+ pci_device_cfg_write_bits(pMga->PciInfo, optionMask,
+ mgaReg->Option, PCI_OPTION_REG);
+
+ if (pMga->Chipset != PCI_CHIP_MGA1064) {
+ pci_device_cfg_write_bits(pMga->PciInfo, OPTION2_MASK,
+ mgaReg->Option2, PCI_MGA_OPTION2);
+
+ if (pMga->Chipset == PCI_CHIP_MGAG400
+ || pMga->Chipset == PCI_CHIP_MGAG550) {
+ pci_device_cfg_write_bits(pMga->PciInfo, OPTION3_MASK,
+ mgaReg->Option3,
+ PCI_MGA_OPTION3);
+ }
+ }
+#else
/* restore pci_option register */
pciSetBitsLong(pMga->PciTag, PCI_OPTION_REG, optionMask,
mgaReg->Option);
@@ -776,7 +1122,14 @@ MGA_NOT_HAL(
if (pMga->Chipset == PCI_CHIP_MGAG400 || pMga->Chipset == PCI_CHIP_MGAG550)
pciSetBitsLong(pMga->PciTag, PCI_MGA_OPTION3, OPTION3_MASK,
mgaReg->Option3);
+#endif
}
+
+ if (pMga->is_G200EV) {
+ MGAG200EVPIXPLLSET(pScrn, mgaReg);
+ } else if (pMga->is_G200WB) {
+ MGAG200WBPIXPLLSET(pScrn, mgaReg);
+ }
); /* MGA_NOT_HAL */
#ifdef USEMGAHAL
/*
@@ -795,11 +1148,11 @@ MGA_NOT_HAL(
#endif
/* restore CRTCEXT regs */
for (i = 0; i < 6; i++)
- OUTREG16(0x1FDE, (mgaReg->ExtVga[i] << 8) | i);
+ OUTREG16(MGAREG_CRTCEXT_INDEX, (mgaReg->ExtVga[i] << 8) | i);
/* This handles restoring the generic VGA registers. */
if (pMga->is_G200SE) {
- vgaHWRestore(pScrn, vgaReg, VGA_SR_MODE);
+ MGAG200SERestoreMode(pScrn, vgaReg);
if (restoreFonts)
MGAG200SERestoreFonts(pScrn, vgaReg);
} else {
@@ -808,10 +1161,24 @@ MGA_NOT_HAL(
}
MGAGRestorePalette(pScrn, vgaReg->DAC);
+
+ if (pMga->is_G200EV) {
+ OUTREG16(MGAREG_CRTCEXT_INDEX, 6);
+ OUTREG16(MGAREG_CRTCEXT_DATA, 0);
+ }
+
/*
* this is needed to properly restore start address
*/
- OUTREG16(0x1FDE, (mgaReg->ExtVga[0] << 8) | 0);
+ OUTREG16(MGAREG_CRTCEXT_INDEX, (mgaReg->ExtVga[0] << 8) | 0);
+
+MGA_NOT_HAL(
+ if (pMga->is_G200WB)
+ {
+ MGAG200WBRestoreFromModeSwitch(pScrn);
+ }
+);
+
} else {
/* Second Crtc */
xMODEINFO ModeInfo;
@@ -830,6 +1197,7 @@ MGA_NOT_HAL(
}
outMGAdac(i, mgaReg->dac2[ i - 0x80]);
}
+
); /* MGA_NOT_HAL */
}
@@ -892,14 +1260,14 @@ MGAGSave(ScrnInfoPtr pScrn, vgaRegPtr vgaReg, MGARegPtr mgaReg,
/*
* Code is needed to get back to bank zero.
*/
- OUTREG16(0x1FDE, 0x0004);
+ OUTREG16(MGAREG_CRTCEXT_INDEX, 0x0004);
/*
* This function will handle creating the data structure and filling
* in the generic VGA portion.
*/
if (pMga->is_G200SE) {
- vgaHWSave(pScrn, vgaReg, VGA_SR_MODE);
+ MGAG200SESaveMode(pScrn, vgaReg);
if (saveFonts)
MGAG200SESaveFonts(pScrn, vgaReg);
} else {
@@ -937,20 +1305,43 @@ MGAGSave(ScrnInfoPtr pScrn, vgaRegPtr vgaReg, MGARegPtr mgaReg,
for (i = 0; i < DACREGSIZE; i++)
mgaReg->DacRegs[i] = inMGAdac(i);
+ if (pMga->is_G200WB) {
+ mgaReg->PllM = inMGAdac(MGA1064_WB_PIX_PLLC_M);
+ mgaReg->PllN = inMGAdac(MGA1064_WB_PIX_PLLC_N);
+ mgaReg->PllP = inMGAdac(MGA1064_WB_PIX_PLLC_P);
+ } else if (pMga->is_G200EV) {
+ mgaReg->PllM = inMGAdac(MGA1064_EV_PIX_PLLC_M);
+ mgaReg->PllN = inMGAdac(MGA1064_EV_PIX_PLLC_N);
+ mgaReg->PllP = inMGAdac(MGA1064_EV_PIX_PLLC_P);
+ }
+
mgaReg->PIXPLLCSaved = TRUE;
+#ifdef XSERVER_LIBPCIACCESS
+ pci_device_cfg_read_u32(pMga->PciInfo, & mgaReg->Option,
+ PCI_OPTION_REG);
+ pci_device_cfg_read_u32(pMga->PciInfo, & mgaReg->Option2,
+ PCI_MGA_OPTION2);
+#else
mgaReg->Option = pciReadLong(pMga->PciTag, PCI_OPTION_REG);
mgaReg->Option2 = pciReadLong(pMga->PciTag, PCI_MGA_OPTION2);
+#endif
if (pMga->Chipset == PCI_CHIP_MGAG400 || pMga->Chipset == PCI_CHIP_MGAG550)
+#ifdef XSERVER_LIBPCIACCESS
+ pci_device_cfg_read_u32(pMga->PciInfo, & mgaReg->Option3,
+ PCI_MGA_OPTION3);
+#else
mgaReg->Option3 = pciReadLong(pMga->PciTag, PCI_MGA_OPTION3);
+#endif
); /* MGA_NOT_HAL */
for (i = 0; i < 6; i++)
{
- OUTREG8(0x1FDE, i);
- mgaReg->ExtVga[i] = INREG8(0x1FDF);
+ OUTREG8(MGAREG_CRTCEXT_INDEX, i);
+ mgaReg->ExtVga[i] = INREG8(MGAREG_CRTCEXT_DATA);
}
+
#ifdef DEBUG
ErrorF("Saved values:\nDAC:");
for (i=0; i<DACREGSIZE; i++) {
@@ -1093,12 +1484,19 @@ MGAGUseHWCursor(ScreenPtr pScrn, CursorPtr pCurs)
* Be careful, DDC1 and DDC2 refer to protocols, DDC_P1 and DDC_P2 refer to
* DDC data coming in on which videoport on the card
*/
-static const int DDC_P1_SDA_MASK = (1 << 1);
-static const int DDC_P1_SCL_MASK = (1 << 3);
-static const int DDC_P2_SDA_MASK = (1 << 0);
-static const int DDC_P2_SCL_MASK = (1 << 2);
-static const int MAVEN_SDA_MASK = (1 << 4);
-static const int MAVEN_SCL_MASK = (1 << 5);
+#define DDC_P1_SDA_MASK (1 << 1)
+#define DDC_P1_SCL_MASK (1 << 3)
+
+static const struct mgag_i2c_private {
+ unsigned sda_mask;
+ unsigned scl_mask;
+} i2c_priv[] = {
+ { (1 << 1), (1 << 3) },
+ { (1 << 0), (1 << 2) },
+ { (1 << 4), (1 << 5) },
+ { (1 << 0), (1 << 1) }, /* G200SE, G200EV and G200WB I2C bits */
+};
+
static unsigned int
MGAG_ddc1Read(ScrnInfoPtr pScrn)
@@ -1123,17 +1521,19 @@ MGAG_ddc1Read(ScrnInfoPtr pScrn)
}
static void
-MGAG_I2CGetBits(I2CBusPtr b, int *clock, int *data, int my_scl_mask, int my_sda_mask)
+MGAG_I2CGetBits(I2CBusPtr b, int *clock, int *data)
{
ScrnInfoPtr pScrn = xf86Screens[b->scrnIndex];
MGAPtr pMga = MGAPTR(pScrn);
+ const struct mgag_i2c_private *p =
+ (struct mgag_i2c_private *) b->DriverPrivate.ptr;
unsigned char val;
/* Get the result. */
val = inMGAdac(MGA1064_GEN_IO_DATA);
- *clock = (val & my_scl_mask) != 0;
- *data = (val & my_sda_mask) != 0;
+ *clock = (val & p->scl_mask) != 0;
+ *data = (val & p->sda_mask) != 0;
#ifdef DEBUG
ErrorF("MGAG_I2CGetBits(%p,...) val=0x%x, returns clock %d, data %d\n", b, val, *clock, *data);
#endif
@@ -1145,57 +1545,49 @@ MGAG_I2CGetBits(I2CBusPtr b, int *clock, int *data, int my_scl_mask, int my_sda_
* to high. High signal is maintained by a 15k Ohm pull-up resistor.
*/
static void
-MGAG_I2CPutBits(I2CBusPtr b, int clock, int data, int my_scl_mask, int my_sda_mask)
+MGAG_I2CPutBits(I2CBusPtr b, int clock, int data)
{
ScrnInfoPtr pScrn = xf86Screens[b->scrnIndex];
MGAPtr pMga = MGAPTR(pScrn);
+ const struct mgag_i2c_private *p =
+ (struct mgag_i2c_private *) b->DriverPrivate.ptr;
unsigned char drv, val;
- val = (clock ? my_scl_mask : 0) | (data ? my_sda_mask : 0);
- drv = ((!clock) ? my_scl_mask : 0) | ((!data) ? my_sda_mask : 0);
+ val = (clock ? p->scl_mask : 0) | (data ? p->sda_mask : 0);
+ drv = ((!clock) ? p->scl_mask : 0) | ((!data) ? p->sda_mask : 0);
/* Write the values */
- outMGAdacmsk(MGA1064_GEN_IO_CTL, ~(my_scl_mask | my_sda_mask) , drv);
- outMGAdacmsk(MGA1064_GEN_IO_DATA, ~(my_scl_mask | my_sda_mask) , val);
+ outMGAdacmsk(MGA1064_GEN_IO_CTL, ~(p->scl_mask | p->sda_mask) , drv);
+ outMGAdacmsk(MGA1064_GEN_IO_DATA, ~(p->scl_mask | p->sda_mask) , val);
#ifdef DEBUG
ErrorF("MGAG_I2CPutBits(%p, %d, %d) val=0x%x\n", b, clock, data, val);
#endif
}
-/* FIXME, can we use some neater way besides these silly stubs? */
-
-static void
-MGAG_DDC_P1_I2CPutBits(I2CBusPtr b, int clock, int data)
-{
- MGAG_I2CPutBits(b, clock, data, DDC_P1_SCL_MASK, DDC_P1_SDA_MASK);
-}
-static void
-MGAG_DDC_P2_I2CPutBits(I2CBusPtr b, int clock, int data)
-{
- MGAG_I2CPutBits(b, clock, data, DDC_P2_SCL_MASK, DDC_P2_SDA_MASK);
-}
-static void
-MGAG_MAVEN_I2CPutBits(I2CBusPtr b, int clock, int data)
-{
- MGAG_I2CPutBits(b, clock, data, MAVEN_SCL_MASK, MAVEN_SDA_MASK);
-}
-static void
-MGAG_DDC_P1_I2CGetBits(I2CBusPtr b, int *clock, int *data)
-{
- MGAG_I2CGetBits(b, clock, data, DDC_P1_SCL_MASK, DDC_P1_SDA_MASK);
-}
-static void
-MGAG_DDC_P2_I2CGetBits(I2CBusPtr b, int *clock, int *data)
+static I2CBusPtr
+mgag_create_i2c_bus(const char *name, unsigned bus_index, unsigned scrn_index)
{
- MGAG_I2CGetBits(b, clock, data, DDC_P2_SCL_MASK, DDC_P2_SDA_MASK);
-}
-static void
-MGAG_MAVEN_I2CGetBits(I2CBusPtr b, int *clock, int *data)
-{
- MGAG_I2CGetBits(b, clock, data, MAVEN_SCL_MASK, MAVEN_SDA_MASK);
+ I2CBusPtr I2CPtr = xf86CreateI2CBusRec();
+
+ if (I2CPtr != NULL) {
+ I2CPtr->BusName = name;
+ I2CPtr->scrnIndex = scrn_index;
+ I2CPtr->I2CPutBits = MGAG_I2CPutBits;
+ I2CPtr->I2CGetBits = MGAG_I2CGetBits;
+ I2CPtr->AcknTimeout = 5;
+ I2CPtr->DriverPrivate.ptr = & i2c_priv[bus_index];
+
+ if (!xf86I2CBusInit(I2CPtr)) {
+ xf86DestroyI2CBusRec(I2CPtr, TRUE, TRUE);
+ I2CPtr = NULL;
+ }
+ }
+
+ return I2CPtr;
}
+
Bool
MGAG_i2cInit(ScrnInfoPtr pScrn)
{
@@ -1203,109 +1595,67 @@ MGAG_i2cInit(ScrnInfoPtr pScrn)
I2CBusPtr I2CPtr;
if (pMga->SecondCrtc == FALSE) {
- I2CPtr = xf86CreateI2CBusRec();
- if(!I2CPtr) return FALSE;
-
- pMga->DDC_Bus1 = I2CPtr;
+ int i2c_index;
- I2CPtr->BusName = "DDC P1";
- I2CPtr->scrnIndex = pScrn->scrnIndex;
- I2CPtr->I2CPutBits = MGAG_DDC_P1_I2CPutBits;
- I2CPtr->I2CGetBits = MGAG_DDC_P1_I2CGetBits;
- I2CPtr->AcknTimeout = 5;
+ if (pMga->is_G200SE || pMga->is_G200WB || pMga->is_G200EV)
+ i2c_index = 3;
+ else
+ i2c_index = 0;
- if (!xf86I2CBusInit(I2CPtr)) {
- xf86DestroyI2CBusRec(pMga->DDC_Bus1, TRUE, TRUE);
- pMga->DDC_Bus1 = NULL;
- return FALSE;
- }
- }
- else {
- /* We have a dual head setup on G-series, set up DDC #2. */
- I2CPtr = xf86CreateI2CBusRec();
- if(!I2CPtr) return FALSE;
-
- pMga->DDC_Bus2 = I2CPtr;
-
- I2CPtr->BusName = "DDC P2";
- I2CPtr->scrnIndex = pScrn->scrnIndex;
- I2CPtr->I2CPutBits = MGAG_DDC_P2_I2CPutBits;
- I2CPtr->I2CGetBits = MGAG_DDC_P2_I2CGetBits;
- I2CPtr->AcknTimeout = 5;
-
- if (!xf86I2CBusInit(I2CPtr)) {
- xf86DestroyI2CBusRec(pMga->DDC_Bus2, TRUE, TRUE);
- pMga->DDC_Bus2 = NULL;
- }
- else {
- if (!xf86I2CProbeAddress(pMga->DDC_Bus2, 0xA0)) { /* 0xA0 is DDC EEPROM address */
- xf86DrvMsg(pScrn->scrnIndex, X_INFO, "DDC #2 unavailable -> TV cable connected or no monitor connected!\n");
- pMga->Crtc2IsTV = TRUE; /* assume for now. We need to fix HAL interactions. */
- }
+ pMga->DDC_Bus1 = mgag_create_i2c_bus("DDC P1",
+ i2c_index, pScrn->scrnIndex);
+ return (pMga->DDC_Bus1 != NULL);
+ } else {
+ /* We have a dual head setup on G-series, set up DDC #2. */
+ pMga->DDC_Bus2 = mgag_create_i2c_bus("DDC P2", 1, pScrn->scrnIndex);
+
+ if (pMga->DDC_Bus2 != NULL) {
+ /* 0xA0 is DDC EEPROM address */
+ if (!xf86I2CProbeAddress(pMga->DDC_Bus2, 0xA0)) {
+ xf86DrvMsg(pScrn->scrnIndex, X_INFO, "DDC #2 unavailable -> TV cable connected or no monitor connected!\n");
+ pMga->Crtc2IsTV = TRUE; /* assume for now. We need to fix HAL interactions. */
}
+ }
/* Then try to set up MAVEN bus. */
-
- I2CPtr = xf86CreateI2CBusRec();
- if(!I2CPtr) return FALSE;
- pMga->Maven_Bus = I2CPtr;
-
- I2CPtr->BusName = "MAVEN";
- I2CPtr->scrnIndex = pScrn->scrnIndex;
- I2CPtr->I2CPutBits = MGAG_MAVEN_I2CPutBits;
- I2CPtr->I2CGetBits = MGAG_MAVEN_I2CGetBits;
- I2CPtr->StartTimeout = 5;
-
- if (!xf86I2CBusInit(I2CPtr)) {
- xf86DestroyI2CBusRec(pMga->Maven_Bus, TRUE, TRUE);
- pMga->Maven_Bus = NULL;
- xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Failed to register MAVEN I2C bus!\n");
- }
- else {
- Bool failed = FALSE;
- /* Try to detect the MAVEN. */
- if (xf86I2CProbeAddress(pMga->Maven_Bus, MAVEN_READ) == TRUE) {
- I2CDevPtr dp = xf86CreateI2CDevRec();
- if (dp) {
- I2CByte maven_ver;
-
- pMga->Maven = dp;
- dp->DevName = "MGA-TVO";
- dp->SlaveAddr = MAVEN_WRITE;
- dp->pI2CBus = pMga->Maven_Bus;
- if (!xf86I2CDevInit(dp)) {
- xf86DestroyI2CDevRec(dp, TRUE);
- pMga->Maven = NULL;
- failed = TRUE;
- }
- if (MGAMavenRead(pScrn, 0xB2, &maven_ver)) {
- if (maven_ver < 0x14) { /* heuristic stolen from matroxfb */
- xf86DrvMsg(pScrn->scrnIndex, X_INFO, "MAVEN revision MGA-TVO-B detected (0x%x)\n", maven_ver);
- pMga->Maven_Version = 'B';
- }
- else {
- xf86DrvMsg(pScrn->scrnIndex, X_INFO, "MAVEN revision MGA-TVO-C detected (0x%x)\n", maven_ver);
- pMga->Maven_Version = 'C';
- }
- }
- else {
- xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Failed to determine MAVEN hardware version!\n");
- }
- }
- else {
- failed = TRUE;
+ pMga->Maven_Bus = mgag_create_i2c_bus("MAVEN", 2, pScrn->scrnIndex);
+ if (pMga->Maven_Bus != NULL) {
+ pMga->Maven = NULL;
+ pMga->Maven_Version = 0;
+
+ /* Try to detect the MAVEN. */
+ if (xf86I2CProbeAddress(pMga->Maven_Bus, MAVEN_READ)) {
+ I2CDevPtr dp = xf86CreateI2CDevRec();
+ if (dp) {
+ I2CByte maven_ver;
+
+ dp->DevName = "MGA-TVO";
+ dp->SlaveAddr = MAVEN_WRITE;
+ dp->pI2CBus = pMga->Maven_Bus;
+ if (!xf86I2CDevInit(dp)) {
+ xf86DestroyI2CDevRec(dp, TRUE);
+ } else {
+ pMga->Maven = dp;
+ if (MGAMavenRead(pScrn, 0xB2, &maven_ver)) {
+ /* heuristic stolen from matroxfb */
+ pMga->Maven_Version = (maven_ver < 0x14)
+ ? 'B' : 'C';
+
+ xf86DrvMsg(pScrn->scrnIndex, X_INFO,
+ "MAVEN revision MGA-TVO-%c detected (0x%x)\n",
+ pMga->Maven_Version, maven_ver);
+ } else {
+ xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Failed to determine MAVEN hardware version!\n");
}
}
- else {
- failed = TRUE;
- }
+ }
+ }
- if (failed) {
- xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Failed to register MGA-TVO I2C device!\n");
- pMga->Maven = NULL;
- pMga->Maven_Version = 0;
- }
+ if (pMga->Maven == NULL) {
+ xf86DrvMsg(pScrn->scrnIndex, X_INFO,
+ "Failed to register MGA-TVO I2C device!\n");
}
+ }
}
return TRUE;
diff --git a/driver/xf86-video-mga/src/mga_dga.c b/driver/xf86-video-mga/src/mga_dga.c
index 6bae9dcd5..d43b96df1 100644
--- a/driver/xf86-video-mga/src/mga_dga.c
+++ b/driver/xf86-video-mga/src/mga_dga.c
@@ -1,5 +1,3 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/mga/mga_dga.c,v 1.14 1999/11/02 23:12:00 mvojkovi Exp $ */
-
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
@@ -329,7 +327,6 @@ MGA_SetMode(
pMga->CurrentLayout.weight.red = BitsSet(pMode->red_mask);
pMga->CurrentLayout.weight.green = BitsSet(pMode->green_mask);
pMga->CurrentLayout.weight.blue = BitsSet(pMode->blue_mask);
- pMga->CurrentLayout.Overlay8Plus24 = FALSE;
/* MGAModeInit() will set the mode field */
pScrn->SwitchMode(index, pMode->mode, 0);
diff --git a/driver/xf86-video-mga/src/mga_dh.c b/driver/xf86-video-mga/src/mga_dh.c
index 0bf89e998..6ba2945f5 100644
--- a/driver/xf86-video-mga/src/mga_dh.c
+++ b/driver/xf86-video-mga/src/mga_dh.c
@@ -1,4 +1,3 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/mga/mga_dh.c,v 1.4tsi Exp $ */
/*********************************************************************
* G450: This is for Dual Head.
* Matrox Graphics
@@ -26,36 +25,6 @@
#define CLKSEL_MGA 0x0c
#define PLLLOCK 0x40
-/* CRTC2 control field*/
-#define C2_EN_A 0
-#define C2_EN_M (1 << C2_EN_A)
-#define C2_HIPRILVL_A 4
-#define C2_HIPRILVL_M (7 << C2_HIPRILVL_A)
-#define C2_MAXHIPRI_A 8
-#define C2_MAXHIPRI_M (7 << C2_MAXHIPRI_A)
-
-#define C2CTL_PIXCLKSEL_SHIFT 1L
-#define C2CTL_PIXCLKSEL_MASK (3L << C2CTL_PIXCLKSEL_SHIFT)
-#define C2CTL_PIXCLKSELH_SHIFT 14L
-#define C2CTL_PIXCLKSELH_MASK (1L << C2CTL_PIXCLKSELH_SHIFT)
-#define C2CTL_PIXCLKSEL_PCICLK 0L
-#define C2CTL_PIXCLKSEL_VDOCLK (1L << C2CTL_PIXCLKSEL_SHIFT)
-#define C2CTL_PIXCLKSEL_PIXELPLL (2L << C2CTL_PIXCLKSEL_SHIFT)
-#define C2CTL_PIXCLKSEL_VIDEOPLL (3L << C2CTL_PIXCLKSEL_SHIFT)
-#define C2CTL_PIXCLKSEL_VDCLK (1L << C2CTL_PIXCLKSELH_SHIFT)
-
-#define C2CTL_PIXCLKSEL_CRISTAL (1L << C2CTL_PIXCLKSEL_SHIFT) | (1L << C2CTL_PIXCLKSELH_SHIFT)
-#define C2CTL_PIXCLKSEL_SYSTEMPLL (2L << C2CTL_PIXCLKSEL_SHIFT) | (1L << C2CTL_PIXCLKSELH_SHIFT)
-
-#define C2CTL_PIXCLKDIS_SHIFT 3L
-#define C2CTL_PIXCLKDIS_MASK (1L << C2CTL_PIXCLKDIS_SHIFT)
-#define C2CTL_PIXCLKDIS_DISABLE (1L << C2CTL_PIXCLKDIS_SHIFT)
-
-#define C2CTL_CRTCDACSEL_SHIFT 20L
-#define C2CTL_CRTCDACSEL_MASK (1L << C2CTL_CRTCDACSEL_SHIFT)
-#define C2CTL_CRTCDACSEL_CRTC1 0
-#define C2CTL_CRTCDACSEL_CRTC2 (1L << C2CTL_CRTCDACSEL_SHIFT)
-
/* Misc field*/
#define IOADDSEL 0x01
#define RAMMAPEN 0x02
@@ -101,39 +70,6 @@
#define XSYNCCTRL_DAC2VSOFF_OFF (1 << XSYNCCTRL_DAC2VSOFF_SHIFT)
#define XSYNCCTRL_DAC2VSOFF_ON 0
-
-/* XDISPCTRL field */
-#define XDISPCTRL_DAC1OUTSEL_SHIFT 0L
-#define XDISPCTRL_DAC1OUTSEL_MASK 1L
-#define XDISPCTRL_DAC1OUTSEL_DIS 0L
-#define XDISPCTRL_DAC1OUTSEL_EN 1L
-#define XDISPCTRL_DAC2OUTSEL_SHIFT 2L
-#define XDISPCTRL_DAC2OUTSEL_MASK (3L << XDISPCTRL_DAC2OUTSEL_SHIFT)
-#define XDISPCTRL_DAC2OUTSEL_DIS 0L
-#define XDISPCTRL_DAC2OUTSEL_CRTC1 (1L << XDISPCTRL_DAC2OUTSEL_SHIFT)
-#define XDISPCTRL_DAC2OUTSEL_CRTC2 (2L << XDISPCTRL_DAC2OUTSEL_SHIFT)
-#define XDISPCTRL_DAC2OUTSEL_TVE (3L << XDISPCTRL_DAC2OUTSEL_SHIFT)
-#define XDISPCTRL_PANOUTSEL_SHIFT 5L
-#define XDISPCTRL_PANOUTSEL_MASK (3L << XDISPCTRL_PANOUTSEL_SHIFT)
-#define XDISPCTRL_PANOUTSEL_DIS 0L
-#define XDISPCTRL_PANOUTSEL_CRTC1 (1L << XDISPCTRL_PANOUTSEL_SHIFT)
-#define XDISPCTRL_PANOUTSEL_CRTC2RGB (2L << XDISPCTRL_PANOUTSEL_SHIFT)
-#define XDISPCTRL_PANOUTSEL_CRTC2656 (3L << XDISPCTRL_PANOUTSEL_SHIFT)
-
-/* XPWRCTRL field*/
-#define XPWRCTRL_DAC2PDN_SHIFT 0
-#define XPWRCTRL_DAC2PDN_MASK (1 << XPWRCTRL_DAC2PDN_SHIFT)
-#define XPWRCTRL_VIDPLLPDN_SHIFT 1
-#define XPWRCTRL_VIDPLLPDN_MASK (1 << XPWRCTRL_VIDPLLPDN_SHIFT)
-#define XPWRCTRL_PANPDN_SHIFT 2
-#define XPWRCTRL_PANPDN_MASK (1 << XPWRCTRL_PANPDN_SHIFT)
-#define XPWRCTRL_RFIFOPDN_SHIFT 3
-#define XPWRCTRL_RFIFOPDN_MASK (1 << XPWRCTRL_RFIFOPDN_SHIFT)
-#define XPWRCTRL_CFIFOPDN_SHIFT 4
-#define XPWRCTRL_CFIFOPDN_MASK (1 << XPWRCTRL_CFIFOPDN_SHIFT)
-
-
-
#define POS_HSYNC 0x00000004
#define POS_VSYNC 0x00000008
@@ -270,7 +206,7 @@ void MGACRTC2Set(ScrnInfoPtr pScrn, xMODEINFO *pModeInfo)
/** Offset value*/
- OUTREG(MGAREG_C2OFFSET, pReg->crtc2[MGAREG2_C2VSYNC]);
+ OUTREG(MGAREG_C2OFFSET, pReg->crtc2[MGAREG2_C2OFFSET]);
#ifdef DEBUG
ErrorF("EXIT MGACRTC2Set\n");
#endif
@@ -295,20 +231,23 @@ void MGAEnableSecondOutPut(ScrnInfoPtr pScrn, xMODEINFO *pModeInfo)
ulC2CTL = INREG( MGAREG_C2CTL);
/*--- Disable Pixel clock oscillations On Crtc1 */
- OUTREG( MGAREG_C2CTL, ulC2CTL | C2CTL_PIXCLKDIS_MASK);
+ OUTREG( MGAREG_C2CTL, ulC2CTL | MGAREG_C2CTL_PIXCLKDIS_MASK);
/*--- Have to wait minimum time (2 acces will be ok) */
(void) INREG( MGAREG_Status);
(void) INREG( MGAREG_Status);
- ulC2CTL &= ~(C2CTL_PIXCLKSEL_MASK | C2CTL_PIXCLKSELH_MASK);
+ ulC2CTL &= ~MGAREG_C2CTL_PIXCLKSEL_MASK;
+ ulC2CTL &= ~MGAREG_C2CTL_PIXCLKSELH_MASK;
- ulC2CTL |= C2CTL_PIXCLKSEL_VIDEOPLL;
+ ulC2CTL |= MGAREG_C2CTL_PIXCLKSEL_VIDEOPLL;
OUTREG( MGAREG_C2CTL, ulC2CTL);
+
/*--- Enable Pixel clock oscillations on CRTC2*/
- OUTREG( MGAREG_C2CTL, ulC2CTL & ~C2CTL_PIXCLKDIS_MASK);
+ ulC2CTL &= ~MGAREG_C2CTL_PIXCLKDIS_MASK;
+ OUTREG( MGAREG_C2CTL, ulC2CTL);
/* We don't use MISC synch pol, must be 0*/
@@ -336,24 +275,21 @@ void MGAEnableSecondOutPut(ScrnInfoPtr pScrn, xMODEINFO *pModeInfo)
ulC2CTL = INREG(MGAREG_C2CTL);
ucXDispCtrl = inMGAdac(MGA1064_DISP_CTL);
- ucXDispCtrl &= ~XDISPCTRL_DAC2OUTSEL_MASK;
- ucXDispCtrl |= XDISPCTRL_DAC2OUTSEL_CRTC2;
+ ucXDispCtrl &= ~MGA1064_DISP_CTL_DAC2OUTSEL_MASK;
if (!pMga->SecondOutput) {
/* Route Crtc2 on Output1 */
- ucXDispCtrl &= ~XDISPCTRL_DAC2OUTSEL_MASK;
- ucXDispCtrl |= XDISPCTRL_DAC2OUTSEL_CRTC1;
- ulC2CTL |= C2CTL_CRTCDACSEL_CRTC2;
+ ucXDispCtrl |= MGA1064_DISP_CTL_DAC2OUTSEL_CRTC1;
+ ulC2CTL |= MGAREG_C2CTL_CRTCDACSEL_CRTC2;
}
else {
/* Route Crtc2 on Output2*/
- ucXDispCtrl &= ~XDISPCTRL_DAC2OUTSEL_MASK;
- ucXDispCtrl |= XDISPCTRL_DAC2OUTSEL_CRTC2;
- ulC2CTL &= ~C2CTL_CRTCDACSEL_MASK;
+ ucXDispCtrl |= MGA1064_DISP_CTL_DAC2OUTSEL_CRTC2;
+ ulC2CTL &= ~MGAREG_C2CTL_CRTCDACSEL_MASK;
}
/* Enable CRTC2*/
- ulC2CTL |= C2_EN_M;
+ ulC2CTL |= MGAREG_C2CTL_C2_EN;
pReg->dac2[ MGA1064_DISP_CTL - 0x80] = ucXDispCtrl;
@@ -377,15 +313,14 @@ void MGAEnableSecondOutPut(ScrnInfoPtr pScrn, xMODEINFO *pModeInfo)
ucByte &= ~(XSYNCCTRL_DAC2HSOFF_MASK | XSYNCCTRL_DAC2VSOFF_MASK);
pReg->dac2[ MGA1064_SYNC_CTL - 0x80] = ucByte;
- /* Powerup DAC2*/
- ucByte = inMGAdac( MGA1064_PWR_CTL);
- pReg->dac2[ MGA1064_PWR_CTL - 0x80] = /* 0x0b; */ (ucByte | XPWRCTRL_DAC2PDN_MASK);
-
-
-
- /* Power up Fifo*/
- ucByte = inMGAdac( MGA1064_PWR_CTL);
- pReg->dac2[ MGA1064_PWR_CTL - 0x80] = 0x1b; /* (ucByte | XPWRCTRL_CFIFOPDN_MASK) */;
+ /* Power up DAC2, Fifo.
+ * The TMDS is powered down here, which is likely wrong.
+ */
+ pReg->dac2[MGA1064_PWR_CTL - 0x80] =
+ MGA1064_PWR_CTL_DAC2_EN |
+ MGA1064_PWR_CTL_VID_PLL_EN |
+ MGA1064_PWR_CTL_RFIFO_EN |
+ MGA1064_PWR_CTL_CFIFO_EN;
#ifdef DEBUG
@@ -496,9 +431,9 @@ void MGACRTC2SetDisplayStart (ScrnInfoPtr pScrn, xMODEINFO *pModeInfo, CARD32 ba
ErrorF("ENTER MGACRTC2SetDisplayStart\n");
#endif
- OUTREG(MGAREG2_C2STARTADD0, pReg->crtc2[MGAREG2_C2STARTADD0]);
+ OUTREG(MGAREG_C2STARTADD0, pReg->crtc2[MGAREG2_C2STARTADD0]);
#ifdef DEBUG
- ErrorF("EXIT MGACRTC2GetDisplayStart\n");
+ ErrorF("EXIT MGACRTC2SetDisplayStart\n");
#endif
}
diff --git a/driver/xf86-video-mga/src/mga_dri.c b/driver/xf86-video-mga/src/mga_dri.c
index 103279d21..3fda62378 100644
--- a/driver/xf86-video-mga/src/mga_dri.c
+++ b/driver/xf86-video-mga/src/mga_dri.c
@@ -1,5 +1,3 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/mga/mga_dri.c,v 1.31tsi Exp $ */
-
/*
* Copyright 2000 VA Linux Systems Inc., Fremont, California.
* All Rights Reserved.
@@ -38,11 +36,6 @@
#include "xf86PciInfo.h"
#include "xf86Pci.h"
-#define PSZ 8
-#include "cfb.h"
-#undef PSZ
-#include "cfb16.h"
-#include "cfb32.h"
#include "miline.h"
@@ -76,13 +69,6 @@
static char MGAKernelDriverName[] = "mga";
static char MGAClientDriverName[] = "mga";
-/* DRI buffer management
- */
-extern void mgaDRIInitBuffers( WindowPtr pWin, RegionPtr prgn, CARD32 index );
-extern void mgaDRIMoveBuffers( WindowPtr pParent, DDXPointRec ptOldOrg,
- RegionPtr prgnSrc, CARD32 index );
-
-
/* Initialize the visual configs that are supported by the hardware.
* These are combined with the visual configs that the indirect
* rendering core supports, and the intersection is exported to the
@@ -496,7 +482,6 @@ MGADRISwapContextShared( ScreenPtr pScreen, DRISyncType syncType,
}
}
-#ifdef USE_XAA
void MGASelectBuffer( ScrnInfoPtr pScrn, int which )
{
MGAPtr pMga = MGAPTR(pScrn);
@@ -518,8 +503,6 @@ void MGASelectBuffer( ScrnInfoPtr pScrn, int which )
break;
}
}
-#endif
-
static unsigned int mylog2( unsigned int n )
{
@@ -618,8 +601,8 @@ static Bool MGADRIBootstrapDMA(ScreenPtr pScreen)
xf86DrvMsg( pScreen->myNum, X_INFO,
"[agp] Mode 0x%08lx [AGP 0x%04x/0x%04x; Card 0x%04x/0x%04x]\n",
mode, vendor, device,
- pMga->PciInfo->vendor,
- pMga->PciInfo->chipType );
+ VENDOR_ID(pMga->PciInfo),
+ DEVICE_ID(pMga->PciInfo));
if ( drmAgpEnable( pMga->drmFD, mode ) < 0 ) {
xf86DrvMsg( pScreen->myNum, X_ERROR, "[agp] AGP not enabled\n" );
@@ -766,7 +749,7 @@ static Bool MGADRIBootstrapDMA(ScreenPtr pScreen)
pMGADRIServer->registers.size = MGAIOMAPSIZE;
if ( drmAddMap( pMga->drmFD,
- (drm_handle_t)pMga->IOAddress,
+ (drm_handle_t) MGA_IO_ADDRESS(pMga),
pMGADRIServer->registers.size,
DRM_REGISTERS, DRM_READ_ONLY,
&pMGADRIServer->registers.handle ) < 0 ) {
@@ -803,23 +786,16 @@ static Bool MGADRIKernelInit( ScreenPtr pScreen )
drm_mga_init_t init;
int ret;
+
+ if (!pMga->chip_attribs->dri_capable) {
+ return FALSE;
+ }
+
memset( &init, 0, sizeof(drm_mga_init_t) );
init.func = MGA_INIT_DMA;
init.sarea_priv_offset = sizeof(XF86DRISAREARec);
-
- switch ( pMga->Chipset ) {
- case PCI_CHIP_MGAG550:
- case PCI_CHIP_MGAG400:
- init.chipset = MGA_CARD_TYPE_G400;
- break;
- case PCI_CHIP_MGAG200:
- case PCI_CHIP_MGAG200_PCI:
- init.chipset = MGA_CARD_TYPE_G200;
- break;
- default:
- return FALSE;
- }
+ init.chipset = pMga->chip_attribs->dri_chipset;
init.sgram = !pMga->HasSDRAM;
init.maccess = pMga->MAccess;
@@ -859,20 +835,26 @@ static Bool MGADRIKernelInit( ScreenPtr pScreen )
return TRUE;
}
+/* FIXME: This function uses the DRM to get the IRQ, but the pci_device
+ * FIXME: structure (PciInfo) already has that information.
+ */
static void MGADRIIrqInit(MGAPtr pMga, ScreenPtr pScreen)
{
ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
- /* version = drmGetVersion(pMga->drmFD);
- if ( version ) {
- if ( version->version_major != 3 ||
- version->version_minor < 0 ) {*/
if (!pMga->irq) {
- pMga->irq = drmGetInterruptFromBusID(
- pMga->drmFD,
+ pMga->irq = drmGetInterruptFromBusID(pMga->drmFD,
+#ifdef XSERVER_LIBPCIACCESS
+ ((pMga->PciInfo->domain << 8) |
+ pMga->PciInfo->bus),
+ pMga->PciInfo->dev,
+ pMga->PciInfo->func
+#else
((pciConfigPtr)pMga->PciInfo->thisCard)->busnum,
((pciConfigPtr)pMga->PciInfo->thisCard)->devnum,
- ((pciConfigPtr)pMga->PciInfo->thisCard)->funcnum);
+ ((pciConfigPtr)pMga->PciInfo->thisCard)->funcnum
+#endif
+ );
if((drmCtlInstHandler(pMga->drmFD, pMga->irq)) != 0) {
xf86DrvMsg(pScrn->scrnIndex, X_INFO,
@@ -911,6 +893,200 @@ static Bool MGADRIBuffersInit( ScreenPtr pScreen )
return TRUE;
}
+#ifdef USE_XAA
+static void MGADRIInitBuffersXAA(WindowPtr pWin, RegionPtr prgn,
+ CARD32 index)
+{
+ ScreenPtr pScreen = pWin->drawable.pScreen;
+ ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
+ MGAPtr pMga = MGAPTR(pScrn);
+ BoxPtr pbox = REGION_RECTS(prgn);
+ int nbox = REGION_NUM_RECTS(prgn);
+ XAAInfoRecPtr xaa = pMga->AccelInfoRec;
+
+ CHECK_DMA_QUIESCENT(MGAPTR(pScrn), pScrn);
+
+ xaa->SetupForSolidFill(pScrn, 0, GXcopy, -1);
+
+ while (nbox--) {
+ MGASelectBuffer(pScrn, MGA_BACK);
+ xaa->SubsequentSolidFillRect(pScrn, pbox->x1, pbox->y1,
+ pbox->x2-pbox->x1, pbox->y2-pbox->y1);
+ MGASelectBuffer(pScrn, MGA_DEPTH);
+ xaa->SubsequentSolidFillRect(pScrn, pbox->x1, pbox->y1,
+ pbox->x2-pbox->x1, pbox->y2-pbox->y1);
+ pbox++;
+ }
+
+ MGASelectBuffer(pScrn, MGA_FRONT);
+
+ pMga->AccelInfoRec->NeedToSync = TRUE;
+}
+#endif
+
+#ifdef USE_EXA
+static void MGADRIInitBuffersEXA(WindowPtr pWin, RegionPtr prgn,
+ CARD32 index)
+{
+ /* FIXME */
+}
+#endif
+
+#ifdef USE_XAA
+/*
+ This routine is a modified form of XAADoBitBlt with the calls to
+ ScreenToScreenBitBlt built in. My routine has the prgnSrc as source
+ instead of destination. My origin is upside down so the ydir cases
+ are reversed.
+*/
+static void MGADRIMoveBuffersXAA(WindowPtr pParent, DDXPointRec ptOldOrg,
+ RegionPtr prgnSrc, CARD32 index)
+{
+ ScreenPtr pScreen = pParent->drawable.pScreen;
+ ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
+ MGAPtr pMga = MGAPTR(pScrn);
+ int nbox;
+ BoxPtr pbox, pboxTmp, pboxNext, pboxBase, pboxNew1, pboxNew2;
+ DDXPointPtr pptTmp, pptNew1, pptNew2;
+ int xdir, ydir;
+ int dx, dy;
+ DDXPointPtr pptSrc;
+ int screenwidth = pScrn->virtualX;
+ int screenheight = pScrn->virtualY;
+ XAAInfoRecPtr xaa = pMga->AccelInfoRec;
+
+ CHECK_DMA_QUIESCENT(pMga, pScrn);
+
+ pbox = REGION_RECTS(prgnSrc);
+ nbox = REGION_NUM_RECTS(prgnSrc);
+ pboxNew1 = 0;
+ pptNew1 = 0;
+ pboxNew2 = 0;
+ pboxNew2 = 0;
+ pptSrc = &ptOldOrg;
+
+ dx = pParent->drawable.x - ptOldOrg.x;
+ dy = pParent->drawable.y - ptOldOrg.y;
+
+ /* If the copy will overlap in Y, reverse the order */
+ if (dy>0) {
+ ydir = -1;
+
+ if (nbox>1) {
+ /* Keep ordering in each band, reverse order of bands */
+ pboxNew1 = (BoxPtr)xalloc(sizeof(BoxRec)*nbox);
+ if (!pboxNew1) return;
+ pptNew1 = (DDXPointPtr)xalloc(sizeof(DDXPointRec)*nbox);
+ if (!pptNew1) {
+ xfree(pboxNew1);
+ return;
+ }
+ pboxBase = pboxNext = pbox+nbox-1;
+ while (pboxBase >= pbox) {
+ while ((pboxNext >= pbox) && (pboxBase->y1 == pboxNext->y1))
+ pboxNext--;
+ pboxTmp = pboxNext+1;
+ pptTmp = pptSrc + (pboxTmp - pbox);
+ while (pboxTmp <= pboxBase) {
+ *pboxNew1++ = *pboxTmp++;
+ *pptNew1++ = *pptTmp++;
+ }
+ pboxBase = pboxNext;
+ }
+ pboxNew1 -= nbox;
+ pbox = pboxNew1;
+ pptNew1 -= nbox;
+ pptSrc = pptNew1;
+ }
+ } else {
+ /* No changes required */
+ ydir = 1;
+ }
+
+ /* If the regions will overlap in X, reverse the order */
+ if (dx>0) {
+ xdir = -1;
+
+ if (nbox > 1) {
+ /*reverse orderof rects in each band */
+ pboxNew2 = (BoxPtr)xalloc(sizeof(BoxRec)*nbox);
+ pptNew2 = (DDXPointPtr)xalloc(sizeof(DDXPointRec)*nbox);
+ if (!pboxNew2 || !pptNew2) {
+ if (pptNew2) xfree(pptNew2);
+ if (pboxNew2) xfree(pboxNew2);
+ if (pboxNew1) {
+ xfree(pptNew1);
+ xfree(pboxNew1);
+ }
+ return;
+ }
+ pboxBase = pboxNext = pbox;
+ while (pboxBase < pbox+nbox) {
+ while ((pboxNext < pbox+nbox) &&
+ (pboxNext->y1 == pboxBase->y1))
+ pboxNext++;
+ pboxTmp = pboxNext;
+ pptTmp = pptSrc + (pboxTmp - pbox);
+ while (pboxTmp != pboxBase) {
+ *pboxNew2++ = *--pboxTmp;
+ *pptNew2++ = *--pptTmp;
+ }
+ pboxBase = pboxNext;
+ }
+ pboxNew2 -= nbox;
+ pbox = pboxNew2;
+ pptNew2 -= nbox;
+ pptSrc = pptNew2;
+ }
+ } else {
+ /* No changes are needed */
+ xdir = 1;
+ }
+
+ xaa->SetupForScreenToScreenCopy(pScrn, xdir, ydir, GXcopy, -1, -1);
+ for ( ; nbox-- ; pbox++) {
+ int x1 = pbox->x1;
+ int y1 = pbox->y1;
+ int destx = x1 + dx;
+ int desty = y1 + dy;
+ int w = pbox->x2 - x1 + 1;
+ int h = pbox->y2 - y1 + 1;
+
+ if ( destx < 0 ) x1 -= destx, w += destx, destx = 0;
+ if ( desty < 0 ) y1 -= desty, h += desty, desty = 0;
+ if ( destx + w > screenwidth ) w = screenwidth - destx;
+ if ( desty + h > screenheight ) h = screenheight - desty;
+ if ( w <= 0 ) continue;
+ if ( h <= 0 ) continue;
+
+ MGASelectBuffer(pScrn, MGA_BACK);
+ xaa->SubsequentScreenToScreenCopy(pScrn, x1, y1, destx, desty, w, h);
+ MGASelectBuffer(pScrn, MGA_DEPTH);
+ xaa->SubsequentScreenToScreenCopy(pScrn, x1, y1, destx, desty, w, h);
+ }
+ MGASelectBuffer(pScrn, MGA_FRONT);
+
+ if (pboxNew2) {
+ xfree(pptNew2);
+ xfree(pboxNew2);
+ }
+ if (pboxNew1) {
+ xfree(pptNew1);
+ xfree(pboxNew1);
+ }
+
+ pMga->AccelInfoRec->NeedToSync = TRUE;
+
+}
+#endif
+
+#ifdef USE_EXA
+static void MGADRIMoveBuffersEXA(WindowPtr pParent, DDXPointRec ptOldOrg,
+ RegionPtr prgnSrc, CARD32 index)
+{
+ /* FIXME */
+}
+#endif
Bool MGADRIScreenInit( ScreenPtr pScreen )
{
@@ -920,13 +1096,7 @@ Bool MGADRIScreenInit( ScreenPtr pScreen )
MGADRIPtr pMGADRI;
MGADRIServerPrivatePtr pMGADRIServer;
- switch(pMga->Chipset) {
- case PCI_CHIP_MGAG550:
- case PCI_CHIP_MGAG400:
- case PCI_CHIP_MGAG200:
- case PCI_CHIP_MGAG200_PCI:
- break;
- default:
+ if (!pMga->chip_attribs->dri_capable) {
xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "[drm] Direct rendering only supported with G200/G400/G450/G550.\n");
return FALSE;
}
@@ -983,13 +1153,19 @@ Bool MGADRIScreenInit( ScreenPtr pScreen )
} else {
pDRIInfo->busIdString = xalloc(64);
sprintf( pDRIInfo->busIdString, "PCI:%d:%d:%d",
+#ifdef XSERVER_LIBPCIACCESS
+ ((pMga->PciInfo->domain << 8) | pMga->PciInfo->bus),
+ pMga->PciInfo->dev, pMga->PciInfo->func
+#else
((pciConfigPtr)pMga->PciInfo->thisCard)->busnum,
((pciConfigPtr)pMga->PciInfo->thisCard)->devnum,
- ((pciConfigPtr)pMga->PciInfo->thisCard)->funcnum );
+ ((pciConfigPtr)pMga->PciInfo->thisCard)->funcnum
+#endif
+ );
}
- pDRIInfo->ddxDriverMajorVersion = MGA_MAJOR_VERSION;
- pDRIInfo->ddxDriverMinorVersion = MGA_MINOR_VERSION;
- pDRIInfo->ddxDriverPatchVersion = MGA_PATCHLEVEL;
+ pDRIInfo->ddxDriverMajorVersion = PACKAGE_VERSION_MAJOR;
+ pDRIInfo->ddxDriverMinorVersion = PACKAGE_VERSION_MINOR;
+ pDRIInfo->ddxDriverPatchVersion = PACKAGE_VERSION_PATCHLEVEL;
pDRIInfo->frameBufferPhysicalAddress = (void *) pMga->FbAddress;
pDRIInfo->frameBufferSize = pMga->FbMapSize;
pDRIInfo->frameBufferStride = pScrn->displayWidth*(pScrn->bitsPerPixel/8);
@@ -1057,8 +1233,19 @@ Bool MGADRIScreenInit( ScreenPtr pScreen )
pDRIInfo->SwapContext = MGADRISwapContext;
}
- pDRIInfo->InitBuffers = mgaDRIInitBuffers;
- pDRIInfo->MoveBuffers = mgaDRIMoveBuffers;
+#ifdef USE_EXA
+ if (pMga->Exa) {
+ pDRIInfo->InitBuffers = MGADRIInitBuffersEXA;
+ pDRIInfo->MoveBuffers = MGADRIMoveBuffersEXA;
+ } else {
+#endif
+#ifdef USE_XAA
+ pDRIInfo->InitBuffers = MGADRIInitBuffersXAA;
+ pDRIInfo->MoveBuffers = MGADRIMoveBuffersXAA;
+#endif
+#ifdef USE_EXA
+ }
+#endif
pDRIInfo->bufferRequests = DRI_ALL_WINDOWS;
@@ -1217,18 +1404,7 @@ Bool MGADRIFinishScreenInit( ScreenPtr pScreen )
MGADRIIrqInit(pMga, pScreen);
- switch(pMga->Chipset) {
- case PCI_CHIP_MGAG550:
- case PCI_CHIP_MGAG400:
- pMGADRI->chipset = MGA_CARD_TYPE_G400;
- break;
- case PCI_CHIP_MGAG200:
- case PCI_CHIP_MGAG200_PCI:
- pMGADRI->chipset = MGA_CARD_TYPE_G200;
- break;
- default:
- return FALSE;
- }
+ pMGADRI->chipset = pMga->chip_attribs->dri_chipset;
pMGADRI->width = pScrn->virtualX;
pMGADRI->height = pScrn->virtualY;
pMGADRI->cpp = pScrn->bitsPerPixel / 8;
diff --git a/driver/xf86-video-mga/src/mga_driver.c b/driver/xf86-video-mga/src/mga_driver.c
index a95871ad3..6f55e63a8 100644
--- a/driver/xf86-video-mga/src/mga_driver.c
+++ b/driver/xf86-video-mga/src/mga_driver.c
@@ -45,8 +45,6 @@
* Added digital screen option for first head
*/
-/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/mga/mga_driver.c,v 1.244tsi Exp $ */
-
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
@@ -64,7 +62,9 @@
#include "xf86PciInfo.h"
/* Drivers that need to access the PCI config space directly need this */
+#ifndef XSERVER_LIBPCIACCESS
#include "xf86Pci.h"
+#endif
/* All drivers initialising the SW cursor need this */
#include "mipointer.h"
@@ -94,8 +94,6 @@
#include "shadowfb.h"
#include "fbdevhw.h"
-#include "cfb8_32.h"
-
#ifdef XF86DRI
#include "dri.h"
#endif
@@ -109,7 +107,12 @@
/* Mandatory functions */
static const OptionInfoRec * MGAAvailableOptions(int chipid, int busid);
static void MGAIdentify(int flags);
+#ifdef XSERVER_LIBPCIACCESS
+static Bool MGAPciProbe(DriverPtr drv, int entity_num,
+ struct pci_device * dev, intptr_t match_data);
+#else
static Bool MGAProbe(DriverPtr drv, int flags);
+#endif
static Bool MGAPreInit(ScrnInfoPtr pScrn, int flags);
static Bool MGAScreenInit(int Index, ScreenPtr pScreen, int argc,
char **argv);
@@ -131,8 +134,14 @@ static void MGAFreeScreen(int scrnIndex, int flags);
static ModeStatus MGAValidMode(int scrnIndex, DisplayModePtr mode,
Bool verbose, int flags);
+#if ((__GNUC__ == 3) && (__GNUC_MINOR__ >= 4)) || (__GNUC__ >= 4)
+#define __must_check __attribute__((warn_unused_result))
+#else
+#define __must_check /* */
+#endif
+
/* Internally used functions */
-static Bool MGAMapMem(ScrnInfoPtr pScrn);
+static Bool __must_check MGAMapMem(ScrnInfoPtr pScrn);
static Bool MGAUnmapMem(ScrnInfoPtr pScrn);
static void MGASave(ScrnInfoPtr pScrn);
static void MGARestore(ScrnInfoPtr pScrn);
@@ -144,24 +153,267 @@ static int MGAEntityIndex = -1;
#include "mga_merge.h"
+static const struct mga_device_attributes attribs[] = {
+ /* 2064 */
+ [0] = { 1, 0, 0, 1, 0, 0, 0, 0, old_BARs,
+ (BLK_OPAQUE_EXPANSION | FASTBLT_BUG | USE_LINEAR_EXPANSION),
+ {
+ { 0, 0 }, /* System VCO frequencies */
+ { 50000, 220000 }, /* Pixel VCO frequencies */
+ { 0, 0 }, /* Video VCO frequencies */
+ 50000, /* Memory clock */
+ 14318, /* PLL reference frequency */
+ 0, /* Supports fast bitblt? */
+ MGA_HOST_PCI /* Host interface */
+ },
+
+ 8192, 0x1000, /* Memory probe size & offset values */
+ },
+
+ /* 1064 */
+ [1] = { 0, 1, 0, 0, 1, 0, 0, 0, probe_BARs,
+ (USE_LINEAR_EXPANSION),
+ {
+ /* There used to be code in MGARamdacInit (mga_dacG.c) that would
+ * set this to 170000 if the chip revision was less than 3. Is
+ * that needed here?
+ */
+ { 50000, 230000 }, /* System VCO frequencies */
+ { 50000, 230000 }, /* Pixel VCO frequencies */
+ { 0, 0 }, /* Video VCO frequencies */
+ 50000, /* Memory clock */
+ 14318, /* PLL reference frequency */
+ 0, /* Supports fast bitblt? */
+ MGA_HOST_PCI /* Host interface */
+ },
+
+ 8192, 0x1000, /* Memory probe size & offset values */
+ },
+
+ /* 2164 */
+ [2] = { 1, 0, 0, 1, 0, 0, 0, 0, new_BARs,
+ (BLK_OPAQUE_EXPANSION | TRANSC_SOLID_FILL | USE_RECTS_FOR_LINES
+ | USE_LINEAR_EXPANSION),
+ {
+ { 0, 0 }, /* System VCO frequencies */
+ { 50000, 220000 }, /* Pixel VCO frequencies */
+ { 0, 0 }, /* Video VCO frequencies */
+ 50000, /* Memory clock */
+ 14318, /* PLL reference frequency */
+ 0, /* Supports fast bitblt? */
+ MGA_HOST_PCI /* Host interface */
+ },
+
+ 8192, 0x1000, /* Memory probe size & offset values */
+ },
+
+ /* 2164 AGP */
+ [3] = { 1, 0, 0, 1, 0, 0, 0, 0, new_BARs,
+ (BLK_OPAQUE_EXPANSION | TRANSC_SOLID_FILL | USE_RECTS_FOR_LINES
+ | USE_LINEAR_EXPANSION),
+ {
+ { 0, 0 }, /* System VCO frequencies */
+ { 50000, 220000 }, /* Pixel VCO frequencies */
+ { 0, 0 }, /* Video VCO frequencies */
+ 50000, /* Memory clock */
+ 14318, /* PLL reference frequency */
+ 0, /* Supports fast bitblt? */
+ MGA_HOST_AGP_1x /* Host interface */
+ },
+
+ 8192, 0x1000, /* Memory probe size & offset values */
+ },
+
+ /* G100 PCI */
+ [4] = { 0, 1, 0, 0, 1, 0, 0, 0, new_BARs,
+ (MGA_NO_PLANEMASK | USE_LINEAR_EXPANSION),
+ {
+ { 50000, 230000 }, /* System VCO frequencies */
+ { 50000, 230000 }, /* Pixel VCO frequencies */
+ { 0, 0 }, /* Video VCO frequencies */
+ 50000, /* Memory clock */
+ 27050, /* PLL reference frequency */
+ 0, /* Supports fast bitblt? */
+ MGA_HOST_PCI /* Host interface */
+ },
+
+ 8192, 0x1000, /* Memory probe size & offset values */
+ },
+
+ /* G100 AGP */
+ [5] = { 0, 1, 0, 0, 1, 0, 0, 0, new_BARs,
+ (MGA_NO_PLANEMASK | USE_LINEAR_EXPANSION),
+ {
+ { 50000, 230000 }, /* System VCO frequencies */
+ { 50000, 230000 }, /* Pixel VCO frequencies */
+ { 0, 0 }, /* Video VCO frequencies */
+ 50000, /* Memory clock */
+ 27050, /* PLL reference frequency */
+ 0, /* Supports fast bitblt? */
+ MGA_HOST_AGP_1x /* Host interface */
+ },
+
+ 8192, 0x1000, /* Memory probe size & offset values */
+ },
+
+ /* G200 PCI */
+ [6] = { 0, 1, 0, 0, 1, 1, 1, 1, new_BARs,
+ (TRANSC_SOLID_FILL | TWO_PASS_COLOR_EXPAND | USE_LINEAR_EXPANSION),
+ {
+ { 50000, 230000 }, /* System VCO frequencies */
+ { 50000, 230000 }, /* Pixel VCO frequencies */
+ { 0, 0 }, /* Video VCO frequencies */
+ 50000, /* Memory clock */
+ 27050, /* PLL reference frequency */
+ 0, /* Supports fast bitblt? */
+ MGA_HOST_PCI /* Host interface */
+ },
+
+ 8192, 0x1000, /* Memory probe size & offset values */
+ },
+
+ /* G200 AGP */
+ [7] = { 0, 1, 0, 0, 1, 1, 1, 1, new_BARs,
+ (TRANSC_SOLID_FILL | TWO_PASS_COLOR_EXPAND | USE_LINEAR_EXPANSION),
+ {
+ { 50000, 230000 }, /* System VCO frequencies */
+ { 50000, 230000 }, /* Pixel VCO frequencies */
+ { 0, 0 }, /* Video VCO frequencies */
+ 50000, /* Memory clock */
+ 27050, /* PLL reference frequency */
+ 0, /* Supports fast bitblt? */
+ MGA_HOST_AGP_2x /* Host interface */
+ },
+
+ 8192, 0x1000, /* Memory probe size & offset values */
+ },
+
+ /* G400 / G450 */
+ [8] = { 0, 1, 1, 0, 1, 1, 2, 1, new_BARs,
+ (TRANSC_SOLID_FILL | TWO_PASS_COLOR_EXPAND | USE_LINEAR_EXPANSION),
+ {
+ { 50000, 252000 }, /* System VCO frequencies */
+ { 50000, 252000 }, /* Pixel VCO frequencies */
+ { 0, 0 }, /* Video VCO frequencies */
+ 200000, /* Memory clock */
+ 27050, /* PLL reference frequency */
+ 0, /* Supports fast bitblt? */
+ MGA_HOST_AGP_4x /* Host interface */
+ },
+
+ 32768, 0x1000, /* Memory probe size & offset values */
+ },
+
+ /* G550 */
+ [9] = { 0, 1, 1, 0, 1, 1, 2, 1, new_BARs,
+ (TRANSC_SOLID_FILL | TWO_PASS_COLOR_EXPAND | USE_LINEAR_EXPANSION),
+ {
+ { 256000, 600000 }, /* System VCO frequencies */
+ { 256000, 600000 }, /* Pixel VCO frequencies */
+ { 256000, 600000 }, /* Video VCO frequencies */
+ 284000, /* Memory clock */
+ 27050, /* PLL reference frequency */
+ 0, /* Supports fast bitblt? */
+ MGA_HOST_AGP_4x /* Host interface */
+ },
+
+ 32768, 0x1000, /* Memory probe size & offset values */
+ },
+
+ /* G200SE A PCI */
+ [10] = { 0, 1, 0, 0, 1, 0, 0, 1, new_BARs,
+ (TRANSC_SOLID_FILL | TWO_PASS_COLOR_EXPAND | USE_LINEAR_EXPANSION),
+ {
+ { 50000, 230000 }, /* System VCO frequencies */
+ { 50000, 230000 }, /* Pixel VCO frequencies */
+ { 0, 0 }, /* Video VCO frequencies */
+ 50000, /* Memory clock */
+ 27050, /* PLL reference frequency */
+ 0, /* Supports fast bitblt? */
+ MGA_HOST_PCI /* Host interface */
+ },
+
+ 4096, 0x800, /* Memory probe size & offset values */
+ },
+
+ /* G200SE B PCI */
+ [11] = { 0, 1, 0, 0, 1, 0, 0, 1, new_BARs,
+ (TRANSC_SOLID_FILL | TWO_PASS_COLOR_EXPAND | USE_LINEAR_EXPANSION),
+ {
+ { 50000, 114000 }, /* System VCO frequencies */
+ { 50000, 114000 }, /* Pixel VCO frequencies */
+ { 0, 0 }, /* Video VCO frequencies */
+ 45000, /* Memory clock */
+ 27050, /* PLL reference frequency */
+ 0, /* Supports fast bitblt? */
+ MGA_HOST_PCI /* Host interface */
+ },
+
+ 4096, 0x800, /* Memory probe size & offset values */
+ },
+
+ /* G200EV */
+ [12] = { 0, 1, 0, 0, 1, 0, 0, 0, new_BARs,
+ (TRANSC_SOLID_FILL | TWO_PASS_COLOR_EXPAND | USE_LINEAR_EXPANSION),
+ {
+ { 50000, 230000 }, /* System VCO frequencies */
+ { 50000, 230000 }, /* Pixel VCO frequencies */
+ { 0, 0 }, /* Video VCO frequencies */
+ 45000, /* Memory clock */
+ 27050, /* PLL reference frequency */
+ 0, /* Supports fast bitblt? */
+ MGA_HOST_PCI /* Host interface */
+ },
+
+ 8192, 0x4000, /* Memory probe size & offset values */
+ },
+
+ /* G200WB */
+ [13] = { 0, 1, 0, 0, 1, 0, 0, 0, new_BARs,
+ (TRANSC_SOLID_FILL | TWO_PASS_COLOR_EXPAND | USE_LINEAR_EXPANSION),
+ {
+ { 50000, 230000 }, /* System VCO frequencies */
+ { 50000, 203400 }, /* Pixel VCO frequencies */
+ { 0, 0 }, /* Video VCO frequencies */
+ 45000, /* Memory clock */
+ 27050, /* PLL reference frequency */
+ 0, /* Supports fast bitblt? */
+ MGA_HOST_PCI /* Host interface */
+ },
+
+ 8192, 0x4000, /* Memory probe size & offset values */
+ },
-/*
- * This contains the functions needed by the server after loading the
- * driver module. It must be supplied, and gets added the driver list by
- * the Module Setup funtion in the dynamic case. In the static case a
- * reference to this is compiled in, and this requires that the name of
- * this DriverRec be an upper-case version of the driver name.
- */
+};
-_X_EXPORT DriverRec MGA_C_NAME = {
- MGA_VERSION,
- MGA_DRIVER_NAME,
- MGAIdentify,
- MGAProbe,
- MGAAvailableOptions,
- NULL,
- 0
+#ifdef XSERVER_LIBPCIACCESS
+#define MGA_DEVICE_MATCH(d, i) \
+ { 0x102B, (d), PCI_MATCH_ANY, PCI_MATCH_ANY, 0, 0, (i) }
+#define MGA_SUBDEVICE_MATCH(d, s, i) \
+ { 0x102B, (d), 0x102B, (s), 0, 0, (i) }
+
+static const struct pci_id_match mga_device_match[] = {
+ MGA_DEVICE_MATCH(PCI_CHIP_MGA2064, 0),
+ MGA_DEVICE_MATCH(PCI_CHIP_MGA1064, 1),
+ MGA_DEVICE_MATCH(PCI_CHIP_MGA2164, 2),
+ MGA_DEVICE_MATCH(PCI_CHIP_MGA2164_AGP, 3),
+ MGA_DEVICE_MATCH(PCI_CHIP_MGAG100, 4),
+ MGA_DEVICE_MATCH(PCI_CHIP_MGAG100_PCI, 5),
+ MGA_DEVICE_MATCH(PCI_CHIP_MGAG200, 6),
+ MGA_DEVICE_MATCH(PCI_CHIP_MGAG200_PCI, 7),
+ MGA_DEVICE_MATCH(PCI_CHIP_MGAG400, 8),
+ MGA_DEVICE_MATCH(PCI_CHIP_MGAG550, 9),
+
+ MGA_DEVICE_MATCH(PCI_CHIP_MGAG200_SE_A_PCI, 10),
+ MGA_DEVICE_MATCH(PCI_CHIP_MGAG200_SE_B_PCI, 11),
+
+ MGA_DEVICE_MATCH(PCI_CHIP_MGAG200_EV_PCI, 12),
+
+ MGA_DEVICE_MATCH( PCI_CHIP_MGAG200_WINBOND_PCI, 13 ),
+
+ { 0, 0, 0 },
};
+#endif
/* Supported chipsets */
static SymTabRec MGAChipsets[] = {
@@ -175,6 +427,8 @@ static SymTabRec MGAChipsets[] = {
{ PCI_CHIP_MGAG200_PCI, "mgag200 PCI" },
{ PCI_CHIP_MGAG200_SE_A_PCI, "mgag200 SE A PCI" },
{ PCI_CHIP_MGAG200_SE_B_PCI, "mgag200 SE B PCI" },
+ { PCI_CHIP_MGAG200_EV_PCI, "mgag200 Maxim" },
+ { PCI_CHIP_MGAG200_WINBOND_PCI, "mgag200 Winbond" },
{ PCI_CHIP_MGAG400, "mgag400" },
{ PCI_CHIP_MGAG550, "mgag550" },
{-1, NULL }
@@ -193,11 +447,44 @@ static PciChipsets MGAPciChipsets[] = {
(resRange*)RES_SHARED_VGA },
{ PCI_CHIP_MGAG200_SE_A_PCI, PCI_CHIP_MGAG200_SE_A_PCI,
(resRange*)RES_SHARED_VGA },
+ { PCI_CHIP_MGAG200_EV_PCI, PCI_CHIP_MGAG200_EV_PCI,
+ (resRange*)RES_SHARED_VGA },
+ { PCI_CHIP_MGAG200_WINBOND_PCI, PCI_CHIP_MGAG200_WINBOND_PCI,
+ (resRange*)RES_SHARED_VGA },
{ PCI_CHIP_MGAG400, PCI_CHIP_MGAG400, (resRange*)RES_SHARED_VGA },
{ PCI_CHIP_MGAG550, PCI_CHIP_MGAG550, (resRange*)RES_SHARED_VGA },
{ -1, -1, (resRange*)RES_UNDEFINED }
};
+/*
+ * This contains the functions needed by the server after loading the
+ * driver module. It must be supplied, and gets added the driver list by
+ * the Module Setup funtion in the dynamic case. In the static case a
+ * reference to this is compiled in, and this requires that the name of
+ * this DriverRec be an upper-case version of the driver name.
+ */
+
+_X_EXPORT DriverRec MGA_C_NAME = {
+ MGA_VERSION,
+ MGA_DRIVER_NAME,
+ MGAIdentify,
+#ifdef XSERVER_LIBPCIACCESS
+ NULL,
+#else
+ MGAProbe,
+#endif
+ MGAAvailableOptions,
+ NULL,
+ 0,
+ NULL,
+
+#ifdef XSERVER_LIBPCIACCESS
+ mga_device_match,
+ MGAPciProbe
+#endif
+};
+
+
static const OptionInfoRec MGAOptions[] = {
{ OPTION_SW_CURSOR, "SWcursor", OPTV_BOOLEAN, {0}, FALSE },
{ OPTION_HW_CURSOR, "HWcursor", OPTV_BOOLEAN, {0}, FALSE },
@@ -236,6 +523,7 @@ static const OptionInfoRec MGAOptions[] = {
{ OPTION_OLDDMA, "OldDmaInit", OPTV_BOOLEAN, {0}, FALSE },
{ OPTION_PCIDMA, "ForcePciDma", OPTV_BOOLEAN, {0}, FALSE },
{ OPTION_ACCELMETHOD, "AccelMethod", OPTV_ANYSTR, {0}, FALSE },
+ { OPTION_KVM, "KVM", OPTV_BOOLEAN, {0}, FALSE },
{ -1, NULL, OPTV_NONE, {0}, FALSE }
};
@@ -274,12 +562,6 @@ static const char *fbSymbols[] = {
NULL
};
-static const char *xf8_32bppSymbols[] = {
- "cfb8_32ScreenInit",
- "xf86Overlay8Plus32Init",
- NULL
-};
-
#ifdef USE_EXA
static const char *exaSymbols[] = {
"exaDriverInit",
@@ -440,7 +722,7 @@ static XF86ModuleVersionInfo mgaVersRec =
MODINFOSTRING1,
MODINFOSTRING2,
XORG_VERSION_CURRENT,
- MGA_MAJOR_VERSION, MGA_MINOR_VERSION, MGA_PATCHLEVEL,
+ PACKAGE_VERSION_MAJOR, PACKAGE_VERSION_MINOR, PACKAGE_VERSION_PATCHLEVEL,
ABI_CLASS_VIDEODRV, /* This is a video driver */
ABI_VIDEODRV_VERSION,
MOD_CLASS_VIDEODRV,
@@ -458,7 +740,7 @@ mgaSetup(pointer module, pointer opts, int *errmaj, int *errmin)
if (!setupDone) {
setupDone = TRUE;
- xf86AddDriver(&MGA_C_NAME, module, 0);
+ xf86AddDriver(&MGA_C_NAME, module, 1);
/*
* Modules that this driver always requires may be loaded here
@@ -476,9 +758,8 @@ mgaSetup(pointer module, pointer opts, int *errmaj, int *errmin)
#ifdef USE_EXA
exaSymbols,
#endif
- xf8_32bppSymbols, ramdacSymbols,
- ddcSymbols, i2cSymbols, shadowSymbols,
- fbdevHWSymbols, vbeSymbols,
+ ramdacSymbols, ddcSymbols, i2cSymbols,
+ shadowSymbols, fbdevHWSymbols, vbeSymbols,
fbSymbols, int10Symbols,
#ifdef XF86DRI
drmSymbols, driSymbols,
@@ -552,6 +833,94 @@ MGAIdentify(int flags)
}
+#ifdef XSERVER_LIBPCIACCESS
+Bool
+MGAPciProbe(DriverPtr drv, int entity_num, struct pci_device * dev,
+ intptr_t match_data)
+{
+ ScrnInfoPtr pScrn = NULL;
+ EntityInfoPtr pEnt;
+ MGAPtr pMga;
+#ifdef DISABLE_VGA_IO
+ MgaSavePtr smga;
+
+
+ smga = xnfalloc(sizeof(MgaSave));
+ smga->pvp = dev;
+#endif
+
+ /* Allocate a ScrnInfoRec and claim the slot */
+ pScrn = xf86ConfigPciEntity(pScrn, 0, entity_num, MGAPciChipsets,
+ NULL,
+#ifndef DISABLE_VGA_IO
+ NULL, NULL, NULL, NULL
+#else
+ VgaIOSave, VgaIOSave, VgaIORestore, smga
+#endif
+ );
+ if (pScrn != NULL) {
+ /* Fill in what we can of the ScrnInfoRec */
+ pScrn->driverVersion = MGA_VERSION;
+ pScrn->driverName = MGA_DRIVER_NAME;
+ pScrn->name = MGA_NAME;
+ pScrn->Probe = NULL;
+ pScrn->PreInit = MGAPreInit;
+ pScrn->ScreenInit = MGAScreenInit;
+ pScrn->SwitchMode = MGASwitchMode;
+ pScrn->AdjustFrame = MGAAdjustFrame;
+ pScrn->EnterVT = MGAEnterVT;
+ pScrn->LeaveVT = MGALeaveVT;
+ pScrn->FreeScreen = MGAFreeScreen;
+ pScrn->ValidMode = MGAValidMode;
+
+
+ /* Allocate the MGARec driverPrivate */
+ if (!MGAGetRec(pScrn)) {
+ return FALSE;
+ }
+
+ pMga = MGAPTR(pScrn);
+ pMga->chip_attribs = & attribs[ match_data ];
+ pMga->PciInfo = dev;
+
+
+ /*
+ * For cards that can do dual head per entity, mark the entity
+ * as sharable.
+ */
+ pEnt = xf86GetEntityInfo(entity_num);
+ if (pMga->chip_attribs->dual_head_possible) {
+ MGAEntPtr pMgaEnt = NULL;
+ DevUnion *pPriv;
+
+ xf86SetEntitySharable(entity_num);
+ /* Allocate an entity private if necessary */
+ if (MGAEntityIndex < 0)
+ MGAEntityIndex = xf86AllocateEntityPrivateIndex();
+ pPriv = xf86GetEntityPrivate(pScrn->entityList[0], MGAEntityIndex);
+ if (!pPriv->ptr) {
+ pPriv->ptr = xnfcalloc(sizeof(MGAEntRec), 1);
+ pMgaEnt = pPriv->ptr;
+ pMgaEnt->lastInstance = -1;
+ } else {
+ pMgaEnt = pPriv->ptr;
+ }
+ /*
+ * Set the entity instance for this instance of the driver. For
+ * dual head per card, instance 0 is the "master" instance, driving
+ * the primary head, and instance 1 is the "slave".
+ */
+ pMgaEnt->lastInstance++;
+ xf86SetEntityInstanceForScreen(pScrn, pScrn->entityList[0],
+ pMgaEnt->lastInstance);
+ }
+ }
+
+ return (pScrn != NULL);
+}
+
+#else
+
/* Mandatory */
static Bool
MGAProbe(DriverPtr drv, int flags)
@@ -621,81 +990,152 @@ MGAProbe(DriverPtr drv, int flags)
if (flags & PROBE_DETECT)
foundScreen = TRUE;
else for (i = 0; i < numUsed; i++) {
- ScrnInfoPtr pScrn;
+ ScrnInfoPtr pScrn = NULL;
EntityInfoPtr pEnt;
+ int attrib_no;
#ifdef DISABLE_VGA_IO
MgaSavePtr smga;
#endif
/* Allocate a ScrnInfoRec and claim the slot */
- pScrn = NULL;
-
#ifndef DISABLE_VGA_IO
- if ((pScrn = xf86ConfigPciEntity(pScrn, 0,usedChips[i],
- MGAPciChipsets, NULL, NULL,
- NULL, NULL, NULL)))
+ pScrn = xf86ConfigPciEntity(pScrn, 0,usedChips[i],
+ MGAPciChipsets, NULL, NULL,
+ NULL, NULL, NULL);
#else
- smga = xnfalloc(sizeof(MgaSave));
- smga->pvp = xf86GetPciInfoForEntity(usedChips[i]);
- if ((pScrn = xf86ConfigPciEntity(pScrn, 0,usedChips[i],
- MGAPciChipsets, NULL,VgaIOSave,
- VgaIOSave, VgaIORestore,smga)))
+ smga = xnfalloc(sizeof(MgaSave));
+ smga->pvp = xf86GetPciInfoForEntity(usedChips[i]);
+ pScrn = xf86ConfigPciEntity(pScrn, 0,usedChips[i],
+ MGAPciChipsets, NULL,VgaIOSave,
+ VgaIOSave, VgaIORestore,smga);
#endif
- {
-
- /* Fill in what we can of the ScrnInfoRec */
- pScrn->driverVersion = MGA_VERSION;
- pScrn->driverName = MGA_DRIVER_NAME;
- pScrn->name = MGA_NAME;
- pScrn->Probe = MGAProbe;
- pScrn->PreInit = MGAPreInit;
- pScrn->ScreenInit = MGAScreenInit;
- pScrn->SwitchMode = MGASwitchMode;
- pScrn->AdjustFrame = MGAAdjustFrame;
- pScrn->EnterVT = MGAEnterVT;
- pScrn->LeaveVT = MGALeaveVT;
- pScrn->FreeScreen = MGAFreeScreen;
- pScrn->ValidMode = MGAValidMode;
-
- foundScreen = TRUE;
+ if (pScrn != NULL) {
+ MGAPtr pMga;
+
+ /* Fill in what we can of the ScrnInfoRec */
+ pScrn->driverVersion = MGA_VERSION;
+ pScrn->driverName = MGA_DRIVER_NAME;
+ pScrn->name = MGA_NAME;
+ pScrn->Probe = MGAProbe;
+ pScrn->PreInit = MGAPreInit;
+ pScrn->ScreenInit = MGAScreenInit;
+ pScrn->SwitchMode = MGASwitchMode;
+ pScrn->AdjustFrame = MGAAdjustFrame;
+ pScrn->EnterVT = MGAEnterVT;
+ pScrn->LeaveVT = MGALeaveVT;
+ pScrn->FreeScreen = MGAFreeScreen;
+ pScrn->ValidMode = MGAValidMode;
+
+ foundScreen = TRUE;
+
+ /* Allocate the MGARec driverPrivate */
+ if (!MGAGetRec(pScrn)) {
+ return FALSE;
}
- /*
- * For cards that can do dual head per entity, mark the entity
- * as sharable.
- */
- pEnt = xf86GetEntityInfo(usedChips[i]);
- if ((pEnt->chipset == PCI_CHIP_MGAG400 || pEnt->chipset == PCI_CHIP_MGAG550)) {
- MGAEntPtr pMgaEnt = NULL;
- DevUnion *pPriv;
+ pMga = MGAPTR(pScrn);
- xf86SetEntitySharable(usedChips[i]);
- /* Allocate an entity private if necessary */
- if (MGAEntityIndex < 0)
- MGAEntityIndex = xf86AllocateEntityPrivateIndex();
- pPriv = xf86GetEntityPrivate(pScrn->entityList[0], MGAEntityIndex);
- if (!pPriv->ptr) {
- pPriv->ptr = xnfcalloc(sizeof(MGAEntRec), 1);
- pMgaEnt = pPriv->ptr;
- pMgaEnt->lastInstance = -1;
- } else {
- pMgaEnt = pPriv->ptr;
- }
/*
- * Set the entity instance for this instance of the driver. For
- * dual head per card, instance 0 is the "master" instance, driving
- * the primary head, and instance 1 is the "slave".
+ * For cards that can do dual head per entity, mark the entity
+ * as sharable.
*/
- pMgaEnt->lastInstance++;
- xf86SetEntityInstanceForScreen(pScrn, pScrn->entityList[0],
- pMgaEnt->lastInstance);
- }
- }
+ pEnt = xf86GetEntityInfo(usedChips[i]);
+
+ switch (pEnt->chipset) {
+ case PCI_CHIP_MGA2064:
+ attrib_no = 0;
+ break;
+
+ case PCI_CHIP_MGA1064:
+ attrib_no = 1;
+ break;
+
+ case PCI_CHIP_MGA2164:
+ attrib_no = 2;
+ break;
+
+ case PCI_CHIP_MGA2164_AGP:
+ attrib_no = 3;
+ break;
+
+ case PCI_CHIP_MGAG100:
+ attrib_no = 4;
+ break;
+
+ case PCI_CHIP_MGAG100_PCI:
+ attrib_no = 5;
+ break;
+ case PCI_CHIP_MGAG200:
+ attrib_no = 6;
+ break;
+
+ case PCI_CHIP_MGAG200_PCI:
+ attrib_no = 7;
+ break;
+
+ case PCI_CHIP_MGAG400:
+ attrib_no = 8;
+ break;
+
+ case PCI_CHIP_MGAG550:
+ attrib_no = 9;
+ break;
+
+ case PCI_CHIP_MGAG200_SE_A_PCI:
+ attrib_no = 10;
+ break;
+
+ case PCI_CHIP_MGAG200_SE_B_PCI:
+ attrib_no = 11;
+ break;
+
+ case PCI_CHIP_MGAG200_EV_PCI:
+ attrib_no = 12;
+ break;
+
+ case PCI_CHIP_MGAG200_WINBOND_PCI:
+ attrib_no = 13;
+ break;
+
+ default:
+ return FALSE;
+ }
+
+ pMga->chip_attribs = & attribs[attrib_no];
+
+ if (pMga->chip_attribs->dual_head_possible) {
+ MGAEntPtr pMgaEnt = NULL;
+ DevUnion *pPriv;
+
+ xf86SetEntitySharable(usedChips[i]);
+ /* Allocate an entity private if necessary */
+ if (MGAEntityIndex < 0)
+ MGAEntityIndex = xf86AllocateEntityPrivateIndex();
+ pPriv = xf86GetEntityPrivate(pScrn->entityList[0], MGAEntityIndex);
+ if (!pPriv->ptr) {
+ pPriv->ptr = xnfcalloc(sizeof(MGAEntRec), 1);
+ pMgaEnt = pPriv->ptr;
+ pMgaEnt->lastInstance = -1;
+ } else {
+ pMgaEnt = pPriv->ptr;
+ }
+ /*
+ * Set the entity instance for this instance of the driver. For
+ * dual head per card, instance 0 is the "master" instance, driving
+ * the primary head, and instance 1 is the "slave".
+ */
+ pMgaEnt->lastInstance++;
+ xf86SetEntityInstanceForScreen(pScrn, pScrn->entityList[0],
+ pMgaEnt->lastInstance);
+ }
+ }
+ }
xfree(usedChips);
return foundScreen;
}
+#endif
/*
@@ -746,18 +1186,26 @@ static int
MGACountRam(ScrnInfoPtr pScrn)
{
MGAPtr pMga = MGAPTR(pScrn);
- int ProbeSize = 8192;
+ int ProbeSize = pMga->chip_attribs->probe_size;
+ int ProbeSizeOffset = pMga->chip_attribs->probe_offset;
int SizeFound = 2048;
CARD32 biosInfo = 0;
+ CARD8 seq1;
#if 0
/* This isn't correct. It looks like this can have arbitrary
data for the memconfig even when the bios has initialized
it. At least, my cards don't advertise the documented
values (my 8 and 16 Meg G200s have the same values) */
- if(pMga->Primary) /* can only trust this for primary cards */
+ if (pMga->Primary) { /* can only trust this for primary cards */
+#ifdef XSERVER_LIBPCIACCESS
+ pci_device_cfg_read_u32(pMga->PciInfo, & biosInfo,
+ PCI_OPTION_REG);
+#else
biosInfo = pciReadLong(pMga->PciTag, PCI_OPTION_REG);
#endif
+ }
+#endif
switch(pMga->Chipset) {
case PCI_CHIP_MGA2164:
@@ -782,11 +1230,6 @@ MGACountRam(ScrnInfoPtr pScrn)
return 32768;
}
}
- ProbeSize = 32768;
- break;
- case PCI_CHIP_MGAG200_SE_A_PCI:
- case PCI_CHIP_MGAG200_SE_B_PCI:
- ProbeSize = 4096;
break;
case PCI_CHIP_MGAG200:
case PCI_CHIP_MGAG200_PCI:
@@ -798,15 +1241,11 @@ MGACountRam(ScrnInfoPtr pScrn)
return 16384;
}
}
- ProbeSize = 8192;
break;
case PCI_CHIP_MGAG100:
case PCI_CHIP_MGAG100_PCI:
if(biosInfo) /* I'm not sure if the docs are correct */
return (biosInfo & (1 << 12)) ? 16384 : 8192;
- case PCI_CHIP_MGA1064:
- case PCI_CHIP_MGA2064:
- ProbeSize = 8192;
break;
default:
break;
@@ -818,16 +1257,40 @@ MGACountRam(ScrnInfoPtr pScrn)
int i;
pMga->FbMapSize = ProbeSize * 1024;
- MGAMapMem(pScrn);
+ if (!MGAMapMem(pScrn)) {
+ return 0;
+ }
+
base = pMga->FbBase;
+ if (pMga->is_G200SE)
+ pMga->reg_1e24 = INREG(0x1e24); /* stash the model for later */
+ if (pMga->reg_1e24 == 0x01) {
+ MGAUnmapMem(pScrn);
+ ProbeSize = 16384;
+ ProbeSizeOffset = 0x10000;
+ pMga->FbMapSize = ProbeSize * 1024;
+ MGAMapMem(pScrn);
+ base = pMga->FbBase;
+ }
+
+ if (pMga->is_G200SE) {
+ OUTREG8(MGAREG_SEQ_INDEX, 0x01);
+ seq1 = INREG8(MGAREG_SEQ_DATA);
+ seq1 |= 0x20;
+ MGAWAITVSYNC();
+ MGAWAITBUSY();
+ OUTREG8(MGAREG_SEQ_DATA, seq1);
+ usleep(20000);
+ }
+
/* turn MGA mode on - enable linear frame buffer (CRTCEXT3) */
OUTREG8(MGAREG_CRTCEXT_INDEX, 3);
tmp = INREG8(MGAREG_CRTCEXT_DATA);
OUTREG8(MGAREG_CRTCEXT_DATA, tmp | 0x80);
- /* apparently the G200SE doesn't have a BIOS to read */
- if (pMga->is_G200SE) {
+ /* apparently the G200 IP don't have a BIOS to read */
+ if (pMga->is_G200SE || pMga->is_G200EV || pMga->is_G200WB) {
CARD32 MemoryAt0, MemoryAt1, Offset;
CARD32 FirstMemoryVal1, FirstMemoryVal2;
CARD32 SecondMemoryVal1, SecondMemoryVal2;
@@ -841,7 +1304,7 @@ MGACountRam(ScrnInfoPtr pScrn)
base[1] = 0;
for (Offset = 0x100000; Offset < (ProbeSize * 1024);
- Offset += 0x1000) {
+ Offset += ProbeSizeOffset) {
FirstMemoryVal1 = base[Offset];
FirstMemoryVal2 = base[Offset+1];
SecondMemoryVal1 = base[Offset+0x100];
@@ -896,8 +1359,17 @@ MGACountRam(ScrnInfoPtr pScrn)
OUTREG8(MGAREG_CRTCEXT_INDEX, 3);
OUTREG8(MGAREG_CRTCEXT_DATA, tmp);
+ if (pMga->is_G200SE) {
+ OUTREG8(MGAREG_SEQ_INDEX, 0x01);
+ seq1 = INREG8(MGAREG_SEQ_DATA);
+ seq1 &= ~0x20;
+ MGAWAITVSYNC();
+ MGAWAITBUSY();
+ OUTREG8(MGAREG_SEQ_DATA, seq1);
+ usleep(20000);
+ }
MGAUnmapMem(pScrn);
- }
+ }
return SizeFound;
}
@@ -1039,26 +1511,41 @@ static void
VgaIOSave(int i, void *arg)
{
MgaSavePtr sMga = arg;
+#ifndef XSERVER_LIBPCIACCESS
PCITAG tag = pciTag(sMga->pvp->bus,sMga->pvp->device,sMga->pvp->func);
+#endif
+ uint32_t temp;
#ifdef DEBUG
ErrorF("mga: VgaIOSave: %d:%d:%d\n", sMga->pvp->bus, sMga->pvp->device,
sMga->pvp->func);
#endif
- sMga->enable = (pciReadLong(tag, PCI_OPTION_REG) & 0x100) != 0;
+#ifdef XSERVER_LIBPCIACCESS
+ pci_device_cfg_read_u32(pMga->PciInfo, & temp, PCI_OPTION_REG);
+#else
+ temp = pciReadLong(tag, PCI_OPTION_REG);
+#endif
+ sMga->enable = (temp & 0x100) != 0;
}
static void
VgaIORestore(int i, void *arg)
{
MgaSavePtr sMga = arg;
+#ifndef XSERVER_LIBPCIACCESS
PCITAG tag = pciTag(sMga->pvp->bus,sMga->pvp->device,sMga->pvp->func);
+#endif
#ifdef DEBUG
ErrorF("mga: VgaIORestore: %d:%d:%d\n", sMga->pvp->bus, sMga->pvp->device,
sMga->pvp->func);
#endif
+#ifdef XSERVER_LIBPCIACCESS
+ pci_device_cfg_write_bits(pMga->PciInfo, 0x00000100, sMga->enable,
+ PCI_OPTION_REG);
+#else
pciSetBitsLong(tag, PCI_OPTION_REG, 0x100, sMga->enable ? 0x100 : 0x000);
+#endif
}
static void
@@ -1073,7 +1560,12 @@ VgaIODisable(void *arg)
BOOLTOSTRING(xf86ResAccessEnter));
#endif
/* Turn off the vgaioen bit. */
+#ifdef XSERVER_LIBPCIACCESS
+ pci_device_cfg_write_bits(pMga->PciInfo, 0x00000100, 0x00000000,
+ PCI_OPTION_REG);
+#else
pciSetBitsLong(pMga->PciTag, PCI_OPTION_REG, 0x100, 0x000);
+#endif
}
static void
@@ -1088,8 +1580,14 @@ VgaIOEnable(void *arg)
BOOLTOSTRING(xf86ResAccessEnter));
#endif
/* Turn on the vgaioen bit. */
- if (pMga->Primary)
+ if (pMga->Primary) {
+#ifdef XSERVER_LIBPCIACCESS
+ pci_device_cfg_write_bits(pMga->PciInfo, 0x00000100, 0x00000100,
+ PCI_OPTION_REG);
+#else
pciSetBitsLong(pMga->PciTag, PCI_OPTION_REG, 0x100, 0x100);
+#endif
+ }
}
#endif /* DISABLE_VGA_IO */
@@ -1164,10 +1662,6 @@ MGAPreInit(ScrnInfoPtr pScrn, int flags)
if (pScrn->numEntities != 1)
return FALSE;
- /* Allocate the MGARec driverPrivate */
- if (!MGAGetRec(pScrn)) {
- return FALSE;
- }
pMga = MGAPTR(pScrn);
/* Set here until dri is enabled */
@@ -1207,10 +1701,12 @@ MGAPreInit(ScrnInfoPtr pScrn, int flags)
if (!vgaHWGetHWRec(pScrn))
return FALSE;
+#ifndef XSERVER_LIBPCIACCESS
/* Find the PCI info for this screen */
pMga->PciInfo = xf86GetPciInfoForEntity(pMga->pEnt->index);
pMga->PciTag = pciTag(pMga->PciInfo->bus, pMga->PciInfo->device,
pMga->PciInfo->func);
+#endif
pMga->Primary = xf86IsPrimaryPci(pMga->PciInfo);
@@ -1246,15 +1742,16 @@ MGAPreInit(ScrnInfoPtr pScrn, int flags)
pMga->Chipset);
} else {
from = X_PROBED;
- pMga->Chipset = pMga->PciInfo->chipType;
+ pMga->Chipset = DEVICE_ID(pMga->PciInfo);
pScrn->chipset = (char *)xf86TokenToString(MGAChipsets, pMga->Chipset);
}
+
if (pMga->device->chipRev >= 0) {
pMga->ChipRev = pMga->device->chipRev;
xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "ChipRev override: %d\n",
pMga->ChipRev);
} else {
- pMga->ChipRev = pMga->PciInfo->chipRev;
+ pMga->ChipRev = CHIP_REVISION(pMga->PciInfo);
}
/*
@@ -1286,15 +1783,11 @@ MGAPreInit(ScrnInfoPtr pScrn, int flags)
|| (pMga->Chipset == PCI_CHIP_MGAG550);
pMga->is_G200SE = (pMga->Chipset == PCI_CHIP_MGAG200_SE_A_PCI)
|| (pMga->Chipset == PCI_CHIP_MGAG200_SE_B_PCI);
- pMga->is_HAL_chipset = ((pMga->Chipset == PCI_CHIP_MGAG200_PCI) ||
- (pMga->Chipset == PCI_CHIP_MGAG200) ||
- (pMga->Chipset == PCI_CHIP_MGAG200_SE_A_PCI) ||
- (pMga->Chipset == PCI_CHIP_MGAG200_SE_B_PCI) ||
- (pMga->Chipset == PCI_CHIP_MGAG400) ||
- (pMga->Chipset == PCI_CHIP_MGAG550));
+ pMga->is_G200EV = (pMga->Chipset == PCI_CHIP_MGAG200_EV_PCI);
+ pMga->is_G200WB = (pMga->Chipset == PCI_CHIP_MGAG200_WINBOND_PCI);
#ifdef USEMGAHAL
- if (HAL_CHIPSETS) {
+ if (pMga->chip_attribs->HAL_chipset) {
Bool loadHal = TRUE;
from = X_DEFAULT;
@@ -1407,17 +1900,22 @@ MGAPreInit(ScrnInfoPtr pScrn, int flags)
if (pMga->SecondCrtc)
flags24 = Support32bppFb;
+ if (pMga->is_G200SE)
+ pScrn->confScreen->defaultdepth = 16;
+
if (!xf86SetDepthBpp(pScrn, 0, 0, 0, flags24)) {
return FALSE;
} else {
/* Check that the returned depth is one we support */
switch (pScrn->depth) {
case 8:
- case 15:
case 16:
case 24:
/* OK */
break;
+ case 15:
+ if (pMga->Chipset != PCI_CHIP_MGAG200_SE_A_PCI)
+ break;
default:
xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
"Given depth (%d) is not supported by this driver\n",
@@ -1457,15 +1955,32 @@ MGAPreInit(ScrnInfoPtr pScrn, int flags)
memcpy(pMga->Options, MGAOptions, sizeof(MGAOptions));
xf86ProcessOptions(pScrn->scrnIndex, pScrn->options, pMga->Options);
+ if (pMga->is_G200SE) {
+ /* Disable MTRR support on PCIe systems */
+#ifdef XSERVER_LIBPCIACCESS
+ uint32_t temp;
+
+ pci_device_cfg_read_u32(pMga->PciInfo, & temp, 0xDC);
+#else
+ CARD32 temp = pciReadLong(pMga->PciTag, 0xDC);
+#endif
+
+ if ((temp & 0x0000FF00) != 0x0) {
+ xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Disabling MTRR support.\n");
+ pScrn->options = xf86ReplaceBoolOption(pScrn->options, "MTRR", FALSE);
+ }
+ }
+
+ if (pMga->is_G200WB && xf86ReturnOptValBool(pMga->Options, OPTION_KVM, TRUE)) {
+ pMga->KVM = TRUE;
+ xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "Enabling KVM\n");
+ }
#if !defined(__powerpc__)
pMga->softbooted = FALSE;
- if (pMga->Chipset >= PCI_CHIP_MGAG400
- && !pMga->Primary
- && !pMga->SecondCrtc)
- Default = TRUE;
- else
- Default = FALSE;
+ Default = (pMga->chip_attribs->dual_head_possible
+ && !pMga->Primary && !pMga->SecondCrtc);
+
if (xf86ReturnOptValBool(pMga->Options, OPTION_INT10, Default) &&
xf86LoadSubModule(pScrn, "int10")) {
xf86Int10InfoPtr pInt;
@@ -1526,6 +2041,13 @@ MGAPreInit(ScrnInfoPtr pScrn, int flags)
}
/* For compatibility, accept this too (as an override) */
+ if (xf86ReturnOptValBool(pMga->Options, OPTION_SW_CURSOR, FALSE)) {
+ from = X_CONFIG;
+ pMga->HWCursor = FALSE;
+ }
+ xf86DrvMsg(pScrn->scrnIndex, from, "Using %s cursor\n",
+ pMga->HWCursor ? "HW" : "SW");
+
if (xf86ReturnOptValBool(pMga->Options, OPTION_NOACCEL, FALSE)) {
pMga->NoAccel = TRUE;
xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "Acceleration disabled\n");
@@ -1564,27 +2086,6 @@ MGAPreInit(ScrnInfoPtr pScrn, int flags)
if (xf86GetOptValFreq(pMga->Options, OPTION_SET_MCLK, OPTUNITS_MHZ, &real)) {
pMga->MemClk = (int)(real * 1000.0);
}
- if ((s = xf86GetOptValString(pMga->Options, OPTION_OVERLAY))) {
- if (!*s || !xf86NameCmp(s, "8,24") || !xf86NameCmp(s, "24,8")) {
- if(pScrn->bitsPerPixel == 32 && pMga->SecondCrtc == FALSE) {
- pMga->Overlay8Plus24 = TRUE;
- if(!xf86GetOptValInteger(
- pMga->Options, OPTION_COLOR_KEY,&(pMga->colorKey)))
- pMga->colorKey = TRANSPARENCY_KEY;
- pScrn->colorKey = pMga->colorKey;
- pScrn->overlayFlags = OVERLAY_8_32_PLANAR;
- xf86DrvMsg(pScrn->scrnIndex, X_CONFIG,
- "PseudoColor overlay enabled\n");
- } else {
- xf86DrvMsg(pScrn->scrnIndex, X_CONFIG,
- "Option \"Overlay\" is only supported in 32 bits per pixel on"
- "the first CRTC\n");
- }
- } else {
- xf86DrvMsg(pScrn->scrnIndex, X_CONFIG,
- "\"%s\" is not a valid value for Option \"Overlay\"\n", s);
- }
- }
if(xf86GetOptValInteger(pMga->Options, OPTION_VIDEO_KEY, &(pMga->videoKey))) {
xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "video key set to 0x%x\n",
@@ -1703,6 +2204,8 @@ MGAPreInit(ScrnInfoPtr pScrn, int flags)
case PCI_CHIP_MGAG200_PCI:
case PCI_CHIP_MGAG200_SE_A_PCI:
case PCI_CHIP_MGAG200_SE_B_PCI:
+ case PCI_CHIP_MGAG200_WINBOND_PCI:
+ case PCI_CHIP_MGAG200_EV_PCI:
case PCI_CHIP_MGAG400:
case PCI_CHIP_MGAG550:
MGAGSetupFuncs(pScrn);
@@ -1712,83 +2215,68 @@ MGAPreInit(ScrnInfoPtr pScrn, int flags)
/* ajv changes to reflect actual values. see sdk pp 3-2. */
/* these masks just get rid of the crap in the lower bits */
- /*
- * For the 2064 and older rev 1064, base0 is the MMIO and base0 is
- * the framebuffer is base1. Let the config file override these.
+ /* For the 2064 and older rev 1064, base0 is the MMIO and base1 is
+ * the framebuffer.
*/
- if (pMga->device->MemBase != 0) {
- /* Require that the config file value matches one of the PCI values. */
- if (!xf86CheckPciMemBase(pMga->PciInfo, pMga->device->MemBase)) {
- xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
- "MemBase 0x%08lX doesn't match any PCI base register.\n",
- pMga->device->MemBase);
- MGAFreeRec(pScrn);
- return FALSE;
- }
- pMga->FbAddress = pMga->device->MemBase;
- from = X_CONFIG;
- } else {
- /* details: mgabase2 sdk pp 4-12 */
- int i = ((pMga->Chipset == PCI_CHIP_MGA1064 && pMga->ChipRev < 3) ||
- pMga->Chipset == PCI_CHIP_MGA2064) ? 1 : 0;
- pMga->FbBaseReg = i;
- if (pMga->PciInfo->memBase[i] != 0) {
- pMga->FbAddress = pMga->PciInfo->memBase[i] & 0xff800000;
- from = X_PROBED;
- } else {
- xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
- "No valid FB address in PCI config space\n");
- MGAFreeRec(pScrn);
- return FALSE;
+
+ switch (pMga->chip_attribs->BARs) {
+ case old_BARs:
+ pMga->framebuffer_bar = 1;
+ pMga->io_bar = 0;
+ pMga->iload_bar = -1;
+ break;
+ case probe_BARs:
+ if (pMga->ChipRev < 3) {
+ pMga->framebuffer_bar = 1;
+ pMga->io_bar = 0;
+ pMga->iload_bar = 2;
+ break;
}
+ /* FALLTHROUGH */
+ case new_BARs:
+ pMga->framebuffer_bar = 0;
+ pMga->io_bar = 1;
+ pMga->iload_bar = 2;
+ break;
}
- xf86DrvMsg(pScrn->scrnIndex, from, "Linear framebuffer at 0x%lX\n",
- (unsigned long)pMga->FbAddress);
-#if !defined(__powerpc__)
- if (pMga->device->IOBase != 0) {
- /* Require that the config file value matches one of the PCI values. */
- if (!xf86CheckPciMemBase(pMga->PciInfo, pMga->device->IOBase)) {
- xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
- "IOBase 0x%08lX doesn't match any PCI base register.\n",
- pMga->device->IOBase);
- MGAFreeRec(pScrn);
- return FALSE;
- }
- pMga->IOAddress = pMga->device->IOBase;
- from = X_CONFIG;
- } else
+#ifdef XSERVER_LIBPCIACCESS
+ pMga->FbAddress = pMga->PciInfo->regions[pMga->framebuffer_bar].base_addr;
+#else
+ pMga->FbAddress = pMga->PciInfo->memBase[pMga->framebuffer_bar] & 0xff800000;
#endif
- {
- /* details: mgabase1 sdk pp 4-11 */
- int i = ((pMga->Chipset == PCI_CHIP_MGA1064 && pMga->ChipRev < 3) ||
- pMga->Chipset == PCI_CHIP_MGA2064) ? 0 : 1;
- if (pMga->PciInfo->memBase[i] != 0) {
- pMga->IOAddress = pMga->PciInfo->memBase[i] & 0xffffc000;
- from = X_PROBED;
- } else {
- xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
- "No valid MMIO address in PCI config space\n");
- MGAFreeRec(pScrn);
- return FALSE;
- }
- }
+
+ xf86DrvMsg(pScrn->scrnIndex, X_PROBED, "Linear framebuffer at 0x%lX\n",
+ (unsigned long)pMga->FbAddress);
+
+#ifdef XSERVER_LIBPCIACCESS
+ xf86DrvMsg(pScrn->scrnIndex, X_PROBED, "MMIO registers at 0x%lX\n",
+ (unsigned long) pMga->PciInfo->regions[pMga->io_bar].base_addr);
+#else
+ pMga->IOAddress = pMga->PciInfo->memBase[pMga->io_bar] & 0xffffc000;
+
xf86DrvMsg(pScrn->scrnIndex, from, "MMIO registers at 0x%lX\n",
(unsigned long)pMga->IOAddress);
+#endif
-
- pMga->ILOADAddress = 0;
- if ( pMga->Chipset != PCI_CHIP_MGA2064 ) {
- if (pMga->PciInfo->memBase[2] != 0) {
- pMga->ILOADAddress = pMga->PciInfo->memBase[2] & 0xffffc000;
- xf86DrvMsg(pScrn->scrnIndex, X_PROBED,
- "Pseudo-DMA transfer window at 0x%lX\n",
- (unsigned long)pMga->ILOADAddress);
- }
+ if (pMga->iload_bar != -1) {
+#ifdef XSERVER_LIBPCIACCESS
+ xf86DrvMsg(pScrn->scrnIndex, X_PROBED,
+ "Pseudo-DMA transfer window at 0x%lX\n",
+ (unsigned long) pMga->PciInfo->regions[pMga->iload_bar].base_addr);
+#else
+ if (pMga->PciInfo->memBase[2] != 0) {
+ pMga->ILOADAddress = pMga->PciInfo->memBase[2] & 0xffffc000;
+ xf86DrvMsg(pScrn->scrnIndex, X_PROBED,
+ "Pseudo-DMA transfer window at 0x%lX\n",
+ (unsigned long)pMga->ILOADAddress);
+ }
+#endif
}
+#ifndef XSERVER_LIBPCIACCESS
/*
* Find the BIOS base. Get it from the PCI config if possible. Otherwise
* use the VGA default. Allow the config file to override this.
@@ -1813,6 +2301,8 @@ MGAPreInit(ScrnInfoPtr pScrn, int flags)
xf86DrvMsg(pScrn->scrnIndex, pMga->BiosFrom, "BIOS at 0x%lX\n",
(unsigned long)pMga->BiosAddress);
}
+#endif
+
if (xf86RegisterResources(pMga->pEnt->index, NULL, ResExclusive)) {
xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
@@ -1825,7 +2315,7 @@ MGAPreInit(ScrnInfoPtr pScrn, int flags)
* Read the BIOS data struct
*/
-#if defined(__alpha__)
+#if defined(__alpha__) && !defined(XSERVER_LIBPCIACCESS)
/*
* Some old Digital-OEMed Matrox Millennium I cards have a VGA
* disable switch. If the disable is on, we can't read the BIOS,
@@ -1882,6 +2372,12 @@ MGAPreInit(ScrnInfoPtr pScrn, int flags)
pScrn->videoRam = MGACountRam(pScrn);
}
+ if (pScrn->videoRam == 0) {
+ xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
+ "Unable to detect video RAM.\n");
+ return FALSE;
+ }
+
if (pMga->DualHeadEnabled) {
/* This takes gives either half or 8 meg to the second head
* whichever is less. */
@@ -1933,6 +2429,8 @@ MGAPreInit(ScrnInfoPtr pScrn, int flags)
case PCI_CHIP_MGAG200_PCI:
case PCI_CHIP_MGAG200_SE_A_PCI:
case PCI_CHIP_MGAG200_SE_B_PCI:
+ case PCI_CHIP_MGAG200_WINBOND_PCI:
+ case PCI_CHIP_MGAG200_EV_PCI:
pMga->SrcOrg = 0;
pMga->DstOrg = 0;
break;
@@ -1961,6 +2459,21 @@ MGAPreInit(ScrnInfoPtr pScrn, int flags)
pScrn->monitor->DDC = MGAdoDDC(pScrn);
#endif /* !__powerpc__ */
+ if (!pScrn->monitor->DDC && pMga->is_G200SE) {
+ /* Jam in ranges big enough for 1024x768 */
+ if (!pScrn->monitor->nHsync) {
+ pScrn->monitor->nHsync = 1;
+ pScrn->monitor->hsync[0].lo = 31.5;
+ pScrn->monitor->hsync[0].hi = 48.0;
+ }
+ if (!pScrn->monitor->nVrefresh) {
+ pScrn->monitor->nVrefresh = 1;
+ pScrn->monitor->vrefresh[0].lo = 56.0;
+ pScrn->monitor->vrefresh[0].hi = 75.0;
+ }
+ }
+
+
/*
* If the driver can do gamma correction, it should call xf86SetGamma()
* here.
@@ -1978,7 +2491,7 @@ MGAPreInit(ScrnInfoPtr pScrn, int flags)
/* XXX Set HW cursor use */
/* Set the min pixel clock */
- pMga->MinClock = 12000; /* XXX Guess, need to check this */
+ pMga->MinClock = 17750;
xf86DrvMsg(pScrn->scrnIndex, X_DEFAULT, "Min pixel clock is %d MHz\n",
pMga->MinClock / 1000);
/*
@@ -2095,6 +2608,8 @@ MGAPreInit(ScrnInfoPtr pScrn, int flags)
case PCI_CHIP_MGAG200_PCI:
case PCI_CHIP_MGAG200_SE_A_PCI:
case PCI_CHIP_MGAG200_SE_B_PCI:
+ case PCI_CHIP_MGAG200_WINBOND_PCI:
+ case PCI_CHIP_MGAG200_EV_PCI:
case PCI_CHIP_MGAG400:
case PCI_CHIP_MGAG550:
maxPitch = 4096;
@@ -2210,29 +2725,26 @@ MGAPreInit(ScrnInfoPtr pScrn, int flags)
); /* MGA_HAL */
#endif
- if (pMga->HasSDRAM) { /* don't bother checking */ }
- else if ((pMga->PciInfo->subsysCard == PCI_CARD_MILL_G200_SD) ||
- (pMga->PciInfo->subsysCard == PCI_CARD_MARV_G200_SD) ||
- (pMga->PciInfo->subsysCard == PCI_CARD_MYST_G200_SD) ||
- (pMga->PciInfo->subsysCard == PCI_CARD_PROD_G100_SD)) {
- pMga->HasSDRAM = TRUE;
- xf86DrvMsg(pScrn->scrnIndex, X_PROBED, "Has SDRAM\n");
- }
- /*
- * Can we trust HALlib to set the memory configuration
- * registers correctly?
+ /* If the Device section explicitly set HasSDRAM, don't bother checking.
*/
- else if ((pMga->softbooted || pMga->Primary
-#ifdef USEMGAHAL
- /*|| pMga->HALLoaded*/
-#endif
- ) &&
- (pMga->Chipset != PCI_CHIP_MGA2064) &&
- (pMga->Chipset != PCI_CHIP_MGA2164) &&
- (pMga->Chipset != PCI_CHIP_MGA2164_AGP)) {
- CARD32 option_reg = pciReadLong(pMga->PciTag, PCI_OPTION_REG);
- if(!(option_reg & (1 << 14))) {
- pMga->HasSDRAM = TRUE;
+ if (!pMga->HasSDRAM) {
+ if ((pMga->softbooted || pMga->Primary)
+ && pMga->chip_attribs->probe_for_sdram) {
+ uint32_t option_reg;
+
+#ifdef XSERVER_LIBPCIACCESS
+ pci_device_cfg_read_u32(pMga->PciInfo, & option_reg,
+ PCI_OPTION_REG);
+#else
+ option_reg = pciReadLong(pMga->PciTag, PCI_OPTION_REG);
+#endif
+ pMga->HasSDRAM = ((option_reg & (1 << 14)) == 0);
+ }
+ else {
+ pMga->HasSDRAM = pMga->chip_attribs->has_sdram;
+ }
+
+ if (pMga->HasSDRAM) {
xf86DrvMsg(pScrn->scrnIndex, X_PROBED, "Has SDRAM\n");
}
}
@@ -2269,23 +2781,19 @@ MGAPreInit(ScrnInfoPtr pScrn, int flags)
*/
pMga->YDstOrg = 0;
- if (((pMga->Chipset == PCI_CHIP_MGA2064) ||
- (pMga->Chipset == PCI_CHIP_MGA2164) ||
- (pMga->Chipset == PCI_CHIP_MGA2164_AGP)) &&
- (pScrn->virtualX * pScrn->virtualY * bytesPerPixel > 4*1024*1024))
- {
- int offset, offset_modulo, ydstorg_modulo;
+ if (pMga->chip_attribs->fb_4mb_quirk &&
+ (pScrn->virtualX * pScrn->virtualY * bytesPerPixel > 4*1024*1024)) {
+ int offset;
+ int offset_modulo = (pScrn->bitsPerPixel == 24) ? 12 : 4;
+ int ydstorg_modulo = 64;
- offset = (4*1024*1024) % (pScrn->displayWidth * bytesPerPixel);
- offset_modulo = 4;
- ydstorg_modulo = 64;
- if (pScrn->bitsPerPixel == 24)
- offset_modulo *= 3;
- if (pMga->Interleave)
- {
+
+ if (pMga->Interleave) {
offset_modulo <<= 1;
ydstorg_modulo <<= 1;
}
+
+ offset = (4*1024*1024) % (pScrn->displayWidth * bytesPerPixel);
pMga->YDstOrg = offset / bytesPerPixel;
/*
@@ -2356,19 +2864,11 @@ MGAPreInit(ScrnInfoPtr pScrn, int flags)
/* Load the required framebuffer */
- if (pMga->Overlay8Plus24) {
- if (!xf86LoadSubModule(pScrn, "xf8_32bpp")) {
- MGAFreeRec(pScrn);
- return FALSE;
- }
- xf86LoaderReqSymLists(xf8_32bppSymbols, NULL);
- } else {
- if (!xf86LoadSubModule(pScrn, "fb")) {
- MGAFreeRec(pScrn);
- return FALSE;
- }
- xf86LoaderReqSymLists(fbSymbols, NULL);
+ if (!xf86LoadSubModule(pScrn, "fb")) {
+ MGAFreeRec(pScrn);
+ return FALSE;
}
+ xf86LoaderReqSymLists(fbSymbols, NULL);
/* Load XAA if needed */
@@ -2424,7 +2924,6 @@ MGAPreInit(ScrnInfoPtr pScrn, int flags)
pMga->CurrentLayout.weight.red = pScrn->weight.red;
pMga->CurrentLayout.weight.green = pScrn->weight.green;
pMga->CurrentLayout.weight.blue = pScrn->weight.blue;
- pMga->CurrentLayout.Overlay8Plus24 = pMga->Overlay8Plus24;
pMga->CurrentLayout.mode = pScrn->currentMode;
@@ -2487,76 +2986,99 @@ MGAPreInit(ScrnInfoPtr pScrn, int flags)
static Bool
MGAMapMem(ScrnInfoPtr pScrn)
{
- MGAPtr pMga;
-
- pMga = MGAPTR(pScrn);
-
- /*
- * Map IO registers to virtual address space
- */
- /*
- * For Alpha, we need to map SPARSE memory, since we need
- * byte/short access. This is taken care of automatically by the
- * os-support layer.
- */
- pMga->IOBase = xf86MapPciMem(pScrn->scrnIndex,
- VIDMEM_MMIO | VIDMEM_READSIDEEFFECT,
- pMga->PciTag, pMga->IOAddress, 0x4000);
- if (pMga->IOBase == NULL)
- return FALSE;
-
- pMga->FbBase = xf86MapPciMem(pScrn->scrnIndex, VIDMEM_FRAMEBUFFER,
- pMga->PciTag, pMga->FbAddress,
- pMga->FbMapSize);
- if (pMga->FbBase == NULL)
- return FALSE;
+ MGAPtr pMga = MGAPTR(pScrn);
+#ifdef XSERVER_LIBPCIACCESS
+ struct pci_device *const dev = pMga->PciInfo;
+ struct pci_mem_region *region;
+ void **memory[2];
+ int i, err;
+#endif
- pMga->FbStart = pMga->FbBase + pMga->YDstOrg * (pScrn->bitsPerPixel / 8);
- /* Map the ILOAD transfer window if there is one. We only make
- DWORD access on DWORD boundaries to this window */
- if (pMga->ILOADAddress) {
- pMga->ILOADBase = xf86MapPciMem(pScrn->scrnIndex,
- VIDMEM_MMIO | VIDMEM_MMIO_32BIT |
- VIDMEM_READSIDEEFFECT,
- pMga->PciTag, pMga->ILOADAddress, 0x800000);
- } else
- pMga->ILOADBase = NULL;
+ if (!pMga->FBDev) {
+#ifdef XSERVER_LIBPCIACCESS
+ memory[pMga->io_bar] = &pMga->IOBase;
+ memory[pMga->framebuffer_bar] = &pMga->FbBase;
- return TRUE;
-}
+ for (i = 0; i < 2; i++) {
+ region = &dev->regions[i];
+ err = pci_device_map_range(dev,
+ region->base_addr, region->size,
+ PCI_DEV_MAP_FLAG_WRITABLE,
+ memory[i]);
-static Bool
-MGAMapMemFBDev(ScrnInfoPtr pScrn)
-{
- MGAPtr pMga;
+ if (err) {
+ xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
+ "Unable to map BAR %i. %s (%d)\n",
+ i, strerror(err), err);
+ return FALSE;
+ }
+ }
+#else
+ /*
+ * For Alpha, we need to map SPARSE memory, since we need
+ * byte/short access. This is taken care of automatically by the
+ * os-support layer.
+ */
+ pMga->IOBase = xf86MapPciMem(pScrn->scrnIndex,
+ VIDMEM_MMIO | VIDMEM_READSIDEEFFECT,
+ pMga->PciTag, pMga->IOAddress, 0x4000);
+ if (pMga->IOBase == NULL)
+ return FALSE;
- pMga = MGAPTR(pScrn);
+ pMga->FbBase = xf86MapPciMem(pScrn->scrnIndex, VIDMEM_FRAMEBUFFER,
+ pMga->PciTag, pMga->FbAddress,
+ pMga->FbMapSize);
+ if (pMga->FbBase == NULL)
+ return FALSE;
+#endif
+ }
+ else {
+ pMga->FbBase = fbdevHWMapVidmem(pScrn);
+ if (pMga->FbBase == NULL) {
+ xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
+ "Unable to map framebuffer.\n");
+ return FALSE;
+ }
- pMga->FbBase = fbdevHWMapVidmem(pScrn);
- if (pMga->FbBase == NULL)
- return FALSE;
+ pMga->IOBase = fbdevHWMapMMIO(pScrn);
+ if (pMga->IOBase == NULL) {
+ xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "Unable to map MMIO.\n");
+ return FALSE;
+ }
+ }
- pMga->IOBase = fbdevHWMapMMIO(pScrn);
- if (pMga->IOBase == NULL)
- return FALSE;
pMga->FbStart = pMga->FbBase + pMga->YDstOrg * (pScrn->bitsPerPixel / 8);
-#if 1 /* can't ask matroxfb for a mapping of the iload window */
-
- /* Map the ILOAD transfer window if there is one. We only make
- DWORD access on DWORD boundaries to this window */
- if(pMga->ILOADAddress)
- pMga->ILOADBase = xf86MapPciMem(pScrn->scrnIndex, VIDMEM_MMIO,
- pMga->PciTag, pMga->ILOADAddress, 0x800000);
- else pMga->ILOADBase = NULL;
+ pMga->ILOADBase = NULL;
+ if (pMga->iload_bar != -1) {
+#ifdef XSERVER_LIBPCIACCESS
+ region = &dev->regions[pMga->iload_bar];
+ err = pci_device_map_range(dev,
+ region->base_addr, region->size,
+ PCI_DEV_MAP_FLAG_WRITABLE,
+ (void *) &pMga->ILOADBase);
+ if (err) {
+ xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
+ "Unable to map BAR 2 (ILOAD region). %s (%d)\n",
+ strerror(err), err);
+ return FALSE;
+ }
+#else
+ pMga->ILOADBase = xf86MapPciMem(pScrn->scrnIndex,
+ VIDMEM_MMIO | VIDMEM_MMIO_32BIT |
+ VIDMEM_READSIDEEFFECT,
+ pMga->PciTag, pMga->ILOADAddress,
+ 0x800000);
#endif
+ }
+
+
return TRUE;
}
-
/*
* Unmap the framebuffer and MMIO memory.
*/
@@ -2564,44 +3086,46 @@ MGAMapMemFBDev(ScrnInfoPtr pScrn)
static Bool
MGAUnmapMem(ScrnInfoPtr pScrn)
{
- MGAPtr pMga;
+ MGAPtr pMga = MGAPTR(pScrn);
+#ifdef XSERVER_LIBPCIACCESS
+ struct pci_device * const dev = pMga->PciInfo;
+#endif
- pMga = MGAPTR(pScrn);
+
+ if (!pMga->FBDev) {
+#ifdef XSERVER_LIBPCIACCESS
+ pci_device_unmap_range(dev, pMga->IOBase,
+ dev->regions[pMga->io_bar].size);
+ pci_device_unmap_range(dev, pMga->FbBase,
+ dev->regions[pMga->framebuffer_bar].size);
+#else
+ xf86UnMapVidMem(pScrn->scrnIndex, (pointer)pMga->IOBase, 0x4000);
+ xf86UnMapVidMem(pScrn->scrnIndex, (pointer)pMga->FbBase, pMga->FbMapSize);
+#endif
+ }
+ else {
+ fbdevHWUnmapVidmem(pScrn);
+ fbdevHWUnmapMMIO(pScrn);
+ }
- /*
- * Unmap IO registers to virtual address space
- */
- xf86UnMapVidMem(pScrn->scrnIndex, (pointer)pMga->IOBase, 0x4000);
- pMga->IOBase = NULL;
+ if ((pMga->iload_bar != -1) && (pMga->ILOADBase != NULL)) {
+#ifdef XSERVER_LIBPCIACCESS
+ pci_device_unmap_range(dev, pMga->ILOADBase,
+ dev->regions[pMga->iload_bar].size);
+#else
+ xf86UnMapVidMem(pScrn->scrnIndex, (pointer)pMga->ILOADBase, 0x800000);
+#endif
+ }
- xf86UnMapVidMem(pScrn->scrnIndex, (pointer)pMga->FbBase, pMga->FbMapSize);
+ pMga->IOBase = NULL;
pMga->FbBase = NULL;
pMga->FbStart = NULL;
-
- if(pMga->ILOADBase)
- xf86UnMapVidMem(pScrn->scrnIndex, (pointer)pMga->ILOADBase, 0x800000);
pMga->ILOADBase = NULL;
- return TRUE;
-}
-
-static Bool
-MGAUnmapMemFBDev(ScrnInfoPtr pScrn)
-{
- MGAPtr pMga;
- pMga = MGAPTR(pScrn);
- fbdevHWUnmapVidmem(pScrn);
- pMga->FbBase = NULL;
- pMga->FbStart = NULL;
- fbdevHWUnmapMMIO(pScrn);
- pMga->IOBase = NULL;
- /* XXX ILOADBase */
return TRUE;
}
-
-
/*
* This function saves the video state.
*/
@@ -2787,7 +3311,11 @@ MGAModeInit(ScrnInfoPtr pScrn, DisplayModePtr mode)
return FALSE;
/* Program the registers */
- vgaHWProtect(pScrn, TRUE);
+ if (pMga->is_G200SE) {
+ MGAG200SEHWProtect(pScrn, TRUE);
+ } else {
+ vgaHWProtect(pScrn, TRUE);
+ }
vgaReg = &hwp->ModeReg;
mgaReg = &pMga->ModeReg;
#ifdef USEMGAHAL
@@ -2867,16 +3395,7 @@ MGA_HAL(
/* getting around bugs in the HAL lib. MATROX: hint, hint. */
MGA_HAL(
- switch (pMga->Chipset) {
- case PCI_CHIP_MGA1064:
- case PCI_CHIP_MGAG100:
- case PCI_CHIP_MGAG100_PCI:
- case PCI_CHIP_MGAG200:
- case PCI_CHIP_MGAG200_PCI:
- case PCI_CHIP_MGAG200_SE_A_PCI:
- case PCI_CHIP_MGAG200_SE_B_PCI:
- case PCI_CHIP_MGAG400:
- case PCI_CHIP_MGAG550:
+ if (pMga->chip_attribs->hwcursor_1064) {
if(pMga->SecondCrtc == FALSE && pMga->HWCursor == TRUE) {
outMGAdac(MGA1064_CURSOR_BASE_ADR_LOW,
pMga->FbCursorOffset >> 10);
@@ -2884,16 +3403,6 @@ MGA_HAL(
pMga->FbCursorOffset >> 18);
outMGAdac(MGA1064_CURSOR_CTL, 0x00);
}
- if (pMga->Overlay8Plus24 == TRUE) {
- outMGAdac(MGA1064_MUL_CTL, MGA1064_MUL_CTL_32bits);
- outMGAdac(MGA1064_COL_KEY_MSK_LSB,0xFF);
- outMGAdac(MGA1064_COL_KEY_LSB,pMga->colorKey);
- outMGAdac(MGA1064_COL_KEY_MSK_MSB,0xFF);
- outMGAdac(MGA1064_COL_KEY_MSB,0xFF);
- }
- break;
- default:
- break;
}
); /* MGA_HAL */
#endif
@@ -2903,7 +3412,11 @@ MGA_HAL(
MGAStormSync(pScrn);
MGAStormEngineInit(pScrn);
- vgaHWProtect(pScrn, FALSE);
+ if (pMga->is_G200SE) {
+ MGAG200SEHWProtect(pScrn,FALSE);
+ } else {
+ vgaHWProtect(pScrn, FALSE);
+ }
if (xf86IsPc98()) {
if (pMga->Chipset == PCI_CHIP_MGA2064)
@@ -2912,6 +3425,16 @@ MGA_HAL(
outb(0xfac, 0x02);
}
+ MGA_NOT_HAL(
+ if (pMga->is_G200SE) {
+ OUTREG8(0x1FDE, 0x06);
+ if (pMga->reg_1e24 == 0x01)
+ OUTREG8(0x1FDF, 0x03);
+ else
+ OUTREG8(0x1FDF, 0x14);
+ }
+ );
+
pMga->CurrentLayout.mode = mode;
if(pMga->MergedFB && mode->Private && (mode->PrivSize == 0)) {
@@ -2945,8 +3468,8 @@ void MGARestoreSecondCrtc(ScrnInfoPtr pScrn)
*/
CARD8 ucXDispCtrl = inMGAdac(MGA1064_DISP_CTL);
- ucXDispCtrl &= ~0x0c; /* dac2outsel mask */
- ucXDispCtrl |= 0x04; /* dac2 -> crtc1 */
+ ucXDispCtrl &= ~MGA1064_DISP_CTL_DAC2OUTSEL_MASK;
+ ucXDispCtrl |= MGA1064_DISP_CTL_DAC2OUTSEL_CRTC1;
outMGAdac(MGA1064_DISP_CTL, ucXDispCtrl);
@@ -2954,9 +3477,13 @@ void MGARestoreSecondCrtc(ScrnInfoPtr pScrn)
CARD8 ucXDispCtrl = inMGAdac(MGA1064_DISP_CTL);
CARD32 ulC2CTL = INREG(MGAREG_C2CTL);
- ucXDispCtrl &= ~0x0c; /* dac2outsel mask */
- ucXDispCtrl |= 0x5; /* dac1outsel -> crtcdacsel, dac2 -> crtc1 */
- ulC2CTL &= ~0x00100000; /* crtcdacsel -> crtc1 */
+ ucXDispCtrl &= ~MGA1064_DISP_CTL_DAC2OUTSEL_MASK;
+ ucXDispCtrl |= MGA1064_DISP_CTL_DAC1OUTSEL_EN;
+ ucXDispCtrl |= MGA1064_DISP_CTL_DAC2OUTSEL_CRTC1;
+
+ /* crtcdacsel -> crtc1 */
+ ulC2CTL &= ~MGAREG_C2CTL_CRTCDACSEL_CRTC2;
+ ulC2CTL |= MGAREG_C2CTL_CRTCDACSEL_CRTC1;
outMGAdac(MGA1064_DISP_CTL, ucXDispCtrl);
OUTREG(MGAREG_C2CTL, ulC2CTL);
@@ -2966,12 +3493,10 @@ void MGARestoreSecondCrtc(ScrnInfoPtr pScrn)
/* Force to close second crtc */
CARD32 ulC2CTL = INREG(MGAREG_C2CTL);
- ulC2CTL &= ~0x1; /* crtc2 disabled */
+ ulC2CTL &= ~MGAREG_C2CTL_C2_EN;
OUTREG(MGAREG_C2CTL, ulC2CTL);
}
-
- return;
}
/*
@@ -3006,7 +3531,11 @@ MGARestore(ScrnInfoPtr pScrn)
}
/* Only restore text mode fonts/text for the primary card */
- vgaHWProtect(pScrn, TRUE);
+ if (pMga->is_G200SE) {
+ MGAG200SEHWProtect(pScrn,TRUE);
+ } else {
+ vgaHWProtect(pScrn, TRUE);
+ }
if (pMga->Primary) {
#ifdef USEMGAHAL
MGA_HAL(
@@ -3020,7 +3549,12 @@ MGARestore(ScrnInfoPtr pScrn)
} else {
vgaHWRestore(pScrn, vgaReg, VGA_SR_MODE);
}
- vgaHWProtect(pScrn, FALSE);
+
+ if (pMga->is_G200SE) {
+ MGAG200SEHWProtect(pScrn,FALSE);
+ } else {
+ vgaHWProtect(pScrn,FALSE);
+ }
}
@@ -3067,6 +3601,7 @@ MGAScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv)
#ifdef XF86DRI
MessageType driFrom = X_DEFAULT;
#endif
+ DPMSSetProcPtr mga_dpms_set_proc = NULL;
/*
* First get the ScrnInfoRec
@@ -3080,19 +3615,35 @@ MGAScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv)
if (pMga->is_G200SE) {
VRTemp = pScrn->videoRam;
FBTemp = pMga->FbMapSize;
- pScrn->videoRam = 4096;
+ pScrn->videoRam = 8192;
pMga->FbMapSize = pScrn->videoRam * 1024;
}
+
/* Map the MGA memory and MMIO areas */
- if (pMga->FBDev) {
- if (!MGAMapMemFBDev(pScrn))
- return FALSE;
- } else {
- if (!MGAMapMem(pScrn))
- return FALSE;
+ if (!MGAMapMem(pScrn))
+ return FALSE;
+
+
+ /* Select functions that vary based on the CRTC configureation of the
+ * screen.
+ */
+ if (!pMga->MergedFB) {
+ if (pMga->SecondCrtc) {
+ mga_dpms_set_proc = MGADisplayPowerManagementSetCrtc2;
+ pScreen->SaveScreen = MGASaveScreenCrtc2;
+ }
+ else {
+ mga_dpms_set_proc = MGADisplayPowerManagementSet;
+ pScreen->SaveScreen = MGASaveScreen;
+ }
}
-
+ else {
+ pScreen->SaveScreen = MGASaveScreenMerged;
+ mga_dpms_set_proc = MGADisplayPowerManagementSetMerged;
+ }
+
+
if ((pMga->Chipset == PCI_CHIP_MGAG100)
|| (pMga->Chipset == PCI_CHIP_MGAG100_PCI))
MGAG100BlackMagic(pScrn);
@@ -3170,7 +3721,7 @@ MGAScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv)
/* There is a problem in the HALlib: set soft reset bit */
/* MATROX: hint, hint. */
if (!pMga->Primary && !pMga->FBDev &&
- (pMga->PciInfo->subsysCard == PCI_CARD_MILL_G200_SG) ) {
+ (SUBSYS_ID(pMga->PciInfo) == PCI_CARD_MILL_G200_SG)) {
OUTREG(MGAREG_Reset, 1);
usleep(200);
OUTREG(MGAREG_Reset, 0);
@@ -3183,57 +3734,46 @@ MGAScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv)
vgaHWGetIOBase(hwp);
/* Map the VGA memory when the primary video */
- if (pMga->Primary && !pMga->FBDev) {
- hwp->MapSize = 0x10000;
- if (!vgaHWMapMem(pScrn))
+ if (!pMga->FBDev) {
+ if (pMga->Primary) {
+ hwp->MapSize = 0x10000;
+ if (!vgaHWMapMem(pScrn))
+ return FALSE;
+ }
+
+ /* Save the current state */
+ MGASave(pScrn);
+ /* Initialise the first mode */
+ if (!MGAModeInit(pScrn, pScrn->currentMode))
return FALSE;
}
-
- if (pMga->FBDev) {
+ else {
fbdevHWSave(pScrn);
/* Disable VGA core, and leave memory access on */
+#ifdef XSERVER_LIBPCIACCESS
+ pci_device_cfg_write_bits(pMga->PciInfo, 0x00000100, 0x00000000,
+ PCI_OPTION_REG);
+#else
pciSetBitsLong(pMga->PciTag, PCI_OPTION_REG, 0x100, 0x000);
+#endif
if (!fbdevHWModeInit(pScrn, pScrn->currentMode))
return FALSE;
- if(pMga->SecondCrtc == FALSE && pMga->HWCursor == TRUE) {
- switch (pMga->Chipset) {
- case PCI_CHIP_MGA1064:
- case PCI_CHIP_MGAG100:
- case PCI_CHIP_MGAG100_PCI:
- case PCI_CHIP_MGAG200:
- case PCI_CHIP_MGAG200_PCI:
- case PCI_CHIP_MGAG200_SE_A_PCI:
- case PCI_CHIP_MGAG200_SE_B_PCI:
- case PCI_CHIP_MGAG400:
- case PCI_CHIP_MGAG550:
- outMGAdac(MGA1064_CURSOR_BASE_ADR_LOW, pMga->FbCursorOffset >> 10);
- outMGAdac(MGA1064_CURSOR_BASE_ADR_HI, pMga->FbCursorOffset >> 18);
- break;
- default:
- break;
- }
+
+ if (!pMga->SecondCrtc && pMga->HWCursor
+ && pMga->chip_attribs->hwcursor_1064) {
+ outMGAdac(MGA1064_CURSOR_BASE_ADR_LOW, pMga->FbCursorOffset >> 10);
+ outMGAdac(MGA1064_CURSOR_BASE_ADR_HI, pMga->FbCursorOffset >> 18);
}
MGAStormEngineInit(pScrn);
- } else {
- /* Save the current state */
- MGASave(pScrn);
- /* Initialise the first mode */
- if (!MGAModeInit(pScrn, pScrn->currentMode))
- return FALSE;
- }
- /* Darken the screen for aesthetic reasons and set the viewport */
- if (pMga->SecondCrtc == TRUE && !pMga->MergedFB) {
- MGASaveScreenCrtc2(pScreen, SCREEN_SAVER_ON);
- }
- if (pMga->SecondCrtc == FALSE && !pMga->MergedFB) {
- MGASaveScreen(pScreen, SCREEN_SAVER_ON);
- }
- if( pMga->MergedFB ) {
- MGASaveScreenMerged( pScreen, SCREEN_SAVER_ON );
}
+
+ /* Darken the screen for aesthetic reasons and set the viewport
+ */
+ (*pScreen->SaveScreen)(pScreen, SCREEN_SAVER_ON);
pScrn->AdjustFrame(scrnIndex, pScrn->frameX0, pScrn->frameY0, 0);
+
/*
* The next step is to setup the screen's visuals, and initialise the
* framebuffer code. In cases where the framebuffer's default
@@ -3253,14 +3793,8 @@ MGAScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv)
/* Setup the visuals we support. */
- /* All MGA support DirectColor and can do overlays in 32bpp */
- if(pMga->Overlay8Plus24 && (pScrn->bitsPerPixel == 32)) {
- if (!miSetVisualTypes(8, PseudoColorMask | GrayScaleMask,
- pScrn->rgbBits, PseudoColor))
- return FALSE;
- if (!miSetVisualTypes(24, TrueColorMask, pScrn->rgbBits, TrueColor))
- return FALSE;
- } else if (pMga->SecondCrtc) {
+ /* All MGA support DirectColor */
+ if (pMga->SecondCrtc) {
/* No DirectColor on the second head */
if (!miSetVisualTypes(pScrn->depth, TrueColorMask, pScrn->rgbBits,
TrueColor))
@@ -3306,13 +3840,11 @@ MGAScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv)
#ifdef XF86DRI
/*
- * Setup DRI after visuals have been established, but before cfbScreenInit
- * is called. cfbScreenInit will eventually call into the drivers
- * InitGLXVisuals call back.
+ * Setup DRI after visuals have been established.
+ *
* The DRI does not work when textured video is enabled at this time.
*/
- if ((pMga->Chipset == PCI_CHIP_MGAG200_SE_A_PCI) ||
- (pMga->Chipset == PCI_CHIP_MGAG200_SE_B_PCI)) {
+ if (pMga->is_G200SE) {
xf86DrvMsg(pScrn->scrnIndex, X_WARNING,
"Not supported by hardware, not initializing the DRI\n");
pMga->directRenderingEnabled = FALSE;
@@ -3352,19 +3884,10 @@ MGAScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv)
#endif
- if (pMga->Overlay8Plus24) {
- ret = cfb8_32ScreenInit(pScreen, FBStart,
- width, height,
- pScrn->xDpi, pScrn->yDpi,
- displayWidth);
- } else {
- ret = fbScreenInit(pScreen, FBStart, width, height,
- pScrn->xDpi, pScrn->yDpi,
- displayWidth, pScrn->bitsPerPixel);
- }
-
- if (!ret)
+ if (!fbScreenInit(pScreen, FBStart, width, height, pScrn->xDpi,
+ pScrn->yDpi, displayWidth, pScrn->bitsPerPixel)) {
return FALSE;
+ }
if (pScrn->bitsPerPixel > 8) {
@@ -3383,9 +3906,8 @@ MGAScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv)
}
/* must be after RGB ordering fixed */
- if (!pMga->Overlay8Plus24)
- fbPictureInit (pScreen, 0, 0);
-
+ fbPictureInit (pScreen, 0, 0);
+
xf86SetBlackWhitePixels(pScreen);
pMga->BlockHandler = pScreen->BlockHandler;
@@ -3445,11 +3967,6 @@ MGAScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv)
NULL, f))
return FALSE;
- if(pMga->Overlay8Plus24) { /* Must come after colormap initialization */
- if(!xf86Overlay8Plus32Init(pScreen))
- return FALSE;
- }
-
if(pMga->ShadowFB) {
RefreshAreaFuncPtr refreshArea = MGARefreshArea;
@@ -3470,34 +3987,16 @@ MGAScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv)
ShadowFBInit(pScreen, refreshArea);
}
- if(pMga->SecondCrtc == TRUE && !pMga->MergedFB) {
- xf86DPMSInit(pScreen, MGADisplayPowerManagementSetCrtc2, 0);
- }
- if(pMga->SecondCrtc == FALSE && !pMga->MergedFB) {
- xf86DPMSInit(pScreen, MGADisplayPowerManagementSet, 0);
- }
- if(pMga->MergedFB) {
- xf86DPMSInit(pScreen, MGADisplayPowerManagementSetMerged, 0);
- }
-
+ xf86DPMSInit(pScreen, mga_dpms_set_proc, 0);
+
pScrn->memPhysBase = pMga->FbAddress;
pScrn->fbOffset = pMga->YDstOrg * (pScrn->bitsPerPixel / 8);
- if(!pMga->MergedFB) {
- if(pMga->SecondCrtc == TRUE) {
- pScreen->SaveScreen = MGASaveScreenCrtc2;
- } else {
- pScreen->SaveScreen = MGASaveScreen;
- }
- } else { /* Merged FB */
- pScreen->SaveScreen = MGASaveScreenMerged;
- }
-
MGAInitVideo(pScreen);
#ifdef XF86DRI
if (pMga->directRenderingEnabled) {
- /* Now that mi, cfb, drm and others have done their thing,
+ /* Now that mi, drm and others have done their thing,
* complete the DRI setup.
*/
pMga->directRenderingEnabled = MGADRIFinishScreenInit(pScreen);
@@ -3671,8 +4170,10 @@ MGAAdjustFrame(int scrnIndex, int x, int y, int flags)
(3 - pMga->BppShifts[(pLayout->bitsPerPixel >> 3) - 1]);
if (pLayout->bitsPerPixel == 24) {
- if (pMga->Chipset == PCI_CHIP_MGAG400 || pMga->Chipset == PCI_CHIP_MGAG550)
- Base &= ~1; /*1 Not sure why */
+ if (pMga->Chipset == PCI_CHIP_MGAG400
+ || pMga->Chipset == PCI_CHIP_MGAG550)
+ Base &= ~1; /*1 Not sure why */
+
Base *= 3;
}
@@ -3692,8 +4193,6 @@ MGAAdjustFrame(int scrnIndex, int x, int y, int flags)
}
-#define C2STARTADD0 0x3C28
-
void
MGAAdjustFrameCrtc2(int scrnIndex, int x, int y, int flags)
{
@@ -3723,7 +4222,7 @@ MGAAdjustFrameCrtc2(int scrnIndex, int x, int y, int flags)
Base = (y * pLayout->displayWidth + x) * pLayout->bitsPerPixel >> 3;
Base += pMga->DstOrg;
Base &= 0x01ffffc0;
- OUTREG(C2STARTADD0, Base);
+ OUTREG(MGAREG_C2STARTADD0, Base);
);
}
@@ -3855,7 +4354,7 @@ MGACloseScreen(int scrnIndex, ScreenPtr pScreen)
if (pScrn->vtSema) {
if (pMga->FBDev) {
fbdevHWRestore(pScrn);
- MGAUnmapMemFBDev(pScrn);
+ MGAUnmapMem(pScrn);
} else {
MGARestore(pScrn);
vgaHWLock(hwp);
@@ -3964,6 +4463,28 @@ MGAFreeScreen(int scrnIndex, int flags)
}
+#ifndef HAVE_XF86MODEBANDWIDTH
+
+#define MODE_BANDWIDTH MODE_BAD
+
+/** Calculates the memory bandwidth (in MiB/sec) of a mode. */
+static unsigned int
+xf86ModeBandwidth(DisplayModePtr mode, int depth)
+{
+ float a_active, a_total, active_percent, pixels_per_second;
+ int bytes_per_pixel = (depth + 7) / 8;
+
+ if (!mode->HTotal || !mode->VTotal || !mode->Clock)
+ return 0;
+
+ a_active = mode->HDisplay * mode->VDisplay;
+ a_total = mode->HTotal * mode->VTotal;
+ active_percent = a_active / a_total;
+ pixels_per_second = active_percent * mode->Clock * 1000.0;
+
+ return (unsigned int)(pixels_per_second * bytes_per_pixel / (1024 * 1024));
+}
+#endif
/* Checks if a mode is suitable for the selected chipset. */
@@ -3975,6 +4496,26 @@ MGAValidMode(int scrnIndex, DisplayModePtr mode, Bool verbose, int flags)
ScrnInfoPtr pScrn = xf86Screens[scrnIndex];
MGAPtr pMga = MGAPTR(pScrn);
+ if (pMga->Chipset == PCI_CHIP_MGAG200_SE_A_PCI) {
+ if (mode->HDisplay > 1600)
+ return MODE_VIRTUAL_X;
+ if (mode->VDisplay > 1200)
+ return MODE_VIRTUAL_Y;
+ if (pMga->reg_1e24 == 0x01 &&
+ xf86ModeBandwidth(mode, pScrn->bitsPerPixel) > 256)
+ return MODE_BANDWIDTH;
+ } else if (pMga->is_G200WB){
+ if (pMga->KVM && mode->HDisplay > 1280)
+ return MODE_VIRTUAL_X;
+ if (pMga->KVM && mode->VDisplay > 1024)
+ return MODE_VIRTUAL_Y;
+ if (xf86ModeBandwidth(mode, pScrn->bitsPerPixel) > 315)
+ return MODE_BANDWIDTH;
+ } else if (pMga->is_G200EV
+ && (xf86ModeBandwidth(mode, pScrn->bitsPerPixel) > 327)) {
+ return MODE_BANDWIDTH;
+ }
+
lace = 1 + ((mode->Flags & V_INTERLACE) != 0);
if ((mode->CrtcHDisplay <= 2048) &&
@@ -4060,10 +4601,14 @@ MGADisplayPowerManagementSet(ScrnInfoPtr pScrn, int PowerManagementMode,
crtcext1 = 0x30;
break;
}
+
/* XXX Prefer an implementation that doesn't depend on VGA specifics */
OUTREG8(MGAREG_SEQ_INDEX, 0x01); /* Select SEQ1 */
seq1 |= INREG8(MGAREG_SEQ_DATA) & ~0x20;
+ MGAWAITVSYNC();
+ MGAWAITBUSY();
OUTREG8(MGAREG_SEQ_DATA, seq1);
+ usleep(20000);
OUTREG8(MGAREG_CRTCEXT_INDEX, 0x01); /* Select CRTCEXT1 */
crtcext1 |= INREG8(MGAREG_CRTCEXT_DATA) & ~0x30;
OUTREG8(MGAREG_CRTCEXT_DATA, crtcext1);
@@ -4079,8 +4624,8 @@ MGADisplayPowerManagementSetCrtc2(ScrnInfoPtr pScrn, int PowerManagementMode,
if (PowerManagementMode==DPMSModeOn) {
/* Enable CRTC2 */
- val |= 0x1;
- val &= ~(0x8);
+ val |= MGAREG_C2CTL_C2_EN;
+ val &= ~MGAREG_C2CTL_PIXCLKDIS_DISABLE;
OUTREG(MGAREG_C2CTL, val);
/* Restore normal MAVEN values */
if (pMga->Maven) {
@@ -4108,8 +4653,8 @@ MGADisplayPowerManagementSetCrtc2(ScrnInfoPtr pScrn, int PowerManagementMode,
}
else {
/* Disable CRTC2 video */
- val |= 0x8;
- val &= ~(0x1);
+ val |= MGAREG_C2CTL_PIXCLKDIS_DISABLE;
+ val &= ~MGAREG_C2CTL_C2_EN;
OUTREG(MGAREG_C2CTL, val);
/* Disable MAVEN display */
diff --git a/driver/xf86-video-mga/src/mga_esc.c b/driver/xf86-video-mga/src/mga_esc.c
index 8beffa81c..47b36a875 100644
--- a/driver/xf86-video-mga/src/mga_esc.c
+++ b/driver/xf86-video-mga/src/mga_esc.c
@@ -1,4 +1,3 @@
-/* $XFree86$ */
/****************************************************************************
* mga_esc.c
*
@@ -41,7 +40,6 @@
#include "vbe.h"
#include "fb.h"
-#include "cfb8_32.h"
#include "dixstruct.h"
#include "mga_reg.h"
diff --git a/driver/xf86-video-mga/src/mga_exa.c b/driver/xf86-video-mga/src/mga_exa.c
index 3242ea884..9321452b8 100644
--- a/driver/xf86-video-mga/src/mga_exa.c
+++ b/driver/xf86-video-mga/src/mga_exa.c
@@ -227,11 +227,6 @@ mgaPrepareCopy(PixmapPtr pSrc, PixmapPtr pDst, int xdir, int ydir, int alu,
*/
QUIESCE_DMA(pSrc);
- DEBUG_MSG(("s: %x@%x d: %x@%x xdir %d ydir %d alu %d pm %d\n",
- exaGetPixmapOffset(pSrc), exaGetPixmapPitch(pSrc),
- exaGetPixmapOffset(pDst), exaGetPixmapPitch(pDst),
- xdir, ydir, alu, planemask));
-
if (xdir < 0)
blit_direction |= BLIT_LEFT;
@@ -261,8 +256,6 @@ mgaCopy(PixmapPtr pDst, int srcx, int srcy, int dstx, int dsty, int w, int h)
PMGA(pDst);
int start, end;
- DEBUG_MSG((" %d,%d -> %d,%d %dx%d\n", srcx, srcy, dstx,dsty, w, h));
-
w--;
if (pMga->BltScanDirection & BLIT_UP) {
@@ -277,9 +270,6 @@ mgaCopy(PixmapPtr pDst, int srcx, int srcy, int dstx, int dsty, int w, int h)
else
end += w;
- DEBUG_MSG((" end %d start %d dstx %d dsty %d w %d h %d\n",
- end, start, dstx, dsty, w, h));
-
WAITFIFO(4);
OUTREG(MGAREG_AR0, end);
OUTREG(MGAREG_AR3, start);
@@ -360,6 +350,8 @@ static Bool
mgaCheckComposite(int op, PicturePtr pSrcPict, PicturePtr pMaskPict,
PicturePtr pDstPict)
{
+ MGAPtr pMga = xf86Screens[pSrcPict->pDrawable->pScreen->myNum]->driverPrivate;
+
if (op >= sizeof(mgaBlendOp) / sizeof(mgaBlendOp[0])) {
DEBUG_MSG(("unsupported op %x\n", op));
return FALSE;
@@ -383,10 +375,9 @@ mgaCheckComposite(int op, PicturePtr pSrcPict, PicturePtr pMaskPict,
return FALSE;
}
- /* FIXME
- * Doing this operation in hardware is broken atm :/
- */
- if (op == PictOpAdd && pSrcPict->format == PICT_a8 &&
+ /* Only the G550 can perform Add on A8 textures, it seems. */
+ if (pMga->Chipset != PCI_CHIP_MGAG550 &&
+ op == PictOpAdd && pSrcPict->format == PICT_a8 &&
pDstPict->format == PICT_a8)
return FALSE;
@@ -594,15 +585,6 @@ mgaPrepareComposite(int op, PicturePtr pSrcPict, PicturePtr pMaskPict,
blendcntl = (blendcntl & ~MGA_SRC_BLEND_MASK) | MGA_SRC_ZERO;
}
- if (!PICT_FORMAT_A(pSrcPict->format) && mgaBlendOp[op].src_alpha) {
- int dblend = blendcntl & MGA_DST_BLEND_MASK;
-
- if (dblend == MGA_DST_SRC_ALPHA)
- blendcntl = (blendcntl & ~MGA_DST_BLEND_MASK) | MGA_DST_ONE;
- else if (dblend == MGA_DST_ONE_MINUS_SRC_ALPHA)
- blendcntl = (blendcntl & ~MGA_DST_BLEND_MASK) | MGA_DST_ZERO;
- }
-
WAITFIFO(5);
OUTREG(MGAREG_FCOL, fcol);
OUTREG(MGAREG_TDUALSTAGE0, ds0);
@@ -732,6 +714,33 @@ mgaUploadToScreen(PixmapPtr pDst, int x, int y, int w, int h,
src += src_pitch;
}
+ exaMarkSync(pDst->drawable.pScreen);
+
+ return TRUE;
+}
+
+static Bool
+mgaDownloadFromScreen(PixmapPtr pSrc, int x, int y, int w, int h,
+ char *dst, int dst_pitch)
+{
+ PMGA(pSrc);
+
+ char *src = pSrc->devPrivate.ptr;
+ int src_pitch = exaGetPixmapPitch(pSrc);
+
+ int cpp = (pSrc->drawable.bitsPerPixel + 7) / 8;
+ int bytes = w * cpp;
+
+ src += y * src_pitch + x * cpp;
+
+ QUIESCE_DMA(pSrc);
+
+ while (h--) {
+ memcpy (dst, src, bytes);
+ src += src_pitch;
+ dst += dst_pitch;
+ }
+
return TRUE;
}
@@ -749,6 +758,82 @@ mgaWaitMarker(ScreenPtr pScreen, int marker)
while (INREG (MGAREG_Status) & 0x10000);
}
+#ifdef XF86DRI
+static void
+init_dri(ScrnInfoPtr pScrn)
+{
+ MGAPtr pMga = MGAPTR(pScrn);
+ MGADRIServerPrivatePtr dri = pMga->DRIServerInfo;
+ int cpp = pScrn->bitsPerPixel / 8;
+ int widthBytes = pScrn->displayWidth * cpp;
+ int bufferSize = ((pScrn->virtualY * widthBytes + MGA_BUFFER_ALIGN)
+ & ~MGA_BUFFER_ALIGN);
+ int maxlines, mb;
+
+ switch (pMga->Chipset) {
+ case PCI_CHIP_MGAG200_SE_A_PCI:
+ case PCI_CHIP_MGAG200_SE_B_PCI:
+ mb = 1;
+ break;
+ default:
+ mb = 16;
+ break;
+ }
+
+ maxlines = (min(pMga->FbUsableSize, mb * 1024 * 1024)) /
+ (pScrn->displayWidth * pMga->CurrentLayout.bitsPerPixel / 8);
+
+ dri->frontOffset = 0;
+ dri->frontPitch = widthBytes;
+
+ /* Try for front, back, depth, and two framebuffers worth of
+ * pixmap cache. Should be enough for a fullscreen background
+ * image plus some leftovers.
+ */
+ dri->textureSize = pMga->FbMapSize - 5 * bufferSize;
+
+ /* If that gives us less than half the available memory, let's
+ * be greedy and grab some more. Sorry, I care more about 3D
+ * performance than playing nicely, and you'll get around a full
+ * framebuffer's worth of pixmap cache anyway.
+ */
+ if (dri->textureSize < (int)pMga->FbMapSize / 2) {
+ dri->textureSize = pMga->FbMapSize - 4 * bufferSize;
+ }
+
+ /* Check to see if there is more room available after the maximum
+ * scanline for textures.
+ */
+ if ((int) pMga->FbMapSize - maxlines * widthBytes - bufferSize * 2
+ > dri->textureSize) {
+ dri->textureSize = pMga->FbMapSize - maxlines * widthBytes -
+ bufferSize * 2;
+ }
+
+ /* Set a minimum usable local texture heap size. This will fit
+ * two 256x256x32bpp textures.
+ */
+ if (dri->textureSize < 512 * 1024) {
+ dri->textureOffset = 0;
+ dri->textureSize = 0;
+ }
+
+ /* Reserve space for textures */
+ dri->textureOffset = (pMga->FbMapSize - dri->textureSize +
+ MGA_BUFFER_ALIGN) & ~MGA_BUFFER_ALIGN;
+
+ /* Reserve space for the shared depth buffer */
+ dri->depthOffset = (dri->textureOffset - bufferSize +
+ MGA_BUFFER_ALIGN) & ~MGA_BUFFER_ALIGN;
+ dri->depthPitch = widthBytes;
+
+ /* Reserve space for the shared back buffer */
+ dri->backOffset = (dri->depthOffset - bufferSize +
+ MGA_BUFFER_ALIGN) & ~MGA_BUFFER_ALIGN;
+ dri->backPitch = widthBytes;
+}
+#endif /* XF86DRI */
+
Bool
mgaExaInit(ScreenPtr pScreen)
{
@@ -797,7 +882,8 @@ mgaExaInit(ScreenPtr pScreen)
pExa->Copy = mgaCopy;
pExa->DoneCopy = mgaNoopDone;
- if (pMga->Chipset == PCI_CHIP_MGAG400) {
+ if (pMga->Chipset == PCI_CHIP_MGAG400 ||
+ pMga->Chipset == PCI_CHIP_MGAG550) {
pExa->CheckComposite = mgaCheckComposite;
pExa->PrepareComposite = mgaPrepareComposite;
pExa->Composite = mgaComposite;
@@ -805,6 +891,12 @@ mgaExaInit(ScreenPtr pScreen)
}
pExa->UploadToScreen = mgaUploadToScreen;
+ pExa->DownloadFromScreen = mgaDownloadFromScreen;
+
+#ifdef XF86DRI
+ if (pMga->directRenderingEnabled)
+ init_dri(pScrn);
+#endif
return exaDriverInit(pScreen, pExa);
}
diff --git a/driver/xf86-video-mga/src/mga_g450pll.c b/driver/xf86-video-mga/src/mga_g450pll.c
index 69f049746..9f544b19a 100644
--- a/driver/xf86-video-mga/src/mga_g450pll.c
+++ b/driver/xf86-video-mga/src/mga_g450pll.c
@@ -1,5 +1,3 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/mga/mga_g450pll.c,v 1.8tsi Exp $ */
-
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
@@ -274,11 +272,10 @@ static CARD32 G450IsPllLocked(ScrnInfoPtr pScrn, Bool *lpbLocked)
MGAPtr pMga = MGAPTR(pScrn);
- /* Pixel PLL */
if (!pMga->SecondCrtc)
- OUTREG8(0x3c00, 0x4f); /* Pixel PLL */
+ OUTREG8(0x3c00, MGA1064_PIX_PLL_STAT);
else
- OUTREG8(0x3c00, 0x8c); /* Video PLL */
+ OUTREG8(0x3c00, MGA1064_VID_PLL_STAT);
ulFallBackCounter = 0;
diff --git a/driver/xf86-video-mga/src/mga_halmod.c b/driver/xf86-video-mga/src/mga_halmod.c
index 94e1f1839..b562ba4f3 100644
--- a/driver/xf86-video-mga/src/mga_halmod.c
+++ b/driver/xf86-video-mga/src/mga_halmod.c
@@ -1,4 +1,3 @@
-/* $XFree86$ */
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
diff --git a/driver/xf86-video-mga/src/mga_hwcurs.c b/driver/xf86-video-mga/src/mga_hwcurs.c
index 464bad034..9c8d01aa9 100644
--- a/driver/xf86-video-mga/src/mga_hwcurs.c
+++ b/driver/xf86-video-mga/src/mga_hwcurs.c
@@ -1,5 +1,3 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/mga/mga_hwcurs.c,v 1.8tsi Exp $ */
-
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
diff --git a/driver/xf86-video-mga/src/mga_macros.h b/driver/xf86-video-mga/src/mga_macros.h
index 8a3221d04..69dc8e39b 100644
--- a/driver/xf86-video-mga/src/mga_macros.h
+++ b/driver/xf86-video-mga/src/mga_macros.h
@@ -3,6 +3,20 @@
#ifndef _MGA_MACROS_H_
#define _MGA_MACROS_H_
+#ifdef XSERVER_LIBPCIACCESS
+#define MGA_IO_ADDRESS(p) (p)->PciInfo->regions[(p)->io_bar].base_addr
+#define VENDOR_ID(p) (p)->vendor_id
+#define DEVICE_ID(p) (p)->device_id
+#define SUBSYS_ID(p) (p)->subdevice_id
+#define CHIP_REVISION(p) (p)->revision
+#else
+#define MGA_IO_ADDRESS(p) (p)->IOAddress
+#define VENDOR_ID(p) (p)->vendor
+#define DEVICE_ID(p) (p)->chipType
+#define SUBSYS_ID(p) (p)->subsysCard
+#define CHIP_REVISION(p) (p)->chipRev
+#endif
+
#define RGBEQUAL(c) (!((((c) >> 8) ^ (c)) & 0xffff))
#ifdef XF86DRI
@@ -63,15 +77,13 @@ while(INREG(MGAREG_DWGSYNC) != MGA_SYNC_XTAG) ; \
#endif
#ifdef USEMGAHAL
-#define HAL_CHIPSETS (pMga->is_HAL_chipset)
-
#define MGA_HAL(x) { \
MGAPtr pMga = MGAPTR(pScrn); \
- if (pMga->HALLoaded && HAL_CHIPSETS) { x; } \
+ if (pMga->HALLoaded && pMga->chip_attribs->HAL_chipset) { x; } \
}
#define MGA_NOT_HAL(x) { \
MGAPtr pMga = MGAPTR(pScrn); \
- if (!pMga->HALLoaded || !HAL_CHIPSETS) { x; } \
+ if (!pMga->HALLoaded || !pMga->chip_attribs->HAL_chipset) { x; } \
}
#else
#define MGA_NOT_HAL(x) { x; }
diff --git a/driver/xf86-video-mga/src/mga_merge.c b/driver/xf86-video-mga/src/mga_merge.c
index 3fdc6ed22..24bcbc154 100644
--- a/driver/xf86-video-mga/src/mga_merge.c
+++ b/driver/xf86-video-mga/src/mga_merge.c
@@ -1,5 +1,3 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/mga/mga_merge.c,v 1.4 2003/09/24 02:43:24 dawes Exp $ */
-
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
@@ -272,8 +270,9 @@ MGAPreInitMergedFB(ScrnInfoPtr pScrn1, int flags)
return TRUE;
}
+#ifndef XSERVER_LIBPCIACCESS
pMga->PciTag = pMga1->PciTag;
-
+#endif
pMga->Primary = pMga1->Primary;
/* Set pScrn->monitor */
@@ -334,7 +333,6 @@ MGAPreInitMergedFB(ScrnInfoPtr pScrn1, int flags)
pMga->ShowCache = pMga1->ShowCache;
pMga->HasSDRAM = pMga1->HasSDRAM;
pMga->MemClk = pMga1->MemClk;
- pMga->Overlay8Plus24 = pMga1->Overlay8Plus24;
pMga->colorKey = pMga1->colorKey;
pScrn->colorKey = pScrn1->colorKey;
pScrn->overlayFlags = pScrn1->overlayFlags;
@@ -363,6 +361,8 @@ MGAPreInitMergedFB(ScrnInfoPtr pScrn1, int flags)
case PCI_CHIP_MGAG200_PCI:
case PCI_CHIP_MGAG200_SE_A_PCI:
case PCI_CHIP_MGAG200_SE_B_PCI:
+ case PCI_CHIP_MGAG200_WINBOND_PCI:
+ case PCI_CHIP_MGAG200_EV_PCI:
case PCI_CHIP_MGAG400:
case PCI_CHIP_MGAG550:
MGAGSetupFuncs(pScrn);
@@ -370,12 +370,13 @@ MGAPreInitMergedFB(ScrnInfoPtr pScrn1, int flags)
}
pMga->FbAddress = pMga1->FbAddress;
- pMga->FbBaseReg = pMga1->FbBaseReg;
pMga->PciInfo = pMga1->PciInfo;
+#ifndef XSERVER_LIBPCIACCESS
pMga->IOAddress = pMga1->IOAddress;
pMga->ILOADAddress = pMga1->ILOADAddress;
pMga->BiosFrom = pMga1->BiosFrom;
pMga->BiosAddress = pMga1->BiosAddress;
+#endif
/*
* Read the BIOS data struct
@@ -514,6 +515,8 @@ MGAPreInitMergedFB(ScrnInfoPtr pScrn1, int flags)
case PCI_CHIP_MGAG200_PCI:
case PCI_CHIP_MGAG200_SE_A_PCI:
case PCI_CHIP_MGAG200_SE_B_PCI:
+ case PCI_CHIP_MGAG200_WINBOND_PCI:
+ case PCI_CHIP_MGAG200_EV_PCI:
case PCI_CHIP_MGAG400:
case PCI_CHIP_MGAG550:
maxPitch = 4096;
@@ -624,7 +627,6 @@ MGAPreInitMergedFB(ScrnInfoPtr pScrn1, int flags)
pMga->CurrentLayout.weight.red = pScrn->weight.red;
pMga->CurrentLayout.weight.green = pScrn->weight.green;
pMga->CurrentLayout.weight.blue = pScrn->weight.blue;
- pMga->CurrentLayout.Overlay8Plus24 = pMga->Overlay8Plus24;
pMga->CurrentLayout.mode = pScrn->currentMode;
@@ -947,23 +949,28 @@ MGASaveScreenMerged(ScreenPtr pScreen, int mode)
if (on) {
/* SetTimdeSinceLastInputEvent();*/
-
+
/* power on Dac1 */
- reg = inMGAdac(0x1E);
- outMGAdac(0x1E, reg | 1);
+ reg = inMGAdac(MGA1064_MISC_CTL);
+ reg |= MGA1064_MISC_CTL_DAC_EN;
+ outMGAdac(MGA1064_MISC_CTL, reg);
+
/* power on Dac2 */
- reg = inMGAdac(0xA0);
- outMGAdac(0xA0, reg | 1);
-
+ reg = inMGAdac(MGA1064_PWR_CTL);
+ reg |= MGA1064_PWR_CTL_DAC2_EN;
+ outMGAdac(MGA1064_PWR_CTL, reg);
} else {
/* power off Dac1 */
- reg = inMGAdac(0x1E);
- outMGAdac(0x1E, reg & ~1);
- /* power off Dac2 */
- reg = inMGAdac(0xA0);
- outMGAdac(0xA0, reg & ~1);
+ reg = inMGAdac(MGA1064_MISC_CTL);
+ reg &= ~MGA1064_MISC_CTL_DAC_EN;
+ outMGAdac(MGA1064_MISC_CTL, reg);
+ /* power off Dac2 */
+ reg = inMGAdac(MGA1064_PWR_CTL);
+ reg &= ~MGA1064_PWR_CTL_DAC2_EN;
+ outMGAdac(MGA1064_PWR_CTL, reg);
}
+
return TRUE;
}
diff --git a/driver/xf86-video-mga/src/mga_reg.h b/driver/xf86-video-mga/src/mga_reg.h
index 874c4ed81..6450e2fa8 100644
--- a/driver/xf86-video-mga/src/mga_reg.h
+++ b/driver/xf86-video-mga/src/mga_reg.h
@@ -221,6 +221,9 @@
#define MGADWG_TRANSC ( 0x01 << 30 )
#define MGAREG_MISC_WRITE 0x3c2
#define MGAREG_MISC_READ 0x3cc
+#define MGAREG_MEM_MISC_WRITE 0x1fc2
+#define MGAREG_MEM_MISC_READ 0x1fcc
+
#define MGAREG_MISC_IOADSEL (0x1 << 0)
#define MGAREG_MISC_RAMMAPEN (0x1 << 1)
#define MGAREG_MISC_CLK_SEL_VGA25 (0x0 << 2)
@@ -316,6 +319,7 @@
#define MGA1064_INDEX 0x00
#define MGA1064_WADR_PAL 0x00
+#define MGA1064_SPAREREG 0x00
#define MGA1064_COL_PAL 0x01
#define MGA1064_PIX_RD_MSK 0x02
#define MGA1064_RADR_PAL 0x03
@@ -355,7 +359,6 @@
#define MGA1064_MUL_CTL_G16V16bits 0x06
#define MGA1064_MUL_CTL_32_24bits 0x07
-#define MGAGDAC_XVREFCTRL 0x18
#define MGA1064_PIX_CLK_CTL 0x1a
#define MGA1064_PIX_CLK_CTL_CLK_DIS ( 0x01 << 2 )
#define MGA1064_PIX_CLK_CTL_CLK_POW_DOWN ( 0x01 << 3 )
@@ -365,8 +368,9 @@
#define MGA1064_PIX_CLK_CTL_SEL_MSK ( 0x03 << 0 )
#define MGA1064_GEN_CTL 0x1d
+#define MGA1064_GEN_CTL_SYNC_ON_GREEN_DIS (0x01 << 5)
#define MGA1064_MISC_CTL 0x1e
-#define MGA1064_MISC_CTL_DAC_POW_DN ( 0x01 << 0 )
+#define MGA1064_MISC_CTL_DAC_EN ( 0x01 << 0 )
#define MGA1064_MISC_CTL_VGA ( 0x01 << 1 )
#define MGA1064_MISC_CTL_DIS_CON ( 0x03 << 1 )
#define MGA1064_MISC_CTL_MAFC ( 0x02 << 1 )
@@ -379,6 +383,16 @@
#define MGA1064_SYS_PLL_N 0x2d
#define MGA1064_SYS_PLL_P 0x2e
#define MGA1064_SYS_PLL_STAT 0x2f
+
+#define MGA1064_REMHEADCTL 0x30
+#define MGA1064_REMHEADCTL_CLKDIS ( 0x01 << 0 )
+#define MGA1064_REMHEADCTL_CLKSL_OFF ( 0x00 << 1 )
+#define MGA1064_REMHEADCTL_CLKSL_PLL ( 0x01 << 1 )
+#define MGA1064_REMHEADCTL_CLKSL_PCI ( 0x02 << 1 )
+#define MGA1064_REMHEADCTL_CLKSL_MSK ( 0x03 << 1 )
+
+#define MGA1064_REMHEADCTL2 0x31
+
#define MGA1064_ZOOM_CTL 0x38
#define MGA1064_SENSE_TST 0x3a
@@ -402,18 +416,47 @@
#define MGA1064_PIX_PLL_STAT 0x4f
/*Added for G450 dual head*/
-/* Supported PLL*/
-#define __PIXEL_PLL 1
-#define __SYSTEM_PLL 2
-#define __VIDEO_PLL 3
+#define MGA1064_VID_PLL_STAT 0x8c
#define MGA1064_VID_PLL_P 0x8D
#define MGA1064_VID_PLL_M 0x8E
#define MGA1064_VID_PLL_N 0x8F
+/* Modified PLL for G200 Winbond (G200WB) */
+#define MGA1064_WB_PIX_PLLC_M 0xb7
+#define MGA1064_WB_PIX_PLLC_N 0xb6
+#define MGA1064_WB_PIX_PLLC_P 0xb8
+
+/* Modified PLL for G200 Maxim (G200EV) */
+#define MGA1064_EV_PIX_PLLC_M 0xb6
+#define MGA1064_EV_PIX_PLLC_N 0xb7
+#define MGA1064_EV_PIX_PLLC_P 0xb8
+
+
#define MGA1064_DISP_CTL 0x8a
+#define MGA1064_DISP_CTL_DAC1OUTSEL_MASK 0x01
+#define MGA1064_DISP_CTL_DAC1OUTSEL_DIS 0x00
+#define MGA1064_DISP_CTL_DAC1OUTSEL_EN 0x01
+#define MGA1064_DISP_CTL_DAC2OUTSEL_MASK (0x03 << 2)
+#define MGA1064_DISP_CTL_DAC2OUTSEL_DIS 0x00
+#define MGA1064_DISP_CTL_DAC2OUTSEL_CRTC1 (0x01 << 2)
+#define MGA1064_DISP_CTL_DAC2OUTSEL_CRTC2 (0x02 << 2)
+#define MGA1064_DISP_CTL_DAC2OUTSEL_TVE (0x03 << 2)
+#define MGA1064_DISP_CTL_PANOUTSEL_MASK (0x03 << 5)
+#define MGA1064_DISP_CTL_PANOUTSEL_DIS 0x00
+#define MGA1064_DISP_CTL_PANOUTSEL_CRTC1 (0x01 << 5)
+#define MGA1064_DISP_CTL_PANOUTSEL_CRTC2RGB (0x02 << 5)
+#define MGA1064_DISP_CTL_PANOUTSEL_CRTC2656 (0x03 << 5)
+
#define MGA1064_SYNC_CTL 0x8b
+
#define MGA1064_PWR_CTL 0xa0
+#define MGA1064_PWR_CTL_DAC2_EN (0x01 << 0)
+#define MGA1064_PWR_CTL_VID_PLL_EN (0x01 << 1)
+#define MGA1064_PWR_CTL_PANEL_EN (0x01 << 2)
+#define MGA1064_PWR_CTL_RFIFO_EN (0x01 << 3)
+#define MGA1064_PWR_CTL_CFIFO_EN (0x01 << 4)
+
#define MGA1064_PAN_CTL 0xa2
/* Using crtc2 */
@@ -428,6 +471,29 @@
#define MGAREG2_C2DATACTL 0x4c
#define MGAREG_C2CTL 0x3c10
+#define MGAREG_C2CTL_C2_EN 0x01
+
+#define MGAREG_C2_HIPRILVL_M (0x07 << 4)
+#define MGAREG_C2_MAXHIPRI_M (0x07 << 8)
+
+#define MGAREG_C2CTL_PIXCLKSEL_MASK (0x03 << 1)
+#define MGAREG_C2CTL_PIXCLKSELH_MASK (0x01 << 14)
+#define MGAREG_C2CTL_PIXCLKSEL_PCICLK 0x00
+#define MGAREG_C2CTL_PIXCLKSEL_VDOCLK (0x01 << 1)
+#define MGAREG_C2CTL_PIXCLKSEL_PIXELPLL (0x02 << 1)
+#define MGAREG_C2CTL_PIXCLKSEL_VIDEOPLL (0x03 << 1)
+#define MGAREG_C2CTL_PIXCLKSEL_VDCLK (0x01 << 14)
+
+#define MGAREG_C2CTL_PIXCLKSEL_CRISTAL (0x01 << 1) | (0x01 << 14)
+#define MGAREG_C2CTL_PIXCLKSEL_SYSTEMPLL (0x02 << 1) | (0x01 << 14)
+
+#define MGAREG_C2CTL_PIXCLKDIS_MASK (0x01 << 3)
+#define MGAREG_C2CTL_PIXCLKDIS_DISABLE (0x01 << 3)
+
+#define MGAREG_C2CTL_CRTCDACSEL_MASK (0x01 << 20)
+#define MGAREG_C2CTL_CRTCDACSEL_CRTC1 0x00
+#define MGAREG_C2CTL_CRTCDACSEL_CRTC2 (0x01 << 20)
+
#define MGAREG_C2HPARAM 0x3c14
#define MGAREG_C2HSYNC 0x3c18
#define MGAREG_C2VPARAM 0x3c1c
@@ -437,10 +503,6 @@
#define MGAREG_C2OFFSET 0x3c40
#define MGAREG_C2DATACTL 0x3c4c
-#define MGA1064_DISP_CTL 0x8a
-#define MGA1064_SYNC_CTL 0x8b
-#define MGA1064_PWR_CTL 0xa0
-
/* video register */
#define MGAREG_BESA1C3ORG 0x3d60
diff --git a/driver/xf86-video-mga/src/mga_shadow.c b/driver/xf86-video-mga/src/mga_shadow.c
index 94f199c9d..4dc03d333 100644
--- a/driver/xf86-video-mga/src/mga_shadow.c
+++ b/driver/xf86-video-mga/src/mga_shadow.c
@@ -1,5 +1,3 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/mga/mga_shadow.c,v 1.1 1999/08/14 10:49:48 dawes Exp $ */
-
/*
Copyright (c) 1999, The XFree86 Project Inc.
Written by Mark Vojkovich <markv@valinux.com>
diff --git a/driver/xf86-video-mga/src/mga_storm.c b/driver/xf86-video-mga/src/mga_storm.c
index 417675fe4..aa6ad823c 100644
--- a/driver/xf86-video-mga/src/mga_storm.c
+++ b/driver/xf86-video-mga/src/mga_storm.c
@@ -1,5 +1,3 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/mga/mga_storm.c,v 1.99tsi Exp $ */
-
#define PSZ 8
#ifdef HAVE_CONFIG_H
@@ -27,7 +25,6 @@
#include "servermd.h"
#ifdef XF86DRI
-#include "cfb.h"
#include "GL/glxtokens.h"
#endif
@@ -141,29 +138,23 @@ static void mgaSubsequentDashedTwoPointLine( ScrnInfoPtr pScrn,
int x1, int y1, int x2, int y2, int flags, int phase );
#endif
-void mgaRestoreAccelState( ScrnInfoPtr pScrn );
-
-#ifdef XF86DRI
-void mgaDRIInitBuffers(WindowPtr pWin, RegionPtr prgn, CARD32 index);
-void mgaDRIMoveBuffers(WindowPtr pParent, DDXPointRec ptOldOrg,
- RegionPtr prgnSrc, CARD32 index);
-#endif
+static void mgaRestoreAccelState( ScrnInfoPtr pScrn );
-extern void MGASetClippingRectangle(ScrnInfoPtr pScrn, int x1, int y1,
+static void MGASetClippingRectangle(ScrnInfoPtr pScrn, int x1, int y1,
int x2, int y2);
-extern void MGADisableClipping(ScrnInfoPtr pScrn);
-extern void MGAFillSolidRectsDMA(ScrnInfoPtr pScrn, int fg, int rop,
+static void MGADisableClipping(ScrnInfoPtr pScrn);
+static void MGAFillSolidRectsDMA(ScrnInfoPtr pScrn, int fg, int rop,
unsigned int planemask, int nBox, BoxPtr pBox);
-extern void MGAFillSolidSpansDMA(ScrnInfoPtr pScrn, int fg, int rop,
+static void MGAFillSolidSpansDMA(ScrnInfoPtr pScrn, int fg, int rop,
unsigned int planemask, int n, DDXPointPtr ppt,
int *pwidth, int fSorted);
-extern void MGAFillMono8x8PatternRectsTwoPass(ScrnInfoPtr pScrn, int fg, int bg,
+static void MGAFillMono8x8PatternRectsTwoPass(ScrnInfoPtr pScrn, int fg, int bg,
int rop, unsigned int planemask, int nBox,
BoxPtr pBox, int pattern0, int pattern1,
int xorigin, int yorigin);
-extern void MGAValidatePolyArc(GCPtr, unsigned long, DrawablePtr);
-extern void MGAValidatePolyPoint(GCPtr, unsigned long, DrawablePtr);
-extern void MGAFillCacheBltRects(ScrnInfoPtr, int, unsigned int, int, BoxPtr,
+static void MGAValidatePolyArc(GCPtr, unsigned long, DrawablePtr);
+static void MGAValidatePolyPoint(GCPtr, unsigned long, DrawablePtr);
+static void MGAFillCacheBltRects(ScrnInfoPtr, int, unsigned int, int, BoxPtr,
int, int, XAACacheInfoPtr);
@@ -220,8 +211,8 @@ static void MGASubsequentCPUToScreenTexture(ScrnInfoPtr pScrn, int dstx,
#include "mipict.h"
#include "dixstruct.h"
-CARD32 MGAAlphaTextureFormats[2] = {PICT_a8, 0};
-CARD32 MGATextureFormats[2] = {PICT_a8r8g8b8, 0};
+static CARD32 MGAAlphaTextureFormats[2] = {PICT_a8, 0};
+static CARD32 MGATextureFormats[2] = {PICT_a8r8g8b8, 0};
static void
RemoveLinear (FBLinearPtr linear)
@@ -318,11 +309,6 @@ Bool MGASetupForCPUToScreenAlphaTextureFaked( ScrnInfoPtr pScrn, int op,
CHECK_DMA_QUIESCENT(pMga, pScrn);
- if(pMga->Overlay8Plus24) {
- WAITFIFO(1);
- SET_PLANEMASK_REPLICATED( 0x00ffffff, 0xffffffff, 32 );
- }
-
pitch = (width + 15) & ~15;
sizeNeeded = pitch * height;
if(pScrn->bitsPerPixel == 16)
@@ -407,11 +393,6 @@ MGASetupForCPUToScreenAlphaTexture (
CHECK_DMA_QUIESCENT(pMga, pScrn);
- if(pMga->Overlay8Plus24) {
- WAITFIFO(1);
- SET_PLANEMASK_REPLICATED( 0x00ffffff, 0xffffffff, 32 );
- }
-
pitch = (width + 15) & ~15;
sizeNeeded = (pitch * height) >> 1;
if(pScrn->bitsPerPixel == 32)
@@ -511,11 +492,6 @@ MGASetupForCPUToScreenTexture (
CHECK_DMA_QUIESCENT(pMga, pScrn);
- if(pMga->Overlay8Plus24) {
- WAITFIFO(1);
- SET_PLANEMASK_REPLICATED( 0x00ffffff, 0xffffffff, 32 );
- }
-
pitch = (width + 15) & ~15;
sizeNeeded = pitch * height;
if(pScrn->bitsPerPixel == 16)
@@ -619,37 +595,10 @@ Bool mgaAccelInit( ScreenPtr pScreen )
pMga->MaxFastBlitY = 0;
pMga->MaxBlitDWORDS = 0x40000 >> 5;
- switch (pMga->Chipset) {
- case PCI_CHIP_MGA2064:
- pMga->AccelFlags = BLK_OPAQUE_EXPANSION | FASTBLT_BUG;
- break;
- case PCI_CHIP_MGA2164:
- case PCI_CHIP_MGA2164_AGP:
- pMga->AccelFlags = BLK_OPAQUE_EXPANSION |
- TRANSC_SOLID_FILL |
- USE_RECTS_FOR_LINES;
- break;
- case PCI_CHIP_MGAG200_SE_A_PCI:
- case PCI_CHIP_MGAG200_SE_B_PCI:
- case PCI_CHIP_MGAG400:
- case PCI_CHIP_MGAG550:
- case PCI_CHIP_MGAG200:
- case PCI_CHIP_MGAG200_PCI:
- pMga->AccelFlags = TRANSC_SOLID_FILL |
- TWO_PASS_COLOR_EXPAND;
- break;
- case PCI_CHIP_MGA1064:
- pMga->AccelFlags = 0;
- break;
- case PCI_CHIP_MGAG100:
- case PCI_CHIP_MGAG100_PCI:
- default:
- pMga->AccelFlags = MGA_NO_PLANEMASK;
- break;
- }
- /* all should be able to use this now with the bug fixes */
- pMga->AccelFlags |= USE_LINEAR_EXPANSION;
+ /* Set initial acceleration flags.
+ */
+ pMga->AccelFlags = pMga->chip_attribs->accel_flags;
if ((pMga->FbMapSize > 8*1024*1024) && (pScrn->depth == 8)) {
pMga->AccelFlags |= LARGE_ADDRESSES;
@@ -1007,7 +956,7 @@ Bool mgaAccelInit( ScreenPtr pScreen )
/* Support for multiscreen */
-void mgaRestoreAccelState(ScrnInfoPtr pScrn)
+static void mgaRestoreAccelState(ScrnInfoPtr pScrn)
{
MGAPtr pMga = MGAPTR(pScrn);
MGAFBLayout *pLayout = &pMga->CurrentLayout;
@@ -1089,8 +1038,8 @@ MGAStormSync(ScrnInfoPtr pScrn)
CHECK_DMA_QUIESCENT(pMga, pScrn);
- /* MGAISBUSY() reportedly causes a freeze for Mystique revision 2 and older */
- if (!(pMga->Chipset == PCI_CHIP_MGA1064 && (pMga->ChipRev >= 0 && pMga->ChipRev <= 2)))
+ /* MGAISBUSY() reportedly causes a freeze for Mystique revisions 0 and 1 */
+ if (!(pMga->Chipset == PCI_CHIP_MGA1064 && (pMga->ChipRev >= 0 && pMga->ChipRev <= 1)))
while(MGAISBUSY());
/* flush cache before a read (mga-1064g 5.1.6) */
OUTREG8(MGAREG_CRTC_INDEX, 0);
@@ -1179,6 +1128,8 @@ void MGAStormEngineInit( ScrnInfoPtr pScrn )
case PCI_CHIP_MGAG200_PCI:
case PCI_CHIP_MGAG200_SE_A_PCI:
case PCI_CHIP_MGAG200_SE_B_PCI:
+ case PCI_CHIP_MGAG200_WINBOND_PCI:
+ case PCI_CHIP_MGAG200_EV_PCI:
pMga->SrcOrg = 0;
OUTREG(MGAREG_SRCORG, pMga->realSrcOrg);
OUTREG(MGAREG_DSTORG, pMga->DstOrg);
@@ -1191,7 +1142,8 @@ void MGAStormEngineInit( ScrnInfoPtr pScrn )
}
-void MGASetClippingRectangle(
+static void
+MGASetClippingRectangle(
ScrnInfoPtr pScrn,
int x1, int y1, int x2, int y2
){
@@ -1206,7 +1158,8 @@ void MGASetClippingRectangle(
pMga->AccelFlags |= CLIPPER_ON;
}
-void MGADisableClipping(ScrnInfoPtr pScrn)
+static void
+MGADisableClipping(ScrnInfoPtr pScrn)
{
MGAPtr pMga = MGAPTR(pScrn);
@@ -2212,7 +2165,7 @@ void mgaSubsequentScreenToScreenColorExpandFill( ScrnInfoPtr pScrn,
}
-void
+static void
MGAFillSolidRectsDMA(
ScrnInfoPtr pScrn,
int fg, int rop,
@@ -2253,7 +2206,7 @@ MGAFillSolidRectsDMA(
OUTREG(MGAREG_OPMODE, MGAOPM_DMA_BLIT);
}
-void
+static void
MGAFillSolidSpansDMA(
ScrnInfoPtr pScrn,
int fg, int rop,
@@ -2312,7 +2265,7 @@ MGAFillSolidSpansDMA(
}
-void
+static void
MGAFillMono8x8PatternRectsTwoPass(
ScrnInfoPtr pScrn,
int fg, int bg, int rop,
@@ -2365,7 +2318,7 @@ SECOND_PASS:
}
-void
+static void
MGAValidatePolyArc(
GCPtr pGC,
unsigned long changes,
@@ -2452,7 +2405,7 @@ MGAPolyPoint (
}
-void
+static void
MGAValidatePolyPoint(
GCPtr pGC,
unsigned long changes,
@@ -2476,7 +2429,7 @@ MGAValidatePolyPoint(
}
-void
+static void
MGAFillCacheBltRects(
ScrnInfoPtr pScrn,
int rop,
@@ -2568,179 +2521,3 @@ MGAFillCacheBltRects(
SET_SYNC_FLAG(infoRec);
}
-
-
-#if defined(XF86DRI)
-void
-mgaDRIInitBuffers(WindowPtr pWin, RegionPtr prgn, CARD32 index)
-{
- ScreenPtr pScreen = pWin->drawable.pScreen;
- ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
- MGAPtr pMga = MGAPTR(pScrn);
- BoxPtr pbox = REGION_RECTS(prgn);
- int nbox = REGION_NUM_RECTS(prgn);
-
- CHECK_DMA_QUIESCENT(MGAPTR(pScrn), pScrn);
-
- mgaSetupForSolidFill(pScrn, 0, GXcopy, -1);
- while (nbox--) {
- MGASelectBuffer(pScrn, MGA_BACK);
- mgaSubsequentSolidFillRect(pScrn, pbox->x1, pbox->y1,
- pbox->x2-pbox->x1, pbox->y2-pbox->y1);
- MGASelectBuffer(pScrn, MGA_DEPTH);
- mgaSubsequentSolidFillRect(pScrn, pbox->x1, pbox->y1,
- pbox->x2-pbox->x1, pbox->y2-pbox->y1);
- pbox++;
- }
- MGASelectBuffer(pScrn, MGA_FRONT);
-
- pMga->AccelInfoRec->NeedToSync = TRUE;
-}
-
-/*
- This routine is a modified form of XAADoBitBlt with the calls to
- ScreenToScreenBitBlt built in. My routine has the prgnSrc as source
- instead of destination. My origin is upside down so the ydir cases
- are reversed.
-*/
-
-void
-mgaDRIMoveBuffers(WindowPtr pParent, DDXPointRec ptOldOrg,
- RegionPtr prgnSrc, CARD32 index)
-{
- ScreenPtr pScreen = pParent->drawable.pScreen;
- ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
- MGAPtr pMga = MGAPTR(pScrn);
- int nbox;
- BoxPtr pbox, pboxTmp, pboxNext, pboxBase, pboxNew1, pboxNew2;
- DDXPointPtr pptTmp, pptNew1, pptNew2;
- int xdir, ydir;
- int dx, dy;
- DDXPointPtr pptSrc;
- int screenwidth = pScrn->virtualX;
- int screenheight = pScrn->virtualY;
-
- CHECK_DMA_QUIESCENT(MGAPTR(pScrn), pScrn);
-
- pbox = REGION_RECTS(prgnSrc);
- nbox = REGION_NUM_RECTS(prgnSrc);
- pboxNew1 = 0;
- pptNew1 = 0;
- pboxNew2 = 0;
- pboxNew2 = 0;
- pptSrc = &ptOldOrg;
-
- dx = pParent->drawable.x - ptOldOrg.x;
- dy = pParent->drawable.y - ptOldOrg.y;
-
- /* If the copy will overlap in Y, reverse the order */
- if (dy>0) {
- ydir = -1;
-
- if (nbox>1) {
- /* Keep ordering in each band, reverse order of bands */
- pboxNew1 = (BoxPtr)ALLOCATE_LOCAL(sizeof(BoxRec)*nbox);
- if (!pboxNew1) return;
- pptNew1 = (DDXPointPtr)ALLOCATE_LOCAL(sizeof(DDXPointRec)*nbox);
- if (!pptNew1) {
- DEALLOCATE_LOCAL(pboxNew1);
- return;
- }
- pboxBase = pboxNext = pbox+nbox-1;
- while (pboxBase >= pbox) {
- while ((pboxNext >= pbox) && (pboxBase->y1 == pboxNext->y1))
- pboxNext--;
- pboxTmp = pboxNext+1;
- pptTmp = pptSrc + (pboxTmp - pbox);
- while (pboxTmp <= pboxBase) {
- *pboxNew1++ = *pboxTmp++;
- *pptNew1++ = *pptTmp++;
- }
- pboxBase = pboxNext;
- }
- pboxNew1 -= nbox;
- pbox = pboxNew1;
- pptNew1 -= nbox;
- pptSrc = pptNew1;
- }
- } else {
- /* No changes required */
- ydir = 1;
- }
-
- /* If the regions will overlap in X, reverse the order */
- if (dx>0) {
- xdir = -1;
-
- if (nbox > 1) {
- /*reverse orderof rects in each band */
- pboxNew2 = (BoxPtr)ALLOCATE_LOCAL(sizeof(BoxRec)*nbox);
- pptNew2 = (DDXPointPtr)ALLOCATE_LOCAL(sizeof(DDXPointRec)*nbox);
- if (!pboxNew2 || !pptNew2) {
- if (pptNew2) DEALLOCATE_LOCAL(pptNew2);
- if (pboxNew2) DEALLOCATE_LOCAL(pboxNew2);
- if (pboxNew1) {
- DEALLOCATE_LOCAL(pptNew1);
- DEALLOCATE_LOCAL(pboxNew1);
- }
- return;
- }
- pboxBase = pboxNext = pbox;
- while (pboxBase < pbox+nbox) {
- while ((pboxNext < pbox+nbox) &&
- (pboxNext->y1 == pboxBase->y1))
- pboxNext++;
- pboxTmp = pboxNext;
- pptTmp = pptSrc + (pboxTmp - pbox);
- while (pboxTmp != pboxBase) {
- *pboxNew2++ = *--pboxTmp;
- *pptNew2++ = *--pptTmp;
- }
- pboxBase = pboxNext;
- }
- pboxNew2 -= nbox;
- pbox = pboxNew2;
- pptNew2 -= nbox;
- pptSrc = pptNew2;
- }
- } else {
- /* No changes are needed */
- xdir = 1;
- }
-
- mgaSetupForScreenToScreenCopy(pScrn, xdir, ydir, GXcopy, -1, -1);
- for ( ; nbox-- ; pbox++) {
- int x1 = pbox->x1;
- int y1 = pbox->y1;
- int destx = x1 + dx;
- int desty = y1 + dy;
- int w = pbox->x2 - x1 + 1;
- int h = pbox->y2 - y1 + 1;
-
- if ( destx < 0 ) x1 -= destx, w += destx, destx = 0;
- if ( desty < 0 ) y1 -= desty, h += desty, desty = 0;
- if ( destx + w > screenwidth ) w = screenwidth - destx;
- if ( desty + h > screenheight ) h = screenheight - desty;
- if ( w <= 0 ) continue;
- if ( h <= 0 ) continue;
-
- MGASelectBuffer(pScrn, MGA_BACK);
- mgaSubsequentScreenToScreenCopy(pScrn, x1, y1, destx, desty, w, h);
- MGASelectBuffer(pScrn, MGA_DEPTH);
- mgaSubsequentScreenToScreenCopy(pScrn, x1, y1, destx, desty, w, h);
- }
- MGASelectBuffer(pScrn, MGA_FRONT);
-
- if (pboxNew2) {
- DEALLOCATE_LOCAL(pptNew2);
- DEALLOCATE_LOCAL(pboxNew2);
- }
- if (pboxNew1) {
- DEALLOCATE_LOCAL(pptNew1);
- DEALLOCATE_LOCAL(pboxNew1);
- }
-
- pMga->AccelInfoRec->NeedToSync = TRUE;
-}
-
-#endif /* XF86DRI */
diff --git a/driver/xf86-video-mga/src/mga_vga.c b/driver/xf86-video-mga/src/mga_vga.c
index fbbfc607e..9f00b3ddc 100644
--- a/driver/xf86-video-mga/src/mga_vga.c
+++ b/driver/xf86-video-mga/src/mga_vga.c
@@ -1,9 +1,15 @@
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
#include "misc.h"
#include "xf86.h"
#include "xf86_OSproc.h"
#include "vgaHW.h"
#include "compiler.h"
#include "xf86cmap.h"
+#include "mga.h"
+#include "mga_reg.h"
#define TEXT_AMOUNT 16384
#define FONT_AMOUNT (8*8192)
@@ -12,9 +18,11 @@ void
MGAG200SERestoreFonts(ScrnInfoPtr scrninfp, vgaRegPtr restore)
{
vgaHWPtr hwp = VGAHWPTR(scrninfp);
+ MGAPtr pMga = MGAPTR(scrninfp);
int savedIOBase;
unsigned char miscOut, attr10, gr1, gr3, gr4, gr5, gr6, gr8, seq2, seq4;
Bool doMap = FALSE;
+ unsigned char scrn;
/* If nothing to do, return now */
if (!hwp->FontInfo1 && !hwp->FontInfo2 && !hwp->TextInfo)
@@ -48,7 +56,14 @@ MGAG200SERestoreFonts(ScrnInfoPtr scrninfp, vgaRegPtr restore)
/* Force into colour mode */
hwp->writeMiscOut(hwp, miscOut | 0x01);
- vgaHWBlankScreen(scrninfp, FALSE);
+ scrn = hwp->readSeq(hwp, 0x01);
+ scrn |= 0x20;/* blank screen */
+ vgaHWSeqReset(hwp, TRUE);
+ MGAWAITVSYNC();
+ MGAWAITBUSY();
+ hwp->writeSeq(hwp, 0x01, scrn);/* change mode */
+ usleep(20000);
+ vgaHWSeqReset(hwp, FALSE);
/*
* here we temporarily switch to 16 colour planar mode, to simply
@@ -66,36 +81,28 @@ MGAG200SERestoreFonts(ScrnInfoPtr scrninfp, vgaRegPtr restore)
hwp->writeGr(hwp, 0x01, 0x00); /* all planes come from CPU */
}
+ hwp->writeSeq(hwp, 0x04, 0x06); /* enable plane graphics */
+ hwp->writeGr(hwp, 0x05, 0x00); /* write mode 0, read mode 0 */
+ hwp->writeGr(hwp, 0x06, 0x05); /* set graphics */
+
if (hwp->FontInfo1) {
hwp->writeSeq(hwp, 0x02, 0x04); /* write to plane 2 */
- hwp->writeSeq(hwp, 0x04, 0x06); /* enable plane graphics */
hwp->writeGr(hwp, 0x04, 0x02); /* read plane 2 */
- hwp->writeGr(hwp, 0x05, 0x00); /* write mode 0, read mode 0 */
- hwp->writeGr(hwp, 0x06, 0x05); /* set graphics */
slowbcopy_tobus(hwp->FontInfo1, hwp->Base, FONT_AMOUNT);
}
if (hwp->FontInfo2) {
hwp->writeSeq(hwp, 0x02, 0x08); /* write to plane 3 */
- hwp->writeSeq(hwp, 0x04, 0x06); /* enable plane graphics */
hwp->writeGr(hwp, 0x04, 0x03); /* read plane 3 */
- hwp->writeGr(hwp, 0x05, 0x00); /* write mode 0, read mode 0 */
- hwp->writeGr(hwp, 0x06, 0x05); /* set graphics */
slowbcopy_tobus(hwp->FontInfo2, hwp->Base, FONT_AMOUNT);
}
if (hwp->TextInfo) {
hwp->writeSeq(hwp, 0x02, 0x01); /* write to plane 0 */
- hwp->writeSeq(hwp, 0x04, 0x06); /* enable plane graphics */
hwp->writeGr(hwp, 0x04, 0x00); /* read plane 0 */
- hwp->writeGr(hwp, 0x05, 0x00); /* write mode 0, read mode 0 */
- hwp->writeGr(hwp, 0x06, 0x05); /* set graphics */
slowbcopy_tobus(hwp->TextInfo, hwp->Base, TEXT_AMOUNT);
hwp->writeSeq(hwp, 0x02, 0x02); /* write to plane 1 */
- hwp->writeSeq(hwp, 0x04, 0x06); /* enable plane graphics */
hwp->writeGr(hwp, 0x04, 0x01); /* read plane 1 */
- hwp->writeGr(hwp, 0x05, 0x00); /* write mode 0, read mode 0 */
- hwp->writeGr(hwp, 0x06, 0x05); /* set graphics */
slowbcopy_tobus((unsigned char *)hwp->TextInfo + TEXT_AMOUNT,
hwp->Base, TEXT_AMOUNT);
}
@@ -113,7 +120,14 @@ MGAG200SERestoreFonts(ScrnInfoPtr scrninfp, vgaRegPtr restore)
hwp->writeSeq(hwp, 0x04, seq4);
hwp->IOBase = savedIOBase;
- vgaHWBlankScreen(scrninfp, TRUE);
+ scrn = hwp->readSeq(hwp, 0x01);
+ scrn &= ~0x20;/* enable screen */
+ vgaHWSeqReset(hwp, TRUE);
+ MGAWAITVSYNC();
+ MGAWAITBUSY();
+ hwp->writeSeq(hwp, 0x01, scrn);/* change mode */
+ usleep(20000);
+ vgaHWSeqReset(hwp, FALSE);
if (doMap)
vgaHWUnmapMem(scrninfp);
@@ -124,9 +138,11 @@ void
MGAG200SESaveFonts(ScrnInfoPtr scrninfp, vgaRegPtr save)
{
vgaHWPtr hwp = VGAHWPTR(scrninfp);
+ MGAPtr pMga = MGAPTR(scrninfp);
int savedIOBase;
unsigned char miscOut, attr10, gr4, gr5, gr6, seq2, seq4;
Bool doMap = FALSE;
+ unsigned char scrn;
if (hwp->Base == NULL) {
doMap = TRUE;
@@ -157,7 +173,14 @@ MGAG200SESaveFonts(ScrnInfoPtr scrninfp, vgaRegPtr save)
/* Force into colour mode */
hwp->writeMiscOut(hwp, miscOut | 0x01);
- vgaHWBlankScreen(scrninfp, FALSE);
+ scrn = hwp->readSeq(hwp, 0x01);
+ scrn |= 0x20;/* blank screen */
+ vgaHWSeqReset(hwp, TRUE);
+ MGAWAITVSYNC();
+ MGAWAITBUSY();
+ hwp->writeSeq(hwp, 0x01, scrn);/* change mode */
+ usleep(20000);
+ vgaHWSeqReset(hwp, FALSE);
/*
* get the character sets, and text screen if required
@@ -171,34 +194,25 @@ MGAG200SESaveFonts(ScrnInfoPtr scrninfp, vgaRegPtr save)
#if 0
hwp->writeAttr(hwp, 0x10, 0x01); /* graphics mode */
#endif
+ hwp->writeSeq(hwp, 0x04, 0x06); /* enable plane graphics */
+ hwp->writeGr(hwp, 0x05, 0x00); /* write mode 0, read mode 0 */
+ hwp->writeGr(hwp, 0x06, 0x05); /* set graphics */
if (hwp->FontInfo1 || (hwp->FontInfo1 = xalloc(FONT_AMOUNT))) {
hwp->writeSeq(hwp, 0x02, 0x04); /* write to plane 2 */
- hwp->writeSeq(hwp, 0x04, 0x06); /* enable plane graphics */
hwp->writeGr(hwp, 0x04, 0x02); /* read plane 2 */
- hwp->writeGr(hwp, 0x05, 0x00); /* write mode 0, read mode 0 */
- hwp->writeGr(hwp, 0x06, 0x05); /* set graphics */
slowbcopy_frombus(hwp->Base, hwp->FontInfo1, FONT_AMOUNT);
}
if (hwp->FontInfo2 || (hwp->FontInfo2 = xalloc(FONT_AMOUNT))) {
hwp->writeSeq(hwp, 0x02, 0x08); /* write to plane 3 */
- hwp->writeSeq(hwp, 0x04, 0x06); /* enable plane graphics */
hwp->writeGr(hwp, 0x04, 0x03); /* read plane 3 */
- hwp->writeGr(hwp, 0x05, 0x00); /* write mode 0, read mode 0 */
- hwp->writeGr(hwp, 0x06, 0x05); /* set graphics */
slowbcopy_frombus(hwp->Base, hwp->FontInfo2, FONT_AMOUNT);
}
if (hwp->TextInfo || (hwp->TextInfo = xalloc(2 * TEXT_AMOUNT))) {
hwp->writeSeq(hwp, 0x02, 0x01); /* write to plane 0 */
- hwp->writeSeq(hwp, 0x04, 0x06); /* enable plane graphics */
hwp->writeGr(hwp, 0x04, 0x00); /* read plane 0 */
- hwp->writeGr(hwp, 0x05, 0x00); /* write mode 0, read mode 0 */
- hwp->writeGr(hwp, 0x06, 0x05); /* set graphics */
slowbcopy_frombus(hwp->Base, hwp->TextInfo, TEXT_AMOUNT);
hwp->writeSeq(hwp, 0x02, 0x02); /* write to plane 1 */
- hwp->writeSeq(hwp, 0x04, 0x06); /* enable plane graphics */
hwp->writeGr(hwp, 0x04, 0x01); /* read plane 1 */
- hwp->writeGr(hwp, 0x05, 0x00); /* write mode 0, read mode 0 */
- hwp->writeGr(hwp, 0x06, 0x05); /* set graphics */
slowbcopy_frombus(hwp->Base,
(unsigned char *)hwp->TextInfo + TEXT_AMOUNT, TEXT_AMOUNT);
}
@@ -213,8 +227,149 @@ MGAG200SESaveFonts(ScrnInfoPtr scrninfp, vgaRegPtr save)
hwp->writeMiscOut(hwp, miscOut);
hwp->IOBase = savedIOBase;
- vgaHWBlankScreen(scrninfp, TRUE);
+ scrn = hwp->readSeq(hwp, 0x01);
+ scrn &= ~0x20;/* enable screen */
+ vgaHWSeqReset(hwp, TRUE);
+ MGAWAITVSYNC();
+ MGAWAITBUSY();
+ hwp->writeSeq(hwp, 0x01, scrn);/* change mode */
+ usleep(20000);
+ vgaHWSeqReset(hwp, FALSE);
if (doMap)
vgaHWUnmapMem(scrninfp);
}
+
+void
+MGAG200SERestoreMode(ScrnInfoPtr scrninfp, vgaRegPtr restore)
+{
+ vgaHWPtr hwp = VGAHWPTR(scrninfp);
+ MGAPtr pMga = MGAPTR(scrninfp);
+ int i;
+ unsigned char scrn;
+
+ if (restore->MiscOutReg & 0x01)
+ hwp->IOBase = VGA_IOBASE_COLOR;
+ else
+ hwp->IOBase = VGA_IOBASE_MONO;
+
+ hwp->writeMiscOut(hwp, restore->MiscOutReg);
+
+
+ for (i = 1; i < restore->numSequencer; i++)
+ {
+ MGAWAITVSYNC();
+ MGAWAITBUSY();
+ hwp->writeSeq(hwp, i, restore->Sequencer[i]);
+ usleep(20000);
+ }
+
+ scrn = hwp->readSeq(hwp, 0x01);
+ scrn |= 0x20;/* blank screen */
+ vgaHWSeqReset(hwp, TRUE);
+ MGAWAITVSYNC();
+ MGAWAITBUSY();
+ hwp->writeSeq(hwp, 0x01, scrn);/* change mode */
+ usleep(20000);
+
+ /* Ensure CRTC registers 0-7 are unlocked by clearing bit 7 of CRTC[17] */
+ hwp->writeCrtc(hwp, 17, restore->CRTC[17] & ~0x80);
+
+ for (i = 0; i < restore->numCRTC; i++)
+ hwp->writeCrtc(hwp, i, restore->CRTC[i]);
+
+ for (i = 0; i < restore->numGraphics; i++)
+ hwp->writeGr(hwp, i, restore->Graphics[i]);
+
+ hwp->enablePalette(hwp);
+ for (i = 0; i < restore->numAttribute; i++)
+ hwp->writeAttr(hwp, i, restore->Attribute[i]);
+ hwp->disablePalette(hwp);
+
+ MGAWAITVSYNC();
+ MGAWAITBUSY();
+ hwp->writeSeq(hwp, 1, restore->Sequencer[1]);
+ usleep(20000);
+}
+
+void
+MGAG200SESaveMode(ScrnInfoPtr scrninfp, vgaRegPtr save)
+{
+ vgaHWPtr hwp = VGAHWPTR(scrninfp);
+ int i;
+
+ save->MiscOutReg = hwp->readMiscOut(hwp);
+ if (save->MiscOutReg & 0x01)
+ hwp->IOBase = VGA_IOBASE_COLOR;
+ else
+ hwp->IOBase = VGA_IOBASE_MONO;
+
+ for (i = 0; i < save->numCRTC; i++) {
+ save->CRTC[i] = hwp->readCrtc(hwp, i);
+#ifdef DEBUG
+ ErrorF("CRTC[0x%02x] = 0x%02x\n", i, save->CRTC[i]);
+#endif
+ }
+
+ hwp->enablePalette(hwp);
+ for (i = 0; i < save->numAttribute; i++) {
+ save->Attribute[i] = hwp->readAttr(hwp, i);
+#ifdef DEBUG
+ ErrorF("Attribute[0x%02x] = 0x%02x\n", i, save->Attribute[i]);
+#endif
+ }
+ hwp->disablePalette(hwp);
+
+ for (i = 0; i < save->numGraphics; i++) {
+ save->Graphics[i] = hwp->readGr(hwp, i);
+#ifdef DEBUG
+ ErrorF("Graphics[0x%02x] = 0x%02x\n", i, save->Graphics[i]);
+#endif
+ }
+
+ for (i = 1; i < save->numSequencer; i++) {
+ save->Sequencer[i] = hwp->readSeq(hwp, i);
+#ifdef DEBUG
+ ErrorF("Sequencer[0x%02x] = 0x%02x\n", i, save->Sequencer[i]);
+#endif
+ }
+}
+
+void
+MGAG200SEHWProtect(ScrnInfoPtr pScrn, Bool on)
+{
+ vgaHWPtr hwp = VGAHWPTR(pScrn);
+ MGAPtr pMga = MGAPTR(pScrn);
+
+ unsigned char tmp;
+
+ if (pScrn->vtSema) {
+ if (on) {
+ /*
+ * Turn off screen and disable sequencer.
+ */
+ tmp = hwp->readSeq(hwp, 0x01);
+
+ vgaHWSeqReset(hwp, TRUE); /* start synchronous reset */
+ MGAWAITVSYNC();
+ MGAWAITBUSY();
+ hwp->writeSeq(hwp, 0x01, tmp | 0x20); /* disable the display */
+ usleep(20000);
+ hwp->enablePalette(hwp);
+ } else {
+ /*
+ * Reenable sequencer, then turn on screen.
+ */
+
+ tmp = hwp->readSeq(hwp, 0x01);
+
+ MGAWAITVSYNC();
+ MGAWAITBUSY();
+ hwp->writeSeq(hwp, 0x01, tmp & ~0x20); /* reenable display */
+ usleep(20000);
+ vgaHWSeqReset(hwp, FALSE); /* clear synchronousreset */
+
+ hwp->disablePalette(hwp);
+ }
+ }
+}
diff --git a/driver/xf86-video-mga/src/mga_video.c b/driver/xf86-video-mga/src/mga_video.c
index 30ae6fcb2..bf60c1d92 100644
--- a/driver/xf86-video-mga/src/mga_video.c
+++ b/driver/xf86-video-mga/src/mga_video.c
@@ -1,5 +1,3 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/mga/mga_video.c,v 1.33tsi Exp $ */
-
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
@@ -63,6 +61,10 @@ static void MGAResetVideoOverlay(ScrnInfoPtr);
static void MGAVideoTimerCallback(ScrnInfoPtr pScrn, Time time);
+static XF86VideoAdaptorPtr MGASetupImageVideoILOAD(ScreenPtr);
+static int MGAPutImageILOAD(ScrnInfoPtr, short, short, short, short, short,
+ short, short, short, int, unsigned char*, short,
+ short, Bool, RegionPtr, pointer, DrawablePtr);
#define MAKE_ATOM(a) MakeAtom(a, sizeof(a) - 1, TRUE)
@@ -89,16 +91,28 @@ void MGAInitVideo(ScreenPtr pScreen)
MGAPtr pMga = MGAPTR(pScrn);
int num_adaptors;
- if((pScrn->bitsPerPixel != 8) && !pMga->NoAccel &&
- (pMga->SecondCrtc == FALSE) &&
- ((pMga->Chipset == PCI_CHIP_MGAG200) ||
- (pMga->Chipset == PCI_CHIP_MGAG200_PCI) ||
- (pMga->Chipset == PCI_CHIP_MGAG400) ||
- (pMga->Chipset == PCI_CHIP_MGAG550)))
- {
- if((pMga->Overlay8Plus24 || pMga->TexturedVideo) &&
- (pScrn->bitsPerPixel != 24))
- {
+ if ((pScrn->bitsPerPixel != 8) && !pMga->NoAccel &&
+ (pMga->SecondCrtc == FALSE) &&
+ ((pMga->Chipset == PCI_CHIP_MGA2164) ||
+ (pMga->Chipset == PCI_CHIP_MGA2164_AGP) ||
+/* (pMga->Chipset == PCI_CHIP_MGA2064) || */
+ (pMga->Chipset == PCI_CHIP_MGAG200) ||
+ (pMga->Chipset == PCI_CHIP_MGAG200_PCI) ||
+ (pMga->Chipset == PCI_CHIP_MGAG400) ||
+ (pMga->Chipset == PCI_CHIP_MGAG550))) {
+ if ((pMga->Chipset == PCI_CHIP_MGA2164) ||
+/* (pMga->Chipset == PCI_CHIP_MGA2064) || */
+ (pMga->Chipset == PCI_CHIP_MGA2164_AGP)) {
+ xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Using MGA 2164W ILOAD video\n");
+ xf86DrvMsg(pScrn->scrnIndex, X_INFO,
+ "This is an experimental driver and may not work on your machine.\n");
+
+ newAdaptor = MGASetupImageVideoILOAD(pScreen);
+ pMga->TexturedVideo = TRUE;
+ /* ^^^ this is not really true but the ILOAD scaler shares
+ * much more code with the textured video than the overlay
+ */
+ } else if (pMga->TexturedVideo && (pScrn->bitsPerPixel != 24)) {
xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Using texture video\n");
newAdaptor = MGASetupImageVideoTexture(pScreen);
pMga->TexturedVideo = TRUE;
@@ -107,8 +121,8 @@ void MGAInitVideo(ScreenPtr pScreen)
newAdaptor = MGASetupImageVideoOverlay(pScreen);
pMga->TexturedVideo = FALSE;
}
- if(!pMga->Overlay8Plus24)
- MGAInitOffscreenImages(pScreen);
+
+ MGAInitOffscreenImages(pScreen);
}
num_adaptors = xf86XVListGenericAdaptors(pScrn, &adaptors);
@@ -782,11 +796,6 @@ MGADisplayVideoTexture(
CHECK_DMA_QUIESCENT(pMga, pScrn);
- if(pMga->Overlay8Plus24) {
- WAITFIFO(1);
- SET_PLANEMASK_REPLICATED( 0x00ffffff, 0xffffffff, 32 );
- }
-
WAITFIFO(15);
OUTREG(MGAREG_TMR0, incx); /* sx inc */
OUTREG(MGAREG_TMR1, 0); /* sy inc */
@@ -1258,3 +1267,760 @@ MGAInitOffscreenImages(ScreenPtr pScreen)
xf86XVRegisterOffscreenImages(pScreen, offscreenImages, num);
}
+
+
+/* Matrox MGA 2164W Xv extension support.
+* The extension is implemented as a HOST->FB image load in YUV format.
+* I decided not to use real hardware overlay since on the Millennium II
+* it would limit the size of the frame buffer to 4Mb (even on a 16Mb
+* card) due to an hardware limitation.
+* Author: Gabriele Gorla (gorlik@yahoo.com)
+* Based on the MGA-Gxxx Xv extension by: Mark Vojkovich
+ */
+
+/* This code is still in alpha stage. Only YUV->RGB conversion
+ and horizontal scaling are hardware accelerated.
+ All 4 FOURCC formats supported by X should be supported.
+ It has been tested only on my DEC XP1000 at 1024x768x32 under
+ linux 2.6.18 with X.org 7.1.1 (debian alpha)
+
+ Bug reports and success/failure stories are greatly appreciated.
+*/
+
+/* #define DEBUG_MGA2164 */
+/* #define CUSTOM_MEMCOPY */
+#define MGA2164_SWFILTER
+
+
+static XF86VideoAdaptorPtr
+MGASetupImageVideoILOAD(ScreenPtr pScreen)
+{
+ ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
+ XF86VideoAdaptorPtr adapt;
+ MGAPtr pMga = MGAPTR(pScrn);
+
+ adapt = MGAAllocAdaptor(pScrn, FALSE);
+
+ adapt->type = XvWindowMask | XvInputMask | XvImageMask;
+ adapt->flags = 0;
+ adapt->name = "Matrox Millennium II ILOAD Video Engine";
+ adapt->nEncodings = 1;
+ adapt->pEncodings = &DummyEncoding[1];
+ adapt->nFormats = NUM_FORMATS;
+ adapt->pFormats = Formats;
+ adapt->nPorts = MGA_MAX_PORTS;
+ adapt->pAttributes = NULL;
+ adapt->nAttributes = 0;
+
+ /* number of supported color formats */
+ adapt->pImages = Images;
+ adapt->nImages = 4;
+
+ adapt->PutVideo = NULL;
+ adapt->PutStill = NULL;
+ adapt->GetVideo = NULL;
+ adapt->GetStill = NULL;
+ adapt->StopVideo = MGAStopVideo;
+
+ adapt->SetPortAttribute = MGASetPortAttributeTexture;
+ adapt->GetPortAttribute = MGAGetPortAttributeTexture;
+ adapt->QueryBestSize = MGAQueryBestSize;
+ adapt->PutImage = MGAPutImageILOAD;
+ adapt->QueryImageAttributes = MGAQueryImageAttributes;
+
+ REGION_INIT(pScreen, &(pMga->portPrivate->clip), NullBox, 0);
+
+ return adapt;
+}
+
+/* this function is optimized for alpha. It might be better also for
+other load/store risc architectures but I never tested on anything else
+than my ev56 */
+static void CopyMungedScanline_AXP(CARD32 *fb_ptr, short src_w,
+ CARD32 *tsp, CARD32 *tpu, CARD32 *tpv)
+{
+ CARD32 k,y0,y1,u,v;
+
+ for(k=src_w/8;k;k--) {
+ y0=*tsp;
+ y1=*(tsp+1);
+ u=*tpu;
+ v=*tpv;
+
+ *(fb_ptr)=(y1&0x000000ff)|((y1&0x0000ff00)<<8) |
+ (v&0x00ff0000)<<8 | (u&0x00ff0000)>>8;
+ *(fb_ptr+1)=(y1&0x000000ff)|((y1&0x0000ff00)<<8) |
+ (v&0x00ff0000)<<8 | (u&0x00ff0000)>>8;
+
+ *(fb_ptr+2)=(y0&0x000000ff)|((y0&0x0000ff00)<<8) |
+ (v&0x000000ff)<<24 | (u&0x000000ff)<<8;
+ *(fb_ptr+3)=(y0&0x000000ff)|((y0&0x0000ff00)<<8) |
+ (v&0x000000ff)<<24 | (u&0x000000ff)<<8;
+
+ /*correct below*/
+ /* *(fb_ptr)=(y0&0x000000ff)|((y0&0x0000ff00)<<8) |
+ (v&0x000000ff)<<24 | (u&0x000000ff)<<8;
+ *(fb_ptr+1)=((y0&0x00ff0000)>>16)|((y0&0xff000000)>>8) |
+ (v&0x0000ff00)<<16 | (u&0x0000ff00);
+ *(fb_ptr+2)=(y1&0x000000ff)|((y1&0x0000ff00)<<8) |
+ (v&0x00ff0000)<<8 | (u&0x00ff0000)>>8;
+ *(fb_ptr+3)=((y1&0x00ff0000)>>16)|((y1&0xff000000)>>8) |
+ (v&0xff000000) | (u&0xff000000)>>16; */
+
+ tsp+=2; tpu++; tpv++;
+ fb_ptr+=4;
+ }
+}
+
+static void CopyMungedScanline_AXP2(CARD32 *fb_ptr, short src_w,
+ CARD32 *tsp, CARD32 *tpu, CARD32 *tpv)
+{
+ CARD8 *y, *u, *v;
+ int k;
+ y=(CARD8 *)tsp;
+ u=(CARD8 *)tpu;
+ v=(CARD8 *)tpv;
+
+ for(k=src_w/8;k;k--) {
+ fb_ptr[0]=y[0] | y[1]<<16 | v[0]<<24 | u[0]<<8;
+ fb_ptr[1]=y[2] | y[3]<<16 | v[1]<<24 | u[1]<<8;
+ fb_ptr[2]=y[4] | y[5]<<16 | v[2]<<24 | u[2]<<8;
+ fb_ptr[3]=y[6] | y[7]<<16 | v[3]<<24 | u[3]<<8;
+
+ y+=8; u+=4; v+=4;
+ fb_ptr+=4;
+ }
+}
+
+
+static void CopyMungedScanlineFilter_AXP(CARD32 *fb_ptr, short src_w,
+ CARD32 *tsp1, CARD32 *tpu1, CARD32 *tpv1,
+ CARD32 *tsp2, CARD32 *tpu2, CARD32 *tpv2,
+ int beta, int xds )
+{
+ unsigned int k,y0_1,y1_1,y0_2,y1_2,u,v;
+ int yf[8], uf[4], vf[4];
+ int oneminbeta = 0xff - beta;
+
+ for(k=xds*src_w/8;k;k--) {
+ y0_1=*tsp1;
+ y1_1=*(tsp1+1);
+ y0_2=*tsp2;
+ y1_2=*(tsp2+1);
+ u=*tpu1;
+ v=*tpv1;
+
+ tsp1+=2; tsp2+=2; tpu1++; tpv1++;
+ yf[0] = ((y0_1&0x000000ff)*oneminbeta + (y0_2&0x000000ff)*beta )>>8;
+ yf[1] = (((y0_1&0x0000ff00)>>8)*oneminbeta + ((y0_2&0x0000ff00)>>8)*beta )>>8;
+ yf[2] = (((y0_1&0x00ff0000)>>16)*oneminbeta + ((y0_2&0x00ff0000)>>16)*beta )>>8;
+ yf[3] = (((y0_1&0xff000000)>>24)*oneminbeta + ((y0_2&0xff000000)>>24)*beta )>>8;
+ yf[4] = ((y1_1&0x000000ff)*oneminbeta + (y1_2&0x000000ff)*beta )>>8;
+ yf[5] = (((y1_1&0x0000ff00)>>8)*oneminbeta + ((y1_2&0x0000ff00)>>8)*beta )>>8;
+ yf[6] = (((y1_1&0x00ff0000)>>16)*oneminbeta + ((y1_2&0x00ff0000)>>16)*beta )>>8;
+ yf[7] = (((y1_1&0xff000000)>>24)*oneminbeta + ((y1_2&0xff000000)>>24)*beta )>>8;
+
+ /* FIXME: there is still no filtering on u and v */
+ uf[0]=(u&0x000000ff);
+ uf[1]=(u&0x0000ff00)>>8;
+ uf[2]=(u&0x00ff0000)>>16;
+ uf[3]=(u&0xff000000)>>24;
+
+ vf[0]=(v&0x000000ff);
+ vf[1]=(v&0x0000ff00)>>8;
+ vf[2]=(v&0x00ff0000)>>16;
+ vf[3]=(v&0xff000000)>>24;
+
+ switch(xds) {
+ case 1:
+ *(fb_ptr)=(yf[0]) | (yf[1]<<16) |
+ vf[0]<<24 | uf[0]<<8;
+ *(fb_ptr+1)=(yf[2]) | (yf[3]<<16) |
+ vf[1]<<24 | uf[1]<<8;
+ *(fb_ptr+2)=(yf[4]) | (yf[5]<<16) |
+ vf[2]<<24 | uf[2]<<8;
+ *(fb_ptr+3)=(yf[6]) | (yf[7]<<16) |
+ vf[3]<<24 | uf[3]<<8;
+ fb_ptr+=4;
+ break;
+
+ case 2:
+ *(fb_ptr)=(yf[0]+yf[1])/2 | (((yf[2]+yf[3])/2)<<16) |
+ ((vf[0]+vf[1])/2 )<<24 | ((uf[0]+uf[1])/2)<<8;
+ *(fb_ptr+1)=(yf[4]+yf[5])/2 | ( ((yf[6]+yf[7])/2) <<16) |
+ ((vf[2]+vf[3])/2 )<<24 | ((uf[2]+uf[3])/2)<<8;
+ fb_ptr+=2;
+ break;
+
+ case 4:
+ *(fb_ptr)=(yf[0]+yf[1]+yf[2]+yf[3])/4 | (((yf[4]+yf[5]+yf[6]+yf[7])/4)<<16) |
+ ((vf[0]+vf[1]+vf[2]+vf[3])/4 )<<24 | ((uf[0]+uf[1]+uf[2]+uf[3])/4)<<8;
+ fb_ptr+=1;
+ break;
+
+ default:
+ break;
+ }
+ }
+}
+
+static void CopyMungedScanlineFilterDown_AXP(CARD32 *fb_ptr, short src_w,
+ CARD32 *tsp1, CARD32 *tpu1, CARD32 *tpv1,
+ CARD32 *tsp2, CARD32 *tpu2, CARD32 *tpv2,
+ int beta , int xds)
+{
+ unsigned int k,y0_1,y1_1,y0_2,y1_2,u,v;
+ int yf[8], uf[4], vf[4];
+
+ for(k=src_w/8;k;k--) {
+ y0_1=*tsp1;
+ y1_1=*(tsp1+1);
+ y0_2=*tsp2;
+ y1_2=*(tsp2+1);
+ u=*tpu1;
+ v=*tpv1;
+
+ tsp1+=2; tsp2+=2; tpu1++; tpv1++;
+ yf[0] = ((y0_1&0x000000ff) + (y0_2&0x000000ff))>>8;
+ yf[1] = (((y0_1&0x0000ff00)>>8) + ((y0_2&0x0000ff00)>>8))>>8;
+ yf[2] = (((y0_1&0x00ff0000)>>16) + ((y0_2&0x00ff0000)>>16))>>8;
+ yf[3] = (((y0_1&0x000000ff)>>24) + ((y0_2&0x000000ff)>>24))>>8;
+ yf[4] = ((y1_1&0x000000ff) + (y1_2&0x000000ff))>>8;
+ yf[5] = (((y1_1&0x0000ff00)>>8) + ((y1_2&0x0000ff00)>>8))>>8;
+ yf[6] = (((y1_1&0x00ff0000)>>16) + ((y1_2&0x00ff0000)>>16))>>8;
+ yf[7] = (((y1_1&0x000000ff)>>24) + ((y1_2&0x000000ff)>>24))>>8;
+
+ *(fb_ptr)=(yf[0]) | (yf[1]<<16) |
+ (v&0x000000ff)<<24 | (u&0x000000ff)<<8;
+ *(fb_ptr+1)=(yf[2]) | (yf[3]<<16) |
+ (v&0x0000ff00)<<16 | (u&0x0000ff00);
+ *(fb_ptr+2)=(yf[4]) | (yf[5]<<16) |
+ (v&0x00ff0000)<<8 | (u&0x00ff0000)>>8;
+ *(fb_ptr+3)=(yf[6]) | (yf[7]<<16) |
+ (v&0xff000000) | (u&0xff000000)>>16;
+
+ fb_ptr+=4;
+ }
+}
+
+static void MGACopyScaledILOAD(
+ ScrnInfoPtr pScrn,
+ int id, unsigned char *buf,
+ BoxPtr pbox,
+ int width, int height, int pitch,
+ short src_x, short src_y,
+ short src_w, short src_h,
+ short drw_x, short drw_y,
+ short drw_w, short drw_h
+ )
+{
+ MGAPtr pMga = MGAPTR(pScrn);
+ CARD32 *fb_ptr;
+ unsigned char *ubuf, *vbuf, *tbuf;
+ CARD32 *pu, *pv;
+ int k,l, pl, dl, xds, yds;
+ short box_h;
+ short scr_pitch = ( pScrn->virtualX + 15) & ~15;
+
+#ifdef DEBUG_MGA2164
+ char sbuf[255];
+
+ sprintf(sbuf,"---- PBOX: x1=%d y1=%d w=%d h=%d (x2=%d y2=%d)\n",
+ pbox->x1,pbox->y1,pbox->x2-pbox->x1,pbox->y2-pbox->y1,
+ pbox->x2,pbox->y2);
+ xf86DrvMsg(pScrn->scrnIndex, X_INFO, sbuf);
+
+ sprintf(sbuf,"in src: src_x=%d src_y=%d src_w=%d src_h=%d\n",
+ src_x,src_y,src_w,src_h);
+ xf86DrvMsg(pScrn->scrnIndex, X_INFO, sbuf);
+ sprintf(sbuf,"in drw: drw_x=%d drw_y=%d drw_w=%d drw_h=%d\n",
+ drw_x,drw_y,drw_w,drw_h);
+ xf86DrvMsg(pScrn->scrnIndex, X_INFO, sbuf);
+#endif
+
+ /* scaling yuv->rgb */
+
+ /* hack to force width and src image to be 8 pixel aligned */
+ src_x&=~0x7;
+ src_w&=~0x7;
+
+ box_h=pbox->y2-pbox->y1;
+
+ /* compute X down scaling factor */
+ if(src_w>drw_w) {
+ if(src_w/2<drw_w) {
+ xds=2;
+ } else if(src_w/4<drw_w) {
+ xds=4;
+ } else { xds=8; }
+ } else xds = 1;
+
+ /* prevent crashing when dragging window outside left boundary of screen */
+ /* FIXME: need to implement per pixel left start to avoid undesired
+ effects when dragging window outside left screen boundary */
+
+ if(drw_x<0) {
+ src_x=( -(drw_x*src_w)/drw_w + 0x7)&~0x7;
+ src_w-=src_x;
+ drw_w+=drw_x;
+ drw_x=0;
+ }
+
+ src_w/=xds;
+
+ /* compute X down scaling factor */
+ if(src_h>drw_h) {
+ if(src_h/2<drw_h) {
+ yds=2;
+ } else if(src_h/4<drw_h) {
+ yds=4;
+ } else { yds=8; }
+ } else yds = 1;
+
+
+#ifdef DEBUG_MGA2164
+ char sbuf[255];
+
+ sprintf(sbuf,"---- xds = %d\n",
+ xds);
+ xf86DrvMsg(pScrn->scrnIndex, X_INFO, sbuf);
+#endif
+
+
+#ifdef DEBUG_MGA2164
+ sprintf(sbuf,"out src: src_x=%d src_y=%d src_w=%d src_h=%d\n",
+ src_x,src_y,src_w,src_h);
+ xf86DrvMsg(pScrn->scrnIndex, X_INFO, sbuf);
+ sprintf(sbuf,"out drw: drw_x=%d drw_y=%d drw_w=%d drw_h=%d\n",
+ drw_x,drw_y,drw_w,drw_h);
+ xf86DrvMsg(pScrn->scrnIndex, X_INFO, sbuf);
+#endif
+
+ CHECK_DMA_QUIESCENT(pMga, pScrn);
+
+ /* scaling ILOAD */
+
+ vbuf=buf+width*height;
+ ubuf=vbuf+width*height/4;
+ pu = (CARD32 *)(ubuf+(src_y/2)*(width/2));
+ pv = (CARD32 *)(vbuf+(src_y/2)*(width/2));
+
+ for(pl=-1,dl=0;dl<box_h;dl++) {
+ int beta;
+ l=(dl+(pbox->y1-drw_y))*src_h/drw_h;
+ /* FIXME: check the math */
+ beta = ((dl+(pbox->y1-drw_y))*src_h*0xff/drw_h) - ((dl+(pbox->y1-drw_y))*src_h/drw_h*0xff);
+
+#ifdef MGA2164_BLIT_DUP
+ if(l!=pl)
+#else
+ if(1)
+#endif
+ {
+
+ /*
+ #ifdef DEBUG_MGA2164
+ sprintf(sbuf,"new line: scr_dst %d img_src %d prev %d\n",
+ dl,l,pl);
+ xf86DrvMsg(pScrn->scrnIndex, X_INFO, sbuf);
+ #endif
+ */
+
+ OUTREG(MGAREG_DWGCTL, MGADWG_ILOAD_HIQH | MGADWG_BUYUV | MGADWG_SHIFTZERO
+ | MGADWG_SGNZERO | 0xc0000);
+
+ OUTREG(MGAREG_AR0, pbox->x1 + drw_w -1); /* SRC LINE END why -1 ? */
+ OUTREG(MGAREG_AR2, ( ( (src_w-1)<<16) / (drw_w-1)) + 1 ); /* ((SRC_X_DIM -1)<<16) / (DST_X_DIM-1) +1 */
+ OUTREG(MGAREG_AR3, pbox->x1 ); /* SRC LINE START*/
+ OUTREG(MGAREG_AR5, scr_pitch); /* DST_Y_INCR = PITCH? */
+ OUTREG(MGAREG_AR6, ((src_w-drw_w)<<16) / (drw_w-1) ); /* */
+ OUTREG(MGAREG_FXBNDRY, drw_x|((drw_x+drw_w-1)<<16) ); /* why -1 ? */
+ OUTREG(MGAREG_CXBNDRY, pbox->x1 | ((pbox->x2-1)<<16 ) );
+ OUTREG(MGAREG_YDST , pbox->y1+dl ); /* Y_START_POS */
+ OUTREG(MGAREG_LEN + MGAREG_EXEC , 1); /* # of LINES */
+
+ /* xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Data finished\n"); */
+
+ fb_ptr=(CARD32 *)pMga->ILOADBase;
+
+ switch(id) {
+ case FOURCC_YV12:
+ case FOURCC_I420:
+ tbuf=buf+(l+src_y)*width;
+ {
+ CARD32 *tpu=pu+src_x/8+l/2*width/8;
+ CARD32 *tpv=pv+src_x/8+l/2*width/8;
+ CARD32 *tsp=(CARD32 *)(tbuf+src_x), *tsp2;
+
+ if((l+src_y)<(src_h-1))
+ tsp2=(CARD32 *)(tbuf+src_x+width);
+ else
+ tsp2=(CARD32 *)(tbuf+src_x);
+
+ /* it is not clear if waiting is actually good for performance */
+ /* WAITFIFO(pMga->FifoSize);*/
+ /* should try to get MGACopyMunged data to work here */
+ /* CopyMungedScanline_AXP(fb_ptr,src_w,tsp,tpu,tpv); */
+
+ /* Filter does not work yet */
+ CopyMungedScanlineFilter_AXP(fb_ptr,src_w,tsp,tpu,tpv,tsp2,tpu,tpv, beta, xds);
+ /* if(l&1) {
+ pu+=width/8;
+ pv+=width/8;
+ } */
+ }
+ break;
+ case FOURCC_UYVY:
+ case FOURCC_YUY2:
+ tbuf=buf+(l+src_y)*width*2;
+
+#ifndef MGA2164_SWFILTER
+ WAITFIFO(pMga->FifoSize/2);
+ memcpy(fb_ptr, tbuf+src_x*2, src_w*2);
+ fb_ptr+=src_w*2; /* pointer in the pseudo dma window */
+#else
+ {
+ CARD32 *tsp=(CARD32 *)(tbuf+src_x*2), *tsp2;
+
+ if((l+src_y)<(src_h-1))
+ tsp2=(CARD32 *)(tbuf+src_x*2+width*2);
+ else
+ tsp2=(CARD32 *)(tbuf+src_x*2);
+ /* {
+ char sbuf [256];
+ sprintf(sbuf,"dst line: %d src_line: %d beta: %x\n",
+ dl, l, beta );
+ xf86DrvMsg(pScrn->scrnIndex, X_INFO, sbuf);
+ } */
+
+ WAITFIFO(pMga->FifoSize/4);
+ for(k=xds*src_w/8;k;k--) {
+ int oneminbeta = 0xff-beta;
+ int y[8], u[4], v[4], ya[4], ua[2], va[2], p;
+
+ switch(yds) {
+ case 1:
+ /* upscale y filter */
+ for(p=0;p<4;p++) {
+ y[2*p]=(((*(tsp+p)&0x000000ff))*oneminbeta+((*(tsp2+p)&0x000000ff))*beta)>>8;
+ y[2*p+1]=(((*(tsp+p)&0x00ff0000)>>16)*oneminbeta+((*(tsp2+p)&0x00ff0000)>>16)*beta)>>8;
+ u[p]=(((*(tsp+p)&0x0000ff00)>>8)*oneminbeta+((*(tsp2+p)&0x0000ff00)>>8)*beta)>>8;
+ v[p]=(((*(tsp+p)&0xff000000)>>24)*oneminbeta+((*(tsp2+p)&0xff000000)>>24)*beta)>>8;
+ }
+ break;
+ /* downscale y filter */
+ case 2:
+ case 3:
+ case 4:
+ default:
+ for(p=0;p<4;p++) {
+ y[2*p]=(((*(tsp+p)&0x000000ff)));
+ y[2*p+1]=(((*(tsp+p)&0x00ff0000)>>16));
+ u[p]=(((*(tsp+p)&0x0000ff00)>>8));
+ v[p]=(((*(tsp+p)&0xff000000)>>24));
+ }
+ break;
+ }
+
+ switch (xds) {
+ case 1: /* simple copy */
+ *(fb_ptr++)=y[0]|y[1]<<16|u[0]<<8|v[0]<<24;
+ *(fb_ptr++)=y[2]|y[3]<<16|u[1]<<8|v[1]<<24;
+ *(fb_ptr++)=y[4]|y[5]<<16|u[2]<<8|v[2]<<24;
+ *(fb_ptr++)=y[6]|y[7]<<16|u[3]<<8|v[3]<<24;
+ break;
+ case 2: /* dowscale by 2 */
+ ya[0]=(y[0]+y[1])>>1;
+ ya[1]=(y[2]+y[3])>>1;
+ ya[2]=(y[4]+y[5])>>1;
+ ya[3]=(y[6]+y[7])>>1;
+ ua[0]=(u[0]+u[1])>>1;
+ ua[1]=(u[2]+u[3])>>1;
+ va[0]=(v[0]+v[1])>>1;
+ va[1]=(v[2]+v[3])>>1;
+ *(fb_ptr++)=ya[0]|ya[1]<<16|ua[0]<<8|va[0]<<24;
+ *(fb_ptr++)=ya[2]|ya[3]<<16|ua[1]<<8|va[1]<<24;
+ break;
+ case 4: /* downscale by 4 */
+ ya[0]=(y[0]+y[1]+y[2]+y[3])>>2;
+ ya[1]=(y[4]+y[5]+y[6]+y[7])>>2;
+ ua[0]=(u[0]+u[1]+u[2]+u[3])>>2;
+ va[0]=(v[0]+v[1]+v[2]+v[3])>>2;
+ *(fb_ptr++)=ya[0]|ya[1]<<16|ua[0]<<8|va[0]<<24;
+ break;
+ case 8:
+ default:
+ break;
+ }
+
+ /* fb_ptr+=4; */
+ tsp+=4; tsp2+=4;
+ }
+ }
+#endif /* MGA2164_SWFILTER */
+ break;
+ default:
+ break;
+ }
+ pl=l;
+ } else {
+ /* dup lines */
+
+#ifdef DEBUG_MGA2164
+ sprintf(sbuf,"dup line: scr_src %d scr_dst %d\n",
+ dl-1,dl);
+ xf86DrvMsg(pScrn->scrnIndex, X_INFO, sbuf);
+#endif
+
+ OUTREG(MGAREG_DWGCTL, 0x040C6008);
+ OUTREG(MGAREG_FXBNDRY, pbox->x1|((pbox->x2-1)<<16) ); /* why -1 ? */
+ OUTREG(MGAREG_AR3, (pbox->y1+dl-1)*scr_pitch+pbox->x1 ); /* SRC LINE START*/
+ OUTREG(MGAREG_AR0, (pbox->y1+dl-1)*scr_pitch+pbox->x2 -1); /* SRC LINE END why -1 ? */
+ OUTREG(MGAREG_AR5, scr_pitch); /* DST_Y_INCR = PITCH? */
+ OUTREG(MGAREG_YDST , pbox->y1+dl); /* Y_START_POS */
+ OUTREG(MGAREG_LEN + MGAREG_EXEC , 1); /* # of LINES */
+ }
+ }
+ OUTREG(MGAREG_CXBNDRY, 0xFFFF0000);
+}
+
+static void MGACopyILOAD(
+ ScrnInfoPtr pScrn,
+ int id, unsigned char *buf,
+ BoxPtr pbox,
+ int width, int height, int pitch,
+ short src_x, short src_y,
+ short src_w, short src_h,
+ short drw_x, short drw_y,
+ short drw_w, short drw_h
+ )
+{
+ MGAPtr pMga = MGAPTR(pScrn);
+ CARD32 *fb_ptr;
+ CARD8 *ubuf, *vbuf;
+ CARD32 *pu, *pv;
+ int k,l;
+ short clip_x1, clip_x2, tmp_w;
+
+#ifdef DEBUG_MGA2164
+ char sbuf[255];
+
+ sprintf(sbuf,"---- PBOX: x1=%d y1=%d w=%d h=%d (x2=%d y2=%d)\n",
+ pbox->x1,pbox->y1,pbox->x2-pbox->x1,pbox->y2-pbox->y1,
+ pbox->x2,pbox->y2);
+ xf86DrvMsg(pScrn->scrnIndex, X_INFO, sbuf);
+
+ sprintf(sbuf,"in src: src_x=%d src_y=%d src_w=%d src_h=%d\n",
+ src_x,src_y,src_w,src_h);
+ xf86DrvMsg(pScrn->scrnIndex, X_INFO, sbuf);
+ sprintf(sbuf,"in drw: drw_x=%d drw_y=%d drw_w=%d drw_h=%d\n",
+ drw_x,drw_y,drw_w,drw_h);
+ xf86DrvMsg(pScrn->scrnIndex, X_INFO, sbuf);
+#endif
+
+ /* non-scaling yuv->rgb */
+
+ /* hack to force width and src image to be 8 pixel aligned */
+ src_x&=~0x7;
+ src_w&=~0x7;
+ drw_w&=~0x7;
+ tmp_w=drw_w;
+ clip_x1=drw_x;
+ clip_x2=drw_x+drw_w;
+
+ /* hack for clipping in non scaling version */
+ /* this works only if no scaling */
+ if(pbox->x1 > drw_x) { /* left side X clipping*/
+ src_x+=((pbox->x1-drw_x)&~0x7);
+ src_w-=((pbox->x1-drw_x)&~0x7);
+ clip_x1=pbox->x1;
+ drw_x+=src_x;
+ drw_w=src_w;
+ }
+
+ if( (pbox->x2) < (drw_x+drw_w) ) { /* right side X clipping */
+ tmp_w=( (pbox->x2) - drw_x );
+ drw_w= tmp_w & (~0x7);
+ if(drw_w!=tmp_w) drw_w+=8;
+ clip_x2=drw_x+tmp_w-1; /* not sure why needs -1 */
+ src_w=drw_w;
+ }
+
+ if(pbox->y1 > drw_y) { /* top side Y clipping */
+ src_y+=(pbox->y1-drw_y);
+ src_h-=(pbox->y1-drw_y);
+ drw_y+=src_y;
+ drw_h=src_h;
+ }
+ if((pbox->y2)<(drw_y+drw_h)) { /* bottom side Y clipping */
+ drw_h=(pbox->y2)-drw_y;
+ src_h=drw_h;
+ }
+
+ if(drw_x<0) drw_x=0;
+
+#ifdef DEBUG_MGA2164
+ sprintf(sbuf,"out src: src_x=%d src_y=%d src_w=%d src_h=%d\n",
+ src_x,src_y,src_w,src_h);
+ xf86DrvMsg(pScrn->scrnIndex, X_INFO, sbuf);
+ sprintf(sbuf,"out drw: drw_x=%d drw_y=%d drw_w=%d drw_h=%d\n",
+ drw_x,drw_y,drw_w,drw_h);
+ xf86DrvMsg(pScrn->scrnIndex, X_INFO, sbuf);
+#endif
+
+ /* ready to draw */
+ if(drw_w==0||drw_h==0) return;
+
+ if(drw_w<0||drw_h<0) {
+ /* actually until scaling is working this might happen
+ during normal operation */
+ /* sprintf(sbuf,"drw_w or drw_h are negative (this should never
+ happen)\n");
+ xf86DrvMsg(pScrn->scrnIndex, X_INFO, sbuf); */
+ return;
+ }
+
+ CHECK_DMA_QUIESCENT(pMga, pScrn);
+
+ /* non scaling ILOAD */
+ WAITFIFO(6);
+ OUTREG(MGAREG_AR5, 0);
+ OUTREG(MGAREG_DWGCTL, MGADWG_ILOAD | MGADWG_BUYUV | MGADWG_SHIFTZERO
+ | MGADWG_SGNZERO | 0xc0000);
+ OUTREG(MGAREG_AR0, (drw_w)-1 );
+ OUTREG(MGAREG_AR3, 0);
+ OUTREG(MGAREG_CXBNDRY, clip_x1|(clip_x2<<16));
+ OUTREG(MGAREG_FXBNDRY, drw_x|((drw_x+drw_w-1)<<16));
+ OUTREG(MGAREG_YDSTLEN + MGAREG_EXEC , (drw_y<<16)|drw_h);
+
+ fb_ptr=(CARD32 *)pMga->ILOADBase;
+ vbuf=buf+width*height;
+ ubuf=vbuf+width*height/4;
+
+ switch(id) {
+ case FOURCC_YV12:
+ case FOURCC_I420:
+ pu = (CARD32 *)(ubuf+(src_y/2)*(width/2));
+ pv = (CARD32 *)(vbuf+(src_y/2)*(width/2));
+ buf+=src_y*width;
+
+ for(l=0;l<drw_h;l++) {
+ CARD32 *tpu=pu+src_x/8;
+ CARD32 *tpv=pv+src_x/8;
+ CARD32 *tsp=(CARD32 *)(buf+src_x);
+
+ /* it is not clear if waiting is actually good for performance */
+ /* WAITFIFO(pMga->FifoSize);*/
+ /* should try to get MGACopyMunged data to work here */
+ CopyMungedScanline_AXP(fb_ptr,src_w,tsp,tpu,tpv);
+ buf+=width;
+ if(l&1) {
+ pu+=width/8;
+ pv+=width/8;
+ }
+ }
+ break;
+ case FOURCC_UYVY:
+ case FOURCC_YUY2:
+ buf+=src_y*width*2;
+ for(l=0;l<drw_h;l++) {
+
+#ifndef CUSTOM_MEMCOPY
+ WAITFIFO(pMga->FifoSize/2); /* not sure what's the value for best performance */
+ memcpy(fb_ptr, buf+src_x*2, src_w*2);
+ fb_ptr+=src_w*2;
+#else
+ CARD32 *tsp=(CARD32 *)(buf+src_x*2);
+ WAITFIFO(pMga->FifoSize/4);
+ for(k=src_w/8;k;k--) {
+ *(fb_ptr)=*(tsp);
+ *(fb_ptr+1)=*(tsp+1);
+ *(fb_ptr+2)=*(tsp+2);
+ *(fb_ptr+3)=*(tsp+3);
+ fb_ptr+=4; tsp+=4;
+ }
+#endif /* CUSTOM_MEMCOPY */
+ buf+=width*2;
+ }
+ break;
+ default:
+ break;
+ }
+ OUTREG(MGAREG_CXBNDRY, 0xFFFF0000); /* put clipping back to normal */
+}
+
+static int
+MGAPutImageILOAD(
+ ScrnInfoPtr pScrn,
+ short src_x, short src_y,
+ short drw_x, short drw_y,
+ short src_w, short src_h,
+ short drw_w, short drw_h,
+ int id, unsigned char* buf,
+ short width, short height,
+ Bool Sync,
+ RegionPtr clipBoxes, pointer data,
+ DrawablePtr pDraw
+ ){
+ MGAPtr pMga = MGAPTR(pScrn);
+ MGAPortPrivPtr pPriv = pMga->portPrivate;
+ INT32 x1, x2, y1, y2;
+ int dstPitch = 0;
+ int bpp;
+ BoxRec dstBox;
+ int nbox;
+ BoxPtr pbox;
+
+ /* Clip */
+ x1 = src_x; x2 = src_x + src_w;
+ y1 = src_y; y2 = src_y + src_h;
+
+ dstBox.x1 = drw_x; dstBox.x2 = drw_x + drw_w;
+ dstBox.y1 = drw_y; dstBox.y2 = drw_y + drw_h;
+
+ if(!xf86XVClipVideoHelper(&dstBox, &x1, &x2, &y1, &y2,
+ clipBoxes, width, height))
+ return Success;
+
+ bpp = pScrn->bitsPerPixel >> 3;
+
+ if( pMga->AccelInfoRec->NeedToSync && ((long)data != pPriv->lastPort) ) {
+ MGAStormSync(pScrn);
+ }
+
+ pPriv->lastPort = (long)data;
+ nbox=REGION_NUM_RECTS(clipBoxes);
+ pbox=REGION_RECTS(clipBoxes);
+
+ while(nbox--) {
+
+ if ( (drw_w==src_w) && (drw_h==src_h) && (drw_x >= 0 ) ) {
+ /* special case 1: non scaling optimization */
+ MGACopyILOAD(pScrn,id,buf,pbox,
+ width, height, dstPitch, src_x, src_y, src_w, src_h,
+ drw_x, drw_y, drw_w, drw_h);
+#if 0
+ } else if ( (drw_w>src_w) && (drw_h>src_h) && (drw_x >= 0 ) ) {
+ /* special case 2: upscaling for full screen apps */
+ /* FIXME: to do */
+ MGACopyScaledILOAD(pScrn,id,buf,pbox,
+ width, height, dstPitch, src_x, src_y, src_w, src_h,
+ drw_x, drw_y, drw_w, drw_h);
+
+#endif
+ } else /* generic fallback case */
+ MGACopyScaledILOAD(pScrn,id,buf,pbox,
+ width, height, dstPitch, src_x, src_y, src_w, src_h,
+ drw_x, drw_y, drw_w, drw_h);
+ /* FIXME: when the generic is perfect I will enable the optimizations */
+ pbox++;
+ }
+
+
+ pMga->AccelInfoRec->NeedToSync = TRUE;
+ pPriv->videoStatus = FREE_TIMER;
+ pPriv->freeTime = currentTime.milliseconds + FREE_DELAY;
+ pMga->VideoTimerCallback = MGAVideoTimerCallback;
+
+ return Success;
+}
diff --git a/driver/xf86-video-mga/util/Makefile.in b/driver/xf86-video-mga/util/Makefile.in
index 957449d6b..2ac4f86d8 100644
--- a/driver/xf86-video-mga/util/Makefile.in
+++ b/driver/xf86-video-mga/util/Makefile.in
@@ -100,6 +100,7 @@ DRI_CFLAGS = @DRI_CFLAGS@
DRI_FALSE = @DRI_FALSE@
DRI_LIBS = @DRI_LIBS@
DRI_TRUE = @DRI_TRUE@
+DSYMUTIL = @DSYMUTIL@
ECHO = @ECHO@
ECHO_C = @ECHO_C@
ECHO_N = @ECHO_N@
@@ -128,6 +129,7 @@ MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@
MAKEINFO = @MAKEINFO@
MISC_MAN_DIR = @MISC_MAN_DIR@
MISC_MAN_SUFFIX = @MISC_MAN_SUFFIX@
+NMEDIT = @NMEDIT@
OBJEXT = @OBJEXT@
PACKAGE = @PACKAGE@
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
@@ -136,8 +138,11 @@ PACKAGE_STRING = @PACKAGE_STRING@
PACKAGE_TARNAME = @PACKAGE_TARNAME@
PACKAGE_VERSION = @PACKAGE_VERSION@
PATH_SEPARATOR = @PATH_SEPARATOR@
+PCIACCESS_CFLAGS = @PCIACCESS_CFLAGS@
+PCIACCESS_LIBS = @PCIACCESS_LIBS@
PKG_CONFIG = @PKG_CONFIG@
RANLIB = @RANLIB@
+SED = @SED@
SET_MAKE = @SET_MAKE@
SHELL = @SHELL@
STRIP = @STRIP@
@@ -148,10 +153,14 @@ USE_XAA_TRUE = @USE_XAA_TRUE@
VERSION = @VERSION@
XORG_CFLAGS = @XORG_CFLAGS@
XORG_LIBS = @XORG_LIBS@
+XSERVER_LIBPCIACCESS_FALSE = @XSERVER_LIBPCIACCESS_FALSE@
+XSERVER_LIBPCIACCESS_TRUE = @XSERVER_LIBPCIACCESS_TRUE@
ac_ct_AR = @ac_ct_AR@
ac_ct_CC = @ac_ct_CC@
ac_ct_CXX = @ac_ct_CXX@
+ac_ct_DSYMUTIL = @ac_ct_DSYMUTIL@
ac_ct_F77 = @ac_ct_F77@
+ac_ct_NMEDIT = @ac_ct_NMEDIT@
ac_ct_RANLIB = @ac_ct_RANLIB@
ac_ct_STRIP = @ac_ct_STRIP@
ac_pt_PKG_CONFIG = @ac_pt_PKG_CONFIG@
diff --git a/driver/xf86-video-mga/util/stormdwg.c b/driver/xf86-video-mga/util/stormdwg.c
index 8f04e0eb8..99f76cce9 100644
--- a/driver/xf86-video-mga/util/stormdwg.c
+++ b/driver/xf86-video-mga/util/stormdwg.c
@@ -7,7 +7,7 @@
#include <stdio.h>
#include <stdlib.h>
-char *opcodes[] = {
+const char *opcodes[] = {
"line_open", /* 0000 */
"autoline_open", /* 0001 */
"line_close", /* 0010 */
@@ -29,7 +29,7 @@ char *opcodes[] = {
"iload filter" /* 1111 */
};
-char *atype[] = {
+const char *atype[] = {
"rpl - Write (Replace)", /* 000 */
"rstr - read-modify-write (raster)", /* 001 */
"reserved", /* 010 */
@@ -40,7 +40,7 @@ char *atype[] = {
"I - Gouraud (with depth compare)" /* 111 */
};
-char *zmode[] = {
+const char *zmode[] = {
"NOZCMP - always", /* 000 */
"reserved", /* 001 */
"ZE - depth =", /* 010 */
@@ -51,7 +51,7 @@ char *zmode[] = {
"zgte" /* 111 */
};
-char *bop[] = {
+const char *bop[] = {
"0", /* 0000 */
"~(D|S)", /* 0001 */
"D & ~S", /* 0010 */
@@ -73,7 +73,7 @@ char *bop[] = {
"1" /* 1111 */
};
-char *bitmod[] = {
+const char *bitmod[] = {
"BMONOLEF - Source is mono, or if iload, source is little endian", /* 0000 */
"BPLAN - source is mono from one plane", /* 0001 */
"BFCOL - source is colour, and is formatted from host", /* 0010 */