summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorꦌꦫꦶꦏ꧀ꦦꦿꦧꦮꦑꦩꦭ꧀ <erik@darapsa.co.id>2021-06-08 13:24:57 +0800
committerꦌꦫꦶꦏ꧀ꦦꦿꦧꦮꦑꦩꦭ꧀ <erik@darapsa.co.id>2021-06-08 13:24:57 +0800
commitdbea417073f08cbc884225a392784abf613d320a (patch)
tree139b100c232a9b8e8ec610cf4957e853ed4c5ea0
parent79a5ba4766cc955ca62de807e3c41e3203555958 (diff)
Further generalise the autotools files
-rw-r--r--.gitignore1
-rw-r--r--Makefile.am9
-rwxr-xr-xarm-apple-darwin11-configure4
-rw-r--r--configure.ac16
-rwxr-xr-xwasm-unknown-emscripten-configure4
-rwxr-xr-xwasm32-unknown-emscripten-configure4
6 files changed, 32 insertions, 6 deletions
diff --git a/.gitignore b/.gitignore
index 1c157ce..785a00f 100644
--- a/.gitignore
+++ b/.gitignore
@@ -23,3 +23,4 @@ libtool
ltmain.sh
m4
missing
+stamp-h1
diff --git a/Makefile.am b/Makefile.am
index e11069c..ae14fb4 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -1,3 +1,12 @@
lib_LTLIBRARIES = libproductviewer.la
libproductviewer_la_SOURCES = viewer.c converter.c
+if APPLE
+libproductviewer_la_CFLAGS = -I${prefix}/System/Library/Frameworks/OpenGLES.framework/Headers
+endif
+if WASM
+libproductviewer_la_LDFLAGS = -static
+endif
+if IOS
+libproductviewer_la_LDFLAGS = -static
+endif
include_HEADERS = productviewer.h
diff --git a/arm-apple-darwin11-configure b/arm-apple-darwin11-configure
index c637d5d..115fd4e 100755
--- a/arm-apple-darwin11-configure
+++ b/arm-apple-darwin11-configure
@@ -2,5 +2,5 @@
export TARGET=arm-apple-darwin11
export CC=ios-clang
export PREFIX=/opt/iPhoneOS8.1.sdk
-export CFLAGS="$CFLAGS -g0 -O2 -I$PREFIX/System/Library/Frameworks/OpenGLES.framework/Headers"
-./configure --host=$TARGET --prefix=$PREFIX/usr --disable-shared
+export CFLAGS="$CFLAGS -g0 -O2"
+./configure --host=$TARGET --prefix=$PREFIX --libdir=$PREFIX/usr/lib --includedir=$PREFIX/usr/include
diff --git a/configure.ac b/configure.ac
index 655b47a..1fd249c 100644
--- a/configure.ac
+++ b/configure.ac
@@ -7,4 +7,20 @@ AC_TYPE_SIZE_T
AC_CHECK_FUNCS([strrchr memset])
AM_PROG_AR
LT_INIT
+AC_CANONICAL_HOST
+case $host_vendor in
+ *apple* ) apple=true;;
+ *) apple=false;;
+esac
+AM_CONDITIONAL([APPLE], [test x$apple = xtrue])
+case $host_cpu in
+ *wasm* ) wasm=true;;
+ *) wasm=false;;
+esac
+AM_CONDITIONAL([WASM], [test x$wasm = xtrue])
+case $host in
+ *arm*apple-darwin1* ) ios=true;;
+ *) ios=false;;
+esac
+AM_CONDITIONAL([IOS], [test x$ios = xtrue])
AC_OUTPUT
diff --git a/wasm-unknown-emscripten-configure b/wasm-unknown-emscripten-configure
deleted file mode 100755
index f84b40a..0000000
--- a/wasm-unknown-emscripten-configure
+++ /dev/null
@@ -1,4 +0,0 @@
-#!/bin/sh
-export CPPFLAGS="$CPPFLAGS -DDEBUG"
-export CFLAGS="$CFLAGS -g"
-emconfigure ./configure --prefix=$EMSDK/upstream/emscripten/system --disable-shared
diff --git a/wasm32-unknown-emscripten-configure b/wasm32-unknown-emscripten-configure
new file mode 100755
index 0000000..f35091b
--- /dev/null
+++ b/wasm32-unknown-emscripten-configure
@@ -0,0 +1,4 @@
+#!/bin/sh
+export CPPFLAGS="$CPPFLAGS -DDEBUG"
+export CFLAGS="$CFLAGS -g"
+emconfigure ./configure --host=wasm32-unknown-emscripten --prefix=$EMSDK/upstream/emscripten/system