Commit 0459e329 authored by Anthony Chan's avatar Anthony Chan Committed by Pavan Balaji
Browse files

fixed redundant CFLAGS. Simplified search known paths for jni.h.

[svn breadcrumb: r7203 @ https://svn.mcs.anl.gov/repos/mpi/tools/mpe2]
parent 030f6898
......@@ -107,52 +107,36 @@ AC_DEFUN([JAC_FIND_PROG_IN_KNOWNS],[
$1=""
# Determine the system type
AC_REQUIRE([AC_CANONICAL_HOST])
subdir=""
if test -d "/software/commmon" ; then
subdir=/software/common
else
subdir=""
fi
subdir_pfx=""
case "$host" in
mips-sgi-irix*)
if test -d "/software/irix" ; then
subdir="irix"
elif test -d "/software/irix-6" ; then
subdir="irix-6"
fi
*irix*)
subdir_pfx="irix"
;;
*linux*)
if test -d "/software/linux" ; then
subdir="linux"
fi
subdir_pfx="linux"
;;
*solaris*)
if test -d "/software/solaris" ; then
subdir="solaris"
elif test -d "/software/solaris-2" ; then
subdir="solaris-2"
fi
subdir_pfx="solaris"
;;
*sun4*)
if test -d "/software/sun4" ; then
subdir="sun4"
fi
;;
*aix*)
if test -d "/software/aix-4" ; then
subdir="aix-4"
fi
subdir_pfx="sun4"
;;
*rs6000*)
if test -d "/software/aix-4" ; then
subdir="aix-4"
fi
*aix*|*rs6000*)
subdir_pfx="aix"
;;
*freebsd*)
if test -d "/software/freebsd" ; then
subdir="freebsd"
fi
subdir_pfx="freebsd"
esac
#
if test -z "$subdir" ; then
if test -d "/software/common" ; then
subdir="common"
fi
if test -n "$subdir_pfx" ; then
for dir in /software/${subdir_pfx}* ; do
test -d "$dir" && subdir=$dir
done
fi
#
reverse_dirs=""
......@@ -162,12 +146,12 @@ for dir in \
/usr/j2sdk* \
/usr/java* \
/usr/java/jdk* \
/usr/local/diablo-jdk* \
/usr/java/j2sdk* \
/usr/local \
/usr/local/java* \
/usr/local/jdk* \
/usr/local/j2sdk* \
/usr/local/diablo-jdk* \
/usr/share \
/usr/share/java* \
/usr/share/jdk* \
......@@ -176,6 +160,7 @@ for dir in \
/usr/contrib/java* \
/usr/contrib/jdk* \
/usr/contrib/j2sdk* \
/usr/lib/jvm/java* \
/System/Library/Frameworks/JavaVM.framework/Versions/*/Home \
$HOME/java* \
$HOME/jdk* \
......@@ -189,12 +174,12 @@ for dir in \
/opt/local/java* \
/Tools/jdk* \
/Tools/j2sdk* \
/software/$subdir/apps/packages/java* \
/software/$subdir/apps/packages/jdk* \
/software/$subdir/apps/packages/j2sdk* \
/software/$subdir/com/packages/java* \
/software/$subdir/com/packages/jdk* \
/software/$subdir/com/packages/j2sdk* \
$subdir/apps/packages/java* \
$subdir/apps/packages/jdk* \
$subdir/apps/packages/j2sdk* \
$subdir/com/packages/java* \
$subdir/com/packages/jdk* \
$subdir/com/packages/j2sdk* \
/soft/apps/packages/java* \
/soft/apps/packages/jdk* \
/soft/apps/packages/j2sdk* \
......@@ -230,7 +215,7 @@ dnl *java* | *jdk* | *j2sdk* | *Frameworks* )
dnl
# Not all releases work.Try tests defined in the 3rd argument
if test -n "[$]$1" ; then
AC_MSG_CHECKING([for $2 in user's PATH])
AC_MSG_CHECKING([for $2 in known path])
AC_MSG_RESULT([found [$]$1])
is_prog_found=yes
ifelse([$3],, [$1="" ; break], [
......
......@@ -169,20 +169,24 @@ case "$host_os" in
aix4* | aix5* )
dnl temporary fix to force libtool on AIX to generate .so file,
dnl i.e. inform libtool to do runtime linking.
LDFLAGS="$LDFLAGS -brtl"
LIBSO_LDFLAGS="-brtl"
;;
*darwin* )
dnl force libtool to build .jnilib which is needed by Mac's JVM
LDFLAGS="$LDFLAGS -shrext .jnilib"
LIBSO_LDFLAGS="-shrext .jnilib"
;;
*cygwin* )
dnl Since SUN's JDK assumes a win32 compiler, so force cygwin/gcc
dnl to be in MINGW32 mode.
CC="gcc -mno-cygwin"
LDFLAGS="$LDFLAGS -Wl,--enable-stdcall-fixup"
LIBSO_CFLAGS="-mno-cygwin"
LIBSO_LDFLAGS="-Wl,--enable-stdcall-fixup"
LIBSO_PREFIX=""
;;
esac
dnl Strictly speaking, we need to test LIBSO_CFLAGS and LIBSO_LDFLAGS
dnl with libtool before using them in Makefile. **FIXME**
AC_SUBST(LIBSO_CFLAGS)
AC_SUBST(LIBSO_LDFLAGS)
AC_SUBST(LIBSO_PREFIX)
dnl intel compiler does not need shared library symbol exported.
......
......@@ -41,15 +41,15 @@ OBJ4T = $(CSRC4T:.c=.@OBJEXT@)
OBJ4E = $(CSRC4E:.c=.@OBJEXT@)
CC = @CC@
LD_CC = @CC@ @CFLAGS@
LDF = @CC@ @LIBSO_CFLAGS@ @CFLAGS@ @LDFLAGS@
INSTALL = @INSTALL@
LIBTOOL = $(SHELL) ../libtool
EXPORT_SYMBOLS = @EXPORT_SYMBOLS@
RM = @RM@
JNI_INC = @JNI_INC@
CFLAGS = -I.. $(JNI_INC) -I$(TRACE_INCDIR) @CFLAGS@
LDFLAGS = -module -no-undefined -avoid-version @CFLAGS@ @LDFLAGS@
CFLAGS = -I.. $(JNI_INC) -I$(TRACE_INCDIR) @LIBSO_CFLAGS@ @CFLAGS@
LTLDFLAGS = -module -no-undefined -avoid-version @LIBSO_LDFLAGS@
# memory leak checker
MEMLIBS = @DEBUG_LIBS@
......@@ -69,11 +69,11 @@ ALL: $(libbuild_dir)/$(LIB_TRACE)
$(libbuild_dir)/$(LIB_TRACE): $(LOBJ)
if [ "$(EXPORT_SYMBOLS)" = "yes" ] ; then \
$(LIBTOOL) --mode=link $(LD_CC) -o $(LIB_TRACE) $(LOBJ) $(LDFLAGS) \
$(LIBTOOL) --mode=link $(LDF) $(LTLDFLAGS) -o $(LIB_TRACE) $(LOBJ) \
-export-symbols $(srcdir)/JavaTraceInput.sym \
-rpath $(libbuild_dir) ; \
else \
$(LIBTOOL) --mode=link $(LD_CC) -o $(LIB_TRACE) $(LOBJ) $(LDFLAGS) \
$(LIBTOOL) --mode=link $(LDF) $(LTLDFLAGS) -o $(LIB_TRACE) $(LOBJ) \
-rpath $(libbuild_dir) ; \
fi
$(LIBTOOL) --mode=install $(INSTALL) $(LIB_TRACE) $(libbuild_dir)
......@@ -81,21 +81,21 @@ $(libbuild_dir)/$(LIB_TRACE): $(LOBJ)
INSTALL_LIBSO: $(LOBJ)
if [ "$(EXPORT_SYMBOLS)" = "yes" ] ; then \
$(LIBTOOL) --mode=link $(LD_CC) -o $(LIB_TRACE) $(LOBJ) $(LDFLAGS) \
$(LIBTOOL) --mode=link $(LDF) $(LTLDFLAGS) -o $(LIB_TRACE) $(LOBJ) \
-export-symbols $(srcdir)/JavaTraceInput.sym \
-rpath $(LIBDIR) ; \
else \
$(LIBTOOL) --mode=link $(LD_CC) -o $(LIB_TRACE) $(LOBJ) $(LDFLAGS) \
$(LIBTOOL) --mode=link $(LDF) $(LTLDFLAGS) -o $(LIB_TRACE) $(LOBJ) \
-rpath $(LIBDIR) ; \
fi
$(LIBTOOL) --mode=install $(INSTALL) $(LIB_TRACE) $(DESTDIR)$(LIBDIR)
$(LIBTOOL) --finish $(LIBDIR)
$(binbuild_dir)/$(PGM_PRINT): $(OBJ4T)
$(LD_CC) -o $@ $(OBJ4T) $(MEMLIBS) @LDFLAGS@
$(LDF) -o $@ $(OBJ4T) $(MEMLIBS)
$(binbuild_dir)/$(PGM_CHECK): $(OBJ4E)
$(LD_CC) -o $@ $(OBJ4E) $(MEMLIBS) @LDFLAGS@
$(LDF) -o $@ $(OBJ4E) $(MEMLIBS)
clean:
@-$(RM) *.@OBJEXT@ *.lo *.la
......
......@@ -169,20 +169,24 @@ case "$host_os" in
aix4* | aix5* )
dnl temporary fix to force libtool on AIX to generate .so file,
dnl i.e. inform libtool to do runtime linking.
LDFLAGS="$LDFLAGS -brtl"
LIBSO_LDFLAGS="-brtl"
;;
*darwin* )
dnl force libtool to build .jnilib which is needed by Mac's JVM
LDFLAGS="$LDFLAGS -shrext .jnilib"
LIBSO_LDFLAGS="-shrext .jnilib"
;;
*cygwin* )
dnl Since SUN's JDK assumes a win32 compiler, so force cygwin/gcc
dnl to be in MINGW32 mode.
CC="gcc -mno-cygwin"
LDFLAGS="$LDFLAGS -Wl,--enable-stdcall-fixup"
LIBSO_CFLAGS="-mno-cygwin"
LIBSO_LDFLAGS="-Wl,--enable-stdcall-fixup"
LIBSO_PREFIX=""
;;
esac
dnl Strictly speaking, we need to test LIBSO_CFLAGS and LIBSO_LDFLAGS
dnl with libtool before using them in Makefile. **FIXME**
AC_SUBST(LIBSO_CFLAGS)
AC_SUBST(LIBSO_LDFLAGS)
AC_SUBST(LIBSO_PREFIX)
dnl intel compiler does not need shared library symbol exported.
......
......@@ -41,15 +41,15 @@ OBJ4T = $(CSRC4T:.c=.@OBJEXT@)
OBJ4E = $(CSRC4E:.c=.@OBJEXT@)
CC = @CC@
LD_CC = @CC@ @CFLAGS@
LDF = @CC@ @LIBSO_CFLAGS@ @CFLAGS@ @LDFLAGS@
INSTALL = @INSTALL@
LIBTOOL = $(SHELL) ../libtool
EXPORT_SYMBOLS = @EXPORT_SYMBOLS@
RM = @RM@
JNI_INC = @JNI_INC@
CFLAGS = -I.. $(JNI_INC) -I$(TRACE_INCDIR) @CFLAGS@
LDFLAGS = -module -no-undefined -avoid-version @CFLAGS@ @LDFLAGS@
CFLAGS = -I.. $(JNI_INC) -I$(TRACE_INCDIR) @LIBSO_CFLAGS@ @CFLAGS@
LTLDFLAGS = -module -no-undefined -avoid-version @LIBSO_LDFLAGS@
# memory leak checker
MEMLIBS = @DEBUG_LIBS@
......@@ -69,11 +69,11 @@ ALL: $(libbuild_dir)/$(LIB_TRACE)
$(libbuild_dir)/$(LIB_TRACE): $(LOBJ)
if [ "$(EXPORT_SYMBOLS)" = "yes" ] ; then \
$(LIBTOOL) --mode=link $(LD_CC) -o $(LIB_TRACE) $(LOBJ) $(LDFLAGS) \
$(LIBTOOL) --mode=link $(LDF) $(LTLDFLAGS) -o $(LIB_TRACE) $(LOBJ) \
-export-symbols $(srcdir)/JavaTraceInput.sym \
-rpath $(libbuild_dir) ; \
else \
$(LIBTOOL) --mode=link $(LD_CC) -o $(LIB_TRACE) $(LOBJ) $(LDFLAGS) \
$(LIBTOOL) --mode=link $(LDF) $(LTLDFLAGS) -o $(LIB_TRACE) $(LOBJ) \
-rpath $(libbuild_dir) ; \
fi
$(LIBTOOL) --mode=install $(INSTALL) $(LIB_TRACE) $(libbuild_dir)
......@@ -81,21 +81,21 @@ $(libbuild_dir)/$(LIB_TRACE): $(LOBJ)
INSTALL_LIBSO: $(LOBJ)
if [ "$(EXPORT_SYMBOLS)" = "yes" ] ; then \
$(LIBTOOL) --mode=link $(LD_CC) -o $(LIB_TRACE) $(LOBJ) $(LDFLAGS) \
$(LIBTOOL) --mode=link $(LDF) $(LTLDFLAGS) -o $(LIB_TRACE) $(LOBJ) \
-export-symbols $(srcdir)/JavaTraceInput.sym \
-rpath $(LIBDIR) ; \
else \
$(LIBTOOL) --mode=link $(LD_CC) -o $(LIB_TRACE) $(LOBJ) $(LDFLAGS) \
$(LIBTOOL) --mode=link $(LDF) $(LTLDFLAGS) -o $(LIB_TRACE) $(LOBJ) \
-rpath $(LIBDIR) ; \
fi
$(LIBTOOL) --mode=install $(INSTALL) $(LIB_TRACE) $(DESTDIR)$(LIBDIR)
$(LIBTOOL) --finish $(LIBDIR)
$(binbuild_dir)/$(PGM_PRINT): $(OBJ4T)
$(LD_CC) -o $@ $(OBJ4T) $(MEMLIBS) @LDFLAGS@
$(LDF) -o $@ $(OBJ4T) $(MEMLIBS)
$(binbuild_dir)/$(PGM_CHECK): $(OBJ4E)
$(LD_CC) -o $@ $(OBJ4E) $(MEMLIBS) @LDFLAGS@
$(LDF) -o $@ $(OBJ4E) $(MEMLIBS)
clean:
@-$(RM) *.@OBJEXT@ *.lo *.la
......
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