Commit af618efb authored by Lynn Garren's avatar Lynn Garren
Browse files

more for cygwing gcc

parent d854403a
......@@ -185,6 +185,39 @@ AM_CONDITIONAL(USE_GMAKE, test x$use_gmake = xyes)
AC_SUBST(COPY_P)
AC_SUBST(DIFF_Q)
# set the platform type
case "$target" in
*-*-cygwin*)
case "$CXX" in
g++)
build_cygwin="yes"
;;
c++)
build_cygwin="yes"
;;
cl)
build_visual="yes"
;;
*) echo UNEXPECTED CHOICE OF COMILER FOR $target: $CXX
build_unix="yes"
esac;;
*-*-win32*)
case "$CXX" in
cl)
build_visual="yes"
;;
*) echo UNEXPECTED CHOICE OF COMILER FOR $target: $CXX
build_unix="yes"
esac;;
*)
build_unix="yes"
esac
# one, and only one, of these should be true
AM_CONDITIONAL(BUILD_VISUAL, test x$build_visual = xyes)
AM_CONDITIONAL(BUILD_CYGWIN, test x$build_cygwin = xyes)
AM_CONDITIONAL(BUILD_UNIX, test x$build_unix = xyes)
# worry about compiler flags
case "$CXX" in
g++)
......@@ -204,7 +237,8 @@ g++)
*-*-cygwin*)
AM_CXXFLAGS="-O -Wall"
MY_SHFLAGS="-DPIC"; SHEXT=dll
MY_SHLINK="-shared -Wl,--export-all-symbols -Wl,--enable-auto-import -Wl,--whole-archive -Wl,--no-whole-archive"
MY_SHLINK="-shared -Wl,--export-all-symbols -Wl,--enable-auto-import -Wl,--whole-archive"
MY_SHLINKEXTRA="-Wl,--no-whole-archive"
MY_SHNAME="-Wl,-out-implib="; MY_LD="-Wl,--rpath -Wl,"
AR="ar"; ARFLAGS="cru"
;;
......@@ -283,7 +317,6 @@ cl)
MY_SHNAME="/OUT:"; MY_LD=" "
build_static="no"
build_shared="yes"
build_visual="yes"
CXXFLAGS=" "
AC_SUBST(CXXFLAGS)
;;
......@@ -327,12 +360,12 @@ esac
AM_CONDITIONAL(BUILD_SHARED, test x$build_shared = xyes)
AM_CONDITIONAL(BUILD_STATIC, test x$build_static = xyes)
AM_CONDITIONAL(BUILD_VISUAL, test x$build_visual = xyes)
AC_SUBST(AM_CXXFLAGS)
AC_SUBST(AM_LDFLAGS)
AC_SUBST(MY_SHFLAGS)
AC_SUBST(MY_SHLINK)
AC_SUBST(MY_SHLINKEXTRA)
AC_SUBST(MY_SHNAME)
AC_SUBST(MY_LD)
AC_SUBST(SHEXT)
......
......@@ -53,11 +53,18 @@ if BUILD_SHARED
shareddir = shared
if BUILD_VISUAL
lib_shared = CLHEP-Random-@VERSION@.$(SHEXT)
else
endif
if BUILD_UNIX
lib_shared = libCLHEP-Random-@VERSION@.$(SHEXT)
endif
if BUILD_CYGWIN
lib_shared_import = libCLHEP-Random-@VERSION@.$(SHEXT).a
lib_shared = cygCLHEP-Random-@VERSION@.$(SHEXT)
DEPLIBS =
endif
SHFLAGS = @MY_SHFLAGS@
SHLINK = @MY_SHLINK@
SHLINKEXTRA = @MY_SHLINKEXTRA@
SHNAME = @MY_SHNAME@
endif
if BUILD_STATIC
......@@ -77,9 +84,19 @@ $(lib_shared): $(libCLHEP_Random_@VERSION@_so_OBJECTS)
$(shareddir)/%.$(OBJEXT): %.cc
$(CXXCOMPILE) $(SHFLAGS) /c /Fo$@ $<
else
endif
if BUILD_CYGWIN
$(lib_shared): $(libCLHEP_Random_@VERSION@_so_OBJECTS)
$(CXXLINK) $(SHLINK) $(SHNAME)$(lib_shared_import) \
$(libCLHEP_Random_@VERSION@_so_OBJECTS) \
$(SHLINKEXTRA) $(DEPLIBS)
$(shareddir)/%.$(OBJEXT): %.cc
$(CXXCOMPILE) $(SHFLAGS) -c -o $@ $<
endif
if BUILD_UNIX
$(lib_shared): $(libCLHEP_Random_@VERSION@_so_OBJECTS)
$(CXXLINK) $(SHLINK) $(SHNAME)$@ $(libCLHEP_Random_@VERSION@_so_OBJECTS) -o $@
$(CXXLINK) $(SHLINK) $(SHNAME)$@ $(libCLHEP_Random_@VERSION@_so_OBJECTS)
$(shareddir)/%.$(OBJEXT): %.cc
$(CXXCOMPILE) $(SHFLAGS) -c -o $@ $<
......
......@@ -12,7 +12,12 @@ if BUILD_STATIC
else
if BUILD_VISUAL
LDADD = $(top_builddir)/src/CLHEP-@PACKAGE@-@VERSION@.$(SHEXT)
else
endif
if BUILD_CYGWIN
LIBS += $(MY_LD)$(top_builddir)/src
LDADD = -L$(top_builddir)/src -lCLHEP-@PACKAGE@-@VERSION@
endif
if BUILD_UNIX
LIBS += $(MY_LD)$(top_builddir)/src
LDADD = $(top_builddir)/src/libCLHEP-@PACKAGE@-@VERSION@.$(SHEXT)
endif
......
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