From dbea417073f08cbc884225a392784abf613d320a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=A6=8C=EA=A6=AB=EA=A6=B6=EA=A6=8F=EA=A7=80=EA=A6=A6?= =?UTF-8?q?=EA=A6=BF=EA=A6=A7=EA=A6=AE=EA=A6=91=EA=A6=A9=EA=A6=AD=EA=A7=80?= Date: Tue, 8 Jun 2021 13:24:57 +0800 Subject: Further generalise the autotools files --- .gitignore | 1 + Makefile.am | 9 +++++++++ arm-apple-darwin11-configure | 4 ++-- configure.ac | 16 ++++++++++++++++ wasm-unknown-emscripten-configure | 4 ---- wasm32-unknown-emscripten-configure | 4 ++++ 6 files changed, 32 insertions(+), 6 deletions(-) delete mode 100755 wasm-unknown-emscripten-configure create mode 100755 wasm32-unknown-emscripten-configure 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 -- cgit v1.2.3