#path to Inno Setup 5 compiler
ISCC=ISCC.exe
PACKAGE_WIN32_FILELIST=$(PACKAGE)-win32.filelist
-PACKAGE_BUNDLE_FILE=$(top_srcdir)/build/macos/reltime.bundle
+PACKAGE_BUNDLE_FILE=$(top_srcdir)/build/macos/$(PACKAGE).bundle
EXTRA_DIST = config.rpath BUGS linphone.kdevelop \
intltool-extract.in \
LINPHONE_INSTALL_PREFIX=$(INSTALLDIR_WITH_PREFIX) \
LIBLINPHONE_INSTALL_PREFIX=$(INSTALLDIR_WITH_PREFIX) \
ige-mac-bundler $(PACKAGE_BUNDLE_FILE)
+ cd $$HOME/Desktop && zip -r Linphone-$(VERSION).app.zip $$HOME/Desktop/Linphone.app
-Compiling linphone on macos X
+**********************************
+* Compiling linphone on macos X *
+**********************************
+
+
+You have two options: using gtk-osx framework (http://gtk-osx.sourceforge.net/) which results in a Linphone GTK well integrated into Mac OS
+environment. The other option is using MacPort, in which case Linphone will run as an X11 application inside Mac OS.
+
+At the date of March 25, 2011, no video support is available yet.
+
+
+Compiling using gtk-osx
+=======================
+
+Requirements:
+* gtk-osx framework
+* xcode (for gcc)
+* macport (to retrieve dependencies easily, such as libosip2, libeXosip2, libspeex
+* linphone git tree
+
+Steps:
+
+- Install gtk-osx jhbuild environment as described at
+http://sourceforge.net/apps/trac/gtk-osx/wiki/Build
+It will build gtk for osx as well as many dependencies.
+
+- Install ige-mac-bundler following instructions here (git clone method is preferred):
+http://sourceforge.net/apps/trac/gtk-osx/wiki/Bundle
+
+- Install some linphone dependencies with macports
+ $ port install speex-dev
+ $ port install osip2
+ $ port install eXosip2
+
+- Now you can compile linphone
+
+$ jhbuild shell
+$ PKG_CONFIG_PATH=$HOME/gtk/inst/lib/pkgconfig:/opt/local/lib/pkgconfig/ ./configure --disable-video --disable-strict
+$ make
+
+- You can generate a bundle using
+$ make bundle
+
+The bundle is generated in ~/Desktop/Linphone and can safely be exported to other places and computers.
+
+
+Compiling using MacPort
+=======================
This procedure works for audio, video still not fully supported.
It was tested on macos X (leopard) on september 2009.
- gettext
- intltool
- gtk2
- - libglade2
- speex-dev
- osip2
- eXosip2
* install to /opt/local
sudo make install
-*********************
-Using gtk-osx (jhbuild environnment)
-
-After installing jhbuild and get gtk built,
-
-$ jhbuild shell
-
-$ PKG_CONFIG_PATH=$HOME/gtk/inst/lib/pkgconfig:/opt/local/lib/pkgconfig/ ./configure --disable-video --disable-strict
export EXTRA_ARGS="--workdir $bundle_res"
-unset GDK_PIXBUF_MODULE_FILE
+
</binary>
<binary>
- ${prefix}/lib/gdk-pixbuf-2.0/*
+ ${prefix}/lib/gdk-pixbuf-2.0
</binary>
<!-- Copy in GTK+ theme engines. Note the use of the
"dest" property. The destination must then start with the macro
"${bundle}", which refers to the bundle root directory.
-->
- <data dest="${bundle}/Contents/Resources/share/linphone">
- ${prefix:linphone}/share/*
+ <data>
+ ${prefix:linphone}/share
</data>
<!-- Copy in the themes data. You may want to trim this to save space
theme of choice if they provide and example, or you can just
change the source path. -->
- <!--data dest="${bundle}/Contents/Resources/etc/${gtkdir}/gtkrc">
- ${project}/src/gtkrc
- </data-->
+ <data dest="${bundle}/Contents/Resources/etc/${gtkdir}/gtkrc">
+ ${project}/../../gtk/gtkrc.mac
+ </data>
<data dest="${bundle}/Contents/Resources/share/sounds/linphone">
${prefix:linphone}/share/sounds/linphone/
*darwin*)
dnl use macport installation
ACLOCAL_MACOS_FLAGS="-I /opt/local/share/aclocal"
+ build_macos=yes
;;
esac
if test "$gtk_ui" = "true" ; then
PKG_CHECK_MODULES(LIBGTK, gtk+-2.0 >= 2.4.0 gthread-2.0)
- AC_SUBST(LIBGTK_CFLAGS)
- AC_SUBST(LIBGTK_LIBS)
+ if test "$build_macos" = "yes" ; then
+ PKG_CHECK_MODULES(LIBGTKMAC,[ige-mac-integration >= 0.9.7 ])
+ fi
else
echo "GTK interface compilation is disabled."
fi
AC_DEFINE_UNQUOTED(LINPHONE_CONFIG_DIR,"$configdir",[Windows appdata subdir where linphonerc can be found])
-AC_ARG_ENABLE(manual,
- [ --disable-manual Do not attempt to build html linphone's user documentation],
+AC_ARG_ENABLE(relativeprefix,
+ [ --enable-relativeprefix Build a linphone that finds its resources relatively to the directory where it is installed],
[case "${enableval}" in
- yes) build_manual=yes ;;
- no) build_manual=false ;;
- *) AC_MSG_ERROR(bad value ${enableval} for --enable-manual) ;;
- esac],[build_manual=yes])
+ yes) relativeprefix=yes ;;
+ no) relativeprefix=no ;;
+ *) AC_MSG_ERROR(bad value ${enableval} for --enable-relativeprefix) ;;
+ esac],[relativeprefix=auto])
AC_ARG_ENABLE(date,
[ --enable-date Use build date in internal version number],
package_prefix=${prefix}
fi
-if test x$mingw_found = xyes ; then
-dnl allow binaries to install everywhere
-package_prefix="."
+
+
+if test "$relativeprefix" = "auto" ; then
+ case $target_os in
+ *darwin*)
+ relativeprefix=yes
+ ;;
+ *mingw*)
+ relativeprefix=yes
+ ;;
+ esac
+fi
+
+if test "$relativeprefix" = "yes" ; then
+ dnl allow binaries to install everywhere
+ package_prefix="."
fi
dnl Set PACKAGE_LOCALE_DIR in config.h.
linphone.iss \
$(LINPHONE_ICO_RC_FILE) \
$(LINPHONE_ICO_FILE)
-
+ gtkrc \
+ gtkrc.mac
if BUILD_GTK_UI
linphone_LDADD=$(ORTP_LIBS) \
$(MEDIASTREAMER_LIBS) \
$(top_builddir)/coreapi/liblinphone.la \
- $(LIBGTK_LIBS) $(INTLLIBS)
+ $(LIBGTK_LIBS) $(LIBGTKMAC_LIBS) $(INTLLIBS)
if BUILD_WIN32
AM_CFLAGS= -DIN_LINPHONE -I$(top_srcdir)/coreapi/ \
$(MEDIASTREAMER_CFLAGS) \
$(ORTP_CFLAGS) \
- $(STRICT_OPTIONS) $(LIBGTK_CFLAGS) $(IPV6_CFLAGS) \
- $(OSIP_CFLAGS)
+ $(STRICT_OPTIONS) $(LIBGTK_CFLAGS) $(LIBGTKMAC_CFLAGS) $(IPV6_CFLAGS)
version_date.h: $(top_srcdir)/configure.ac
--- /dev/null
+include "../../share/themes/Mac4Lin_GTK_Aqua_v1.0/gtk-2.0/gtkrc"
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
-//#define USE_LIBGLADE 1
#define VIDEOSELFVIEW_DEFAULT 1
#include "lpconfig.h"
-
-#ifdef USE_LIBGLADE
-#include <glade/glade.h>
-#endif
-
#include <sys/types.h>
#include <sys/stat.h>
#include <unistd.h>
+#ifdef __APPLE__
+#include <gtkosxapplication.h>
+#endif
+
#ifdef WIN32
#define chdir _chdir
#endif
}
}
-#ifdef USE_LIBGLADE
-
-GtkWidget *linphone_gtk_create_window(const char *window_name){
- GtkWidget *w;
- GladeXML *gxml;
- char path[2048];
- snprintf(path,sizeof(path),"%s/%s.glade",BUILD_TREE_XML_DIR,window_name);
- if (access(path,F_OK)!=0){
- snprintf(path,sizeof(path),"%s/%s.glade",INSTALLED_XML_DIR,window_name);
- if (access(path,F_OK)!=0){
- g_error("Could not locate neither %s/%s.glade and %s/%s.glade .",BUILD_TREE_XML_DIR,window_name,
- INSTALLED_XML_DIR,window_name);
- return NULL;
- }
- }
- gxml=glade_xml_new(path,NULL,NULL);
- glade_xml_signal_autoconnect(gxml);
- w=glade_xml_get_widget(gxml,window_name);
- if (w==NULL) g_error("Could not retrieve '%s' window from xml file",window_name);
- linphone_gtk_configure_window(w,window_name);
- return w;
-}
-
-GtkWidget *linphone_gtk_get_widget(GtkWidget *window, const char *name){
- GtkWidget *w;
- GladeXML *gxml=glade_get_widget_tree(window);
- if (gxml==NULL) g_error("Could not retrieve XML tree of window %s",name);
- w=glade_xml_get_widget(gxml,name);
- if (w==NULL) g_error("Could not retrieve widget %s",name);
- return GTK_WIDGET(w);
-}
-
-#else
-
static int get_ui_file(const char *name, char *path, int pathsize){
snprintf(path,pathsize,"%s/%s.ui",BUILD_TREE_XML_DIR,name);
if (access(path,F_OK)!=0){
return GTK_WIDGET(w);
}
-#endif
void linphone_gtk_display_something(GtkMessageType type,const gchar *message){
GtkWidget *dialog;
if (title) {
gtk_window_set_title(GTK_WINDOW(w),title);
#if GTK_CHECK_VERSION(2,16,0)
+#ifdef __APPLE__
+ gtk_menu_item_set_label(GTK_MENU_ITEM(linphone_gtk_get_widget(w,"main_menu")),_("Windows"));
+#else
gtk_menu_item_set_label(GTK_MENU_ITEM(linphone_gtk_get_widget(w,"main_menu")),title);
+#endif
#endif
}
if (start_call_icon){
linphone_core_terminate_all_calls(lc);
}
linphone_core_enable_video_preview(lc,FALSE);
+#ifdef __APPLE__
+ gtk_window_iconify(GTK_WINDOW(mw));
+#else
gtk_widget_hide(mw);
+#endif
return TRUE;
}
/*prevent the main window from being destroyed by a user click on WM controls, instead we hide it*/
g_signal_connect (G_OBJECT (main_window), "delete-event",
G_CALLBACK (linphone_gtk_close), main_window);
+#ifdef __APPLE__
+ {
+ GtkWidget *menubar=linphone_gtk_get_widget(main_window,"menubar1");
+ gtk_widget_destroy(linphone_gtk_get_widget(main_window,"imagemenuitem5"));
+ GtkOSXApplication *theMacApp = (GtkOSXApplication*)g_object_new(GTK_TYPE_OSX_APPLICATION, NULL);
+ gtk_osxapplication_set_menu_bar(theMacApp,GTK_MENU_SHELL(menubar));
+ gtk_widget_hide(menubar);
+ gtk_osxapplication_ready(theMacApp);
+ }
+#endif
}
add_pixmap_directory("pixmaps");
add_pixmap_directory(PACKAGE_DATA_DIR "/pixmaps/linphone");
-
-
+#ifdef __APPLE__
+ GtkOSXApplication *theMacApp = (GtkOSXApplication*)g_object_new(GTK_TYPE_OSX_APPLICATION, NULL);
+ g_signal_connect(G_OBJECT(theMacApp),"NSApplicationDidBecomeActive",(GCallback)linphone_gtk_show_main_window,NULL);
+ g_signal_connect(G_OBJECT(theMacApp),"NSApplicationWillTerminate",(GCallback)gtk_main_quit,NULL);
+#endif
the_ui=linphone_gtk_create_window("main");
gtk_timeout_add(30,(GtkFunction)linphone_gtk_iterate,(gpointer)linphone_gtk_get_core());
gtk_timeout_add(30,(GtkFunction)linphone_gtk_check_logs,(gpointer)NULL);
linphone_gtk_init_main_window();
+#ifndef __APPLE__
linphone_gtk_init_status_icon();
+#endif
if (!iconified){
linphone_gtk_show_main_window();
linphone_gtk_check_soundcards();
gdk_threads_leave();
linphone_gtk_destroy_log_window();
linphone_core_destroy(the_core);
+#ifndef __APPLE__
/*workaround a bug on win32 that makes status icon still present in the systray even after program exit.*/
gtk_status_icon_set_visible(icon,FALSE);
+#endif
free(progpath);
return 0;
}