Commit f6810a13 authored by neverlord's avatar neverlord

configure and linux compatibility

parent 61968e31
......@@ -10,3 +10,5 @@ cppa.creator.user.1.3
8threads
4threads
libcppa.Makefile
cpp0x_test
cpp0x_test.dSYM/
# the used GCC binary
CXX = /opt/local/bin/g++-mp-4.6
# compiler flags
#CXXFLAGS = -std=c++0x -pedantic -Wall -Wextra -O2 -I/opt/local/include/ -fpermissive
CXXFLAGS = -std=c++0x -pedantic -Wall -Wextra -g -O0 -I/opt/local/include/ -fpermissive
# external libraries
LIBS = -L/opt/local/lib -lboost_thread-mt
# external include directories
INCLUDES =
#!/bin/bash
gcc_flags="-std=c++0x -pedantic -Wall -Wextra -g -O0 -I/opt/local/include/ -fpermissive"
gcc_found=$(find /bin/ /usr/bin /opt/bin /opt/local/bin -regex "^.*g\+\+.*$" 2>/dev/null)
gcc_selected=""
function compatibility_test()
{
if $1 $gcc_flags -o cpp0x_test cpp0x_test.cpp &>/dev/null ; then
if test "$(./cpp0x_test)" "!=" "yes" ; then
return -1
else
return 0
fi
fi
}
for i in $gcc_found ; do
version=$($i -v 2>&1 | grep -oE "gcc version [0-9](\.[0-9]){2}" | grep -oE "[0-9](\.[0-9]){2}")
if test "!" $version "<" 4.6.0 ; then
if compatibility_test "$i" ; then
gcc_selected=$i
break
fi
fi
done
if test -z "$gcc_selected" ; then
echo "no GCC >= 4.6.0 found ... quit"
exit
fi
echo "selected = $gcc_selected"
#echo "GCC = $GCC"
rm -f Makefile.rules &>/dev/null
echo "CXX = $gcc_selected" >> Makefile.rules
echo "CXXFLAGS = $gcc_flags" >> Makefile.rules
echo "LIBS = -L/opt/local/lib -lboost_thread-mt" >> Makefile.rules
echo "done"
#include <iostream>
template<class Out>
inline Out& print(Out& out)
{
return out;
}
template<class Out, typename A0, typename... Args>
inline Out& print(Out& out, const A0 arg0, const Args&... args)
{
return print(out << arg0, args...);
}
int main()
{
print(std::cout, "y", 'e', "s", '\n');
return 0;
}
......@@ -25,12 +25,6 @@ append_hpp_from "cppa/util"
append_cpp_from "src"
if test "$(uname)" = "Darwin"; then
LIB_NAME="libcppa.dylib"
else
LIB_NAME="libcppa.so"
fi
echo "include Makefile.rules"
echo "INCLUDE_FLAGS = \$(INCLUDES) -I./"
echo
......@@ -46,7 +40,11 @@ echo "%.o : %.cpp \$(HEADERS)"
printf "%b\n" "\t\$(CXX) \$(CXXFLAGS) \$(INCLUDE_FLAGS) -fPIC -c \$< -o \$@"
echo
echo "\$(LIB_NAME) : \$(OBJECTS) \$(HEADERS)"
printf "%b\n" "\t\$(CXX) \$(LIBS) -dynamiclib -o \$(LIB_NAME) \$(OBJECTS)"
if test "$(uname)" "=" "Darwin" ; then
printf "%b\n" "\t\$(CXX) \$(LIBS) -dynamiclib -o libcppa.dylib \$(OBJECTS)"
else
printf "%b\n" "\t\$(CXX) \$(LIBS) -shared -Wl,-soname,libcppa.so.0 -o libcppa.so.0.0.0 \$(OBJECTS)"
fi
echo
echo "all : \$(LIB_NAME) \$(OBJECTS)"
echo
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment