[gtkada] patch to support Mac OS X
jim hopper
hopperj at macconnect.com
Tue Dec 16 02:51:04 CET 2003
This patch will probably break other versions. i have minimized this
where i know how but there are a couple places that i don't know how to
branch.
1. -shared is used in a couple of link lines. since so_opts is used in
every case it is, and so_opts can be set up to do port specific things
(i added darwin branch for the mac stuff). is it possible to move that
to there?
2. i added ...CFLAGS = -fno-common ... and .. GNATFLAGS = -fno-common
and ..GNATFLAGS_DEVEL = -fno-common..
in most of the make files I don't know how to special case this so
only darwin sees it.
3. is added ! GTK_LIBS = @GTK_LIBS@ -L/usr/X11R6/lib -lX11
-flat_namespace -undefined suppress again i don't know how to make that
darwin specific.
there are a couple other cases like this. if any of the maintainers
would be willing to work with me, i would be glad to try to get this
patch into shape so it could be integrated with the main line so os
x/darwin could be a fully supported platform. i have written a number
of projects with it for my work and it works very well on os x, and
makes projects that i can build on both os x and linux easily.
best jim
full patch file as it exists now (i hand edited a couple of things that
shouldnt have been there out but it should still be correct ;-))
*** ../GtkAda.orig/configure Wed Dec 10 19:22:21 2003
--- configure Fri Dec 12 11:57:25 2003
***************
*** 1420,1425 ****
--- 1420,1429 ----
BUILD_SHARED=no
FPIC=
;;
+ *darwin*)
+ SO_EXT=.dylib
+ SO_OPTS="-dynamiclib -compatibility_version 2.2.2
-current_version 2.2.2 -install_name @prefix@/lib/"
+ ;;
esac
*** ../GtkAda.orig/config.guess Wed Dec 10 19:22:21 2003
--- config.guess Thu Dec 11 22:11:45 2003
***************
*** 205,210 ****
--- 205,213 ----
*:IRIX*:*:*)
echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'`
exit 0 ;;
+ Power*:Darwin*:*:*)
+ echo powerpc-apple-darwin${UNAME_RELEASE}
+ exit 0 ;;
????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX.
echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id
exit 0 ;; # Note that: echo "'`uname -s`'" gives 'AIX '
*** ../GtkAda.orig/config.sub Wed Dec 10 19:22:21 2003
--- config.sub Thu Dec 11 22:11:45 2003
***************
*** 94,101 ****
-convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\
-c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti*
| \
-harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \
! -apple)
! os=
basic_machine=$1
;;
-hiux*)
--- 94,100 ----
-convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\
-c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti*
| \
-harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \
! -apple*)
basic_machine=$1
;;
-hiux*)
***************
*** 481,486 ****
--- 480,488 ----
;;
power) basic_machine=rs6000-ibm
;;
+ powerpc)
+ basic_machine=powerpc-apple
+ ;;
ppc) basic_machine=powerpc-unknown
;;
ppc-*) basic_machine=powerpc-`echo $basic_machine | sed
's/^[^-]*-//'`
***************
*** 689,695 ****
| -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \
| -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
| -cygwin32* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
! | -linux-gnu* | -uxpv* | -mingw32* )
# Remember, each alternative MUST END IN *, to match a version
number.
;;
-linux*)
--- 691,697 ----
| -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \
| -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
| -cygwin32* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
! | -linux-gnu* | -uxpv*)
# Remember, each alternative MUST END IN *, to match a version
number.
;;
-linux*)
***************
*** 750,760 ****
-xenix)
os=-xenix
;;
-none)
;;
*)
# Get rid of the `-' at the beginning of $os.
! os=`echo $os | sed 's/[^-]*-//'`
echo Invalid configuration \`$1\': system \`$os\' not recognized
1>&2
exit 1
;;
--- 752,764 ----
-xenix)
os=-xenix
;;
+ -darwin*)
+ ;;
-none)
;;
*)
# Get rid of the `-' at the beginning of $os.
! #os=`echo $os | sed 's/[^-]*-//'`
echo Invalid configuration \`$1\': system \`$os\' not recognized
1>&2
exit 1
;;
***************
*** 868,873 ****
--- 872,881 ----
f301-fujitsu)
os=-uxpv
;;
+ ppc-darwin)
+ os=-darwin
+ basic-machine=powerpc-apple
+ ;;
*)
os=-none
;;
*** ../GtkAda.orig/src/Makefile.in Wed Dec 10 19:22:20 2003
--- src/Makefile.in Fri Dec 12 10:08:06 2003
***************
*** 12,18 ****
MAKE_ADB = make_gtk
! CFLAGS = -DG_DISABLE_ASSERT -DG_DISABLE_CHECKS
-DG_DISABLE_CAST_CHECKS \
@CFLAGS@ -Wall @GTK_CFLAGS@ -I.. $(FPIC)
GNATMAKEBINDFLAGS =
--- 12,18 ----
MAKE_ADB = make_gtk
! CFLAGS = -fno-common -DG_DISABLE_ASSERT -DG_DISABLE_CHECKS
-DG_DISABLE_CAST_CHECKS \
@CFLAGS@ -Wall @GTK_CFLAGS@ -I.. $(FPIC)
GNATMAKEBINDFLAGS =
***************
*** 33,39 ****
INSTALL_SCRIPT = @INSTALL_SCRIPT@
LIBNAME = libgtkada$(SO_EXT)
! SONAME = libgtkada-$(MAJOR).$(MINOR)$(SO_EXT).$(MICRO)
ARCHIVENAME = libgtkada.a
GTKADA_CONFIG = gtkada-config
--- 33,39 ----
INSTALL_SCRIPT = @INSTALL_SCRIPT@
LIBNAME = libgtkada$(SO_EXT)
! SONAME = libgtkada-$(MAJOR).$(MINOR).$(MICRO)$(SO_EXT)
ARCHIVENAME = libgtkada.a
GTKADA_CONFIG = gtkada-config
***************
*** 81,87 ****
$(LIBNAME):: $(LIB_DIR)/$(MAKE_ADB).o ${wildcard ${LIB_DIR}/*.o}
$(c_objects)
ifeq ($(BUILD_SHARED),yes)
! $(CC) -shared $(FPIC) $(OS_SPECIFIC_LINK_OPTIONS) -o $(SONAME) \
$(SO_OPTS)$(SONAME) $(LIB_DIR)/glib*.o $(LIB_DIR)/gdk*.o \
$(LIB_DIR)/gtk*.o $(LIB_DIR)/pango*.o \
$(c_objects) $(c_extra_objects) $(GTK_LIBS)
--- 81,87 ----
$(LIBNAME):: $(LIB_DIR)/$(MAKE_ADB).o ${wildcard ${LIB_DIR}/*.o}
$(c_objects)
ifeq ($(BUILD_SHARED),yes)
! $(CC) $(FPIC) $(OS_SPECIFIC_LINK_OPTIONS) -o $(SONAME) \
$(SO_OPTS)$(SONAME) $(LIB_DIR)/glib*.o $(LIB_DIR)/gdk*.o \
$(LIB_DIR)/gtk*.o $(LIB_DIR)/pango*.o \
$(c_objects) $(c_extra_objects) $(GTK_LIBS)
*** ../GtkAda.orig/src/Makefile.common.in Wed Dec 10 19:22:20 2003
--- src/Makefile.common.in Thu Dec 11 23:23:52 2003
***************
*** 1,8 ****
CC = @CC@
FPIC = @FPIC@
! GNATFLAGS = -O2 -gnatn -gnatws
! GNATFLAGS_DEVEL = -O2 -gnatag -gnatwlrkmj -g
GNATMAKE = gnatmake
OS_SPECIFIC_LINK_OPTIONS = @OS_SPECIFIC_LINK_OPTIONS@
--- 1,8 ----
CC = @CC@
FPIC = @FPIC@
! GNATFLAGS = -fno-common -O2 -gnatn -gnatws
! GNATFLAGS_DEVEL = -fno-common -O2 -gnatag -gnatwlrkmj -g
GNATMAKE = gnatmake
OS_SPECIFIC_LINK_OPTIONS = @OS_SPECIFIC_LINK_OPTIONS@
***************
*** 12,18 ****
MAJOR = @GTKADA_MAJOR_VERSION@
MINOR = @GTKADA_MINOR_VERSION@
MICRO = @GTKADA_MICRO_VERSION@
! GTK_LIBS = @GTK_LIBS@
CP = cp -p -f
LN = ln -f -s
--- 12,18 ----
MAJOR = @GTKADA_MAJOR_VERSION@
MINOR = @GTKADA_MINOR_VERSION@
MICRO = @GTKADA_MICRO_VERSION@
! GTK_LIBS = @GTK_LIBS@ -L/usr/X11R6/lib -lX11 -flat_namespace
-undefined suppress
CP = cp -p -f
LN = ln -f -s
*** ../GtkAda.orig/src/gnome/Makefile.in Wed Dec 10 19:22:20 2003
--- src/gnome/Makefile.in Fri Dec 12 10:07:37 2003
***************
*** 1,7 ****
include ../Makefile.common
LIBNAME = libgnomeada$(SO_EXT)
! SONAME = libgnomeada-$(MAJOR).$(MINOR)$(SO_EXT).$(MICRO)
ARCHIVENAME = libgnomeada.a
GNOME_LIBS = @GNOME_LIBS@
HAVE_GNOME = @HAVE_GNOME@
--- 1,7 ----
include ../Makefile.common
LIBNAME = libgnomeada$(SO_EXT)
! SONAME = libgnomeada-$(MAJOR).$(MINOR).$(MICRO)$(SO_EXT)
ARCHIVENAME = libgnomeada.a
GNOME_LIBS = @GNOME_LIBS@
HAVE_GNOME = @HAVE_GNOME@
***************
*** 33,39 ****
$(LIBNAME): gnome
ifeq ($(BUILD_SHARED),yes)
! $(CC) -shared $(FPIC) $(OS_SPECIFIC_LINK_OPTIONS) -o $(SONAME) \
$(SO_OPTS)$(SONAME) gnome.o gnome-*.o bonobo*.o \
$(GTK_LIBS) $(GNOME_LIBS)
$(RM) $(LIBNAME)
--- 33,39 ----
$(LIBNAME): gnome
ifeq ($(BUILD_SHARED),yes)
! $(CC) $(FPIC) $(OS_SPECIFIC_LINK_OPTIONS) -o $(SONAME) \
$(SO_OPTS)$(SONAME) gnome.o gnome-*.o bonobo*.o \
$(GTK_LIBS) $(GNOME_LIBS)
$(RM) $(LIBNAME)
*** ../GtkAda.orig/src/gtkextra/Makefile.in Wed Dec 10 19:22:20 2003
--- src/gtkextra/Makefile.in Thu Dec 11 22:40:47 2003
***************
*** 9,15 ****
CC=@CC@
FPIC=@FPIC@
CFLAGS=@CFLAGS@
! ALL_CFLAGS=$(CFLAGS) @GTK_CFLAGS@ $(FPIC)
all: gtkextra-marshal.h gtkextra-marshal.c $(OBJ)
--- 9,15 ----
CC=@CC@
FPIC=@FPIC@
CFLAGS=@CFLAGS@
! ALL_CFLAGS=$(CFLAGS) -fno-common @GTK_CFLAGS@ $(FPIC)
all: gtkextra-marshal.h gtkextra-marshal.c $(OBJ)
*** ../GtkAda.orig/src/opengl/Makefile.in Wed Dec 10 19:22:20 2003
--- src/opengl/Makefile.in Fri Dec 12 10:07:21 2003
***************
*** 7,15 ****
include ../Makefile.common
! CFLAGS = @CFLAGS@ -Wall @GTK_CFLAGS@ -I. $(FPIC)
! SONAME = libgtkada_gl-$(MAJOR).$(MINOR)$(SO_EXT).$(MICRO)
LIBNAME = libgtkada_gl$(SO_EXT)
ARCHIVENAME = libgtkada_gl.a
INSTALL = @INSTALL@
--- 7,15 ----
include ../Makefile.common
! CFLAGS = @CFLAGS@ -fno-common -Wall @GTK_CFLAGS@ -I. $(FPIC)
! SONAME = libgtkada_gl-$(MAJOR).$(MINOR).$(MICRO)$(SO_EXT)
LIBNAME = libgtkada_gl$(SO_EXT)
ARCHIVENAME = libgtkada_gl.a
INSTALL = @INSTALL@
***************
*** 57,65 ****
endif
$(LIBNAME):: $(OPENGL_OBJECTS) $(OPENGL_C_OBJECTS)
! $(CC) -shared $(FPIC) $(OS_SPECIFIC_LINK_OPTIONS) -o $(SONAME) \
$(SO_OPTS)$(SONAME) $(OPENGL_OBJECTS) $(OPENGL_C_OBJECTS) \
! @GTK_LIBS@ -L.. -lgtkada $(OPENGL_LIBS)
$(RM) $(LIBNAME)
$(LN) $(SONAME) $(LIBNAME)
- at if [ ! -f ../.devel ]; then \
--- 57,65 ----
endif
$(LIBNAME):: $(OPENGL_OBJECTS) $(OPENGL_C_OBJECTS)
! $(CC) $(FPIC) $(OS_SPECIFIC_LINK_OPTIONS) -o $(SONAME) \
$(SO_OPTS)$(SONAME) $(OPENGL_OBJECTS) $(OPENGL_C_OBJECTS) \
! @GTK_LIBS@ -L.. -lgtkada $(OPENGL_LIBS) -L/usr/X11R6/lib -lX11
-flat_namespace -undefined suppress
$(RM) $(LIBNAME)
$(LN) $(SONAME) $(LIBNAME)
- at if [ ! -f ../.devel ]; then \
*** ../GtkAda.orig/src/glade/Makefile.in Wed Dec 10 19:22:20 2003
--- src/glade/Makefile.in Fri Dec 12 10:07:44 2003
***************
*** 7,13 ****
include ../Makefile.common
! SONAME = libgtkada_glade-$(MAJOR).$(MINOR)$(SO_EXT).$(MICRO)
LIBNAME = libgtkada_glade$(SO_EXT)
ARCHIVENAME = libgtkada_glade.a
INSTALL = @INSTALL@
--- 7,13 ----
include ../Makefile.common
! SONAME = libgtkada_glade-$(MAJOR).$(MINOR).$(MICRO)$(SO_EXT)
LIBNAME = libgtkada_glade$(SO_EXT)
ARCHIVENAME = libgtkada_glade.a
INSTALL = @INSTALL@
***************
*** 18,24 ****
ifeq ($(HAVE_LIBGLADE),True)
LIBGLADE_SOURCES=glade.adb glade-xml.adb
LIBGLADE_OBJECTS=glade.o glade-xml.o
! LIBGLADE_LIBS=@LIBGLADE_LIBS@
all: $(LIBNAME) $(ARCHIVENAME)
install: all
--- 18,24 ----
ifeq ($(HAVE_LIBGLADE),True)
LIBGLADE_SOURCES=glade.adb glade-xml.adb
LIBGLADE_OBJECTS=glade.o glade-xml.o
! LIBGLADE_LIBS=@LIBGLADE_LIBS@ -L/usr/X11R6/lib -lX11 -flat_namespace
-undefined suppress
all: $(LIBNAME) $(ARCHIVENAME)
install: all
***************
*** 41,47 ****
$(LIBNAME): $(LIBGLADE_OBJECTS)
$(CC) -shared -fPIC $(OS_SPECIFIC_LINK_OPTIONS) -o $(SONAME) \
! $(SO_OPTS)$(SONAME) $(LIBGLADE_OBJECTS) $(LIBGLADE_LIBS) @GTK_LIBS@
$(RM) $(LIBNAME)
$(LN) $(SONAME) $(LIBNAME)
- at if [ ! -f ../.devel ]; then \
--- 41,47 ----
$(LIBNAME): $(LIBGLADE_OBJECTS)
$(CC) -shared -fPIC $(OS_SPECIFIC_LINK_OPTIONS) -o $(SONAME) \
! $(SO_OPTS)$(SONAME) $(LIBGLADE_OBJECTS) $(LIBGLADE_LIBS)
@GTK_LIBS@ -L/usr/X11R6/lib -lX11 -flat_namespace -undefined suppress
$(RM) $(LIBNAME)
$(LN) $(SONAME) $(LIBNAME)
- at if [ ! -f ../.devel ]; then \
*** ../GtkAda.orig/testgtk/Makefile.in Wed Dec 10 19:22:21 2003
--- testgtk/Makefile.in Fri Dec 12 14:01:19 2003
***************
*** 64,70 ****
opengl/view_gl.gpb opengl/view_gl.adb
lw.o: opengl/lw.c opengl/lw.h
! $(CC) -c opengl/lw.c -Iopengl @GTK_CFLAGS@
install: all
$(MKDIR) $(examples)
--- 64,70 ----
opengl/view_gl.gpb opengl/view_gl.adb
lw.o: opengl/lw.c opengl/lw.h
! $(CC) -c opengl/lw.c -I/usr/X11R6/include -Iopengl @GTK_CFLAGS@
install: all
$(MKDIR) $(examples)
More information about the gtkada
mailing list