]> granicus.if.org Git - fribidi/commitdiff
Simplistic cross compilation support from a gcc based system.
authorDov Grobgeld <dov.grobgeld@gmail.com>
Sun, 7 Jan 2018 19:49:32 +0000 (21:49 +0200)
committerDov Grobgeld <dov.grobgeld@gmail.com>
Sun, 7 Jan 2018 19:49:32 +0000 (21:49 +0200)
configure.ac
gen.tab/Makefile.am
gen.tab/packtab.h

index 8339ae895e9636a4cf462a297ca1da7f9624ba19..46634e19da692dadd3a035cd131a8cf9aa46cb87 100644 (file)
@@ -33,7 +33,7 @@ m4_define(fribidi_version,
 
 AC_INIT([GNU FriBidi],
        fribidi_version(),
-        [http://bugs.freedesktop.org/enter_bug.cgi?product=fribidi],
+        [https://github.com/fribidi/fribidi/issues/new],
        [fribidi],
        [http://fribidi.org/])
 
@@ -180,6 +180,27 @@ fi
 fi
 AM_CONDITIONAL(FRIBIDI_USE_GLIB, test x$FRIBIDI_USE_GLIB = x1)
 
+# A hack for supporting cross compilation
+if test $host != $build; then
+  BUILD_CC="gcc"
+  BUILD_CFLAGS="-O2 -g"
+  BUILD_LDFLAGS=""
+  BUILD_EXEEXT=""
+else
+  BUILD_CC="${CC}"
+  BUILD_CFLAGS="${CFLAGS}"
+  BUILD_LDFLAGS="${LDFLAGS}"
+  BUILD_EXEEXT="${EXEEXT}"
+fi
+
+# Continuation of hack to set up the proper include directories
+BUILD_CFLAGS="${BUILD_CFLAGS} -DHAVE_CONFIG_H -I.. -I../lib"
+
+AC_ARG_VAR([BUILD_CC])
+AC_ARG_VAR([BUILD_CFLAGS])
+AC_ARG_VAR([BUILD_LDFLAGS])
+AC_ARG_VAR([BUILD_EXEEXT])
+
 # Generate output
 AC_CONFIG_FILES([fribidi.pc
                 lib/fribidi-config.h
index 7bc3acf98ca3ba410aa397febfa5bf4e9156dbe6..66f35732dcdb7b2881869bc3785c8c843743eeda 100644 (file)
@@ -50,7 +50,7 @@ derived_bidi-type.tab.i: \
                DerivedBidiClass.txt \
                fribidi-unicode-version.h \
                $(gen_bidi_type_tab_SOURCES)
-       $(MAKE) $(AM_MAKEFLAGS) $(gen_bidi_type_tab)
+       $(BUILD_CC) $(BUILD_CFLAGS) -o $(gen_bidi_type_tab) $(gen_bidi_type_tab_SOURCES)
        ./$(gen_bidi_type_tab) $(COMPRESSION) $^ > $@ \
        || ($(RM) $@ && false)
 
@@ -58,7 +58,7 @@ bidi-type.tab.i: \
                UnicodeData.txt \
                fribidi-unicode-version.h \
                $(gen_bidi_type_tab_SOURCES)
-       $(MAKE) $(AM_MAKEFLAGS) $(gen_bidi_type_tab)
+       $(BUILD_CC) $(BUILD_CFLAGS) -o $(gen_bidi_type_tab) $(gen_bidi_type_tab_SOURCES)
        ./$(gen_bidi_type_tab) $(COMPRESSION) $^ > $@ \
        || ($(RM) $@ && false)
 
@@ -73,7 +73,7 @@ joining-type.tab.i: \
                ArabicShaping.txt \
                fribidi-unicode-version.h \
                $(gen_joining_type_tab_SOURCES)
-       $(MAKE) $(AM_MAKEFLAGS) $(gen_joining_type_tab)
+       $(BUILD_CC) $(BUILD_CFLAGS) -o $(gen_joining_type_tab) $(gen_joining_type_tab_SOURCES)
        ./$(gen_joining_type_tab) $(COMPRESSION) $^ > $@ \
        || ($(RM) $@ && false)
 
@@ -85,7 +85,7 @@ arabic-shaping.tab.i: \
                UnicodeData.txt \
                fribidi-unicode-version.h \
                $(gen_arabic_shaping_tab_SOURCES)
-       $(MAKE) $(AM_MAKEFLAGS) $(gen_arabic_shaping_tab)
+       $(BUILD_CC) $(BUILD_CFLAGS) -o $(gen_arabic_shaping_tab) $(gen_arabic_shaping_tab_SOURCES)
        ./$(gen_arabic_shaping_tab) $(COMPRESSION) $^ > $@ \
        || ($(RM) $@ && false)
 
@@ -97,7 +97,7 @@ mirroring.tab.i: \
                BidiMirroring.txt \
                fribidi-unicode-version.h \
                $(gen_mirroring_tab_SOURCES)
-       $(MAKE) $(AM_MAKEFLAGS) $(gen_mirroring_tab)
+       $(BUILD_CC) $(BUILD_CFLAGS) -o $(gen_mirroring_tab) $(gen_mirroring_tab_SOURCES)
        ./$(gen_mirroring_tab) $(COMPRESSION) $^ > $@ \
        || ($(RM) $@ && false)
 
@@ -110,7 +110,7 @@ brackets.tab.i: \
                UnicodeData.txt \
                fribidi-unicode-version.h \
                $(gen_brackets_tab_SOURCES)
-       $(MAKE) $(AM_MAKEFLAGS) $(gen_brackets_tab)
+       $(BUILD_CC) $(BUILD_CFLAGS) -o $(gen_brackets_tab) $(gen_brackets_tab_SOURCES)
        ./$(gen_brackets_tab) $(COMPRESSION) $^ > $@ \
        || ($(RM) $@ && false)
 
@@ -122,7 +122,7 @@ brackets-type.tab.i: \
                BidiBrackets.txt \
                fribidi-unicode-version.h \
                $(gen_brackets_type_tab_SOURCES)
-       $(MAKE) $(AM_MAKEFLAGS) $(gen_brackets_type_tab)
+       $(BUILD_CC) $(BUILD_CFLAGS) -o $(gen_brackets_type_tab) $(gen_brackets_type_tab_SOURCES)
        ./$(gen_brackets_type_tab) $(COMPRESSION) $^ > $@ \
        || ($(RM) $@ && false)
 
@@ -134,7 +134,7 @@ fribidi-unicode-version.h: \
                ReadMe.txt \
                BidiMirroring.txt \
                $(gen_unicode_version_SOURCES)
-       $(MAKE) $(AM_MAKEFLAGS) $(gen_unicode_version)
+       $(BUILD_CC) $(BUILD_CFLAGS) -o $(gen_unicode_version) $(gen_unicode_version_SOURCES)
        ./$(gen_unicode_version) $^ > $@ \
        || ($(RM) $@ && false)
 
@@ -142,10 +142,10 @@ fribidi-unicode-version.h: \
 gen: $(EXTRA_PROGRAMS)
 
 $(top_builddir)/config.h: $(top_srcdir)/config.h.in
-       cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) config.h
+       cd $(top_builddir) && $(BUILD_CC) $(BUILD_CFLAGS) -o config.h
 
 $(top_builddir)/lib/fribidi-config.h: $(top_srcdir)/lib/fribidi-config.h.in
-       cd $(top_builddir)/lib && $(MAKE) $(AM_MAKEFLAGS) fribidi-config.h
+       cd $(top_builddir)/lib && $(BUILD_CC) $(BUILD_CFLAGS) -o fribidi-config.h
 
 .PHONY: gen
 
index 2c11b3f9147f7d38b20e98bd6f9a28ec9075ec62..7ae80f01ccf21ebc685f3e7039480a66def61f39 100644 (file)
@@ -22,6 +22,8 @@
 #ifndef PACKTAB_H
 #define PACKTAB_H
 
+#include <stdio.h>
+
 #ifdef __cplusplus
 extern "C"
 {