The Birdfont Source Code
Build on mac
These changes was commited to the Birdfont repository Sat, 09 May 2015 18:31:38 +0000.
Contributing
Send patches or pull requests to johan.mattsson.m@gmail.com.
Clone this repository: git clone https://github.com/johanmattssonm/birdfont.git
Build on mac
--- a/libbirdgems/fit_cubic.c
+++ b/libbirdgems/fit_cubic.c
@@ -22,7 +22,13 @@
#include "GraphicsGems.h"
#include <stdio.h>
+
+ #ifdef MAC
+ #include <malloc/malloc.h>
+ #else
#include <malloc.h>
+ #endif
+
#include <math.h>
#include <stdio.h>
--- a/scripts/build.py
+++ b/scripts/build.py
@@ -48,6 +48,7 @@
--pkg gio-2.0 \
--pkg cairo \
--pkg libbirdxml \
+ --pkg libbirdgems \
""")
#copy c sources
@@ -64,7 +65,8 @@
$(pkg-config --cflags gio-2.0) \
$(pkg-config --cflags cairo) \
$(pkg-config --cflags glib-2.0) \
- -I ./build/libbirdxml""")
+ -I ./build/libbirdxml \
+ -I ./build/libbirdgems""")
run("mv ./*.o build/libbirdfont/ ")
if library.endswith (".dylib"):
@@ -81,7 +83,7 @@
$(pkg-config --libs gio-2.0) \
$(pkg-config --libs cairo) \
$(pkg-config --libs glib-2.0) \
- -L./build -L./build/bin -l birdxml \
+ -L./build -L./build/bin -l birdxml -l birdgems\
-o """ + library)
run("mv " + library + " build/bin/")
@@ -166,7 +168,7 @@
def libbirdgems(prefix, cc, cflags, ldflags, valac, valaflags, library, nonNull = True):
- #libbirdfont
+ print ('Compiling libbirdgems')
run("mkdir -p build/libbirdgems")
run("mkdir -p build/bin")
@@ -177,19 +179,22 @@
run(valac + """\
-C \
""" + valaflags + """ \
+ -H build/libbirdgems/birdgems.h \
--pkg posix \
--vapidir=./ \
--basedir build/libbirdgems/ \
""" + experimentalNonNull + """ \
--enable-experimental \
--library libbirdgems \
- -H build/libbirdxml/birdxml.h \
- libbirdxml/*.vala \
+ libbirdgems/*.vala \
""")
if cc == "":
print ("Skipping compilation");
else:
+ run("cp libbirdgems/*.c build/libbirdgems/")
+ run("cp libbirdgems/*.h build/libbirdgems/")
+
run(cc + " " + cflags + """ \
-c build/libbirdgems/*.c \
""")
--- a/scripts/mac_build.py
+++ b/scripts/mac_build.py
@@ -2,5 +2,5 @@
"""
- Copyright (C) 2013 2014 Johan Mattsson
+ Copyright (C) 2013 2014 2015 Johan Mattsson
This library is free software; you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
@@ -54,9 +54,13 @@
xml_library_cflags = "-fno-common -fPIC " + cflags
xml_library_ldflags = options.ldflags + " " + """-dynamiclib -Wl,-headerpad_max_install_names,-undefined,dynamic_lookup,-compatibility_version,1.0,-current_version,1.0,-install_name,""" + prefix + """/lib/libbirdxml.dylib"""
+
+ gems_library_cflags = "-fno-common -fPIC -D MAC" + cflags
+ gems_library_ldflags = options.ldflags + " " + """-dynamiclib -Wl,-headerpad_max_install_names,-undefined,dynamic_lookup,-compatibility_version,1.0,-current_version,1.0,-install_name,""" + prefix + """/lib/libbirdgems.dylib"""
configfile.write_config (prefix)
compile_translations()
+ build.libbirdgems(prefix, cc, gems_library_cflags, gems_library_ldflags, valac, valaflags, "libbirdgems." + version.LIBBIRDGEMS_SO_VERSION + ".dylib", False)
build.libbirdxml(prefix, cc, xml_library_cflags, xml_library_ldflags, valac, valaflags, "libbirdxml." + version.LIBBIRDXML_SO_VERSION + ".dylib", False)
build.libbirdfont(prefix, cc, library_cflags, library_ldflags, valac, valaflags, "libbirdfont." + version.SO_VERSION + ".dylib", False)
build.birdfont_import(prefix, cc, cflags, ldflags, valac, valaflags, False)