• R/O
  • HTTP
  • SSH
  • HTTPS

提交

標籤
無標籤

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

Commit MetaInfo

修訂fe30e14428a6011356f79400f5c4e9ada8e8cd9a (tree)
時間2012-06-05 18:17:46
作者Katsuhiko Nishimra <ktns.87@gmai...>
CommiterKatsuhiko Nishimra

Log Message

Implement enable-release option. #28588

git-svn-id: https://svn.sourceforge.jp/svnroot/molds/branches/automake@714 1136aad2-a195-0410-b898-f5ea1d11b9d8

Change Summary

差異

--- a/src/configure.ac
+++ b/src/configure.ac
@@ -5,20 +5,36 @@ AC_PREREQ([2.59])
55 AC_INIT([MolDS], [0.1], [molds-dev@lists.sourceforge.jp])
66
77 # Check if pwd is source directory
8-[ if [ -x ./configure ]; then ]
9-AC_MSG_FAILURE([Don't execute configure script in source directory!])
10-[ fi ]
8+AS_IF([test -x ./configure],
9+ AC_MSG_FAILURE([Don't execute configure script in source directory!]))
1110
1211 AM_INIT_AUTOMAKE([MolDS], [0.1])
1312 AC_CONFIG_SRCDIR([Main.cpp])
1413 AC_CONFIG_HEADERS([config.h])
1514
1615 # Setup CXXFLAGS
17-[
18- if [ -z "$CXXFLAGS" ]; then
19- export CXXFLAGS="-g -O0"
20- fi
21- ]
16+AC_MSG_CHECKING([release mode])
17+AC_ARG_ENABLE([release],
18+ AS_HELP_STRING([--enable-release],
19+ [Enable optimize option and disable debug option])
20+ ,[AS_IF([test "$enableval" = "no"],
21+ [export release_enabled=no],
22+ [export release_enabled=yes])]
23+ ,[export release_enabled=no])
24+AC_MSG_RESULT([$release_enabled])
25+AS_IF([test -z "$CXXFLAGS"],
26+ [AS_IF([test "$release_enabled" = "yes"],
27+ [export CXXFLAGS="-O2"],
28+ [export CXXFLAGS="-g -O0"
29+ AS_IF([test
30+ # OpenMP debug options
31+ export CXXFLAGS_SAVED="$CXXFLAGS_SAVED"
32+ export CXXFLAGS="$CXXFLAGS -openmp-report2"
33+ AC_MSG_CHECKING([for openmp diagnosis option])
34+ AC_COMPILE_IFELSE([int main(){return 0;}],
35+ [AC_MSG_RESULT([-openmp-report2])],
36+ [AC_MSG_RESULT([no])
37+ export CXXFLAGS="$CXXFLAGS_SAVED"])])])
2238
2339 # Checks for programs.
2440 AC_PROG_CXX([icpc g++])
@@ -39,17 +55,7 @@ AC_CHECK_LIB([iomp5], [omp_set_num_threads],,[
3955 ])
4056 ])
4157 AC_CHECK_FUNC([omp_get_wtime],,
42- [AC_MSG_FAILURE([Cannot find omp_get_wtime!])
43- ])
44-# OpenMP debug options
45-export CXXFLAGS_SAVED="$CXXFLAGS_SAVED"
46-export CXXFLAGS="$CXXFLAGS -openmp-report2"
47-AC_MSG_CHECKING([for openmp diagnosis option])
48-AC_COMPILE_IFELSE(
49- [int main(){return 0;}],
50- [AC_MSG_RESULT([-openmp-report2])],
51- [AC_MSG_RESULT([no])
52- export CXXFLAGS="$CXXFLAGS_SAVED"])
58+ [AC_MSG_FAILURE([Cannot find omp_get_wtime!])])
5359
5460 # Check for mkl
5561 export LIBS="-lmkl_intel_thread -lmkl_core $LIBS"