[AWS] AWS on Mac OS X
John B. Matthews
trashgod at gmail.com
Wed Oct 24 21:22:27 CEST 2007
I've made some progress in building shared libraries for AWS on Mac
OS X 10.4.10 using GNAT 4.3. As expected, the typical (unstriped)
binary went from nearly 4MB to under 70KB. Several problems arose,
and the proposed solutions require further refinement. As the matter
interests both groups, I have taken the liberty of cross-posting. I
would welcome discussion:
0. Set SHARED = true in makefile.conf.
1. Set SOEXT = .dylib for Darwin in makefile. [diff below]
2. The gcc option -fno-common is required. I put it in the Compiler's
Global_Options in shared.gpr. I don't yet understand .gpr well enough
to special case Darwin; can anyone offer guidance? [diff below]
3. At several points, I had to manually copy the shared libs from the
obj directory (where they had been built) to the corresponding lib
directory:
cp .build/release/ssl/obj/libaws_ssl.dylib .build/release/ssl/lib/.
cp .build/release/include/obj/libaws_include.dylib .build/release/
include/lib/.
cp .build/release/obj/libaws.dylib .build/release/lib/.
4. To build the demos, I added the working library directories to the
DYLD_LIBRARY_PATH:
export DYLD_LIBRARY_PATH=\
/usr/local/ada-4.3/lib/gcc/powerpc-apple-darwin8/4.3.0/adalib:\
~/src/ada/AWS/.build/release/lib:\
~/src/ada/AWS/.build/release/ssl/lib:\
~/src/ada/AWS/.build/release/include/lib
After installation, the path was much simpler:
export DYLD_LIBRARY_PATH=\
/usr/local/ada-4.3/lib/gcc/powerpc-apple-darwin8/4.3.0/adalib:\
/usr/local/ada-4.3/lib
5. Building the documentation depends on unicode.ads:
export ADA_INCLUDE_PATH=/opt/gtk/include/gtkada
John
--
John B. Matthews
trashgod at gmail dot com
http://home.woh.rr.com/jbmatthews/
$ svn diff makefile shared.gpr
Index: makefile
===================================================================
--- makefile (revision 118580)
+++ makefile (working copy)
@@ -41,6 +41,10 @@
EXEEXT =
endif
+ifeq ($(UNAME), Darwin)
+SOEXT = .dylib
+endif
+
ifeq ($(DEBUG), true)
MAKE_OPT =
BDIR = .build/debug
Index: shared.gpr
===================================================================
--- shared.gpr (revision 118580)
+++ shared.gpr (working copy)
@@ -90,7 +90,7 @@
-- Compiler --
--------------
- Global_Options := ("");
+ Global_Options := ("-fno-common");
-- Options used for all Ada units in both Debug and Release modes
Common_Options :=
More information about the AWS
mailing list